related-ui-components 1.9.2 → 1.9.3
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/lib/commonjs/app.js +159 -151
- package/lib/commonjs/app.js.map +1 -1
- package/lib/commonjs/components/Banner/Banner.js +1 -2
- package/lib/commonjs/components/Banner/Banner.js.map +1 -1
- package/lib/commonjs/components/index.js +29 -29
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/index.js +5 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/app.js +153 -151
- package/lib/module/app.js.map +1 -1
- package/lib/module/components/Banner/Banner.js +1 -2
- package/lib/module/components/Banner/Banner.js.map +1 -1
- package/lib/module/index.js +4 -7
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/commonjs/app.d.ts +3 -0
- package/lib/typescript/commonjs/app.d.ts.map +1 -1
- package/lib/typescript/commonjs/components/Banner/Banner.d.ts.map +1 -1
- package/lib/typescript/commonjs/components/DateRangePicker/index.d.ts +1 -0
- package/lib/typescript/commonjs/components/SelectAmount/index.d.ts +1 -0
- package/lib/typescript/commonjs/components/TravelBooking/index.d.ts +1 -0
- package/lib/typescript/commonjs/index.d.ts +1 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/module/app.d.ts +3 -0
- package/lib/typescript/module/app.d.ts.map +1 -1
- package/lib/typescript/module/components/Banner/Banner.d.ts.map +1 -1
- package/lib/typescript/module/components/DateRangePicker/index.d.ts +1 -0
- package/lib/typescript/module/components/SelectAmount/index.d.ts +1 -0
- package/lib/typescript/module/components/TravelBooking/index.d.ts +1 -0
- package/lib/typescript/module/index.d.ts +1 -0
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/package.json +24 -27
- package/src/app.tsx +121 -145
- package/src/components/Banner/Banner.tsx +1 -1
- package/src/index.ts +4 -4
package/src/app.tsx
CHANGED
|
@@ -1,151 +1,127 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
|
|
15
|
-
|
|
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
|
-
|
|
22
|
-
// console.error("Custom Barcode Error:", error.message);
|
|
23
|
-
// setErrorMsg(`Barcode Error: ${error.message}`);
|
|
24
|
-
// };
|
|
20
|
+
const { theme } = useTheme();
|
|
25
21
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
//
|
|
29
|
-
|
|
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
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
-
|
|
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;
|
|
@@ -2,6 +2,7 @@ import React from "react";
|
|
|
2
2
|
import {
|
|
3
3
|
StyleSheet,
|
|
4
4
|
Text,
|
|
5
|
+
TouchableOpacity,
|
|
5
6
|
ViewStyle,
|
|
6
7
|
TextStyle,
|
|
7
8
|
ImageSourcePropType,
|
|
@@ -11,7 +12,6 @@ import {
|
|
|
11
12
|
} from "react-native";
|
|
12
13
|
import { Card, CardFooter } from "../Card";
|
|
13
14
|
import { useTheme, ThemeType } from "../../theme";
|
|
14
|
-
import { TouchableOpacity } from "react-native-gesture-handler";
|
|
15
15
|
|
|
16
16
|
export interface BannerProps {
|
|
17
17
|
backgroundImage: ImageSourcePropType;
|
package/src/index.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { registerRootComponent } from 'expo';
|
|
2
|
+
import "react-native-reanimated";
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
import App from "./app";
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
registerRootComponent(App);
|
|
8
8
|
|
|
9
9
|
export * from "./theme"
|
|
10
10
|
export * from "./components";
|