Skip to content

Commit 4a93f4c

Browse files
committed
fea: donate to orgs
1 parent ba64a11 commit 4a93f4c

File tree

4 files changed

+57
-12
lines changed

4 files changed

+57
-12
lines changed

components/OffsetCard.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,24 @@ import {NonprofitsSheet} from './bottomSheet/NonProfitsSheet';
66

77
const OffsetCard = () => {
88
const [visible, setVisible] = useState(false);
9+
const [TransactionSheetVisible, setTransactionSheetVisible] = useState(false);
910

1011
const toggleBottomNavigationView = () => {
1112
setVisible(!visible);
1213
};
14+
const toggleTransactionView = () => {
15+
setTransactionSheetVisible(!TransactionSheetVisible);
16+
};
1317
return (
1418
<View style={styles.offsetBox}>
1519
<View style={styles.treeContainer}>
1620
<Text style={styles.tree}>🌲</Text>
1721
</View>
1822
<View style={styles.offsetContainer}>
1923
<Text style={styles.offsetText}>Your Footprint is reducing 🔥</Text>
20-
<TouchableOpacity style={styles.button} onPress={toggleBottomNavigationView}>
24+
<TouchableOpacity
25+
style={styles.button}
26+
onPress={toggleBottomNavigationView}>
2127
<Text style={styles.txButton}>Offset</Text>
2228
</TouchableOpacity>
2329

components/bottomSheet/NonProfitsSheet.tsx

Lines changed: 48 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,28 @@
11
import {FlatList, StyleSheet, Text, View} from 'react-native';
22
import {useTransactionStore} from '../../store/transaction_store';
33
import {useEffect} from 'react';
4+
import {Image} from 'react-native';
5+
import {TouchableOpacity} from 'react-native';
46

57
export const NonprofitsSheet: React.FC = () => {
68
const {changeOrgNonProfits, fetchNonProfits} = useTransactionStore();
79

810
useEffect(() => {
911
fetchNonProfits();
10-
});
12+
}, []);
1113

1214
const renderItem = ({item}: any) => {
13-
return <View>
14-
15-
<Text>
16-
17-
</Text>
18-
</View>;
15+
return (
16+
<TouchableOpacity style={styles.cardContainer}>
17+
<View style={styles.logoContainer}>
18+
<Image source={{uri: item.icon_url}} style={styles.logo} />
19+
</View>
20+
<View>
21+
<Text style={styles.orgTitle}>{item.name}</Text>
22+
{/* <Text style={styles.orgSubTitle}>{item.solanaAddress}</Text> */}
23+
</View>
24+
</TouchableOpacity>
25+
);
1926
};
2027

2128
return (
@@ -42,9 +49,41 @@ const styles = StyleSheet.create({
4249
paddingHorizontal: 20,
4350
},
4451
title: {
45-
fontSize: 20,
52+
fontSize: 24,
4653
color: 'black',
4754
fontFamily: 'Rubik-Bold',
48-
marginBottom: 12,
55+
paddingTop: 30,
56+
paddingBottom: 10,
57+
textAlign: 'center',
58+
// marginBottom: 12,
59+
},
60+
logo: {
61+
height: '100%',
62+
width: '100%',
63+
borderRadius: 10,
64+
},
65+
logoContainer: {
66+
height: 48,
67+
width: 48,
68+
},
69+
cardContainer: {
70+
flexDirection: 'row',
71+
gap: 12,
72+
paddingLeft: 16,
73+
paddingRight: 70,
74+
// justifyContent: '',
75+
marginVertical: 8,
76+
alignItems: 'center',
77+
},
78+
orgTitle: {
79+
color: 'black',
80+
fontSize: 18,
81+
fontFamily: 'Rubik-SemiBold',
82+
},
83+
orgSubTitle: {
84+
color: 'black',
85+
fontSize: 12,
86+
fontFamily: 'Rubik-Regular',
87+
marginTop: -6,
4988
},
5089
});

screens/Home.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const Home = () => {
5151
visible={visible}
5252
toggleBottomNavigationView={toggleBottomNavigationView}
5353
bottomsheetChild={
54-
<SendTransaction toggleNFTSheetView={toggleNFTSheet} />
54+
<SendTransaction toggleNFTSheetView={toggleNFTSheet} address="" />
5555
}
5656
/>
5757
<NFTSheet

store/transaction_store.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export const useTransactionStore = create<ITransactionStore>((set, get) => ({
9595
changeOrgNonProfits: response,
9696
});
9797

98-
console.log({response});
98+
console.log(response);
9999
},
100100
}));
101101

0 commit comments

Comments
 (0)