@oxyhq/services 5.1.12 → 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 +194 -103
- 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 +194 -104
- 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 +140 -81
- 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,164 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { View, Text, StyleSheet, ScrollView, Platform, TouchableOpacity, TextInput, LayoutAnimation, UIManager } from 'react-native';
|
|
3
|
+
import { BaseScreenProps } from '../../navigation/types';
|
|
4
|
+
import { Ionicons } from '@expo/vector-icons';
|
|
5
|
+
|
|
6
|
+
if (Platform.OS === 'android' && UIManager.setLayoutAnimationEnabledExperimental) {
|
|
7
|
+
UIManager.setLayoutAnimationEnabledExperimental(true);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const FAQS = [
|
|
11
|
+
{
|
|
12
|
+
q: 'What is karma?',
|
|
13
|
+
a: 'Karma is a recognition of your positive actions in the Oxy Ecosystem. It cannot be sent or received directly.'
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
q: 'How do I earn karma?',
|
|
17
|
+
a: 'By helping others, reporting bugs, contributing content, and participating in community events.'
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
q: 'Can I lose karma?',
|
|
21
|
+
a: 'Karma may be reduced for negative actions or breaking community rules.'
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
q: 'What can I do with karma?',
|
|
25
|
+
a: 'Unlock rewards, badges, and special features as you earn more karma.'
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
q: 'Can I transfer karma to others?',
|
|
29
|
+
a: 'No, karma cannot be sent or received. It is only earned by your actions.'
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
q: 'How do I get support?',
|
|
33
|
+
a: 'Contact Oxy support via the app or website for any karma-related questions.'
|
|
34
|
+
},
|
|
35
|
+
];
|
|
36
|
+
|
|
37
|
+
const KarmaFAQScreen: React.FC<BaseScreenProps> = ({ goBack, theme }) => {
|
|
38
|
+
const isDarkTheme = theme === 'dark';
|
|
39
|
+
const backgroundColor = isDarkTheme ? '#121212' : '#FFFFFF';
|
|
40
|
+
const textColor = isDarkTheme ? '#FFFFFF' : '#000000';
|
|
41
|
+
const cardColor = isDarkTheme ? '#23232b' : '#f7f7fa';
|
|
42
|
+
const primaryColor = '#d169e5';
|
|
43
|
+
const inputBg = isDarkTheme ? '#23232b' : '#f2f2f7';
|
|
44
|
+
const inputBorder = isDarkTheme ? '#444' : '#e0e0e0';
|
|
45
|
+
|
|
46
|
+
const [expanded, setExpanded] = useState<number | null>(0);
|
|
47
|
+
const [search, setSearch] = useState('');
|
|
48
|
+
|
|
49
|
+
const filteredFaqs = FAQS.filter(faq =>
|
|
50
|
+
faq.q.toLowerCase().includes(search.toLowerCase()) ||
|
|
51
|
+
faq.a.toLowerCase().includes(search.toLowerCase())
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
const handleToggle = (idx: number) => {
|
|
55
|
+
LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
|
|
56
|
+
setExpanded(expanded === idx ? null : idx);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<View style={[styles.container, { backgroundColor }]}>
|
|
61
|
+
<Text style={[styles.title, { color: textColor }]}>Karma FAQ</Text>
|
|
62
|
+
<View style={[styles.searchBar, { backgroundColor: inputBg, borderColor: inputBorder }]}>
|
|
63
|
+
<Ionicons name="search-outline" size={20} color={primaryColor} style={{ marginRight: 8 }} />
|
|
64
|
+
<TextInput
|
|
65
|
+
style={[styles.searchInput, { color: textColor }]}
|
|
66
|
+
placeholder="Search FAQ..."
|
|
67
|
+
placeholderTextColor={isDarkTheme ? '#aaa' : '#888'}
|
|
68
|
+
value={search}
|
|
69
|
+
onChangeText={setSearch}
|
|
70
|
+
returnKeyType="search"
|
|
71
|
+
/>
|
|
72
|
+
</View>
|
|
73
|
+
<ScrollView contentContainerStyle={styles.contentContainer} keyboardShouldPersistTaps="handled">
|
|
74
|
+
{filteredFaqs.length === 0 ? (
|
|
75
|
+
<Text style={[styles.noResults, { color: textColor }]}>No results found.</Text>
|
|
76
|
+
) : (
|
|
77
|
+
filteredFaqs.map((item, idx) => {
|
|
78
|
+
const isOpen = expanded === idx;
|
|
79
|
+
return (
|
|
80
|
+
<TouchableOpacity
|
|
81
|
+
key={idx}
|
|
82
|
+
style={[styles.card, { backgroundColor: cardColor, shadowColor: isDarkTheme ? '#000' : '#d169e5' }]}
|
|
83
|
+
activeOpacity={0.95}
|
|
84
|
+
onPress={() => handleToggle(idx)}
|
|
85
|
+
>
|
|
86
|
+
<View style={styles.questionRow}>
|
|
87
|
+
<Ionicons name={isOpen ? 'chevron-down' : 'chevron-forward'} size={22} color={primaryColor} style={{ marginRight: 8 }} />
|
|
88
|
+
<Text style={[styles.question, { color: primaryColor }]}>{item.q}</Text>
|
|
89
|
+
</View>
|
|
90
|
+
{isOpen && (
|
|
91
|
+
<Text style={[styles.answer, { color: textColor }]}>{item.a}</Text>
|
|
92
|
+
)}
|
|
93
|
+
</TouchableOpacity>
|
|
94
|
+
);
|
|
95
|
+
})
|
|
96
|
+
)}
|
|
97
|
+
<Text style={[styles.paragraph, { color: textColor, marginTop: 32, textAlign: 'center' }]}>Still have questions? Contact support!</Text>
|
|
98
|
+
</ScrollView>
|
|
99
|
+
</View>
|
|
100
|
+
);
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
const styles = StyleSheet.create({
|
|
104
|
+
container: { flex: 1 },
|
|
105
|
+
title: {
|
|
106
|
+
fontFamily: Platform.OS === 'web' ? 'Phudu' : 'Phudu-Bold',
|
|
107
|
+
fontWeight: Platform.OS === 'web' ? 'bold' : undefined,
|
|
108
|
+
fontSize: 38,
|
|
109
|
+
margin: 24,
|
|
110
|
+
marginBottom: 12,
|
|
111
|
+
textAlign: 'center',
|
|
112
|
+
},
|
|
113
|
+
searchBar: {
|
|
114
|
+
flexDirection: 'row',
|
|
115
|
+
alignItems: 'center',
|
|
116
|
+
borderRadius: 16,
|
|
117
|
+
borderWidth: 1,
|
|
118
|
+
marginHorizontal: 24,
|
|
119
|
+
marginBottom: 12,
|
|
120
|
+
paddingHorizontal: 12,
|
|
121
|
+
height: 44,
|
|
122
|
+
},
|
|
123
|
+
searchInput: {
|
|
124
|
+
flex: 1,
|
|
125
|
+
fontSize: 16,
|
|
126
|
+
height: 44,
|
|
127
|
+
},
|
|
128
|
+
contentContainer: { padding: 24, paddingBottom: 40 },
|
|
129
|
+
card: {
|
|
130
|
+
borderRadius: 18,
|
|
131
|
+
padding: 20,
|
|
132
|
+
marginBottom: 18,
|
|
133
|
+
shadowOpacity: 0.08,
|
|
134
|
+
shadowOffset: { width: 0, height: 2 },
|
|
135
|
+
shadowRadius: 8,
|
|
136
|
+
elevation: 2,
|
|
137
|
+
},
|
|
138
|
+
questionRow: {
|
|
139
|
+
flexDirection: 'row',
|
|
140
|
+
alignItems: 'center',
|
|
141
|
+
marginBottom: 8,
|
|
142
|
+
},
|
|
143
|
+
question: {
|
|
144
|
+
fontSize: 17,
|
|
145
|
+
fontWeight: 'bold',
|
|
146
|
+
},
|
|
147
|
+
answer: {
|
|
148
|
+
fontSize: 16,
|
|
149
|
+
lineHeight: 22,
|
|
150
|
+
marginTop: 8,
|
|
151
|
+
},
|
|
152
|
+
paragraph: {
|
|
153
|
+
fontSize: 16,
|
|
154
|
+
marginBottom: 12,
|
|
155
|
+
},
|
|
156
|
+
noResults: {
|
|
157
|
+
fontSize: 16,
|
|
158
|
+
marginTop: 32,
|
|
159
|
+
textAlign: 'center',
|
|
160
|
+
opacity: 0.7,
|
|
161
|
+
},
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
export default KarmaFAQScreen;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import { View, Text, StyleSheet, ScrollView, ActivityIndicator, TouchableOpacity } from 'react-native';
|
|
3
|
+
import { BaseScreenProps } from '../../navigation/types';
|
|
4
|
+
import { useOxy } from '../../context/OxyContext';
|
|
5
|
+
import Avatar from '../../components/Avatar';
|
|
6
|
+
|
|
7
|
+
const KarmaLeaderboardScreen: React.FC<BaseScreenProps> = ({ goBack, theme, navigate }) => {
|
|
8
|
+
const { oxyServices } = useOxy();
|
|
9
|
+
const [leaderboard, setLeaderboard] = useState<any[]>([]);
|
|
10
|
+
const [isLoading, setIsLoading] = useState(true);
|
|
11
|
+
const [error, setError] = useState<string | null>(null);
|
|
12
|
+
|
|
13
|
+
const isDarkTheme = theme === 'dark';
|
|
14
|
+
const backgroundColor = isDarkTheme ? '#121212' : '#FFFFFF';
|
|
15
|
+
const textColor = isDarkTheme ? '#FFFFFF' : '#000000';
|
|
16
|
+
const primaryColor = '#d169e5';
|
|
17
|
+
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
setIsLoading(true);
|
|
20
|
+
setError(null);
|
|
21
|
+
oxyServices.getKarmaLeaderboard()
|
|
22
|
+
.then((data) => setLeaderboard(Array.isArray(data) ? data : []))
|
|
23
|
+
.catch((err) => setError(err.message || 'Failed to load leaderboard'))
|
|
24
|
+
.finally(() => setIsLoading(false));
|
|
25
|
+
}, [oxyServices]);
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<View style={[styles.container, { backgroundColor }]}>
|
|
29
|
+
<Text style={[styles.title, { color: textColor }]}>Karma Leaderboard</Text>
|
|
30
|
+
{isLoading ? (
|
|
31
|
+
<ActivityIndicator size="large" color={primaryColor} style={{ marginTop: 40 }} />
|
|
32
|
+
) : error ? (
|
|
33
|
+
<Text style={[styles.error, { color: '#D32F2F' }]}>{error}</Text>
|
|
34
|
+
) : (
|
|
35
|
+
<ScrollView contentContainerStyle={styles.listContainer}>
|
|
36
|
+
{leaderboard.length === 0 ? (
|
|
37
|
+
<Text style={[styles.placeholder, { color: textColor }]}>No leaderboard data.</Text>
|
|
38
|
+
) : (
|
|
39
|
+
leaderboard.map((entry, idx) => (
|
|
40
|
+
<TouchableOpacity
|
|
41
|
+
key={entry.userId}
|
|
42
|
+
style={[styles.row, idx < 3 && { backgroundColor: '#f7eaff' }]}
|
|
43
|
+
onPress={() => navigate && navigate('KarmaProfile', { userId: entry.userId, username: entry.username })}
|
|
44
|
+
activeOpacity={0.7}
|
|
45
|
+
>
|
|
46
|
+
<Text style={[styles.rank, { color: primaryColor }]}>{idx + 1}</Text>
|
|
47
|
+
<Avatar name={entry.username || 'User'} size={40} theme={theme} style={styles.avatar} />
|
|
48
|
+
<Text style={[styles.username, { color: textColor }]}>{entry.username || entry.userId}</Text>
|
|
49
|
+
<Text style={[styles.karma, { color: primaryColor }]}>{entry.total}</Text>
|
|
50
|
+
</TouchableOpacity>
|
|
51
|
+
))
|
|
52
|
+
)}
|
|
53
|
+
</ScrollView>
|
|
54
|
+
)}
|
|
55
|
+
</View>
|
|
56
|
+
);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
const styles = StyleSheet.create({
|
|
60
|
+
container: { flex: 1 },
|
|
61
|
+
title: { fontSize: 24, fontWeight: 'bold', margin: 24, textAlign: 'center' },
|
|
62
|
+
listContainer: { paddingBottom: 40 },
|
|
63
|
+
row: {
|
|
64
|
+
flexDirection: 'row',
|
|
65
|
+
alignItems: 'center',
|
|
66
|
+
paddingVertical: 12,
|
|
67
|
+
paddingHorizontal: 20,
|
|
68
|
+
borderBottomWidth: 1,
|
|
69
|
+
borderColor: '#eee',
|
|
70
|
+
},
|
|
71
|
+
rank: { fontSize: 20, width: 32, textAlign: 'center', fontWeight: 'bold' },
|
|
72
|
+
avatar: { marginHorizontal: 8 },
|
|
73
|
+
username: { flex: 1, fontSize: 16, marginLeft: 8 },
|
|
74
|
+
karma: { fontSize: 18, fontWeight: 'bold', marginLeft: 12 },
|
|
75
|
+
placeholder: { fontSize: 16, color: '#888', textAlign: 'center', marginTop: 40 },
|
|
76
|
+
error: { fontSize: 16, textAlign: 'center', marginTop: 40 },
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
export default KarmaLeaderboardScreen;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View, Text, StyleSheet, ScrollView } from 'react-native';
|
|
3
|
+
import { BaseScreenProps } from '../../navigation/types';
|
|
4
|
+
|
|
5
|
+
const KarmaRewardsScreen: React.FC<BaseScreenProps> = ({ goBack, theme }) => {
|
|
6
|
+
const isDarkTheme = theme === 'dark';
|
|
7
|
+
const backgroundColor = isDarkTheme ? '#121212' : '#FFFFFF';
|
|
8
|
+
const textColor = isDarkTheme ? '#FFFFFF' : '#000000';
|
|
9
|
+
const primaryColor = '#d169e5';
|
|
10
|
+
|
|
11
|
+
// Placeholder: In a real app, fetch rewards from API
|
|
12
|
+
return (
|
|
13
|
+
<View style={[styles.container, { backgroundColor }]}>
|
|
14
|
+
<Text style={[styles.title, { color: textColor }]}>Karma Rewards</Text>
|
|
15
|
+
<ScrollView contentContainerStyle={styles.contentContainer}>
|
|
16
|
+
<Text style={[styles.paragraph, { color: textColor }]}>Unlock special features and recognition by earning karma!</Text>
|
|
17
|
+
<View style={styles.rewardBox}>
|
|
18
|
+
<Text style={[styles.rewardTitle, { color: primaryColor }]}>🎉 Early Access</Text>
|
|
19
|
+
<Text style={[styles.rewardDesc, { color: textColor }]}>Get early access to new features with 100+ karma.</Text>
|
|
20
|
+
</View>
|
|
21
|
+
<View style={styles.rewardBox}>
|
|
22
|
+
<Text style={[styles.rewardTitle, { color: primaryColor }]}>🏅 Community Badge</Text>
|
|
23
|
+
<Text style={[styles.rewardDesc, { color: textColor }]}>Earn a special badge for 500+ karma.</Text>
|
|
24
|
+
</View>
|
|
25
|
+
<View style={styles.rewardBox}>
|
|
26
|
+
<Text style={[styles.rewardTitle, { color: primaryColor }]}>🌟 Featured Member</Text>
|
|
27
|
+
<Text style={[styles.rewardDesc, { color: textColor }]}>Be featured in the community for 1000+ karma.</Text>
|
|
28
|
+
</View>
|
|
29
|
+
<Text style={[styles.paragraph, { color: textColor, marginTop: 24 }]}>More rewards coming soon!</Text>
|
|
30
|
+
</ScrollView>
|
|
31
|
+
</View>
|
|
32
|
+
);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const styles = StyleSheet.create({
|
|
36
|
+
container: { flex: 1 },
|
|
37
|
+
title: { fontSize: 24, fontWeight: 'bold', margin: 24, textAlign: 'center' },
|
|
38
|
+
contentContainer: { padding: 24 },
|
|
39
|
+
rewardBox: {
|
|
40
|
+
backgroundColor: '#f7eaff',
|
|
41
|
+
borderRadius: 16,
|
|
42
|
+
padding: 18,
|
|
43
|
+
marginBottom: 18,
|
|
44
|
+
shadowColor: '#000',
|
|
45
|
+
shadowOpacity: 0.04,
|
|
46
|
+
shadowOffset: { width: 0, height: 1 },
|
|
47
|
+
shadowRadius: 4,
|
|
48
|
+
elevation: 1,
|
|
49
|
+
},
|
|
50
|
+
rewardTitle: { fontSize: 18, fontWeight: 'bold', marginBottom: 6 },
|
|
51
|
+
rewardDesc: { fontSize: 15 },
|
|
52
|
+
paragraph: { fontSize: 16, marginBottom: 12 },
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
export default KarmaRewardsScreen;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import { View, Text, StyleSheet, ScrollView, ActivityIndicator } from 'react-native';
|
|
3
|
+
import { BaseScreenProps } from '../../navigation/types';
|
|
4
|
+
import { useOxy } from '../../context/OxyContext';
|
|
5
|
+
|
|
6
|
+
const KarmaRulesScreen: React.FC<BaseScreenProps> = ({ goBack, theme }) => {
|
|
7
|
+
const { oxyServices } = useOxy();
|
|
8
|
+
const [rules, setRules] = useState<any[]>([]);
|
|
9
|
+
const [isLoading, setIsLoading] = useState(true);
|
|
10
|
+
const [error, setError] = useState<string | null>(null);
|
|
11
|
+
|
|
12
|
+
const isDarkTheme = theme === 'dark';
|
|
13
|
+
const backgroundColor = isDarkTheme ? '#121212' : '#FFFFFF';
|
|
14
|
+
const textColor = isDarkTheme ? '#FFFFFF' : '#000000';
|
|
15
|
+
const primaryColor = '#d169e5';
|
|
16
|
+
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
setIsLoading(true);
|
|
19
|
+
setError(null);
|
|
20
|
+
oxyServices.getKarmaRules()
|
|
21
|
+
.then((data) => setRules(Array.isArray(data) ? data : []))
|
|
22
|
+
.catch((err) => setError(err.message || 'Failed to load rules'))
|
|
23
|
+
.finally(() => setIsLoading(false));
|
|
24
|
+
}, [oxyServices]);
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<View style={[styles.container, { backgroundColor }]}>
|
|
28
|
+
<Text style={[styles.title, { color: textColor }]}>Karma Rules</Text>
|
|
29
|
+
{isLoading ? (
|
|
30
|
+
<ActivityIndicator size="large" color={primaryColor} style={{ marginTop: 40 }} />
|
|
31
|
+
) : error ? (
|
|
32
|
+
<Text style={[styles.error, { color: '#D32F2F' }]}>{error}</Text>
|
|
33
|
+
) : (
|
|
34
|
+
<ScrollView contentContainerStyle={styles.listContainer}>
|
|
35
|
+
{rules.length === 0 ? (
|
|
36
|
+
<Text style={[styles.placeholder, { color: textColor }]}>No rules found.</Text>
|
|
37
|
+
) : (
|
|
38
|
+
rules.map((rule, idx) => (
|
|
39
|
+
<View key={rule.id || idx} style={styles.ruleRow}>
|
|
40
|
+
<Text style={[styles.ruleDesc, { color: textColor }]}>{rule.description}</Text>
|
|
41
|
+
</View>
|
|
42
|
+
))
|
|
43
|
+
)}
|
|
44
|
+
</ScrollView>
|
|
45
|
+
)}
|
|
46
|
+
</View>
|
|
47
|
+
);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const styles = StyleSheet.create({
|
|
51
|
+
container: { flex: 1 },
|
|
52
|
+
title: { fontSize: 24, fontWeight: 'bold', margin: 24, textAlign: 'center' },
|
|
53
|
+
listContainer: { paddingBottom: 40 },
|
|
54
|
+
ruleRow: {
|
|
55
|
+
paddingVertical: 14,
|
|
56
|
+
paddingHorizontal: 24,
|
|
57
|
+
borderBottomWidth: 1,
|
|
58
|
+
borderColor: '#eee',
|
|
59
|
+
},
|
|
60
|
+
ruleDesc: { fontSize: 16 },
|
|
61
|
+
placeholder: { fontSize: 16, color: '#888', textAlign: 'center', marginTop: 40 },
|
|
62
|
+
error: { fontSize: 16, textAlign: 'center', marginTop: 40 },
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
export default KarmaRulesScreen;
|
package/src/ui/styles/theme.ts
CHANGED
|
@@ -1,50 +0,0 @@
|
|
|
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 AboutKarmaScreen = ({
|
|
12
|
-
onClose,
|
|
13
|
-
theme
|
|
14
|
-
}) => {
|
|
15
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
16
|
-
style: [styles.container],
|
|
17
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
18
|
-
style: [styles.title],
|
|
19
|
-
children: "About Karma"
|
|
20
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
21
|
-
style: [styles.message],
|
|
22
|
-
children: "Karma is a system that rewards users for their contributions to the community. The more you contribute, the more karma points you earn!"
|
|
23
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
24
|
-
style: [styles.message],
|
|
25
|
-
children: "Your karma points can be used to unlock special features and benefits within the app."
|
|
26
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
27
|
-
style: [styles.message],
|
|
28
|
-
children: "Thank you for being a part of our community!"
|
|
29
|
-
})]
|
|
30
|
-
});
|
|
31
|
-
};
|
|
32
|
-
const styles = _reactNative.StyleSheet.create({
|
|
33
|
-
container: {
|
|
34
|
-
flex: 1
|
|
35
|
-
},
|
|
36
|
-
title: {
|
|
37
|
-
fontSize: 18,
|
|
38
|
-
fontWeight: 'bold',
|
|
39
|
-
color: '#000',
|
|
40
|
-
marginBottom: 15
|
|
41
|
-
},
|
|
42
|
-
message: {
|
|
43
|
-
fontSize: 14,
|
|
44
|
-
color: '#5e5e5e',
|
|
45
|
-
lineHeight: 20,
|
|
46
|
-
marginBottom: 15
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
var _default = exports.default = AboutKarmaScreen;
|
|
50
|
-
//# sourceMappingURL=AboutKarmaScreen.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_jsxRuntime","e","__esModule","default","AboutKarmaScreen","onClose","theme","jsxs","View","style","styles","container","children","jsx","Text","title","message","StyleSheet","create","flex","fontSize","fontWeight","color","marginBottom","lineHeight","_default","exports"],"sourceRoot":"../../../../src","sources":["ui/screens/AboutKarmaScreen.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAWsB,IAAAE,WAAA,GAAAF,OAAA;AAAA,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAItB,MAAMG,gBAA2C,GAAGA,CAAC;EACjDC,OAAO;EACPC;AACJ,CAAC,KAAK;EAGF,oBACI,IAAAN,WAAA,CAAAO,IAAA,EAACR,YAAA,CAAAS,IAAI;IAACC,KAAK,EAAE,CAACC,MAAM,CAACC,SAAS,CAAE;IAAAC,QAAA,gBAC5B,IAAAZ,WAAA,CAAAa,GAAA,EAACd,YAAA,CAAAe,IAAI;MAACL,KAAK,EAAE,CAACC,MAAM,CAACK,KAAK,CAAE;MAAAH,QAAA,EAAC;IAAW,CAAM,CAAC,eAC/C,IAAAZ,WAAA,CAAAa,GAAA,EAACd,YAAA,CAAAe,IAAI;MAACL,KAAK,EAAE,CAACC,MAAM,CAACM,OAAO,CAAE;MAAAJ,QAAA,EAAC;IAG/B,CAAM,CAAC,eACP,IAAAZ,WAAA,CAAAa,GAAA,EAACd,YAAA,CAAAe,IAAI;MAACL,KAAK,EAAE,CAACC,MAAM,CAACM,OAAO,CAAE;MAAAJ,QAAA,EAAC;IAE/B,CAAM,CAAC,eACP,IAAAZ,WAAA,CAAAa,GAAA,EAACd,YAAA,CAAAe,IAAI;MAACL,KAAK,EAAE,CAACC,MAAM,CAACM,OAAO,CAAE;MAAAJ,QAAA,EAAC;IAE/B,CAAM,CAAC;EAAA,CACL,CAAC;AAEf,CAAC;AAED,MAAMF,MAAM,GAAGO,uBAAU,CAACC,MAAM,CAAC;EAC7BP,SAAS,EAAE;IACPQ,IAAI,EAAE;EACV,CAAC;EACDJ,KAAK,EAAE;IACHK,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,MAAM;IAClBC,KAAK,EAAE,MAAM;IACbC,YAAY,EAAE;EAClB,CAAC;EACDP,OAAO,EAAE;IACLI,QAAQ,EAAE,EAAE;IACZE,KAAK,EAAE,SAAS;IAChBE,UAAU,EAAE,EAAE;IACdD,YAAY,EAAE;EAClB;AACJ,CAAC,CAAC;AAAC,IAAAE,QAAA,GAAAC,OAAA,CAAAvB,OAAA,GAEYC,gBAAgB","ignoreList":[]}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { View, Text, StyleSheet } from 'react-native';
|
|
5
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
-
const AboutKarmaScreen = ({
|
|
7
|
-
onClose,
|
|
8
|
-
theme
|
|
9
|
-
}) => {
|
|
10
|
-
return /*#__PURE__*/_jsxs(View, {
|
|
11
|
-
style: [styles.container],
|
|
12
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
13
|
-
style: [styles.title],
|
|
14
|
-
children: "About Karma"
|
|
15
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
16
|
-
style: [styles.message],
|
|
17
|
-
children: "Karma is a system that rewards users for their contributions to the community. The more you contribute, the more karma points you earn!"
|
|
18
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
19
|
-
style: [styles.message],
|
|
20
|
-
children: "Your karma points can be used to unlock special features and benefits within the app."
|
|
21
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
22
|
-
style: [styles.message],
|
|
23
|
-
children: "Thank you for being a part of our community!"
|
|
24
|
-
})]
|
|
25
|
-
});
|
|
26
|
-
};
|
|
27
|
-
const styles = StyleSheet.create({
|
|
28
|
-
container: {
|
|
29
|
-
flex: 1
|
|
30
|
-
},
|
|
31
|
-
title: {
|
|
32
|
-
fontSize: 18,
|
|
33
|
-
fontWeight: 'bold',
|
|
34
|
-
color: '#000',
|
|
35
|
-
marginBottom: 15
|
|
36
|
-
},
|
|
37
|
-
message: {
|
|
38
|
-
fontSize: 14,
|
|
39
|
-
color: '#5e5e5e',
|
|
40
|
-
lineHeight: 20,
|
|
41
|
-
marginBottom: 15
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
export default AboutKarmaScreen;
|
|
45
|
-
//# sourceMappingURL=AboutKarmaScreen.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","Text","StyleSheet","jsx","_jsx","jsxs","_jsxs","AboutKarmaScreen","onClose","theme","style","styles","container","children","title","message","create","flex","fontSize","fontWeight","color","marginBottom","lineHeight"],"sourceRoot":"../../../../src","sources":["ui/screens/AboutKarmaScreen.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAoB,OAAO;AACvC,SACIC,IAAI,EACJC,IAAI,EAEJC,UAAU,QAOP,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAItB,MAAMC,gBAA2C,GAAGA,CAAC;EACjDC,OAAO;EACPC;AACJ,CAAC,KAAK;EAGF,oBACIH,KAAA,CAACN,IAAI;IAACU,KAAK,EAAE,CAACC,MAAM,CAACC,SAAS,CAAE;IAAAC,QAAA,gBAC5BT,IAAA,CAACH,IAAI;MAACS,KAAK,EAAE,CAACC,MAAM,CAACG,KAAK,CAAE;MAAAD,QAAA,EAAC;IAAW,CAAM,CAAC,eAC/CT,IAAA,CAACH,IAAI;MAACS,KAAK,EAAE,CAACC,MAAM,CAACI,OAAO,CAAE;MAAAF,QAAA,EAAC;IAG/B,CAAM,CAAC,eACPT,IAAA,CAACH,IAAI;MAACS,KAAK,EAAE,CAACC,MAAM,CAACI,OAAO,CAAE;MAAAF,QAAA,EAAC;IAE/B,CAAM,CAAC,eACPT,IAAA,CAACH,IAAI;MAACS,KAAK,EAAE,CAACC,MAAM,CAACI,OAAO,CAAE;MAAAF,QAAA,EAAC;IAE/B,CAAM,CAAC;EAAA,CACL,CAAC;AAEf,CAAC;AAED,MAAMF,MAAM,GAAGT,UAAU,CAACc,MAAM,CAAC;EAC7BJ,SAAS,EAAE;IACPK,IAAI,EAAE;EACV,CAAC;EACDH,KAAK,EAAE;IACHI,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,MAAM;IAClBC,KAAK,EAAE,MAAM;IACbC,YAAY,EAAE;EAClB,CAAC;EACDN,OAAO,EAAE;IACLG,QAAQ,EAAE,EAAE;IACZE,KAAK,EAAE,SAAS;IAChBE,UAAU,EAAE,EAAE;IACdD,YAAY,EAAE;EAClB;AACJ,CAAC,CAAC;AAEF,eAAed,gBAAgB","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AboutKarmaScreen.d.ts","sourceRoot":"","sources":["../../../../src/ui/screens/AboutKarmaScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAaxC,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAGtD,QAAA,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAqB/C,CAAC;AAoBF,eAAe,gBAAgB,CAAC"}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
View,
|
|
4
|
-
Text,
|
|
5
|
-
TouchableOpacity,
|
|
6
|
-
StyleSheet,
|
|
7
|
-
ActivityIndicator,
|
|
8
|
-
ScrollView,
|
|
9
|
-
Alert,
|
|
10
|
-
Platform,
|
|
11
|
-
Image,
|
|
12
|
-
TextStyle,
|
|
13
|
-
} from 'react-native';
|
|
14
|
-
import { BaseScreenProps } from '../navigation/types';
|
|
15
|
-
import { fontFamilies } from '../styles/fonts';
|
|
16
|
-
|
|
17
|
-
const AboutKarmaScreen: React.FC<BaseScreenProps> = ({
|
|
18
|
-
onClose,
|
|
19
|
-
theme,
|
|
20
|
-
}) => {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
return (
|
|
24
|
-
<View style={[styles.container]}>
|
|
25
|
-
<Text style={[styles.title]}>About Karma</Text>
|
|
26
|
-
<Text style={[styles.message]}>
|
|
27
|
-
Karma is a system that rewards users for their contributions to the community.
|
|
28
|
-
The more you contribute, the more karma points you earn!
|
|
29
|
-
</Text>
|
|
30
|
-
<Text style={[styles.message]}>
|
|
31
|
-
Your karma points can be used to unlock special features and benefits within the app.
|
|
32
|
-
</Text>
|
|
33
|
-
<Text style={[styles.message]}>
|
|
34
|
-
Thank you for being a part of our community!
|
|
35
|
-
</Text>
|
|
36
|
-
</View>
|
|
37
|
-
);
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
const styles = StyleSheet.create({
|
|
41
|
-
container: {
|
|
42
|
-
flex: 1,
|
|
43
|
-
},
|
|
44
|
-
title: {
|
|
45
|
-
fontSize: 18,
|
|
46
|
-
fontWeight: 'bold',
|
|
47
|
-
color: '#000',
|
|
48
|
-
marginBottom: 15,
|
|
49
|
-
},
|
|
50
|
-
message: {
|
|
51
|
-
fontSize: 14,
|
|
52
|
-
color: '#5e5e5e',
|
|
53
|
-
lineHeight: 20,
|
|
54
|
-
marginBottom: 15,
|
|
55
|
-
},
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
export default AboutKarmaScreen;
|