related-ui-components 1.9.2 → 1.9.4

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/package.json CHANGED
@@ -1,126 +1,123 @@
1
- {
2
- "name": "related-ui-components",
3
- "main": "./src/index.ts",
4
- "version": "1.9.2",
5
- "scripts": {
6
- "start": "expo start",
7
- "reset-project": "node ./scripts/reset-project.js",
8
- "android": "expo start --android",
9
- "ios": "expo start --ios",
10
- "web": "expo start --web",
11
- "test": "jest --watchAll",
12
- "lint": "expo lint",
13
- "prepare": "bob build"
14
- },
15
- "jest": {
16
- "preset": "jest-expo",
17
- "modulePathIgnorePatterns": [
18
- "<rootDir>/lib/"
19
- ]
20
- },
21
- "dependencies": {
22
- "@expo/metro-runtime": "~4.0.1",
23
- "@expo/vector-icons": "^14.0.2",
24
- "@gorhom/bottom-sheet": "^5.1.2",
25
- "@ptomasroos/react-native-multi-slider": "^2.2.2",
26
- "@react-native-community/slider": "4.5.5",
27
- "@react-native-picker/picker": "2.9.0",
28
- "@react-navigation/native": "^7.0.14",
29
- "@shopify/react-native-skia": "1.5.0",
30
- "date-fns": "^4.1.0",
31
- "expo": "~52.0.46",
32
- "expo-barcode-generator": "^4.0.0",
33
- "expo-checkbox": "^4.0.1",
34
- "expo-clipboard": "~7.0.1",
35
- "expo-constants": "~17.0.7",
36
- "expo-font": "~13.0.4",
37
- "expo-linear-gradient": "~14.0.2",
38
- "expo-linking": "~7.0.5",
39
- "expo-splash-screen": "~0.29.24",
40
- "expo-status-bar": "~2.0.1",
41
- "react": "18.3.1",
42
- "react-dom": "18.3.1",
43
- "react-native": "0.76.9",
44
- "react-native-calendars": "^1.1310.0",
45
- "react-native-gesture-handler": "~2.20.2",
46
- "react-native-modal": "^14.0.0-rc.1",
47
- "react-native-qrcode-svg": "^6.3.15",
48
- "react-native-reanimated": "^3.16.1",
49
- "react-native-safe-area-context": "4.12.0",
50
- "react-native-screens": "~4.4.0",
51
- "react-native-svg": "15.8.0",
52
- "react-native-web": "~0.19.13",
53
- "react-native-webview": "13.12.5"
54
- },
55
- "devDependencies": {
56
- "@babel/core": "^7.25.2",
57
- "@chromatic-com/storybook": "^3.2.5",
58
- "@react-native-async-storage/async-storage": "1.23.1",
59
- "@react-native-community/datetimepicker": "8.2.0",
60
- "@react-native-community/slider": "4.5.5",
61
- "@types/jest": "^29.5.12",
62
- "@types/jsbarcode": "^3.11.4",
63
- "@types/react": "~18.3.12",
64
- "@types/react-test-renderer": "^18.3.0",
65
- "@types/xmldom": "^0.1.34",
66
- "babel-loader": "^8.4.1",
67
- "jest": "^29.2.1",
68
- "jest-expo": "~52.0.4",
69
- "react-native-builder-bob": "^0.37.0",
70
- "react-test-renderer": "18.3.1",
71
- "storybook": "^8.6.4",
72
- "typescript": "^5.3.3",
73
- "vite": "^6.2.1"
74
- },
75
- "private": false,
76
- "source": "./src/index.ts",
77
- "module": "./lib/module/index.js",
78
- "types": "./lib/typescript/commonjs/index.d.ts",
79
- "exports": {
80
- ".": {
81
- "import": {
82
- "types": "./lib/typescript/module/index.d.ts",
83
- "default": "./lib/module/index.js"
84
- },
85
- "require": {
86
- "types": "./lib/typescript/commonjs/index.d.ts",
87
- "default": "./lib/commonjs/index.js"
88
- }
89
- }
90
- },
91
- "files": [
92
- "src",
93
- "lib",
94
- "!**/__tests__",
95
- "!**/__fixtures__",
96
- "!**/__mocks__"
97
- ],
98
- "react-native-builder-bob": {
99
- "source": "src",
100
- "output": "lib",
101
- "targets": [
102
- [
103
- "commonjs",
104
- {
105
- "esm": true
106
- }
107
- ],
108
- [
109
- "module",
110
- {
111
- "esm": true
112
- }
113
- ],
114
- [
115
- "typescript",
116
- {
117
- "esm": true
118
- }
119
- ]
120
- ]
121
- },
122
- "eslintIgnore": [
123
- "node_modules/",
124
- "lib/"
125
- ]
126
- }
1
+ {
2
+ "name": "related-ui-components",
3
+ "main": "./src/index.ts",
4
+ "version": "1.9.4",
5
+ "scripts": {
6
+ "start": "expo start",
7
+ "reset-project": "node ./scripts/reset-project.js",
8
+ "android": "expo start --android",
9
+ "ios": "expo start --ios",
10
+ "web": "expo start --web",
11
+ "test": "jest --watchAll",
12
+ "lint": "expo lint",
13
+ "prepare": "bob build"
14
+ },
15
+ "jest": {
16
+ "preset": "jest-expo",
17
+ "modulePathIgnorePatterns": [
18
+ "<rootDir>/lib/"
19
+ ]
20
+ },
21
+ "dependencies": {
22
+ "@expo/metro-runtime": "~4.0.1",
23
+ "@expo/vector-icons": "^14.0.2",
24
+ "@gorhom/bottom-sheet": "^5.1.2",
25
+ "@ptomasroos/react-native-multi-slider": "^2.2.2",
26
+ "@react-native-community/slider": "4.5.5",
27
+ "@react-native-picker/picker": "2.9.0",
28
+ "@react-navigation/native": "^7.0.14",
29
+ "@shopify/react-native-skia": "1.5.0",
30
+ "date-fns": "^4.1.0",
31
+ "expo": "~52.0.46",
32
+ "expo-checkbox": "^4.0.1",
33
+ "expo-constants": "~17.0.7",
34
+ "expo-font": "~13.0.4",
35
+ "expo-linear-gradient": "~14.0.2",
36
+ "expo-linking": "~7.0.5",
37
+ "expo-splash-screen": "~0.29.24",
38
+ "expo-status-bar": "~2.0.1",
39
+ "react": "18.3.1",
40
+ "react-dom": "18.3.1",
41
+ "react-native": "0.76.9",
42
+ "react-native-calendars": "^1.1310.0",
43
+ "react-native-gesture-handler": "~2.20.2",
44
+ "react-native-modal": "^14.0.0-rc.1",
45
+ "react-native-qrcode-svg": "^6.3.15",
46
+ "react-native-reanimated": "^3.16.1",
47
+ "react-native-safe-area-context": "4.12.0",
48
+ "react-native-screens": "~4.4.0",
49
+ "react-native-svg": "15.8.0",
50
+ "react-native-web": "~0.19.13",
51
+ "react-native-webview": "13.12.5",
52
+ "expo-clipboard": "~7.0.1"
53
+ },
54
+ "devDependencies": {
55
+ "@babel/core": "^7.25.2",
56
+ "@chromatic-com/storybook": "^3.2.5",
57
+ "@react-native-async-storage/async-storage": "1.23.1",
58
+ "@react-native-community/datetimepicker": "8.2.0",
59
+ "@react-native-community/slider": "4.5.5",
60
+ "@types/jest": "^29.5.12",
61
+ "@types/react": "~18.3.12",
62
+ "@types/react-test-renderer": "^18.3.0",
63
+ "babel-loader": "^8.4.1",
64
+ "jest": "^29.2.1",
65
+ "jest-expo": "~52.0.4",
66
+ "react-native-builder-bob": "^0.37.0",
67
+ "react-test-renderer": "18.3.1",
68
+ "storybook": "^8.6.4",
69
+ "typescript": "^5.3.3",
70
+ "vite": "^6.2.1"
71
+ },
72
+ "private": false,
73
+ "source": "./src/index.ts",
74
+ "module": "./lib/module/index.js",
75
+ "types": "./lib/typescript/commonjs/index.d.ts",
76
+ "exports": {
77
+ ".": {
78
+ "import": {
79
+ "types": "./lib/typescript/module/index.d.ts",
80
+ "default": "./lib/module/index.js"
81
+ },
82
+ "require": {
83
+ "types": "./lib/typescript/commonjs/index.d.ts",
84
+ "default": "./lib/commonjs/index.js"
85
+ }
86
+ }
87
+ },
88
+ "files": [
89
+ "src",
90
+ "lib",
91
+ "!**/__tests__",
92
+ "!**/__fixtures__",
93
+ "!**/__mocks__"
94
+ ],
95
+ "react-native-builder-bob": {
96
+ "source": "src",
97
+ "output": "lib",
98
+ "targets": [
99
+ [
100
+ "commonjs",
101
+ {
102
+ "esm": true
103
+ }
104
+ ],
105
+ [
106
+ "module",
107
+ {
108
+ "esm": true
109
+ }
110
+ ],
111
+ [
112
+ "typescript",
113
+ {
114
+ "esm": true
115
+ }
116
+ ]
117
+ ]
118
+ },
119
+ "eslintIgnore": [
120
+ "node_modules/",
121
+ "lib/"
122
+ ]
123
+ }
package/src/app.tsx CHANGED
@@ -1,151 +1,127 @@
1
- // // App.tsx or any other screen component
2
- // import React, { useState } from "react";
3
- // import {
4
- // SafeAreaView,
5
- // StyleSheet,
6
- // TextInput,
7
- // View,
8
- // Text,
9
- // ScrollView,
10
- // Button,
11
- // } from "react-native";
12
- // import Barcode, { BarcodeFormat } from "./components/Barcode/Barcode";
1
+ import React, { useState } from "react";
2
+ import { View, Button, Text } from "react-native";
3
+ import {
4
+ FilterResult,
5
+ Filters,
6
+ Popup,
7
+ ScratchCard,
8
+ ScratchCardContent,
9
+ UnlockRewards,
10
+ } from "./components";
11
+ import BRANDS from "./constants/BRANDS";
12
+ import { Ionicons } from "@expo/vector-icons";
13
+ import { useTheme } from "./theme";
14
+ import RedeemedVoucherSheet from "./components/RedeemedVoucher/RedeemedVoucherSheet";
15
+ import { GestureHandlerRootView } from "react-native-gesture-handler";
13
16
 
