|
| 1 | +import { Text, Badge, Checkbox, HStack, VStack } from 'native-base'; |
| 2 | +import { useState } from 'react'; |
| 3 | +import { Pressable } from 'react-native'; |
| 4 | +import { CommunityFundsIcon, SegmentedAidIcon, ResultsBasedIcon } from '../../assets'; |
| 5 | + |
| 6 | +// TODO All components wrap a component that has a step forward and backward callback |
| 7 | +const SelectType = ({ onStepForward }: { onStepForward: () => {} }) => { |
| 8 | + type PoolType = 'community-funds' | 'segmented-aid' | 'results-based'; |
| 9 | + const [type, setType] = useState<PoolType>(); |
| 10 | + |
| 11 | + const poolTypes = [ |
| 12 | + { |
| 13 | + id: 'community-funds' as PoolType, |
| 14 | + name: 'Community Funds', |
| 15 | + icon: CommunityFundsIcon, |
| 16 | + description: 'Facilitate money distribution to members of existing community organisations', |
| 17 | + interested: false, |
| 18 | + disabled: false, |
| 19 | + }, |
| 20 | + { |
| 21 | + id: 'segmented-aid' as PoolType, |
| 22 | + name: 'Segmented Aid', |
| 23 | + icon: SegmentedAidIcon, |
| 24 | + description: |
| 25 | + 'Self-sovereign, user-managed and encrypted digital demographic information allows access to specific funds via GoodOffers', |
| 26 | + interested: true, |
| 27 | + disabled: true, |
| 28 | + }, |
| 29 | + { |
| 30 | + id: 'results-based' as PoolType, |
| 31 | + name: 'Results-based direct payments', |
| 32 | + icon: ResultsBasedIcon, |
| 33 | + description: 'Provides direct payments to stewards based on verified climate action', |
| 34 | + interested: true, |
| 35 | + disabled: true, |
| 36 | + }, |
| 37 | + ]; |
| 38 | + |
| 39 | + return ( |
| 40 | + <VStack space={8}> |
| 41 | + <div>About Various Pools</div> |
| 42 | + Lorem ipsum, dolor sit amet consectetur adipisicing elit. Dignissimos ipsa ab nemo fugiat expedita, facilis |
| 43 | + voluptatibus magni velit odio quis cumque quidem veniam fuga. Ea perferendis voluptas voluptatum in iste! |
| 44 | + {poolTypes.map((poolType) => ( |
| 45 | + <Pressable |
| 46 | + disabled={poolType.disabled} |
| 47 | + onPress={() => { |
| 48 | + setType(poolType.id); |
| 49 | + onStepForward(); |
| 50 | + }}> |
| 51 | + <HStack backgroundColor="white" space={8} alignItems="center" justifyContent="center" paddingY={4}> |
| 52 | + <img src={poolType.icon} /> |
| 53 | + <VStack w="4/6"> |
| 54 | + <Text textTransform="uppercase">{poolType.name}</Text> |
| 55 | + <div>{poolType.description}</div> |
| 56 | + <div> |
| 57 | + {poolType.interested && ( |
| 58 | + <Badge maxW="48" rounded="full"> |
| 59 | + 'Interested? Please reach out!' |
| 60 | + </Badge> |
| 61 | + )} |
| 62 | + </div> |
| 63 | + </VStack> |
| 64 | + <div>{!poolType.disabled && <Checkbox value={'true'} />}</div> |
| 65 | + </HStack> |
| 66 | + </Pressable> |
| 67 | + ))} |
| 68 | + </VStack> |
| 69 | + ); |
| 70 | +}; |
| 71 | + |
| 72 | +export default SelectType; |
0 commit comments