related-ui-components 1.8.7 → 1.8.9
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 +147 -62
- package/lib/commonjs/app.js.map +1 -1
- package/lib/commonjs/components/Popup/Popup.js +22 -24
- package/lib/commonjs/components/Popup/Popup.js.map +1 -1
- package/lib/commonjs/components/ScratchCard/ScratchCard.js +26 -7
- package/lib/commonjs/components/ScratchCard/ScratchCard.js.map +1 -1
- package/lib/commonjs/components/Skeleton/Shimmer.js +75 -0
- package/lib/commonjs/components/Skeleton/Shimmer.js.map +1 -0
- package/lib/commonjs/components/Skeleton/SkeletonElement.js +36 -0
- package/lib/commonjs/components/Skeleton/SkeletonElement.js.map +1 -0
- package/lib/commonjs/components/Skeleton/index.js +48 -0
- package/lib/commonjs/components/Skeleton/index.js.map +1 -0
- package/lib/commonjs/components/Wheel/Wheel.js +8 -8
- package/lib/commonjs/components/Wheel/Wheel.js.map +1 -1
- package/lib/commonjs/components/index.js +11 -0
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/index.js +0 -5
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/theme/Colors.js +6 -2
- package/lib/commonjs/theme/Colors.js.map +1 -1
- package/lib/module/app.js +149 -63
- package/lib/module/app.js.map +1 -1
- package/lib/module/components/Popup/Popup.js +22 -24
- package/lib/module/components/Popup/Popup.js.map +1 -1
- package/lib/module/components/ScratchCard/ScratchCard.js +29 -11
- package/lib/module/components/ScratchCard/ScratchCard.js.map +1 -1
- package/lib/module/components/Skeleton/Shimmer.js +69 -0
- package/lib/module/components/Skeleton/Shimmer.js.map +1 -0
- package/lib/module/components/Skeleton/SkeletonElement.js +31 -0
- package/lib/module/components/Skeleton/SkeletonElement.js.map +1 -0
- package/lib/module/components/Skeleton/index.js +7 -0
- package/lib/module/components/Skeleton/index.js.map +1 -0
- package/lib/module/components/Wheel/Wheel.js +9 -9
- package/lib/module/components/Wheel/Wheel.js.map +1 -1
- package/lib/module/components/index.js +1 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/index.js +7 -4
- package/lib/module/index.js.map +1 -1
- package/lib/module/theme/Colors.js +6 -2
- package/lib/module/theme/Colors.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/ScratchCard/ScratchCard.d.ts +11 -0
- package/lib/typescript/commonjs/components/ScratchCard/ScratchCard.d.ts.map +1 -1
- package/lib/typescript/commonjs/components/Skeleton/Shimmer.d.ts +13 -0
- package/lib/typescript/commonjs/components/Skeleton/Shimmer.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Skeleton/SkeletonElement.d.ts +12 -0
- package/lib/typescript/commonjs/components/Skeleton/SkeletonElement.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Skeleton/index.d.ts +5 -0
- package/lib/typescript/commonjs/components/Skeleton/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Wheel/Wheel.d.ts +2 -0
- package/lib/typescript/commonjs/components/Wheel/Wheel.d.ts.map +1 -1
- package/lib/typescript/commonjs/components/index.d.ts +1 -0
- package/lib/typescript/commonjs/components/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +0 -1
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/Colors.d.ts +2 -0
- package/lib/typescript/commonjs/theme/Colors.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/ScratchCard/ScratchCard.d.ts +11 -0
- package/lib/typescript/module/components/ScratchCard/ScratchCard.d.ts.map +1 -1
- package/lib/typescript/module/components/Skeleton/Shimmer.d.ts +13 -0
- package/lib/typescript/module/components/Skeleton/Shimmer.d.ts.map +1 -0
- package/lib/typescript/module/components/Skeleton/SkeletonElement.d.ts +12 -0
- package/lib/typescript/module/components/Skeleton/SkeletonElement.d.ts.map +1 -0
- package/lib/typescript/module/components/Skeleton/index.d.ts +5 -0
- package/lib/typescript/module/components/Skeleton/index.d.ts.map +1 -0
- package/lib/typescript/module/components/Wheel/Wheel.d.ts +2 -0
- package/lib/typescript/module/components/Wheel/Wheel.d.ts.map +1 -1
- package/lib/typescript/module/components/index.d.ts +1 -0
- package/lib/typescript/module/components/index.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +0 -1
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/theme/Colors.d.ts +2 -0
- package/lib/typescript/module/theme/Colors.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/app.tsx +119 -37
- package/src/components/Popup/Popup.tsx +2 -2
- package/src/components/ScratchCard/ScratchCard.tsx +30 -7
- package/src/components/Skeleton/Shimmer.tsx +89 -0
- package/src/components/Skeleton/SkeletonElement.tsx +34 -0
- package/src/components/Skeleton/index.ts +5 -0
- package/src/components/Wheel/Wheel.tsx +15 -3
- package/src/components/index.ts +2 -1
- package/src/index.ts +4 -4
- package/src/theme/Colors.ts +8 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAQA,cAAc,SAAS,CAAA;AACvB,cAAc,cAAc,CAAC"}
|
|
@@ -37,6 +37,8 @@ export interface ThemeType {
|
|
|
37
37
|
secondary?: string[];
|
|
38
38
|
[key: string]: string[] | undefined;
|
|
39
39
|
};
|
|
40
|
+
skeletonBackgroundColor?: string;
|
|
41
|
+
skeletonItemColor?: string;
|
|
40
42
|
}
|
|
41
43
|
export declare const lightTheme: ThemeType;
|
|
42
44
|
export declare const darkTheme: ThemeType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Colors.d.ts","sourceRoot":"","sources":["../../../../src/theme/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AAM,CAAC;IAClC,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAGD,eAAO,MAAM,UAAU,EAAE,SA+CxB,CAAC;AAGF,eAAO,MAAM,SAAS,EAAE,SA+CvB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../../src/app.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../../src/app.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAgBxC,QAAA,MAAM,QAAQ,yBA4Gb,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -14,6 +14,17 @@ type ScratchCardProps = {
|
|
|
14
14
|
textFontSize?: number;
|
|
15
15
|
textFontColor?: string;
|
|
16
16
|
onScratched?: () => void;
|
|
17
|
+
gradient?: {
|
|
18
|
+
colors: string[];
|
|
19
|
+
start?: {
|
|
20
|
+
x: number;
|
|
21
|
+
y: number;
|
|
22
|
+
};
|
|
23
|
+
end?: {
|
|
24
|
+
x: number;
|
|
25
|
+
y: number;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
17
28
|
};
|
|
18
29
|
declare const ScratchCard: React.FC<ScratchCardProps>;
|
|
19
30
|
export default ScratchCard;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScratchCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/ScratchCard/ScratchCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAKN,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ScratchCard.d.ts","sourceRoot":"","sources":["../../../../../src/components/ScratchCard/ScratchCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAKN,MAAM,OAAO,CAAC;AAkBf,OAAO,EACL,SAAS,EAET,SAAS,EAET,kBAAkB,EAEnB,MAAM,cAAc,CAAC;AAQtB,KAAK,gBAAgB,GAAG;IACtB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,KAAK,CAAC,EAAE,kBAAkB,CAAC;IAC3B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,QAAQ,CAAC,EAAE;QACT,MAAM,EAAE,MAAM,EAAE,CAAC;QACjB,KAAK,CAAC,EAAE;YAAE,CAAC,EAAE,MAAM,CAAC;YAAC,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;QACjC,GAAG,CAAC,EAAE;YAAE,CAAC,EAAE,MAAM,CAAC;YAAC,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;KAChC,CAAC;CACH,CAAC;AAEF,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CA6M3C,CAAC;AAyBF,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ViewStyle, DimensionValue, StyleProp } from "react-native";
|
|
3
|
+
interface ShimmerProps {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
width: DimensionValue;
|
|
6
|
+
height: DimensionValue;
|
|
7
|
+
style?: StyleProp<ViewStyle>;
|
|
8
|
+
duration?: number;
|
|
9
|
+
shimmerWidth?: number;
|
|
10
|
+
}
|
|
11
|
+
declare const Shimmer: React.FC<ShimmerProps>;
|
|
12
|
+
export default Shimmer;
|
|
13
|
+
//# sourceMappingURL=Shimmer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Shimmer.d.ts","sourceRoot":"","sources":["../../../../../src/components/Skeleton/Shimmer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AACjD,OAAO,EAKL,SAAS,EACT,cAAc,EACd,SAAS,EACV,MAAM,cAAc,CAAC;AAItB,UAAU,YAAY;IACpB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,KAAK,EAAE,cAAc,CAAC;IACtB,MAAM,EAAE,cAAc,CAAC;IACvB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,QAAA,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAgEnC,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ViewStyle, DimensionValue } from "react-native";
|
|
3
|
+
interface SkeletonElementProps {
|
|
4
|
+
width?: DimensionValue;
|
|
5
|
+
height?: DimensionValue;
|
|
6
|
+
borderRadius?: number;
|
|
7
|
+
style?: ViewStyle;
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
declare const SkeletonElement: React.FC<SkeletonElementProps>;
|
|
11
|
+
export default SkeletonElement;
|
|
12
|
+
//# sourceMappingURL=SkeletonElement.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SkeletonElement.d.ts","sourceRoot":"","sources":["../../../../../src/components/Skeleton/SkeletonElement.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAoB,SAAS,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE3E,UAAU,oBAAoB;IAC5B,KAAK,CAAC,EAAE,cAAc,CAAA;IACtB,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAmBnD,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Skeleton/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAC,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,OAAO,IAAI,eAAe,EAAC,MAAM,mBAAmB,CAAA;AAE7D,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ViewStyle, TextStyle } from "react-native";
|
|
3
|
+
import { AppButtonProps } from "../Button";
|
|
3
4
|
export interface SpinWheelItem {
|
|
4
5
|
id: string | number;
|
|
5
6
|
label: string;
|
|
@@ -23,6 +24,7 @@ interface SpinWheelProps {
|
|
|
23
24
|
knobStyle?: ViewStyle;
|
|
24
25
|
actionButtonStyle?: ViewStyle;
|
|
25
26
|
actionButtonTextStyle?: TextStyle;
|
|
27
|
+
actionButtonProps?: Partial<Omit<AppButtonProps, "title" | "onPress">>;
|
|
26
28
|
wheelBorderColor?: string;
|
|
27
29
|
wheelTextColor?: string;
|
|
28
30
|
knobColor?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Wheel.d.ts","sourceRoot":"","sources":["../../../../../src/components/Wheel/Wheel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA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GAAG,SAAS,CAAC,CAC5C,CAAC;IAGF,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IAGnB,eAAe,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACnC;AAED,QAAA,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAgSvC,CAAC;AAqDF,eAAe,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAA;AACtB,cAAc,eAAe,CAAC;AAC9B,cAAe,UAAU,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAA;AACtB,cAAc,eAAe,CAAC;AAC9B,cAAe,UAAU,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAQA,cAAc,SAAS,CAAA;AACvB,cAAc,cAAc,CAAC"}
|
|
@@ -37,6 +37,8 @@ export interface ThemeType {
|
|
|
37
37
|
secondary?: string[];
|
|
38
38
|
[key: string]: string[] | undefined;
|
|
39
39
|
};
|
|
40
|
+
skeletonBackgroundColor?: string;
|
|
41
|
+
skeletonItemColor?: string;
|
|
40
42
|
}
|
|
41
43
|
export declare const lightTheme: ThemeType;
|
|
42
44
|
export declare const darkTheme: ThemeType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Colors.d.ts","sourceRoot":"","sources":["../../../../src/theme/Colors.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,SAAS;IAExB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAA;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,CAAA;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IAGb,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CA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AS,EAAE,MAAM,CAAC;IAGlB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAGhB,QAAQ,EAAE,MAAM,CAAC;IAGjB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IAEf,OAAO,EAAE;QACP,EAAE,EAAE,MAAM,CAAC;QACX,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;QACV,EAAE,EAAE,MAAM,CAAC;QACX,GAAG,EAAE,MAAM,CAAC;KACb,CAAA;IAED,SAAS,CAAC,EAAE;QACV,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;QACnB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;QACrB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC;KACrC,CAAC;IACF,uBAAuB,CAAC,EAAG,MAAM,CAAC;IAClC,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAGD,eAAO,MAAM,UAAU,EAAE,SA+CxB,CAAC;AAGF,eAAO,MAAM,SAAS,EAAE,SA+CvB,CAAC"}
|
package/package.json
CHANGED
package/src/app.tsx
CHANGED
|
@@ -1,45 +1,127 @@
|
|
|
1
1
|
import React, { useState } from "react";
|
|
2
|
-
import { View, Button } from "react-native";
|
|
3
|
-
import
|
|
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";
|
|
4
16
|
|
|
5
|
-
const
|
|
6
|
-
|
|
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
|
-
];
|
|
17
|
+
const MyScreen = () => {
|
|
18
|
+
const [isFilterVisible, setIsFilterVisible] = useState(false);
|
|
13
19
|
|
|
14
|
-
const
|
|
15
|
-
const [winner, setWinner] = useState<SpinWheelItem | null>(null);
|
|
20
|
+
const { theme } = useTheme();
|
|
16
21
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
const handleApplyFilters = (result: FilterResult) => {
|
|
23
|
+
console.log("Filters applied:", result);
|
|
24
|
+
// Process filter results...
|
|
25
|
+
};
|
|
26
|
+
|
|
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
|
+
];
|
|
29
92
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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
|
+
</>
|
|
42
124
|
);
|
|
43
125
|
};
|
|
44
126
|
|
|
45
|
-
export default
|
|
127
|
+
export default MyScreen;
|
|
@@ -210,7 +210,7 @@ const Popup: FC<PopupProps> = ({
|
|
|
210
210
|
]}
|
|
211
211
|
pointerEvents="box-none"
|
|
212
212
|
>
|
|
213
|
-
<TouchableWithoutFeedback>
|
|
213
|
+
{/* <TouchableWithoutFeedback> */}
|
|
214
214
|
<View style={[!children && styles.popupContainer, containerStyle]}>
|
|
215
215
|
<CloseIcon
|
|
216
216
|
show={showCloseIcon}
|
|
@@ -243,7 +243,7 @@ const Popup: FC<PopupProps> = ({
|
|
|
243
243
|
renderDefaultContent()
|
|
244
244
|
)}
|
|
245
245
|
</View>
|
|
246
|
-
</TouchableWithoutFeedback>
|
|
246
|
+
{/* </TouchableWithoutFeedback> */}
|
|
247
247
|
</Animated.View>
|
|
248
248
|
</View>
|
|
249
249
|
</Modal>
|
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
SkPath, // Import SkPath type
|
|
20
20
|
SkFont, // Import SkFont type
|
|
21
21
|
SkImage, // Import SkImage type
|
|
22
|
+
LinearGradient,
|
|
22
23
|
} from "@shopify/react-native-skia";
|
|
23
24
|
import {
|
|
24
25
|
StyleProp,
|
|
@@ -26,9 +27,8 @@ import {
|
|
|
26
27
|
ViewStyle,
|
|
27
28
|
StyleSheet,
|
|
28
29
|
ImageRequireSource,
|
|
29
|
-
LogBox,
|
|
30
|
+
LogBox,
|
|
30
31
|
} from "react-native";
|
|
31
|
-
// Import runOnJS and useSharedValue
|
|
32
32
|
import { runOnJS, useSharedValue } from "react-native-reanimated";
|
|
33
33
|
import {
|
|
34
34
|
Gesture,
|
|
@@ -36,9 +36,6 @@ import {
|
|
|
36
36
|
GestureHandlerRootView,
|
|
37
37
|
} from "react-native-gesture-handler";
|
|
38
38
|
|
|
39
|
-
// Ignore specific warning if it appears, related to path mutation - use cautiously
|
|
40
|
-
// LogBox.ignoreLogs(['Skia: SkPath.Make()']);
|
|
41
|
-
|
|
42
39
|
type ScratchCardProps = {
|
|
43
40
|
style?: StyleProp<ViewStyle>;
|
|
44
41
|
image?: ImageRequireSource;
|
|
@@ -53,6 +50,11 @@ type ScratchCardProps = {
|
|
|
53
50
|
textFontSize?: number;
|
|
54
51
|
textFontColor?: string;
|
|
55
52
|
onScratched?: () => void;
|
|
53
|
+
gradient?: {
|
|
54
|
+
colors: string[];
|
|
55
|
+
start?: { x: number; y: number };
|
|
56
|
+
end?: { x: number; y: number };
|
|
57
|
+
};
|
|
56
58
|
};
|
|
57
59
|
|
|
58
60
|
const ScratchCard: React.FC<ScratchCardProps> = ({
|
|
@@ -69,6 +71,7 @@ const ScratchCard: React.FC<ScratchCardProps> = ({
|
|
|
69
71
|
textFontColor = "#CCCCCC",
|
|
70
72
|
textFontSize = 16,
|
|
71
73
|
onScratched,
|
|
74
|
+
gradient,
|
|
72
75
|
}) => {
|
|
73
76
|
const loadedImg = useImage(image);
|
|
74
77
|
const loadedFont = useFont(textFont, textFontSize);
|
|
@@ -171,12 +174,14 @@ const ScratchCard: React.FC<ScratchCardProps> = ({
|
|
|
171
174
|
const canRenderCanvas = isLayoutReady && areaWidth > 0 && areaHeight > 0;
|
|
172
175
|
|
|
173
176
|
return (
|
|
174
|
-
<GestureHandlerRootView
|
|
177
|
+
<GestureHandlerRootView
|
|
178
|
+
style={{ justifyContent: "center", alignContent: "center" }}
|
|
179
|
+
>
|
|
175
180
|
<View
|
|
176
181
|
onLayout={handleLayout}
|
|
177
182
|
style={[styles.container, style, { width, height }]}
|
|
178
183
|
>
|
|
179
|
-
<View style={styles.content}>{children}</View>
|
|
184
|
+
{canRenderCanvas && <View style={styles.content}>{children}</View>}
|
|
180
185
|
|
|
181
186
|
{!isScratched && canRenderCanvas && (
|
|
182
187
|
<GestureDetector gesture={pan}>
|
|
@@ -212,6 +217,24 @@ const ScratchCard: React.FC<ScratchCardProps> = ({
|
|
|
212
217
|
width={areaWidth}
|
|
213
218
|
height={areaHeight}
|
|
214
219
|
/>
|
|
220
|
+
) : gradient ? (
|
|
221
|
+
<Group>
|
|
222
|
+
<LinearGradient
|
|
223
|
+
start={gradient.start ?? { x: 0, y: 0 }}
|
|
224
|
+
end={gradient.end ?? { x: areaWidth, y: areaHeight }}
|
|
225
|
+
colors={gradient.colors}
|
|
226
|
+
></LinearGradient>
|
|
227
|
+
<Rect x={0} y={0} width={areaWidth} height={areaHeight} />
|
|
228
|
+
{loadedFont && textMetrics && text ? (
|
|
229
|
+
<Text
|
|
230
|
+
x={textMetrics.x}
|
|
231
|
+
y={textMetrics.y}
|
|
232
|
+
text={text}
|
|
233
|
+
color={textFontColor}
|
|
234
|
+
font={loadedFont}
|
|
235
|
+
/>
|
|
236
|
+
) : null}
|
|
237
|
+
</Group>
|
|
215
238
|
) : (
|
|
216
239
|
<Group>
|
|
217
240
|
<Rect
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import React, { useEffect, useRef } from "react";
|
|
2
|
+
import {
|
|
3
|
+
View,
|
|
4
|
+
StyleSheet,
|
|
5
|
+
Animated,
|
|
6
|
+
Easing,
|
|
7
|
+
ViewStyle,
|
|
8
|
+
DimensionValue,
|
|
9
|
+
StyleProp,
|
|
10
|
+
} from "react-native";
|
|
11
|
+
import { LinearGradient } from "expo-linear-gradient";
|
|
12
|
+
import { useTheme } from "../../theme";
|
|
13
|
+
|
|
14
|
+
interface ShimmerProps {
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
width: DimensionValue;
|
|
17
|
+
height: DimensionValue;
|
|
18
|
+
style?: StyleProp<ViewStyle>;
|
|
19
|
+
duration?: number;
|
|
20
|
+
shimmerWidth?: number;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const Shimmer: React.FC<ShimmerProps> = ({
|
|
24
|
+
children,
|
|
25
|
+
width,
|
|
26
|
+
height,
|
|
27
|
+
style,
|
|
28
|
+
duration = 1500,
|
|
29
|
+
shimmerWidth = 150,
|
|
30
|
+
}) => {
|
|
31
|
+
const { theme } = useTheme();
|
|
32
|
+
|
|
33
|
+
const animatedValue = useRef(new Animated.Value(0)).current;
|
|
34
|
+
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
const animation = Animated.loop(
|
|
37
|
+
Animated.timing(animatedValue, {
|
|
38
|
+
toValue: 1,
|
|
39
|
+
duration: duration,
|
|
40
|
+
easing: Easing.linear,
|
|
41
|
+
useNativeDriver: true,
|
|
42
|
+
})
|
|
43
|
+
);
|
|
44
|
+
animation.start();
|
|
45
|
+
return () => animation.stop();
|
|
46
|
+
}, [animatedValue, duration]);
|
|
47
|
+
|
|
48
|
+
const translateX = animatedValue.interpolate({
|
|
49
|
+
inputRange: [0, 1],
|
|
50
|
+
|
|
51
|
+
outputRange: [
|
|
52
|
+
-shimmerWidth,
|
|
53
|
+
typeof width === "number" ? width + shimmerWidth : 400 + shimmerWidth,
|
|
54
|
+
],
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
const shimmerColors = [
|
|
58
|
+
"transparent",
|
|
59
|
+
"rgba(255, 255, 255, 0.4)",
|
|
60
|
+
"transparent",
|
|
61
|
+
];
|
|
62
|
+
|
|
63
|
+
return (
|
|
64
|
+
<View
|
|
65
|
+
style={[
|
|
66
|
+
{ width, height, overflow: "hidden", backgroundColor: theme.skeletonBackgroundColor },
|
|
67
|
+
style,
|
|
68
|
+
]}
|
|
69
|
+
>
|
|
70
|
+
{children}
|
|
71
|
+
<Animated.View
|
|
72
|
+
style={{
|
|
73
|
+
...StyleSheet.absoluteFillObject,
|
|
74
|
+
transform: [{ translateX }],
|
|
75
|
+
zIndex: 1,
|
|
76
|
+
}}
|
|
77
|
+
>
|
|
78
|
+
<LinearGradient
|
|
79
|
+
colors={shimmerColors as any}
|
|
80
|
+
style={{ flex: 1, width: shimmerWidth }}
|
|
81
|
+
start={{ x: 0, y: 0.5 }}
|
|
82
|
+
end={{ x: 1, y: 0.5 }}
|
|
83
|
+
/>
|
|
84
|
+
</Animated.View>
|
|
85
|
+
</View>
|
|
86
|
+
);
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export default Shimmer;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { useTheme } from "../../theme";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { View, StyleSheet, ViewStyle, DimensionValue } from "react-native";
|
|
4
|
+
|
|
5
|
+
interface SkeletonElementProps {
|
|
6
|
+
width?: DimensionValue
|
|
7
|
+
height?: DimensionValue;
|
|
8
|
+
borderRadius?: number;
|
|
9
|
+
style?: ViewStyle;
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const SkeletonElement: React.FC<SkeletonElementProps> = ({
|
|
14
|
+
width,
|
|
15
|
+
height,
|
|
16
|
+
borderRadius,
|
|
17
|
+
style,
|
|
18
|
+
children,
|
|
19
|
+
}) => {
|
|
20
|
+
const { theme } = useTheme();
|
|
21
|
+
|
|
22
|
+
const styles = StyleSheet.create({
|
|
23
|
+
skeleton: {
|
|
24
|
+
backgroundColor: theme.skeletonItemColor,
|
|
25
|
+
width: width,
|
|
26
|
+
height: height,
|
|
27
|
+
borderRadius: borderRadius,
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
return <View style={[styles.skeleton, style]}>{children}</View>;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export default SkeletonElement;
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
TextStyle,
|
|
11
11
|
} from "react-native";
|
|
12
12
|
import { Svg, Path, G, Text as SvgText } from "react-native-svg";
|
|
13
|
+
import { AppButtonProps, Button } from "../Button";
|
|
13
14
|
|
|
14
15
|
export interface SpinWheelItem {
|
|
15
16
|
id: string | number;
|
|
@@ -72,7 +73,10 @@ interface SpinWheelProps {
|
|
|
72
73
|
wheelTextStyle?: TextStyle;
|
|
73
74
|
knobStyle?: ViewStyle;
|
|
74
75
|
actionButtonStyle?: ViewStyle;
|
|
75
|
-
actionButtonTextStyle?: TextStyle
|
|
76
|
+
actionButtonTextStyle?: TextStyle
|
|
77
|
+
actionButtonProps?: Partial<
|
|
78
|
+
Omit<AppButtonProps, "title" | "onPress">
|
|
79
|
+
>;
|
|
76
80
|
|
|
77
81
|
// Custom colors
|
|
78
82
|
wheelBorderColor?: string;
|
|
@@ -101,6 +105,7 @@ const SpinWheel: React.FC<SpinWheelProps> = ({
|
|
|
101
105
|
actionButtonTextStyle,
|
|
102
106
|
wheelBorderColor,
|
|
103
107
|
wheelTextColor = "#FFFFFF",
|
|
108
|
+
actionButtonProps
|
|
104
109
|
}) => {
|
|
105
110
|
const wheelItems = items.length > 0 ? items : [];
|
|
106
111
|
|
|
@@ -350,7 +355,14 @@ const SpinWheel: React.FC<SpinWheelProps> = ({
|
|
|
350
355
|
zIndex: 2,
|
|
351
356
|
}}
|
|
352
357
|
>
|
|
353
|
-
<
|
|
358
|
+
<Button
|
|
359
|
+
style={[styles.actionButton, actionButtonStyle]}
|
|
360
|
+
onPress={handleSpin}
|
|
361
|
+
title={spinButtonText}
|
|
362
|
+
textStyle={[styles.actionButtonText, actionButtonTextStyle]}
|
|
363
|
+
{...actionButtonProps}
|
|
364
|
+
/>
|
|
365
|
+
{/* <TouchableOpacity
|
|
354
366
|
onPress={handleSpin}
|
|
355
367
|
disabled={spinning || !enabled || wheelItems.length === 0}
|
|
356
368
|
style={[styles.actionButton, actionButtonStyle]}
|
|
@@ -358,7 +370,7 @@ const SpinWheel: React.FC<SpinWheelProps> = ({
|
|
|
358
370
|
<Text style={[styles.actionButtonText, actionButtonTextStyle]}>
|
|
359
371
|
{spinButtonText}
|
|
360
372
|
</Text>
|
|
361
|
-
</TouchableOpacity>
|
|
373
|
+
</TouchableOpacity> */}
|
|
362
374
|
</View>
|
|
363
375
|
</View>
|
|
364
376
|
</View>
|
package/src/components/index.ts
CHANGED