14
- // export default function App() {
15
- // const [barcodeValue, setBarcodeValue] = useState("123456789012");
16
- // const [barcodeFormat, setBarcodeFormat] = useState<BarcodeFormat>(
17
- // BarcodeFormat.EAN13,
18
- // );
19
- // const [errorMsg, setErrorMsg] = useState<string | null>(null);
17
+ const MyScreen = () => {
18
+ const [isFilterVisible, setIsFilterVisible] = useState(false);
20
19
 
21
- // const handleBarcodeError = (error: Error) => {
22
- // console.error("Custom Barcode Error:", error.message);
23
- // setErrorMsg(`Barcode Error: ${error.message}`);
24
- // };
20
+ const { theme } = useTheme();
25
21
 
26
- // const cycleFormat = () => {
27
- // const formats = Object.values(BarcodeFormat);
28
- // const currentIndex = formats.indexOf(barcodeFormat);
29
- // const nextIndex = (currentIndex + 1) % formats.length;
30
- // setBarcodeFormat(formats[nextIndex]);
31
- // // Adjust value for specific formats if needed
32
- // if (formats[nextIndex] === BarcodeFormat.EAN13) setBarcodeValue("978020137962"); // Valid EAN13
33
- // else if (formats[nextIndex] === BarcodeFormat.UPC) setBarcodeValue("012345678905"); // Valid UPC
34
- // else if (formats[nextIndex] === BarcodeFormat.CODE39) setBarcodeValue("HELLO-WORLD");
35
- // else setBarcodeValue("TEST12345");
22
+ const handleApplyFilters = (result: FilterResult) => {
23
+ console.log("Filters applied:", result);
24
+ // Process filter results...
25
+ };
36
26
 
37
- // };
27
+ const rewardsData = [
28
+ {
29
+ icon: (
30
+ <Ionicons name="briefcase-outline" size={30} color={theme.primary} />
31
+ ),
32
+ activeIcon: (
33
+ <Ionicons name="briefcase-outline" size={30} color={theme.onPrimary} />
34
+ ),
35
+ title: "Aqua Guardian",
36
+ description:
37
+ "Maintain water usage below the community average for a month.",
38
+ isActive: false,
39
+ status: "0/1",
40
+ statusBackgroundColor: "#FFCDD2",
41
+ statusTextColor: "#D32F2F",
42
+ },
43
+ {
44
+ icon: <Ionicons name="heart-outline" size={30} color={theme.primary} />,
45
+ activeIcon: (
46
+ <Ionicons name="heart-outline" size={30} color={theme.onPrimary} />
47
+ ),
48
+ title: "Wellness Warrior",
49
+ description: "Complete 30 days of healthy hydration tracking.",
50
+ isActive: true,
51
+ status: "15/30",
52
+ statusBackgroundColor: "#C8E6C9",
53
+ statusTextColor: "#388E3C",
54
+ },
55
+ {
56
+ icon: <Ionicons name="airplane-outline" size={24} color={theme.helper} />,
57
+ activeIcon: (
58
+ <Ionicons name="airplane-outline" size={24} color={theme.primary} />
59
+ ),
60
+ title: "Eco Traveler",
61
+ description: "Log 5 trips where you chose sustainable travel options.",
62
+ isActive: false,
63
+ status: "2/5",
64
+ statusBackgroundColor: theme.disabled,
65
+ statusTextColor: theme.text,
66
+ },
67
+ {
68
+ icon: <Ionicons name="school-outline" size={24} color={theme.helper} />,
69
+ activeIcon: (
70
+ <Ionicons name="school-outline" size={24} color={theme.primary} />
71
+ ),
72
+ title: "Knowledge Seeker",
73
+ description: "Complete all water conservation learning modules.",
74
+ isActive: false,
75
+ status: "3/5",
76
+ statusBackgroundColor: theme.disabled,
77
+ statusTextColor: theme.text,
78
+ },
79
+ {
80
+ icon: <Ionicons name="settings-outline" size={24} color={theme.helper} />,
81
+ activeIcon: (
82
+ <Ionicons name="settings-outline" size={24} color={theme.primary} />
83
+ ),
84
+ title: "Smart Saver",
85
+ description: "Set up and use all water-saving features in the app.",
86
+ isActive: true,
87
+ status: "4/4",
88
+ statusBackgroundColor: theme.primary,
89
+ statusTextColor: theme.background,
90
+ },
91
+ ];
38
92
 
39
- // return (
40
- // <SafeAreaView style={styles.container}>
41
- // <ScrollView contentContainerStyle={styles.scrollContent}>
42
- // <Text style={styles.title}>Custom Barcode Generator</Text>
93
+ return (
94
+ <>
95
+ <GestureHandlerRootView>
96
+ <Popup visible={true} onClose={()=>{}}>
97
+ <ScratchCard
98
+ backgroundColor="#8A2BE2"
99
+ text="Scratch to reveal your prize!"
100
+ textFontColor="#FFFFFF"
101
+ textFontSize={18}
102
+ textFont={require("@/assets/fonts/SpaceMono-Regular.ttf")}
103
+ width={300}
104
+ height={150}
105
+ gradient={{
106
+ colors: ["#ff0000", "#00ff00", "#0000ff"],
107
+ start: { x: 0, y: 0 },
108
+ end: { x: 300, y: 300 },
109
+ }}
110
+ onScratched={() => alert("Congratulations! You won a prize!")}
111
+ >
112
+ <ScratchCardContent style={{ backgroundColor: "#FFD700" }}>
113
+ <Text style={{ fontSize: 24, fontWeight: "bold", color: "#000" }}>
114
+ 50% OFF COUPON
115
+ </Text>
116
+ <Text style={{ marginTop: 8, color: "#333" }}>
117
+ Use code: SCRATCH50
118
+ </Text>
119
+ </ScratchCardContent>
120
+ </ScratchCard>
121
+ </Popup>
122
+ </GestureHandlerRootView>
123
+ </>
124
+ );
125
+ };
43
126
 
