Skip to content

Commit 623db81

Browse files
authored
Revert "Feat/recent activity component"
1 parent 5f112c3 commit 623db81

File tree

4 files changed

+16
-133
lines changed

4 files changed

+16
-133
lines changed

apps/native/app/(tabs)/_layout.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export default function Layout() {
66
return (
77
<Tabs
88
screenOptions={{
9+
headerShown: false,
910
tabBarShowLabel: false,
1011
tabBarStyle: {
1112
backgroundColor: "#fff",

apps/native/app/(tabs)/home.tsx

+14-118
Original file line numberDiff line numberDiff line change
@@ -1,91 +1,38 @@
1-
import React, { useState, useEffect } from "react";
2-
import { Image, StyleSheet, Text, View } from "react-native";
3-
import { FlashList } from "@shopify/flash-list";
1+
import React from "react";
2+
import { StyleSheet, View } from "react-native";
43
import MaterialIcons from "@expo/vector-icons/MaterialIcons";
54
import BalanceCard from "@/components/ui/BalanceCard";
65
import { WIDTH } from "../../utils/dimensions";
7-
import useWalletList from "wallet_state/src/hooks/wallet";
8-
import { Colors } from "@/constants/Colors";
9-
import Title from "@/components/ui/common/Title";
106

11-
const balanceData = [
12-
{ value: "1000", label: "Tokens", icon: "toll", color: "#2E7D32" },
13-
{
14-
value: "2",
15-
label: "Wallets",
16-
icon: "account-balance-wallet",
17-
color: "#1A237E",
18-
},
7+
const data = [
8+
{ value: "1000", label: "Tokens" },
9+
{ value: "2", label: "Wallets" },
1910
];
2011

21-
type ItemProps = {
22-
id: string;
23-
logo: string;
24-
name: string;
25-
status: string;
26-
balance: number;
12+
const iconMapping = {
13+
Tokens: <MaterialIcons name="toll" size={24} color="#2E7D32" />,
14+
Wallets: (
15+
<MaterialIcons name="account-balance-wallet" size={24} color="#1A237E" />
16+
),
2717
};
2818

2919
export default function Home() {
30-
const [user, setUser] = useState<{ userId: string }>({
31-
userId: "default-user",
32-
});
33-
34-
const walletList = useWalletList(user?.userId);
35-
3620
return (
3721
<View style={styles.container}>
38-
<View style={[styles.row, { gap: WIDTH * 0.05, marginTop: 30 }]}>
39-
{balanceData.map(item => (
22+
<View style={[styles.row, { gap: WIDTH * 0.05 }]}>
23+
{data.map((item, index) => (
4024
<BalanceCard
41-
key={item.label}
25+
key={index}
4226
value={item.value}
43-
icon={
44-
<MaterialIcons name={item.icon} size={24} color={item.color} />
45-
}
27+
icon={iconMapping[item.label]}
4628
label={item.label}
4729
/>
4830
))}
4931
</View>
50-
51-
<View style={styles.activityContainer}>
52-
<View style={styles.activityHeader}>
53-
<Title title="Recent activity" />
54-
<Text style={styles.activityLink}>View all</Text>
55-
</View>
56-
</View>
57-
<FlashList
58-
data={walletList?.list || []}
59-
keyExtractor={item => item.id}
60-
renderItem={({ item }) => <ActivityItem item={item} />}
61-
estimatedItemSize={50}
62-
/>
6332
</View>
6433
);
6534
}
6635

67-
const ActivityItem = ({ item }: { item: ItemProps }) => (
68-
<View style={styles.itemContainer}>
69-
<View style={styles.leftColumn}>
70-
<Image source={{ uri: item.logo }} style={styles.icon} />
71-
<View>
72-
<Text style={styles.title}>{item.name}</Text>
73-
<Text style={styles.status}>{item.status}</Text>
74-
</View>
75-
</View>
76-
<Text
77-
style={[
78-
styles.value,
79-
{
80-
color:
81-
item.status === "Received" ? Colors.green : Colors.blackOverlay,
82-
},
83-
]}>
84-
{item.balance}
85-
</Text>
86-
</View>
87-
);
88-
8936
const styles = StyleSheet.create({
9037
container: {
9138
flex: 1,
@@ -97,55 +44,4 @@ const styles = StyleSheet.create({
9744
justifyContent: "center",
9845
flexWrap: "wrap",
9946
},
100-
activityContainer: {
101-
marginTop: 30,
102-
marginVertical: 8,
103-
paddingTop: 24,
104-
},
105-
activityHeader: {
106-
flexDirection: "row",
107-
justifyContent: "space-between",
108-
width: "100%",
109-
},
110-
activityTitle: {
111-
fontSize: 20,
112-
color: "black",
113-
fontWeight: "bold",
114-
},
115-
activityLink: {
116-
fontSize: 16,
117-
color: Colors.green,
118-
textDecorationLine: "underline",
119-
},
120-
itemContainer: {
121-
flexDirection: "row",
122-
justifyContent: "space-between",
123-
alignItems: "center",
124-
padding: 16,
125-
borderBottomWidth: 1,
126-
borderBottomColor: "#ddd",
127-
backgroundColor: "#fff",
128-
},
129-
leftColumn: {
130-
flexDirection: "row",
131-
alignItems: "center",
132-
gap: 10,
133-
},
134-
icon: {
135-
width: 40,
136-
height: 40,
137-
borderRadius: 20,
138-
},
139-
title: {
140-
fontSize: 16,
141-
fontWeight: "500",
142-
},
143-
status: {
144-
fontSize: 14,
145-
color: Colors.darkGray,
146-
},
147-
value: {
148-
fontSize: 18,
149-
fontWeight: "bold",
150-
},
15147
});

apps/native/components/ui/common/Title.tsx

-14
This file was deleted.

apps/native/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"react-native-svg": "15.8.0",
4747
"react-native-svg-transformer": "^1.5.0",
4848
"react-native-web": "~0.19.10",
49-
"core": "1.0.0"
49+
"wallet_state": "1.0.0"
5050
},
5151
"devDependencies": {
5252
"@babel/core": "^7.20.0",

0 commit comments

Comments
 (0)