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.
- package/lib/commonjs/app.js +62 -120
- package/lib/commonjs/app.js.map +1 -1
- package/lib/commonjs/components/Wheel/Wheel.js +193 -178
- package/lib/commonjs/components/Wheel/Wheel.js.map +1 -1
- package/lib/commonjs/index.js +5 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/app.js +63 -121
- package/lib/module/app.js.map +1 -1
- package/lib/module/components/Wheel/Wheel.js +194 -180
- package/lib/module/components/Wheel/Wheel.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 +2 -2
- package/lib/typescript/commonjs/app.d.ts.map +1 -1
- package/lib/typescript/commonjs/components/Wheel/Wheel.d.ts +3 -1
- package/lib/typescript/commonjs/components/Wheel/Wheel.d.ts.map +1 -1
- 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 +2 -2
- package/lib/typescript/module/app.d.ts.map +1 -1
- package/lib/typescript/module/components/Wheel/Wheel.d.ts +3 -1
- package/lib/typescript/module/components/Wheel/Wheel.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +1 -0
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/app.tsx +35 -99
- package/src/components/Wheel/Wheel.tsx +233 -220
- package/src/index.ts +4 -4
package/lib/commonjs/app.js
CHANGED
|
@@ -5,130 +5,72 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var _RedeemedVoucherSheet = _interopRequireDefault(require("./components/RedeemedVoucher/RedeemedVoucherSheet.js"));
|
|
11
|
-
var _reactNativeGestureHandler = require("react-native-gesture-handler");
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _Wheel = _interopRequireDefault(require("./components/Wheel/Wheel.js"));
|
|
12
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
12
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
15
13
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
statusTextColor: theme.text
|
|
76
|
-
}, {
|
|
77
|
-
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
|
|
78
|
-
name: "school-outline",
|
|
79
|
-
size: 24,
|
|
80
|
-
color: theme.helper
|
|
81
|
-
}),
|
|
82
|
-
activeIcon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
|
|
83
|
-
name: "school-outline",
|
|
84
|
-
size: 24,
|
|
85
|
-
color: theme.primary
|
|
86
|
-
}),
|
|
87
|
-
title: "Knowledge Seeker",
|
|
88
|
-
description: "Complete all water conservation learning modules.",
|
|
89
|
-
isActive: false,
|
|
90
|
-
status: "3/5",
|
|
91
|
-
statusBackgroundColor: theme.disabled,
|
|
92
|
-
statusTextColor: theme.text
|
|
93
|
-
}, {
|
|
94
|
-
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
|
|
95
|
-
name: "settings-outline",
|
|
96
|
-
size: 24,
|
|
97
|
-
color: theme.helper
|
|
98
|
-
}),
|
|
99
|
-
activeIcon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
|
|
100
|
-
name: "settings-outline",
|
|
101
|
-
size: 24,
|
|
102
|
-
color: theme.primary
|
|
103
|
-
}),
|
|
104
|
-
title: "Smart Saver",
|
|
105
|
-
description: "Set up and use all water-saving features in the app.",
|
|
106
|
-
isActive: true,
|
|
107
|
-
status: "4/4",
|
|
108
|
-
statusBackgroundColor: theme.primary,
|
|
109
|
-
statusTextColor: theme.background
|
|
110
|
-
}];
|
|
111
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
112
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeGestureHandler.GestureHandlerRootView, {
|
|
113
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_RedeemedVoucherSheet.default, {
|
|
114
|
-
visible: true,
|
|
115
|
-
onClose: () => {},
|
|
116
|
-
code: "0000P78SHV50KK"
|
|
117
|
-
// amount={100}
|
|
118
|
-
,
|
|
119
|
-
expiry: "22/01/2025",
|
|
120
|
-
currency: "USD",
|
|
121
|
-
title: "Voucher Activated!"
|
|
122
|
-
// primaryButtonColors={["red", "blue"]}
|
|
123
|
-
,
|
|
124
|
-
onMyVouchersButtonPress: () => console.log("My Vouchers pressed"),
|
|
125
|
-
onCopyCode: code => console.log("Copied:", code)
|
|
126
|
-
// To use custom icons:
|
|
127
|
-
// amountIconComponent={<Image source={YourCustomAmountIcon} style={{width: 20, height: 20, marginRight: 5}} />}
|
|
128
|
-
// renderCopyIcon={() => <Text style={{fontSize: 22, color: 'blue'}}>COPY</Text>}
|
|
129
|
-
})
|
|
130
|
-
})
|
|
14
|
+
const wheelItems = [{
|
|
15
|
+
id: 1,
|
|
16
|
+
label: "Prize 1",
|
|
17
|
+
color: "#FF6384"
|
|
18
|
+
}, {
|
|
19
|
+
id: 2,
|
|
20
|
+
label: "Prize 2",
|
|
21
|
+
color: "#36A2EB"
|
|
22
|
+
}, {
|
|
23
|
+
id: 3,
|
|
24
|
+
label: "Prize 3",
|
|
25
|
+
color: "#FFCE56"
|
|
26
|
+
}, {
|
|
27
|
+
id: 4,
|
|
28
|
+
label: "Prize 4",
|
|
29
|
+
color: "#4BC0C0"
|
|
30
|
+
}, {
|
|
31
|
+
id: 5,
|
|
32
|
+
label: "Prize 5",
|
|
33
|
+
color: "#9966FF"
|
|
34
|
+
}, {
|
|
35
|
+
id: 6,
|
|
36
|
+
label: "Prize 6",
|
|
37
|
+
color: "#FF9F40"
|
|
38
|
+
}];
|
|
39
|
+
const MockWheelScreen = () => {
|
|
40
|
+
const [winner, setWinner] = (0, _react.useState)(null);
|
|
41
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
42
|
+
style: {
|
|
43
|
+
flex: 1,
|
|
44
|
+
justifyContent: "center",
|
|
45
|
+
alignItems: "center"
|
|
46
|
+
},
|
|
47
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Wheel.default, {
|
|
48
|
+
items: wheelItems,
|
|
49
|
+
predeterminedWinner: wheelItems[2],
|
|
50
|
+
onSpinEnd: item => {
|
|
51
|
+
alert(`Winner: ${item.label}`);
|
|
52
|
+
setWinner(null);
|
|
53
|
+
},
|
|
54
|
+
size: 300,
|
|
55
|
+
spinButtonText: "Spin Randomly"
|
|
56
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
57
|
+
style: {
|
|
58
|
+
flexDirection: "row",
|
|
59
|
+
marginTop: 20
|
|
60
|
+
},
|
|
61
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Button, {
|
|
62
|
+
title: "Spin to Prize 3",
|
|
63
|
+
onPress: () => setWinner(wheelItems[2])
|
|
64
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
65
|
+
style: {
|
|
66
|
+
width: 20
|
|
67
|
+
}
|
|
68
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Button, {
|
|
69
|
+
title: "Spin Random",
|
|
70
|
+
onPress: () => setWinner(null)
|
|
71
|
+
})]
|
|
72
|
+
})]
|
|
131
73
|
});
|
|
132
74
|
};
|
|
133
|
-
var _default = exports.default =
|
|
75
|
+
var _default = exports.default = MockWheelScreen;
|
|
134
76
|
//# sourceMappingURL=app.js.map
|
package/lib/commonjs/app.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_Wheel","_interopRequireDefault","_jsxRuntime","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","wheelItems","id","label","color","MockWheelScreen","winner","setWinner","useState","jsxs","View","style","flex","justifyContent","alignItems","children","jsx","items","predeterminedWinner","onSpinEnd","item","alert","size","spinButtonText","flexDirection","marginTop","Button","title","onPress","width","_default","exports"],"sourceRoot":"..\\..\\src","sources":["app.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAC,sBAAA,CAAAH,OAAA;AAAoE,IAAAI,WAAA,GAAAJ,OAAA;AAAA,SAAAG,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,yBAAAH,CAAA,6BAAAI,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAD,wBAAA,YAAAA,CAAAH,CAAA,WAAAA,CAAA,GAAAM,CAAA,GAAAD,CAAA,KAAAL,CAAA;AAAA,SAAAN,wBAAAM,CAAA,EAAAK,CAAA,SAAAA,CAAA,IAAAL,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAE,OAAA,EAAAF,CAAA,QAAAM,CAAA,GAAAH,wBAAA,CAAAE,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAC,GAAA,CAAAP,CAAA,UAAAM,CAAA,CAAAE,GAAA,CAAAR,CAAA,OAAAS,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAf,CAAA,oBAAAe,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAjB,CAAA,EAAAe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