44
- // <TextInput
45
- // style={styles.input}
46
- // placeholder="Enter barcode value"
47
- // value={barcodeValue}
48
- // onChangeText={setBarcodeValue}
49
- // autoCapitalize="characters" // Good for some formats like CODE39
50
- // />
51
-
52
- // <View style={styles.formatSelector}>
53
- // <Text>Format: {barcodeFormat}</Text>
54
- // <Button title="Cycle Format" onPress={cycleFormat} />
55
- // </View>
56
-
57
- // {errorMsg && <Text style={styles.errorTextDisplay}>{errorMsg}</Text>}
58
-
59
- // <Text style={styles.label}>Default:</Text>
60
- // <Barcode
61
- // value={barcodeValue}
62
- // format={barcodeFormat}
63
- // onError={handleBarcodeError}
64
- // />
65
-
66
- // <Text style={styles.label}>Customized (CODE128):</Text>
67
- // <Barcode
68
- // value="CUSTOM-CODE-128"
69
- // format={BarcodeFormat.CODE128}
70
- // lineColor="blue"
71
- // backgroundColor="#e0e0ff"
72
- // height={80}
73
- // width={1.5} // Bar width
74
- // fontSize={16}
75
- // textMargin={5}
76
- // margin={20} // Margin around the SVG
77
- // onError={handleBarcodeError}
78
- // style={styles.customBarcodeStyle}
79
- // />
80
-
81
- // <Text style={styles.label}>No Text Value (EAN13):</Text>
82
- // <Barcode
83
- // value="590123412345" // Needs valid check digit for EAN13
84
- // format={BarcodeFormat.EAN13}
85
- // displayValue={false}
86
- // onError={handleBarcodeError}
87
- // />
88
-
89
- // <Text style={styles.label}>Invalid Value Example (for EAN13):</Text>
90
- // <Barcode
91
- // value="INVALID" // This will likely cause an error for EAN13
92
- // format={BarcodeFormat.EAN13}
93
- // onError={handleBarcodeError}
94
- // />
95
- // <Text style={styles.label}>Empty Value:</Text>
96
- // <Barcode
97
- // value=""
98
- // format={BarcodeFormat.CODE128}
99
- // onError={handleBarcodeError}
100
- // />
101
- // </ScrollView>
102
- // </SafeAreaView>
103
- // );
104
- // }
105
-
106
- // const styles = StyleSheet.create({
107
- // container: {
108
- // flex: 1,
109
- // backgroundColor: "#f0f0f0",
110
- // },
111
- // scrollContent: {
112
- // alignItems: "center",
113
- // padding: 20,
114
- // },
115
- // title: {
116
- // fontSize: 24,
117
- // fontWeight: "bold",
118
- // marginBottom: 20,
119
- // },
120
- // input: {
121
- // height: 40,
122
- // borderColor: "gray",
123
- // borderWidth: 1,
124
- // paddingHorizontal: 10,
125
- // marginBottom: 20,
126
- // width: "90%",
127
- // backgroundColor: "white",
128
- // },
129
- // label: {
130
- // fontSize: 16,
131
- // fontWeight: "600",
132
- // marginTop: 20,
133
- // marginBottom: 8,
134
- // },
135
- // customBarcodeStyle: {
136
- // borderWidth: 1,
137
- // borderColor: "purple",
138
- // padding: 5, // Padding for the View container, not the barcode margin
139
- // },
140
- // formatSelector: {
141
- // flexDirection: "row",
142
- // alignItems: "center",
143
- // justifyContent: "space-between",
144
- // width: "90%",
145
- // marginBottom: 15,
146
- // },
147
- // errorTextDisplay: {
148
- // color: 'red',
149
- // marginVertical: 10,
150
- // }
151
- // });
127
+ export default MyScreen;
@@ -374,6 +374,7 @@ const SpinWheel: React.FC<SpinWheelProps> = ({
374
374
  style={[styles.actionButton, actionButtonStyle]}
375
375
  onPress={handleSpin}
376
376
  title={spinButtonText}
377
+ disabled={spinning}
377
378
  textStyle={[styles.actionButtonText, actionButtonTextStyle]}
378
379
  {...actionButtonProps}
379
380
  />