@hoddy-ui/core 1.0.6 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.ts +2 -0
- package/package.json +3 -4
- package/src/Components/Locator.tsx +5 -2
- package/src/config/index.ts +15 -6
package/index.ts
CHANGED
|
@@ -11,5 +11,7 @@ export { default as Typography } from "./src/Components/Typography";
|
|
|
11
11
|
export { default as SafeAreaView } from "./src/Components/SafeAreaView";
|
|
12
12
|
export { default as SelectMenu } from "./src/Components/SelectMenu";
|
|
13
13
|
// Others
|
|
14
|
+
|
|
15
|
+
export * from "./src/config";
|
|
14
16
|
export * from "./src/hooks";
|
|
15
17
|
export * from "./src/theme/index";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hoddy-ui/core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"description": "Core rich react native components written in typescript",
|
|
5
5
|
"main": "index.ts",
|
|
6
6
|
"repository": {
|
|
@@ -11,15 +11,13 @@
|
|
|
11
11
|
"author": "Hoddy inc",
|
|
12
12
|
"license": "MIT",
|
|
13
13
|
"private": false,
|
|
14
|
-
"scripts": {
|
|
15
|
-
"postinstall": "node -r ts-node/register -e \"require('./config/index').loadConfig()\""
|
|
16
|
-
},
|
|
17
14
|
"peerDependencies": {
|
|
18
15
|
"@expo/vector-icons": "^13.0.0",
|
|
19
16
|
"@react-native-async-storage/async-storage": "^1.18.1",
|
|
20
17
|
"@react-navigation/native": "^6.1.6",
|
|
21
18
|
"@types/react": "^18.2.6",
|
|
22
19
|
"@types/react-native": "^0.72.0",
|
|
20
|
+
"expo-location": "^15.1.1",
|
|
23
21
|
"expo-navigation-bar": "^2.1.1",
|
|
24
22
|
"expo-system-ui": "^2.2.1",
|
|
25
23
|
"react": "^18.2.0",
|
|
@@ -38,6 +36,7 @@
|
|
|
38
36
|
"dependencies": {
|
|
39
37
|
"@react-native-async-storage/async-storage": "^1.18.1",
|
|
40
38
|
"@react-navigation/native": "^6.1.6",
|
|
39
|
+
"expo-location": "^15.1.1",
|
|
41
40
|
"expo-navigation-bar": "^2.1.1",
|
|
42
41
|
"expo-system-ui": "^2.2.1",
|
|
43
42
|
"react-native-safe-area-context": "^4.5.3",
|
|
@@ -10,10 +10,13 @@ import { useColors } from "../hooks";
|
|
|
10
10
|
import { LocatorProps } from "../types";
|
|
11
11
|
|
|
12
12
|
// import { GOOGLE_MAP_API } from "../../api/config";
|
|
13
|
+
import { getApiKey } from "../config/KeyManager";
|
|
13
14
|
import Typography from "./Typography";
|
|
14
|
-
import { GOOGLE_MAP_API_KEY } from "../../api/config";
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
const { GOOGLE_MAP_API_KEY } = getApiKey();
|
|
17
|
+
|
|
18
|
+
if (GOOGLE_MAP_API_KEY) Location.setGoogleApiKey(GOOGLE_MAP_API_KEY);
|
|
19
|
+
else console.error("Google map api key needs to be set to use this component");
|
|
17
20
|
|
|
18
21
|
type predictionType = {
|
|
19
22
|
id: string;
|
package/src/config/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as fs from "fs";
|
|
1
|
+
// import * as fs from "fs";
|
|
2
2
|
import { setApiKey } from "./KeyManager";
|
|
3
3
|
|
|
4
4
|
type configProps = {
|
|
@@ -13,16 +13,25 @@ type configProps = {
|
|
|
13
13
|
};
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
-
export function
|
|
16
|
+
export function initialize(config: configProps): void {
|
|
17
17
|
try {
|
|
18
|
-
const configData = fs.readFileSync("./hui-config.json", "utf-8");
|
|
19
|
-
const config: configProps = JSON.parse(configData);
|
|
20
18
|
setApiKey({
|
|
21
19
|
GOOGLE_MAP_API_KEY: config.googleMapApiKey,
|
|
22
20
|
});
|
|
23
|
-
|
|
24
|
-
console.log("Got key from frontend", config.googleMapApiKey);
|
|
25
21
|
} catch (error) {
|
|
26
22
|
console.error("Error reading the config file:", error);
|
|
27
23
|
}
|
|
28
24
|
}
|
|
25
|
+
// export function loadConfig(): void {
|
|
26
|
+
// try {
|
|
27
|
+
// const configData = fs.readFileSync("./hui-config.json", "utf-8");
|
|
28
|
+
// const config: configProps = JSON.parse(configData);
|
|
29
|
+
// setApiKey({
|
|
30
|
+
// GOOGLE_MAP_API_KEY: config.googleMapApiKey,
|
|
31
|
+
// });
|
|
32
|
+
|
|
33
|
+
// console.log("Got key from frontend", config.googleMapApiKey);
|
|
34
|
+
// } catch (error) {
|
|
35
|
+
// console.error("Error reading the config file:", error);
|
|
36
|
+
// }
|
|
37
|
+
// }
|