Skip to content

Commit e39f980

Browse files
committed
Use UI Kitten for components, consolidate pin flow into one screen
1 parent ab90419 commit e39f980

File tree

15 files changed

+1294
-1180
lines changed

15 files changed

+1294
-1180
lines changed

package-lock.json

Lines changed: 789 additions & 800 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/mobile-app/app/(tabs)/balances.tsx

Lines changed: 147 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export default function Balances() {
2323
onScroll={scrollHandler}
2424
contentContainerStyle={{ flexGrow: 1 }}
2525
>
26-
<View style={{ flexGrow: 1 }}>
26+
<View style={styles.container}>
2727
<AccountHeader offsetY={scrollYOffset} />
2828

2929
<View style={styles.contentContainer}>
@@ -40,36 +40,40 @@ function TabsRoot({ defaultTab }: { defaultTab: string }) {
4040

4141
return (
4242
<View>
43-
<View style={styles.tabList}>
43+
<View style={styles.tabContainer}>
4444
<TouchableOpacity
45-
style={[styles.tab, activeTab === "assets" && styles.activeTab]}
45+
style={[
46+
styles.tabButton,
47+
activeTab === "assets" && styles.activeTabButton,
48+
]}
4649
onPress={() => setActiveTab("assets")}
4750
>
48-
<Text style={styles.tabText}>Assets</Text>
51+
<Text style={styles.tabButtonText}>Assets</Text>
4952
</TouchableOpacity>
5053
<TouchableOpacity
51-
style={[styles.tab, activeTab === "transactions" && styles.activeTab]}
54+
style={[
55+
styles.tabButton,
56+
activeTab === "transactions" && styles.activeTabButton,
57+
]}
5258
onPress={() => setActiveTab("transactions")}
5359
>
54-
<Text style={styles.tabText}>Transactions</Text>
60+
<Text style={styles.tabButtonText}>Transactions</Text>
5561
</TouchableOpacity>
5662
</View>
5763

58-
{activeTab === "assets" && (
59-
<View style={styles.tabContent}>
60-
<AssetRow />
61-
<AssetRow />
62-
<AssetRow />
63-
<AssetRow />
64-
<AssetRow />
65-
<AssetRow />
66-
</View>
67-
)}
68-
{activeTab === "transactions" && (
69-
<View style={styles.tabContent}>
70-
<BottomSheetDemo />
71-
</View>
72-
)}
64+
<View style={styles.tabContent}>
65+
{activeTab === "assets" && (
66+
<>
67+
<AssetRow />
68+
<AssetRow />
69+
<AssetRow />
70+
<AssetRow />
71+
<AssetRow />
72+
<AssetRow />
73+
</>
74+
)}
75+
{activeTab === "transactions" && <BottomSheetDemo />}
76+
</View>
7377
</View>
7478
);
7579
}
@@ -78,26 +82,23 @@ function AccountHeader({ offsetY }: { offsetY: SharedValue<number> }) {
7882
return (
7983
<Animated.View style={{ transform: [{ translateY: offsetY }] }}>
8084
<View style={styles.headerTop}>
81-
<Text></Text>
85+
<Text style={styles.menuIcon}></Text>
8286
<Text style={styles.headerTitle}>Account 1</Text>
83-
<Text>⚙️</Text>
87+
<Text style={styles.settingsIcon}>⚙️</Text>
8488
</View>
85-
<View style={styles.headerContent}>
86-
<Text style={styles.balanceText}>100.55</Text>
87-
<Text style={styles.currencyText}>IRON</Text>
89+
<View style={styles.headerBalance}>
90+
<Text style={styles.balanceAmount}>100.55</Text>
91+
<Text style={styles.balanceCurrency}>IRON</Text>
8892

8993
<View style={styles.actionButtons}>
90-
<TouchableOpacity style={styles.iconButton}>
91-
<Text></Text>
92-
<Text>Receive</Text>
94+
<TouchableOpacity style={styles.actionButton}>
95+
<Text style={styles.actionButtonText}>↓ Receive</Text>
9396
</TouchableOpacity>
94-
<TouchableOpacity style={styles.iconButton}>
95-
<Text></Text>
96-
<Text>Send</Text>
97+
<TouchableOpacity style={styles.actionButton}>
98+
<Text style={styles.actionButtonText}>↑ Send</Text>
9799
</TouchableOpacity>
98-
<TouchableOpacity style={styles.iconButton}>
99-
<Text></Text>
100-
<Text>Bridge</Text>
100+
<TouchableOpacity style={styles.actionButton}>
101+
<Text style={styles.actionButtonText}>⇄ Bridge</Text>
101102
</TouchableOpacity>
102103
</View>
103104
</View>
@@ -111,34 +112,34 @@ function AssetBadge() {
111112

112113
function AssetRow() {
113114
return (
114-
<View style={styles.card}>
115-
<View style={styles.assetRow}>
115+
<TouchableOpacity style={styles.assetCard}>
116+
<View style={styles.assetCardContent}>
116117
<AssetBadge />
117-
<View>
118-
<Text>$IRON</Text>
119-
<Text style={styles.secondaryText}>100.55</Text>
118+
<View style={styles.assetInfo}>
119+
<Text style={styles.assetSymbol}>$IRON</Text>
120+
<Text style={styles.assetAmount}>100.55</Text>
120121
</View>
121-
<Text></Text>
122+
<Text style={styles.chevron}></Text>
122123
</View>
123-
</View>
124+
</TouchableOpacity>
124125
);
125126
}
126127

127128
function BottomSheetDemo() {
128-
const [isVisible, setIsVisible] = useState(false);
129+
const [open, setOpen] = useState(false);
129130

130131
return (
131-
<View style={styles.bottomSheetDemo}>
132+
<View>
132133
<TouchableOpacity
133-
style={styles.button}
134-
onPress={() => setIsVisible(true)}
134+
style={styles.sheetButton}
135+
onPress={() => setOpen(true)}
135136
>
136-
<Text style={styles.buttonText}>Show Bottom Sheet</Text>
137+
<Text>Show Bottom Sheet</Text>
137138
</TouchableOpacity>
138139

139-
{isVisible && (
140+
{open && (
140141
<View style={styles.bottomSheet}>
141-
<AccountSyncingDetails onClose={() => setIsVisible(false)} />
142+
<AccountSyncingDetails onClose={() => setOpen(false)} />
142143
</View>
143144
)}
144145
</View>
@@ -147,127 +148,149 @@ function BottomSheetDemo() {
147148

148149
function AccountSyncingDetails({ onClose }: { onClose: () => void }) {
149150
return (
150-
<View>
151-
<Text style={styles.secondaryText}>
151+
<View style={styles.syncDetails}>
152+
<Text style={styles.syncText}>
152153
The blockchain is currently syncing with your accounts. Your balance may
153154
be inaccurate and sending transactions will be disabled until the sync
154155
is done.
155156
</Text>
156-
<View style={styles.syncDetails}>
157-
<View>
158-
<Text style={styles.secondaryText}>Node Status:</Text>
159-
<Text style={styles.detailText}>Syncing Blocks</Text>
157+
158+
<View style={styles.syncStats}>
159+
<View style={styles.syncRow}>
160+
<Text style={styles.syncLabel}>Node Status:</Text>
161+
<Text style={styles.syncValue}>Syncing Blocks</Text>
160162
</View>
161-
<View>
162-
<Text style={styles.secondaryText}>Progress:</Text>
163-
<Text style={styles.detailText}>42.3%</Text>
163+
<View style={styles.syncRow}>
164+
<Text style={styles.syncLabel}>Progress:</Text>
165+
<Text style={styles.syncValue}>42.3%</Text>
164166
</View>
165-
<View>
166-
<Text style={styles.secondaryText}>Blocks Scanned:</Text>
167-
<Text style={styles.detailText}>33645/74346</Text>
167+
<View style={styles.syncRow}>
168+
<Text style={styles.syncLabel}>Blocks Scanned:</Text>
169+
<Text style={styles.syncValue}>33645/74346</Text>
168170
</View>
169171
</View>
170-
<TouchableOpacity style={styles.button} onPress={onClose}>
171-
<Text style={styles.buttonText}>Close</Text>
172+
173+
<TouchableOpacity style={styles.closeButton} onPress={onClose}>
174+
<Text>Close</Text>
172175
</TouchableOpacity>
173176
</View>
174177
);
175178
}
176179

177180
const styles = StyleSheet.create({
181+
container: {
182+
flex: 1,
183+
},
178184
contentContainer: {
185+
flex: 1,
179186
backgroundColor: "#fff",
180-
flexGrow: 1,
181-
borderTopLeftRadius: 20,
182-
borderTopRightRadius: 20,
187+
borderTopLeftRadius: 16,
188+
borderTopRightRadius: 16,
183189
},
184-
tabList: {
190+
tabContainer: {
185191
flexDirection: "row",
186192
borderBottomWidth: 1,
187-
borderBottomColor: "#eee",
193+
borderBottomColor: "#E1E1E1",
188194
},
189-
tab: {
195+
tabButton: {
190196
flex: 1,
191197
padding: 16,
192198
alignItems: "center",
193199
},
194-
activeTab: {
200+
activeTabButton: {
195201
borderBottomWidth: 2,
196202
borderBottomColor: "#000",
197203
},
198-
tabText: {
204+
tabButtonText: {
199205
fontSize: 16,
200206
},
201207
tabContent: {
202208
padding: 16,
203-
paddingBottom: 64,
209+
paddingBottom: 24,
204210
gap: 16,
205211
},
206212
headerTop: {
207213
flexDirection: "row",
208-
alignItems: "center",
209214
padding: 16,
210215
paddingVertical: 24,
216+
alignItems: "center",
217+
},
218+
menuIcon: {
219+
fontSize: 24,
211220
},
212221
headerTitle: {
213222
flex: 1,
214223
textAlign: "center",
215-
fontSize: 18,
224+
fontSize: 20,
225+
fontWeight: "600",
226+
},
227+
settingsIcon: {
228+
fontSize: 24,
216229
},
217-
headerContent: {
230+
headerBalance: {
218231
alignItems: "center",
232+
gap: 8,
219233
},
220-
balanceText: {
221-
fontSize: 32,
234+
balanceAmount: {
235+
fontSize: 24,
236+
fontWeight: "600",
222237
},
223-
currencyText: {
224-
fontSize: 18,
238+
balanceCurrency: {
239+
fontSize: 16,
225240
},
226241
actionButtons: {
227242
flexDirection: "row",
228243
padding: 24,
229244
gap: 16,
230245
},
231-
iconButton: {
246+
actionButton: {
232247
alignItems: "center",
233-
gap: 8,
234248
},
235-
assetBadge: {
236-
backgroundColor: "pink",
237-
height: 48,
238-
width: 48,
239-
borderRadius: 24,
249+
actionButtonText: {
250+
fontSize: 16,
240251
},
241-
card: {
242-
backgroundColor: "#fff",
243-
padding: 16,
244-
borderRadius: 8,
252+
assetBadge: {
253+
width: 40,
254+
height: 40,
255+
borderRadius: 20,
256+
backgroundColor: "#E1E1E1",
257+
elevation: 4,
245258
shadowColor: "#000",
246259
shadowOffset: { width: 0, height: 2 },
247-
shadowOpacity: 0.1,
260+
shadowOpacity: 0.25,
248261
shadowRadius: 4,
249-
elevation: 2,
250262
},
251-
assetRow: {
263+
assetCard: {
264+
borderWidth: 1,
265+
borderColor: "#E1E1E1",
266+
borderRadius: 8,
267+
padding: 16,
268+
backgroundColor: "#fff",
269+
},
270+
assetCardContent: {
252271
flexDirection: "row",
253272
alignItems: "center",
254273
gap: 12,
255274
},
256-
secondaryText: {
275+
assetInfo: {
276+
gap: 4,
277+
},
278+
assetSymbol: {
279+
fontSize: 16,
280+
fontWeight: "500",
281+
},
282+
assetAmount: {
283+
fontSize: 14,
257284
color: "#666",
258285
},
259-
bottomSheetDemo: {
260-
gap: 8,
286+
chevron: {
287+
marginLeft: "auto",
288+
fontSize: 20,
261289
},
262-
button: {
263-
backgroundColor: "#000",
290+
sheetButton: {
264291
padding: 16,
265-
borderRadius: 8,
266292
alignItems: "center",
267293
},
268-
buttonText: {
269-
color: "#fff",
270-
},
271294
bottomSheet: {
272295
position: "absolute",
273296
bottom: 0,
@@ -277,17 +300,34 @@ const styles = StyleSheet.create({
277300
padding: 16,
278301
borderTopLeftRadius: 16,
279302
borderTopRightRadius: 16,
303+
elevation: 8,
280304
shadowColor: "#000",
281305
shadowOffset: { width: 0, height: -2 },
282-
shadowOpacity: 0.1,
306+
shadowOpacity: 0.25,
283307
shadowRadius: 4,
284308
},
285309
syncDetails: {
286-
marginTop: 32,
287-
marginBottom: 80,
288310
gap: 16,
289311
},
290-
detailText: {
291-
fontSize: 18,
312+
syncText: {
313+
color: "#666",
314+
},
315+
syncStats: {
316+
gap: 16,
317+
marginVertical: 24,
318+
},
319+
syncRow: {
320+
flexDirection: "row",
321+
justifyContent: "space-between",
322+
},
323+
syncLabel: {
324+
color: "#666",
325+
},
326+
syncValue: {
327+
fontWeight: "500",
328+
},
329+
closeButton: {
330+
padding: 16,
331+
alignItems: "center",
292332
},
293333
});

0 commit comments

Comments
 (0)