@oxyhq/services 5.1.11 → 5.1.13
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/ui/components/OxyProvider.js +50 -30
- package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
- package/lib/commonjs/ui/components/OxySignInButton.js +4 -4
- package/lib/commonjs/ui/components/OxySignInButton.js.map +1 -1
- package/lib/commonjs/ui/context/OxyContext.js +15 -7
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/navigation/OxyRouter.js +47 -7
- package/lib/commonjs/ui/navigation/OxyRouter.js.map +1 -1
- package/lib/commonjs/ui/screens/ProfileScreen.js +346 -0
- package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/SignInScreen.js +82 -86
- package/lib/commonjs/ui/screens/SignInScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SignUpScreen.js +190 -108
- package/lib/commonjs/ui/screens/SignUpScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaAboutScreen.js +88 -0
- package/lib/commonjs/ui/screens/karma/KarmaAboutScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js +364 -0
- package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/karma/KarmaFAQScreen.js +202 -0
- package/lib/commonjs/ui/screens/karma/KarmaFAQScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/karma/KarmaLeaderboardScreen.js +148 -0
- package/lib/commonjs/ui/screens/karma/KarmaLeaderboardScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js +127 -0
- package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/karma/KarmaRulesScreen.js +105 -0
- package/lib/commonjs/ui/screens/karma/KarmaRulesScreen.js.map +1 -0
- package/lib/commonjs/ui/styles/theme.js +1 -2
- package/lib/commonjs/ui/styles/theme.js.map +1 -1
- package/lib/module/ui/components/OxyProvider.js +51 -31
- package/lib/module/ui/components/OxyProvider.js.map +1 -1
- package/lib/module/ui/components/OxySignInButton.js +4 -4
- package/lib/module/ui/components/OxySignInButton.js.map +1 -1
- package/lib/module/ui/context/OxyContext.js +15 -7
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/navigation/OxyRouter.js +47 -7
- package/lib/module/ui/navigation/OxyRouter.js.map +1 -1
- package/lib/module/ui/screens/ProfileScreen.js +340 -0
- package/lib/module/ui/screens/ProfileScreen.js.map +1 -0
- package/lib/module/ui/screens/SignInScreen.js +83 -87
- package/lib/module/ui/screens/SignInScreen.js.map +1 -1
- package/lib/module/ui/screens/SignUpScreen.js +189 -109
- package/lib/module/ui/screens/SignUpScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaAboutScreen.js +83 -0
- package/lib/module/ui/screens/karma/KarmaAboutScreen.js.map +1 -0
- package/lib/module/ui/screens/karma/KarmaCenterScreen.js +358 -0
- package/lib/module/ui/screens/karma/KarmaCenterScreen.js.map +1 -0
- package/lib/module/ui/screens/karma/KarmaFAQScreen.js +197 -0
- package/lib/module/ui/screens/karma/KarmaFAQScreen.js.map +1 -0
- package/lib/module/ui/screens/karma/KarmaLeaderboardScreen.js +142 -0
- package/lib/module/ui/screens/karma/KarmaLeaderboardScreen.js.map +1 -0
- package/lib/module/ui/screens/karma/KarmaRewardsScreen.js +122 -0
- package/lib/module/ui/screens/karma/KarmaRewardsScreen.js.map +1 -0
- package/lib/module/ui/screens/karma/KarmaRulesScreen.js +100 -0
- package/lib/module/ui/screens/karma/KarmaRulesScreen.js.map +1 -0
- package/lib/module/ui/styles/theme.js +1 -2
- package/lib/module/ui/styles/theme.js.map +1 -1
- package/lib/typescript/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/ui/components/OxySignInButton.d.ts +5 -0
- package/lib/typescript/ui/components/OxySignInButton.d.ts.map +1 -1
- package/lib/typescript/ui/context/OxyContext.d.ts +4 -1
- package/lib/typescript/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/ui/navigation/OxyRouter.d.ts.map +1 -1
- package/lib/typescript/ui/screens/ProfileScreen.d.ts +9 -0
- package/lib/typescript/ui/screens/ProfileScreen.d.ts.map +1 -0
- package/lib/typescript/ui/screens/SignInScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/SignUpScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/karma/KarmaAboutScreen.d.ts +5 -0
- package/lib/typescript/ui/screens/karma/KarmaAboutScreen.d.ts.map +1 -0
- package/lib/typescript/ui/screens/karma/KarmaCenterScreen.d.ts +5 -0
- package/lib/typescript/ui/screens/karma/KarmaCenterScreen.d.ts.map +1 -0
- package/lib/typescript/ui/screens/karma/KarmaFAQScreen.d.ts +5 -0
- package/lib/typescript/ui/screens/karma/KarmaFAQScreen.d.ts.map +1 -0
- package/lib/typescript/ui/screens/karma/KarmaLeaderboardScreen.d.ts +5 -0
- package/lib/typescript/ui/screens/karma/KarmaLeaderboardScreen.d.ts.map +1 -0
- package/lib/typescript/ui/screens/karma/KarmaRewardsScreen.d.ts +5 -0
- package/lib/typescript/ui/screens/karma/KarmaRewardsScreen.d.ts.map +1 -0
- package/lib/typescript/ui/screens/karma/KarmaRulesScreen.d.ts +5 -0
- package/lib/typescript/ui/screens/karma/KarmaRulesScreen.d.ts.map +1 -0
- package/lib/typescript/ui/styles/theme.d.ts +0 -1
- package/lib/typescript/ui/styles/theme.d.ts.map +1 -1
- package/package.json +4 -3
- package/src/ui/components/OxyProvider.tsx +42 -29
- package/src/ui/components/OxySignInButton.tsx +9 -3
- package/src/ui/context/OxyContext.tsx +16 -8
- package/src/ui/navigation/OxyRouter.tsx +44 -7
- package/src/ui/screens/ProfileScreen.tsx +155 -0
- package/src/ui/screens/SignInScreen.tsx +68 -73
- package/src/ui/screens/SignUpScreen.tsx +136 -87
- package/src/ui/screens/karma/KarmaAboutScreen.tsx +45 -0
- package/src/ui/screens/karma/KarmaCenterScreen.tsx +271 -0
- package/src/ui/screens/karma/KarmaFAQScreen.tsx +164 -0
- package/src/ui/screens/karma/KarmaLeaderboardScreen.tsx +79 -0
- package/src/ui/screens/karma/KarmaRewardsScreen.tsx +55 -0
- package/src/ui/screens/karma/KarmaRulesScreen.tsx +65 -0
- package/src/ui/styles/theme.ts +1 -2
- package/lib/commonjs/ui/screens/AboutKarmaScreen.js +0 -50
- package/lib/commonjs/ui/screens/AboutKarmaScreen.js.map +0 -1
- package/lib/module/ui/screens/AboutKarmaScreen.js +0 -45
- package/lib/module/ui/screens/AboutKarmaScreen.js.map +0 -1
- package/lib/typescript/ui/screens/AboutKarmaScreen.d.ts +0 -5
- package/lib/typescript/ui/screens/AboutKarmaScreen.d.ts.map +0 -1
- package/src/ui/screens/AboutKarmaScreen.tsx +0 -58
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _OxyContext = require("../../context/OxyContext");
|
|
10
|
+
var _Avatar = _interopRequireDefault(require("../../components/Avatar"));
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
14
|
+
const KarmaLeaderboardScreen = ({
|
|
15
|
+
goBack,
|
|
16
|
+
theme,
|
|
17
|
+
navigate
|
|
18
|
+
}) => {
|
|
19
|
+
const {
|
|
20
|
+
oxyServices
|
|
21
|
+
} = (0, _OxyContext.useOxy)();
|
|
22
|
+
const [leaderboard, setLeaderboard] = (0, _react.useState)([]);
|
|
23
|
+
const [isLoading, setIsLoading] = (0, _react.useState)(true);
|
|
24
|
+
const [error, setError] = (0, _react.useState)(null);
|
|
25
|
+
const isDarkTheme = theme === 'dark';
|
|
26
|
+
const backgroundColor = isDarkTheme ? '#121212' : '#FFFFFF';
|
|
27
|
+
const textColor = isDarkTheme ? '#FFFFFF' : '#000000';
|
|
28
|
+
const primaryColor = '#d169e5';
|
|
29
|
+
(0, _react.useEffect)(() => {
|
|
30
|
+
setIsLoading(true);
|
|
31
|
+
setError(null);
|
|
32
|
+
oxyServices.getKarmaLeaderboard().then(data => setLeaderboard(Array.isArray(data) ? data : [])).catch(err => setError(err.message || 'Failed to load leaderboard')).finally(() => setIsLoading(false));
|
|
33
|
+
}, [oxyServices]);
|
|
34
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
35
|
+
style: [styles.container, {
|
|
36
|
+
backgroundColor
|
|
37
|
+
}],
|
|
38
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
39
|
+
style: [styles.title, {
|
|
40
|
+
color: textColor
|
|
41
|
+
}],
|
|
42
|
+
children: "Karma Leaderboard"
|
|
43
|
+
}), isLoading ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
|
|
44
|
+
size: "large",
|
|
45
|
+
color: primaryColor,
|
|
46
|
+
style: {
|
|
47
|
+
marginTop: 40
|
|
48
|
+
}
|
|
49
|
+
}) : error ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
50
|
+
style: [styles.error, {
|
|
51
|
+
color: '#D32F2F'
|
|
52
|
+
}],
|
|
53
|
+
children: error
|
|
54
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ScrollView, {
|
|
55
|
+
contentContainerStyle: styles.listContainer,
|
|
56
|
+
children: leaderboard.length === 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
57
|
+
style: [styles.placeholder, {
|
|
58
|
+
color: textColor
|
|
59
|
+
}],
|
|
60
|
+
children: "No leaderboard data."
|
|
61
|
+
}) : leaderboard.map((entry, idx) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
|
|
62
|
+
style: [styles.row, idx < 3 && {
|
|
63
|
+
backgroundColor: '#f7eaff'
|
|
64
|
+
}],
|
|
65
|
+
onPress: () => navigate && navigate('KarmaProfile', {
|
|
66
|
+
userId: entry.userId,
|
|
67
|
+
username: entry.username
|
|
68
|
+
}),
|
|
69
|
+
activeOpacity: 0.7,
|
|
70
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
71
|
+
style: [styles.rank, {
|
|
72
|
+
color: primaryColor
|
|
73
|
+
}],
|
|
74
|
+
children: idx + 1
|
|
75
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Avatar.default, {
|
|
76
|
+
name: entry.username || 'User',
|
|
77
|
+
size: 40,
|
|
78
|
+
theme: theme,
|
|
79
|
+
style: styles.avatar
|
|
80
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
81
|
+
style: [styles.username, {
|
|
82
|
+
color: textColor
|
|
83
|
+
}],
|
|
84
|
+
children: entry.username || entry.userId
|
|
85
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
86
|
+
style: [styles.karma, {
|
|
87
|
+
color: primaryColor
|
|
88
|
+
}],
|
|
89
|
+
children: entry.total
|
|
90
|
+
})]
|
|
91
|
+
}, entry.userId))
|
|
92
|
+
})]
|
|
93
|
+
});
|
|
94
|
+
};
|
|
95
|
+
const styles = _reactNative.StyleSheet.create({
|
|
96
|
+
container: {
|
|
97
|
+
flex: 1
|
|
98
|
+
},
|
|
99
|
+
title: {
|
|
100
|
+
fontSize: 24,
|
|
101
|
+
fontWeight: 'bold',
|
|
102
|
+
margin: 24,
|
|
103
|
+
textAlign: 'center'
|
|
104
|
+
},
|
|
105
|
+
listContainer: {
|
|
106
|
+
paddingBottom: 40
|
|
107
|
+
},
|
|
108
|
+
row: {
|
|
109
|
+
flexDirection: 'row',
|
|
110
|
+
alignItems: 'center',
|
|
111
|
+
paddingVertical: 12,
|
|
112
|
+
paddingHorizontal: 20,
|
|
113
|
+
borderBottomWidth: 1,
|
|
114
|
+
borderColor: '#eee'
|
|
115
|
+
},
|
|
116
|
+
rank: {
|
|
117
|
+
fontSize: 20,
|
|
118
|
+
width: 32,
|
|
119
|
+
textAlign: 'center',
|
|
120
|
+
fontWeight: 'bold'
|
|
121
|
+
},
|
|
122
|
+
avatar: {
|
|
123
|
+
marginHorizontal: 8
|
|
124
|
+
},
|
|
125
|
+
username: {
|
|
126
|
+
flex: 1,
|
|
127
|
+
fontSize: 16,
|
|
128
|
+
marginLeft: 8
|
|
129
|
+
},
|
|
130
|
+
karma: {
|
|
131
|
+
fontSize: 18,
|
|
132
|
+
fontWeight: 'bold',
|
|
133
|
+
marginLeft: 12
|
|
134
|
+
},
|
|
135
|
+
placeholder: {
|
|
136
|
+
fontSize: 16,
|
|
137
|
+
color: '#888',
|
|
138
|
+
textAlign: 'center',
|
|
139
|
+
marginTop: 40
|
|
140
|
+
},
|
|
141
|
+
error: {
|
|
142
|
+
fontSize: 16,
|
|
143
|
+
textAlign: 'center',
|
|
144
|
+
marginTop: 40
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
var _default = exports.default = KarmaLeaderboardScreen;
|
|
148
|
+
//# sourceMappingURL=KarmaLeaderboardScreen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_OxyContext","_Avatar","_interopRequireDefault","_jsxRuntime","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","KarmaLeaderboardScreen","goBack","theme","navigate","oxyServices","useOxy","leaderboard","setLeaderboard","useState","isLoading","setIsLoading","error","setError","isDarkTheme","backgroundColor","textColor","primaryColor","useEffect","getKarmaLeaderboard","then","data","Array","isArray","catch","err","message","finally","jsxs","View","style","styles","container","children","jsx","Text","title","color","ActivityIndicator","size","marginTop","ScrollView","contentContainerStyle","listContainer","length","placeholder","map","entry","idx","TouchableOpacity","row","onPress","userId","username","activeOpacity","rank","name","avatar","karma","total","StyleSheet","create","flex","fontSize","fontWeight","margin","textAlign","paddingBottom","flexDirection","alignItems","paddingVertical","paddingHorizontal","borderBottomWidth","borderColor","width","marginHorizontal","marginLeft","_default","exports"],"sourceRoot":"../../../../../src","sources":["ui/screens/karma/KarmaLeaderboardScreen.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAC,sBAAA,CAAAJ,OAAA;AAA6C,IAAAK,WAAA,GAAAL,OAAA;AAAA,SAAAI,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAP,wBAAAO,CAAA,EAAAG,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAX,uBAAA,YAAAA,CAAAO,CAAA,EAAAG,CAAA,SAAAA,CAAA,IAAAH,C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gBAAgB,EAAE;EAAE,CAAC;EAC/BtB,QAAQ,EAAE;IAAES,IAAI,EAAE,CAAC;IAAEC,QAAQ,EAAE,EAAE;IAAEa,UAAU,EAAE;EAAE,CAAC;EAClDlB,KAAK,EAAE;IAAEK,QAAQ,EAAE,EAAE;IAAEC,UAAU,EAAE,MAAM;IAAEY,UAAU,EAAE;EAAG,CAAC;EAC3D/B,WAAW,EAAE;IAAEkB,QAAQ,EAAE,EAAE;IAAE1B,KAAK,EAAE,MAAM;IAAE6B,SAAS,EAAE,QAAQ;IAAE1B,SAAS,EAAE;EAAG,CAAC;EAChF5B,KAAK,EAAE;IAAEmD,QAAQ,EAAE,EAAE;IAAEG,SAAS,EAAE,QAAQ;IAAE1B,SAAS,EAAE;EAAG;AAC9D,CAAC,CAAC;AAAC,IAAAqC,QAAA,GAAAC,OAAA,CAAA9F,OAAA,GAEYiB,sBAAsB","ignoreList":[]}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
const KarmaRewardsScreen = ({
|
|
12
|
+
goBack,
|
|
13
|
+
theme
|
|
14
|
+
}) => {
|
|
15
|
+
const isDarkTheme = theme === 'dark';
|
|
16
|
+
const backgroundColor = isDarkTheme ? '#121212' : '#FFFFFF';
|
|
17
|
+
const textColor = isDarkTheme ? '#FFFFFF' : '#000000';
|
|
18
|
+
const primaryColor = '#d169e5';
|
|
19
|
+
|
|
20
|
+
// Placeholder: In a real app, fetch rewards from API
|
|
21
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
22
|
+
style: [styles.container, {
|
|
23
|
+
backgroundColor
|
|
24
|
+
}],
|
|
25
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
26
|
+
style: [styles.title, {
|
|
27
|
+
color: textColor
|
|
28
|
+
}],
|
|
29
|
+
children: "Karma Rewards"
|
|
30
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.ScrollView, {
|
|
31
|
+
contentContainerStyle: styles.contentContainer,
|
|
32
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
33
|
+
style: [styles.paragraph, {
|
|
34
|
+
color: textColor
|
|
35
|
+
}],
|
|
36
|
+
children: "Unlock special features and recognition by earning karma!"
|
|
37
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
38
|
+
style: styles.rewardBox,
|
|
39
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
40
|
+
style: [styles.rewardTitle, {
|
|
41
|
+
color: primaryColor
|
|
42
|
+
}],
|
|
43
|
+
children: "\uD83C\uDF89 Early Access"
|
|
44
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
45
|
+
style: [styles.rewardDesc, {
|
|
46
|
+
color: textColor
|
|
47
|
+
}],
|
|
48
|
+
children: "Get early access to new features with 100+ karma."
|
|
49
|
+
})]
|
|
50
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
51
|
+
style: styles.rewardBox,
|
|
52
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
53
|
+
style: [styles.rewardTitle, {
|
|
54
|
+
color: primaryColor
|
|
55
|
+
}],
|
|
56
|
+
children: "\uD83C\uDFC5 Community Badge"
|
|
57
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
58
|
+
style: [styles.rewardDesc, {
|
|
59
|
+
color: textColor
|
|
60
|
+
}],
|
|
61
|
+
children: "Earn a special badge for 500+ karma."
|
|
62
|
+
})]
|
|
63
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
64
|
+
style: styles.rewardBox,
|
|
65
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
66
|
+
style: [styles.rewardTitle, {
|
|
67
|
+
color: primaryColor
|
|
68
|
+
}],
|
|
69
|
+
children: "\uD83C\uDF1F Featured Member"
|
|
70
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
71
|
+
style: [styles.rewardDesc, {
|
|
72
|
+
color: textColor
|
|
73
|
+
}],
|
|
74
|
+
children: "Be featured in the community for 1000+ karma."
|
|
75
|
+
})]
|
|
76
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
77
|
+
style: [styles.paragraph, {
|
|
78
|
+
color: textColor,
|
|
79
|
+
marginTop: 24
|
|
80
|
+
}],
|
|
81
|
+
children: "More rewards coming soon!"
|
|
82
|
+
})]
|
|
83
|
+
})]
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
const styles = _reactNative.StyleSheet.create({
|
|
87
|
+
container: {
|
|
88
|
+
flex: 1
|
|
89
|
+
},
|
|
90
|
+
title: {
|
|
91
|
+
fontSize: 24,
|
|
92
|
+
fontWeight: 'bold',
|
|
93
|
+
margin: 24,
|
|
94
|
+
textAlign: 'center'
|
|
95
|
+
},
|
|
96
|
+
contentContainer: {
|
|
97
|
+
padding: 24
|
|
98
|
+
},
|
|
99
|
+
rewardBox: {
|
|
100
|
+
backgroundColor: '#f7eaff',
|
|
101
|
+
borderRadius: 16,
|
|
102
|
+
padding: 18,
|
|
103
|
+
marginBottom: 18,
|
|
104
|
+
shadowColor: '#000',
|
|
105
|
+
shadowOpacity: 0.04,
|
|
106
|
+
shadowOffset: {
|
|
107
|
+
width: 0,
|
|
108
|
+
height: 1
|
|
109
|
+
},
|
|
110
|
+
shadowRadius: 4,
|
|
111
|
+
elevation: 1
|
|
112
|
+
},
|
|
113
|
+
rewardTitle: {
|
|
114
|
+
fontSize: 18,
|
|
115
|
+
fontWeight: 'bold',
|
|
116
|
+
marginBottom: 6
|
|
117
|
+
},
|
|
118
|
+
rewardDesc: {
|
|
119
|
+
fontSize: 15
|
|
120
|
+
},
|
|
121
|
+
paragraph: {
|
|
122
|
+
fontSize: 16,
|
|
123
|
+
marginBottom: 12
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
var _default = exports.default = KarmaRewardsScreen;
|
|
127
|
+
//# sourceMappingURL=KarmaRewardsScreen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_jsxRuntime","e","__esModule","default","KarmaRewardsScreen","goBack","theme","isDarkTheme","backgroundColor","textColor","primaryColor","jsxs","View","style","styles","container","children","jsx","Text","title","color","ScrollView","contentContainerStyle","contentContainer","paragraph","rewardBox","rewardTitle","rewardDesc","marginTop","StyleSheet","create","flex","fontSize","fontWeight","margin","textAlign","padding","borderRadius","marginBottom","shadowColor","shadowOpacity","shadowOffset","width","height","shadowRadius","elevation","_default","exports"],"sourceRoot":"../../../../../src","sources":["ui/screens/karma/KarmaRewardsScreen.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAAkE,IAAAE,WAAA,GAAAF,OAAA;AAAA,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAGlE,MAAMG,kBAA6C,GAAGA,CAAC;EAAEC,MAAM;EAAEC;AAAM,CAAC,KAAK;EACzE,MAAMC,WAAW,GAAGD,KAAK,KAAK,MAAM;EACpC,MAAME,eAAe,GAAGD,WAA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AAAZ,QAAA,EAAC;MAAyB,CAAM,CAAC;IAAA,CAC9F,CAAC;EAAA,CACX,CAAC;AAEf,CAAC;AAED,MAAMF,MAAM,GAAGe,uBAAU,CAACC,MAAM,CAAC;EAC7Bf,SAAS,EAAE;IAAEgB,IAAI,EAAE;EAAE,CAAC;EACtBZ,KAAK,EAAE;IAAEa,QAAQ,EAAE,EAAE;IAAEC,UAAU,EAAE,MAAM;IAAEC,MAAM,EAAE,EAAE;IAAEC,SAAS,EAAE;EAAS,CAAC;EAC5EZ,gBAAgB,EAAE;IAAEa,OAAO,EAAE;EAAG,CAAC;EACjCX,SAAS,EAAE;IACPjB,eAAe,EAAE,SAAS;IAC1B6B,YAAY,EAAE,EAAE;IAChBD,OAAO,EAAE,EAAE;IACXE,YAAY,EAAE,EAAE;IAChBC,WAAW,EAAE,MAAM;IACnBC,aAAa,EAAE,IAAI;IACnBC,YAAY,EAAE;MAAEC,KAAK,EAAE,CAAC;MAAEC,MAAM,EAAE;IAAE,CAAC;IACrCC,YAAY,EAAE,CAAC;IACfC,SAAS,EAAE;EACf,CAAC;EACDnB,WAAW,EAAE;IAAEM,QAAQ,EAAE,EAAE;IAAEC,UAAU,EAAE,MAAM;IAAEK,YAAY,EAAE;EAAE,CAAC;EAClEX,UAAU,EAAE;IAAEK,QAAQ,EAAE;EAAG,CAAC;EAC5BR,SAAS,EAAE;IAAEQ,QAAQ,EAAE,EAAE;IAAEM,YAAY,EAAE;EAAG;AAChD,CAAC,CAAC;AAAC,IAAAQ,QAAA,GAAAC,OAAA,CAAA5C,OAAA,GAEYC,kBAAkB","ignoreList":[]}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _OxyContext = require("../../context/OxyContext");
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
12
|
+
const KarmaRulesScreen = ({
|
|
13
|
+
goBack,
|
|
14
|
+
theme
|
|
15
|
+
}) => {
|
|
16
|
+
const {
|
|
17
|
+
oxyServices
|
|
18
|
+
} = (0, _OxyContext.useOxy)();
|
|
19
|
+
const [rules, setRules] = (0, _react.useState)([]);
|
|
20
|
+
const [isLoading, setIsLoading] = (0, _react.useState)(true);
|
|
21
|
+
const [error, setError] = (0, _react.useState)(null);
|
|
22
|
+
const isDarkTheme = theme === 'dark';
|
|
23
|
+
const backgroundColor = isDarkTheme ? '#121212' : '#FFFFFF';
|
|
24
|
+
const textColor = isDarkTheme ? '#FFFFFF' : '#000000';
|
|
25
|
+
const primaryColor = '#d169e5';
|
|
26
|
+
(0, _react.useEffect)(() => {
|
|
27
|
+
setIsLoading(true);
|
|
28
|
+
setError(null);
|
|
29
|
+
oxyServices.getKarmaRules().then(data => setRules(Array.isArray(data) ? data : [])).catch(err => setError(err.message || 'Failed to load rules')).finally(() => setIsLoading(false));
|
|
30
|
+
}, [oxyServices]);
|
|
31
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
32
|
+
style: [styles.container, {
|
|
33
|
+
backgroundColor
|
|
34
|
+
}],
|
|
35
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
36
|
+
style: [styles.title, {
|
|
37
|
+
color: textColor
|
|
38
|
+
}],
|
|
39
|
+
children: "Karma Rules"
|
|
40
|
+
}), isLoading ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
|
|
41
|
+
size: "large",
|
|
42
|
+
color: primaryColor,
|
|
43
|
+
style: {
|
|
44
|
+
marginTop: 40
|
|
45
|
+
}
|
|
46
|
+
}) : error ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
47
|
+
style: [styles.error, {
|
|
48
|
+
color: '#D32F2F'
|
|
49
|
+
}],
|
|
50
|
+
children: error
|
|
51
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ScrollView, {
|
|
52
|
+
contentContainerStyle: styles.listContainer,
|
|
53
|
+
children: rules.length === 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
54
|
+
style: [styles.placeholder, {
|
|
55
|
+
color: textColor
|
|
56
|
+
}],
|
|
57
|
+
children: "No rules found."
|
|
58
|
+
}) : rules.map((rule, idx) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
59
|
+
style: styles.ruleRow,
|
|
60
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
61
|
+
style: [styles.ruleDesc, {
|
|
62
|
+
color: textColor
|
|
63
|
+
}],
|
|
64
|
+
children: rule.description
|
|
65
|
+
})
|
|
66
|
+
}, rule.id || idx))
|
|
67
|
+
})]
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
const styles = _reactNative.StyleSheet.create({
|
|
71
|
+
container: {
|
|
72
|
+
flex: 1
|
|
73
|
+
},
|
|
74
|
+
title: {
|
|
75
|
+
fontSize: 24,
|
|
76
|
+
fontWeight: 'bold',
|
|
77
|
+
margin: 24,
|
|
78
|
+
textAlign: 'center'
|
|
79
|
+
},
|
|
80
|
+
listContainer: {
|
|
81
|
+
paddingBottom: 40
|
|
82
|
+
},
|
|
83
|
+
ruleRow: {
|
|
84
|
+
paddingVertical: 14,
|
|
85
|
+
paddingHorizontal: 24,
|
|
86
|
+
borderBottomWidth: 1,
|
|
87
|
+
borderColor: '#eee'
|
|
88
|
+
},
|
|
89
|
+
ruleDesc: {
|
|
90
|
+
fontSize: 16
|
|
91
|
+
},
|
|
92
|
+
placeholder: {
|
|
93
|
+
fontSize: 16,
|
|
94
|
+
color: '#888',
|
|
95
|
+
textAlign: 'center',
|
|
96
|
+
marginTop: 40
|
|
97
|
+
},
|
|
98
|
+
error: {
|
|
99
|
+
fontSize: 16,
|
|
100
|
+
textAlign: 'center',
|
|
101
|
+
marginTop: 40
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
var _default = exports.default = KarmaRulesScreen;
|
|
105
|
+
//# sourceMappingURL=KarmaRulesScreen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_OxyContext","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","KarmaRulesScreen","goBack","theme","oxyServices","useOxy","rules","setRules","useState","isLoading","setIsLoading","error","setError","isDarkTheme","backgroundColor","textColor","primaryColor","useEffect","getKarmaRules","then","data","Array","isArray","catch","err","message","finally","jsxs","View","style","styles","container","children","jsx","Text","title","color","ActivityIndicator","size","marginTop","ScrollView","contentContainerStyle","listContainer","length","placeholder","map","rule","idx","ruleRow","ruleDesc","description","id","StyleSheet","create","flex","fontSize","fontWeight","margin","textAlign","paddingBottom","paddingVertical","paddingHorizontal","borderBottomWidth","borderColor","_default","exports"],"sourceRoot":"../../../../../src","sources":["ui/screens/karma/KarmaRulesScreen.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAA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AAE,CAAC;EACtBnB,KAAK,EAAE;IAAEoB,QAAQ,EAAE,EAAE;IAAEC,UAAU,EAAE,MAAM;IAAEC,MAAM,EAAE,EAAE;IAAEC,SAAS,EAAE;EAAS,CAAC;EAC5EhB,aAAa,EAAE;IAAEiB,aAAa,EAAE;EAAG,CAAC;EACpCX,OAAO,EAAE;IACLY,eAAe,EAAE,EAAE;IACnBC,iBAAiB,EAAE,EAAE;IACrBC,iBAAiB,EAAE,CAAC;IACpBC,WAAW,EAAE;EACjB,CAAC;EACDd,QAAQ,EAAE;IAAEM,QAAQ,EAAE;EAAG,CAAC;EAC1BX,WAAW,EAAE;IAAEW,QAAQ,EAAE,EAAE;IAAEnB,KAAK,EAAE,MAAM;IAAEsB,SAAS,EAAE,QAAQ;IAAEnB,SAAS,EAAE;EAAG,CAAC;EAChF5B,KAAK,EAAE;IAAE4C,QAAQ,EAAE,EAAE;IAAEG,SAAS,EAAE,QAAQ;IAAEnB,SAAS,EAAE;EAAG;AAC9D,CAAC,CAAC;AAAC,IAAAyB,QAAA,GAAAC,OAAA,CAAAzE,OAAA,GAEYS,gBAAgB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_fonts","lightColors","text","background","inputBackground","placeholder","primary","border","error","success","warning","secondaryText","darkColors","createTheme","isDark","colors","fonts","title","fontFamily","Platform","OS","fontWeight","undefined","fontSize","body","lineHeight","button","fontFamilies","phuduSemiBold","color","label","marginBottom","getTheme","theme","exports","useThemeColors","createCommonStyles","themeObj","StyleSheet","create","container","backgroundColor","scrollContainer","
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_fonts","lightColors","text","background","inputBackground","placeholder","primary","border","error","success","warning","secondaryText","darkColors","createTheme","isDark","colors","fonts","title","fontFamily","Platform","OS","fontWeight","undefined","fontSize","body","lineHeight","button","fontFamilies","phuduSemiBold","color","label","marginBottom","getTheme","theme","exports","useThemeColors","createCommonStyles","themeObj","StyleSheet","create","container","backgroundColor","scrollContainer","padding","input","height","borderRadius","paddingHorizontal","borderWidth","borderColor","alignItems","justifyContent","marginTop","buttonText","errorContainer","errorText"],"sourceRoot":"../../../../src","sources":["ui/styles/theme.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAyBA,MAAME,WAAwB,GAAG;EAC/BC,IAAI,EAAE,SAAS;EACfC,UAAU,EAAE,SAAS;EACrBC,eAAe,EAAE,SAAS;EAC1BC,WAAW,EAAE,SAAS;EACtBC,OAAO,EAAE,SAAS;EAClBC,MAAM,EAAE,SAAS;EACjBC,KAAK,EAAE,SAAS;EAChBC,OAAO,EAAE,SAAS;EAClBC,OAAO,EAAE,SAAS;EAClBC,aAAa,EAAE;AACjB,CAAC;AAED,MAAMC,UAAuB,GAAG;EAC9BV,IAAI,EAAE,SAAS;EACfC,UAAU,EAAE,SAAS;EACrBC,eAAe,EAAE,SAAS;EAC1BC,WAAW,EAAE,SAAS;EACtBC,OAAO,EAAE,SAAS;EAClBC,MAAM,EAAE,SAAS;EACjBC,KAAK,EAAE,SAAS;EAChBC,OAAO,EAAE,SAAS;EAClBC,OAAO,EAAE,SAAS;EAClBC,aAAa,EAAE;AACjB,CAAC;AAED,MAAME,WAAW,GAAIC,MAAe,IAAY;EAC9C,MAAMC,MAAM,GAAGD,MAAM,GAAGF,UAAU,GAAGX,WAAW;EAEhD,OAAO;IACLc,MAAM;IACNC,KAAK,EAAE;MACLC,KAAK,EAAE;QACLC,UAAU,EAAEC,qBAAQ,CAACC,EAAE,KAAK,KAAK,GAC7B,OAAO,GACP,YAAY;QAChBC,UAAU,EAAEF,qBAAQ,CAACC,EAAE,KAAK,KAAK,GAAG,MAAM,GAAGE,SAAS;QACtDC,QAAQ,EAAE;MACZ,CAAC;MACDC,IAAI,EAAE;QACJD,QAAQ,EAAE,EAAE;QACZE,UAAU,EAAE;MACd,CAAC;MACDC,MAAM,EAAE;QACNR,UAAU,EAAES,mB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EAAE,QAAQ;MACxBC,SAAS,EAAE;IACb,CAAC;IACDC,UAAU,EAAE;MACVnC,UAAU,EAAES,mBAAY,CAACC,aAAa;MACtCL,QAAQ,EAAE,EAAE;MACZF,UAAU,EAAE,KAAK;MACjBQ,KAAK,EAAE;IACT,CAAC;IACDyB,cAAc,EAAE;MACdb,eAAe,EAAE,SAAS;MAC1BE,OAAO,EAAE,EAAE;MACXG,YAAY,EAAE,EAAE;MAChBf,YAAY,EAAE;IAChB,CAAC;IACDwB,SAAS,EAAE;MACThC,QAAQ,EAAE,EAAE;MACZF,UAAU,EAAE,KAAK;MACjBQ,KAAK,EAAEd,MAAM,CAACP;IAChB;EACF,CAAC,CAAC;AACJ,CAAC;AAAC0B,OAAA,CAAAE,kBAAA,GAAAA,kBAAA","ignoreList":[]}
|
|
@@ -10,7 +10,8 @@ import OxyRouter from '../navigation/OxyRouter';
|
|
|
10
10
|
import { FontLoader, setupFonts } from './FontLoader';
|
|
11
11
|
|
|
12
12
|
// Import bottom sheet components directly - no longer a peer dependency
|
|
13
|
-
import { BottomSheetModal, BottomSheetBackdrop, BottomSheetModalProvider
|
|
13
|
+
import { BottomSheetModal, BottomSheetBackdrop, BottomSheetModalProvider } from './bottomSheet';
|
|
14
|
+
import { BottomSheetScrollView } from '@gorhom/bottom-sheet';
|
|
14
15
|
|
|
15
16
|
// Initialize fonts automatically
|
|
16
17
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -95,6 +96,10 @@ const OxyBottomSheet = ({
|
|
|
95
96
|
// Use the internal ref (which is passed as a prop from OxyProvider)
|
|
96
97
|
const modalRef = useRef(null);
|
|
97
98
|
|
|
99
|
+
// Track content height for dynamic sizing
|
|
100
|
+
const [contentHeight, setContentHeight] = useState(0);
|
|
101
|
+
const screenHeight = Dimensions.get('window').height;
|
|
102
|
+
|
|
98
103
|
// Set up effect to sync the internal ref with our modal ref
|
|
99
104
|
useEffect(() => {
|
|
100
105
|
if (bottomSheetRef && modalRef.current) {
|
|
@@ -115,20 +120,26 @@ const OxyBottomSheet = ({
|
|
|
115
120
|
|
|
116
121
|
// Add a method to navigate between screens
|
|
117
122
|
// @ts-ignore - Adding custom method
|
|
118
|
-
bottomSheetRef.current._navigateToScreen = screenName => {
|
|
123
|
+
bottomSheetRef.current._navigateToScreen = (screenName, props) => {
|
|
119
124
|
// Access the navigation function exposed by OxyRouter
|
|
120
125
|
// Use internal mechanism to notify router about navigation
|
|
121
126
|
// We'll use a simple event-based approach
|
|
122
127
|
if (typeof document !== 'undefined') {
|
|
123
128
|
// For web - use a custom event
|
|
124
129
|
const event = new CustomEvent('oxy:navigate', {
|
|
125
|
-
detail:
|
|
130
|
+
detail: {
|
|
131
|
+
screen: screenName,
|
|
132
|
+
props
|
|
133
|
+
}
|
|
126
134
|
});
|
|
127
135
|
document.dispatchEvent(event);
|
|
128
136
|
} else {
|
|
129
137
|
// For React Native - use the navigation prop directly if available
|
|
130
|
-
|
|
131
|
-
|
|
138
|
+
// We'll implement a mechanism in OxyRouter to listen for this
|
|
139
|
+
global.oxyNavigateEvent = {
|
|
140
|
+
screen: screenName,
|
|
141
|
+
props
|
|
142
|
+
};
|
|
132
143
|
}
|
|
133
144
|
};
|
|
134
145
|
}
|
|
@@ -279,22 +290,37 @@ const OxyBottomSheet = ({
|
|
|
279
290
|
const highestPoint = points[points.length - 1];
|
|
280
291
|
setSnapPoints([highestPoint, highestPoint]);
|
|
281
292
|
} else {
|
|
282
|
-
|
|
293
|
+
// If we have content height, use it as a constraint
|
|
294
|
+
if (contentHeight > 0) {
|
|
295
|
+
// Calculate content height as percentage of screen (plus some padding)
|
|
296
|
+
const contentHeightPercent = Math.min(Math.ceil((contentHeight + 40) / screenHeight * 100), 90) + '%';
|
|
297
|
+
// Use content height for first snap point if it's taller than the default
|
|
298
|
+
const firstPoint = contentHeight / screenHeight > 0.6 ? contentHeightPercent : points[0];
|
|
299
|
+
setSnapPoints([firstPoint, points[1]]);
|
|
300
|
+
} else {
|
|
301
|
+
setSnapPoints(points);
|
|
302
|
+
}
|
|
283
303
|
}
|
|
284
|
-
}, [keyboardVisible]);
|
|
285
|
-
|
|
286
|
-
//
|
|
287
|
-
const
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
304
|
+
}, [keyboardVisible, contentHeight, screenHeight]);
|
|
305
|
+
|
|
306
|
+
// Handle content layout changes to measure height
|
|
307
|
+
const handleContentLayout = useCallback(event => {
|
|
308
|
+
const layoutHeight = event.nativeEvent.layout.height;
|
|
309
|
+
setContentHeight(layoutHeight);
|
|
310
|
+
|
|
311
|
+
// Update snap points based on new content height
|
|
312
|
+
if (keyboardVisible) {
|
|
313
|
+
// If keyboard is visible, use the highest snap point
|
|
314
|
+
const highestPoint = snapPoints[snapPoints.length - 1];
|
|
315
|
+
setSnapPoints([highestPoint, highestPoint]);
|
|
316
|
+
} else {
|
|
317
|
+
if (layoutHeight > 0) {
|
|
318
|
+
const contentHeightPercent = Math.min(Math.ceil((layoutHeight + 40) / screenHeight * 100), 90) + '%';
|
|
319
|
+
const firstPoint = layoutHeight / screenHeight > 0.6 ? contentHeightPercent : snapPoints[0];
|
|
320
|
+
setSnapPoints([firstPoint, snapPoints[1]]);
|
|
321
|
+
}
|
|
296
322
|
}
|
|
297
|
-
}, []);
|
|
323
|
+
}, [keyboardVisible, screenHeight, snapPoints]);
|
|
298
324
|
|
|
299
325
|
// Close the bottom sheet with animation
|
|
300
326
|
const handleClose = useCallback(() => {
|
|
@@ -341,7 +367,9 @@ const OxyBottomSheet = ({
|
|
|
341
367
|
index: 0,
|
|
342
368
|
snapPoints: snapPoints,
|
|
343
369
|
enablePanDownToClose: true,
|
|
344
|
-
backdropComponent: renderBackdrop
|
|
370
|
+
backdropComponent: renderBackdrop
|
|
371
|
+
// Remove enableDynamicSizing as we're implementing our own solution
|
|
372
|
+
,
|
|
345
373
|
handleComponent: () => /*#__PURE__*/_jsx(Animated.View, {
|
|
346
374
|
style: {
|
|
347
375
|
alignItems: 'center',
|
|
@@ -383,16 +411,13 @@ const OxyBottomSheet = ({
|
|
|
383
411
|
onAnimate: (fromIndex, toIndex) => {
|
|
384
412
|
console.log(`Animating from index ${fromIndex} to ${toIndex}`);
|
|
385
413
|
},
|
|
386
|
-
children: /*#__PURE__*/_jsx(
|
|
414
|
+
children: /*#__PURE__*/_jsx(BottomSheetScrollView, {
|
|
387
415
|
style: [styles.contentContainer,
|
|
388
416
|
// Override padding if provided in customStyles
|
|
389
417
|
customStyles.contentPadding !== undefined && {
|
|
390
418
|
padding: customStyles.contentPadding
|
|
391
|
-
},
|
|
392
|
-
// Add bottom padding when keyboard is visible to ensure content is not covered
|
|
393
|
-
keyboardVisible && {
|
|
394
|
-
paddingBottom: Math.max(keyboardHeight - insets.bottom, 0)
|
|
395
419
|
}],
|
|
420
|
+
onLayout: handleContentLayout,
|
|
396
421
|
children: /*#__PURE__*/_jsx(Animated.View, {
|
|
397
422
|
style: [styles.animatedContent,
|
|
398
423
|
// Apply animations - conditionally for Android
|
|
@@ -418,16 +443,11 @@ const OxyBottomSheet = ({
|
|
|
418
443
|
};
|
|
419
444
|
const styles = StyleSheet.create({
|
|
420
445
|
contentContainer: {
|
|
421
|
-
flex: 1,
|
|
422
|
-
padding: 16,
|
|
423
446
|
width: '100%',
|
|
424
|
-
height: '100%',
|
|
425
447
|
backgroundColor: 'transparent' // Make this transparent to let the bottom sheet background show through
|
|
426
448
|
},
|
|
427
449
|
animatedContent: {
|
|
428
|
-
|
|
429
|
-
width: '100%',
|
|
430
|
-
height: '100%'
|
|
450
|
+
width: '100%'
|
|
431
451
|
},
|
|
432
452
|
indicator: {
|
|
433
453
|
width: 40,
|