related-ui-components 1.8.5 → 1.8.7

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.
@@ -1,4 +1,4 @@
1
1
  import React from "react";
2
- declare const MyScreen: () => React.JSX.Element;
3
- export default MyScreen;
2
+ declare const MockWheelScreen: () => React.JSX.Element;
3
+ export default MockWheelScreen;
4
4
  //# sourceMappingURL=app.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../../src/app.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AASxC,QAAA,MAAM,QAAQ,yBAiGb,CAAC;AAEF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../../src/app.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAaxC,QAAA,MAAM,eAAe,yBA6BpB,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -9,8 +9,10 @@ export interface SpinWheelItem {
9
9
  }
10
10
  interface SpinWheelProps {
11
11
  items: SpinWheelItem[];
12
+ predeterminedWinner?: SpinWheelItem | string | number;
12
13
  size?: number;
13
14
  spinDuration?: number;
15
+ friction?: number;
14
16
  enabled?: boolean;
15
17
  onSpinStart?: () => void;
16
18
  onSpinEnd?: (item: SpinWheelItem) => void;
@@ -21,10 +23,10 @@ interface SpinWheelProps {
21
23
  knobStyle?: ViewStyle;
22
24
  actionButtonStyle?: ViewStyle;
23
25
  actionButtonTextStyle?: TextStyle;
26
+ wheelBorderColor?: string;
24
27
  wheelTextColor?: string;
25
28
  knobColor?: string;
26
29
  centerComponent?: React.ReactNode;
27
- predeterminedWinnerId?: string | number | null;
28
30
  }
29
31
  declare const SpinWheel: React.FC<SpinWheelProps>;
30
32
  export default SpinWheel;
@@ -1 +1 @@
1
- {"version":3,"file":"Wheel.d.ts","sourceRoot":"","sources":["../../../../../src/components/Wheel/W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react-native-reanimated";
1
2
  export * from "./theme";
2
3
  export * from "./components";
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAQA,cAAc,SAAS,CAAA;AACvB,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,yBAAyB,CAAC;AAOjC,cAAc,SAAS,CAAA;AACvB,cAAc,cAAc,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "related-ui-components",
3
3
  "main": "./src/index.ts",
4
- "version": "1.8.5",
4
+ "version": "1.8.7",
5
5
  "scripts": {
6
6
  "start": "expo start",
7
7
  "reset-project": "node ./scripts/reset-project.js",
package/src/app.tsx CHANGED
@@ -1,109 +1,45 @@
1
1
  import React, { useState } from "react";
2
2
  import { View, Button } from "react-native";
3
- import { FilterResult, Filters, Popup, UnlockRewards } from "./components";
4
- import BRANDS from "./constants/BRANDS";
5
- import { Ionicons } from "@expo/vector-icons";
6
- import { useTheme } from "./theme";
7
- import RedeemedVoucherSheet from "./components/RedeemedVoucher/RedeemedVoucherSheet";
8
- import { GestureHandlerRootView } from "react-native-gesture-handler";
3
+ import SpinWheel, { SpinWheelItem } from "./components/Wheel/Wheel";
9
4
 
10
- const MyScreen = () => {
11
- const [isFilterVisible, setIsFilterVisible] = useState(false);
5
+ const wheelItems: SpinWheelItem[] = [
6
+ { id: 1, label: "Prize 1", color: "#FF6384" },
7
+ { id: 2, label: "Prize 2", color: "#36A2EB" },
8
+ { id: 3, label: "Prize 3", color: "#FFCE56" },
9
+ { id: 4, label: "Prize 4", color: "#4BC0C0" },
10
+ { id: 5, label: "Prize 5", color: "#9966FF" },
11
+ { id: 6, label: "Prize 6", color: "#FF9F40" },
12
+ ];
12
13
 
13
- const { theme } = useTheme();
14
-
15
- const handleApplyFilters = (result: FilterResult) => {
16
- console.log("Filters applied:", result);
17
- // Process filter results...
18
- };
19
-
20
- const rewardsData = [
21
- {
22
- icon: (
23
- <Ionicons name="briefcase-outline" size={30} color={theme.primary} />
24
- ),
25
- activeIcon: (
26
- <Ionicons name="briefcase-outline" size={30} color={theme.onPrimary} />
27
- ),
28
- title: "Aqua Guardian",
29
- description:
30
- "Maintain water usage below the community average for a month.",
31
- isActive: false,
32
- status: "0/1",
33
- statusBackgroundColor: "#FFCDD2",
34
- statusTextColor: "#D32F2F",
35
- },
36
- {
37
- icon: <Ionicons name="heart-outline" size={30} color={theme.primary} />,
38
- activeIcon: (
39
- <Ionicons name="heart-outline" size={30} color={theme.onPrimary} />
40
- ),
41
- title: "Wellness Warrior",
42
- description: "Complete 30 days of healthy hydration tracking.",
43
- isActive: true,
44
- status: "15/30",
45
- statusBackgroundColor: "#C8E6C9",
46
- statusTextColor: "#388E3C",
47
- },
48
- {
49
- icon: <Ionicons name="airplane-outline" size={24} color={theme.helper} />,
50
- activeIcon: (
51
- <Ionicons name="airplane-outline" size={24} color={theme.primary} />
52
- ),
53
- title: "Eco Traveler",
54
- description: "Log 5 trips where you chose sustainable travel options.",
55
- isActive: false,
56
- status: "2/5",
57
- statusBackgroundColor: theme.disabled,
58
- statusTextColor: theme.text,
59
- },
60
- {
61
- icon: <Ionicons name="school-outline" size={24} color={theme.helper} />,
62
- activeIcon: (
63
- <Ionicons name="school-outline" size={24} color={theme.primary} />
64
- ),
65
- title: "Knowledge Seeker",
66
- description: "Complete all water conservation learning modules.",
67
- isActive: false,
68
- status: "3/5",
69
- statusBackgroundColor: theme.disabled,
70
- statusTextColor: theme.text,
71
- },
72
- {
73
- icon: <Ionicons name="settings-outline" size={24} color={theme.helper} />,
74
- activeIcon: (
75
- <Ionicons name="settings-outline" size={24} color={theme.primary} />
76
- ),
77
- title: "Smart Saver",
78
- description: "Set up and use all water-saving features in the app.",
79
- isActive: true,
80
- status: "4/4",
81
- statusBackgroundColor: theme.primary,
82
- statusTextColor: theme.background,
83
- },
84
- ];
14
+ const MockWheelScreen = () => {
15
+ const [winner, setWinner] = useState<SpinWheelItem | null>(null);
85
16
 
86
17
  return (
87
- <>
88
- <GestureHandlerRootView>
89
- <RedeemedVoucherSheet
90
- visible={true}
91
- onClose={() => {}}
92
- code="0000P78SHV50KK"
93
- // amount={100}
94
- expiry="22/01/2025"
95
- currency="USD"
96
- title="Voucher Activated!"
97
- // primaryButtonColors={["red", "blue"]}
98
- onMyVouchersButtonPress={() => console.log("My Vouchers pressed")}
99
- onCopyCode={(code) => console.log("Copied:", code)}
100
- // To use custom icons:
101
- // amountIconComponent={<Image source={YourCustomAmountIcon} style={{width: 20, height: 20, marginRight: 5}} />}
102
- // renderCopyIcon={() => <Text style={{fontSize: 22, color: 'blue'}}>COPY</Text>}
18
+ <View style={{ flex: 1, justifyContent: "center", alignItems: "center" }}>
19
+ <SpinWheel
20
+ items={wheelItems}
21
+ predeterminedWinner={wheelItems[2]}
22
+ onSpinEnd={(item) => {
23
+ alert(`Winner: ${item.label}`);
24
+ setWinner(null);
25
+ }}
26
+ size={300}
27
+ spinButtonText="Spin Randomly"
103
28
  />
104
- </GestureHandlerRootView>
105
- </>
29
+
30
+ <View style={{ flexDirection: "row", marginTop: 20 }}>
31
+ <Button
32
+ title="Spin to Prize 3"
33
+ onPress={() => setWinner(wheelItems[2])}
34
+ />
35
+ <View style={{ width: 20 }} />
36
+ <Button
37
+ title="Spin Random"
38
+ onPress={() => setWinner(null)}
39
+ />
40
+ </View>
41
+ </View>
106
42
  );
107
43
  };
108
44
 
109
- export default MyScreen;
45
+ export default MockWheelScreen;