diff --git a/apps/box/src/navigation/MainTabs.navigator.tsx b/apps/box/src/navigation/MainTabs.navigator.tsx index 6f2591ef..e1ff2194 100644 --- a/apps/box/src/navigation/MainTabs.navigator.tsx +++ b/apps/box/src/navigation/MainTabs.navigator.tsx @@ -4,7 +4,6 @@ import { useTheme } from '@shopify/restyle'; import { FxTheme } from '@functionland/component-library'; import { BoxScreen } from '../screens/Box.screen'; import { MainTabsParamList } from './navigatonConfig'; -import { WalletScreen } from '../screens/Wallet.screen'; import { SettingsScreen } from '../screens/Settings.screen'; import { PoolScreen } from '../screens/Pool.screen'; import { UserScreen } from '../screens/User.screen'; @@ -15,6 +14,7 @@ import { UserIcon, WalletIcon, } from '../components'; +import { RewardsScreen } from '../screens/Rewards.screen'; export const MainTabsNavigator = () => { const theme = useTheme(); @@ -37,8 +37,8 @@ export const MainTabsNavigator = () => { }} /> , diff --git a/apps/box/src/navigation/navigatonConfig.ts b/apps/box/src/navigation/navigatonConfig.ts index 4f21df85..1208c532 100644 --- a/apps/box/src/navigation/navigatonConfig.ts +++ b/apps/box/src/navigation/navigatonConfig.ts @@ -7,7 +7,7 @@ export type RootStackParamList = { export type MainTabsParamList = { Box: undefined; - Wallet: undefined; + Rewards: undefined; Settings: undefined; User: undefined; Pool: undefined; diff --git a/apps/box/src/screens/Rewards.screen.tsx b/apps/box/src/screens/Rewards.screen.tsx new file mode 100644 index 00000000..96f248d7 --- /dev/null +++ b/apps/box/src/screens/Rewards.screen.tsx @@ -0,0 +1,276 @@ +import { + FxBottomSheetModal, + FxBottomSheetModalMethods, + FxBox, + FxButton, + FxFilterIcon, + FxFoldableContent, + FxLineChart, + FxPressableOpacity, + FxSafeAreaBox, + FxSpacer, + FxText, + FxTheme, +} from '@functionland/component-library'; +import { useTheme } from '@shopify/restyle'; +import React from 'react'; +import { ScrollView } from 'react-native'; +import Reanimated, { + useAnimatedStyle, + useSharedValue, + withTiming, +} from 'react-native-reanimated'; +import { mixColor } from 'react-native-redash'; + +const TEST_DATA_Y = [ + 0, 1, 2, 8, 10, 5, 6, 7, 8, 9, 10, 9, 8, 7, 6, 13, 16, 12, 5, 8, 10, +]; + +const ICON_SIZE = 10; + +export const RewardsScreen = () => { + const bottomSheetRef = React.useRef(null); + + const filterPressed = () => { + bottomSheetRef.current.present(); + }; + + return ( + + + + + + + + + All + + Earnings + + Transactions + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ); +}; + +const RowItem = () => { + const theme = useTheme(); + const backgroundAnimationValue = useSharedValue(0); + const backgroundAnimatedStyle = useAnimatedStyle(() => { + return { + backgroundColor: mixColor( + backgroundAnimationValue.value, + theme.colors.backgroundApp, + theme.colors.backgroundPrimary + ) as string, + }; + }); + + const headerContent = ( + + + + 9.0951 + + + + 0.0012 + + + + + 07/19/22 + + + + + Purchase + + + + + ); + + return ( + + { + if (expanded) { + backgroundAnimationValue.value = withTiming(1, { duration: 300 }); + } else { + backgroundAnimationValue.value = withTiming(0, { duration: 300 }); + } + }} + > + + + + + Tower #2 + + + See in wallet + + + + + + ); +}; + +const TableHeader = () => { + return ( + + + + + + + + ); +}; + +type TextHeaderItemProps = { + text: string; +}; + +const TableHeaderItem = ({ text }: TextHeaderItemProps) => { + return ( + + {text} + + ); +}; + +type ScreenHeaderContainerProps = { + children: React.ReactElement; +}; + +const ScreenHeaderContainer = ({ children }: ScreenHeaderContainerProps) => { + return ( + + {children} + + ); +}; + +const ScreenHeader = () => { + return ( + + + All Rewards + + + ); +}; + +const Separator = () => { + return ( + + ); +}; + +type FxTabOptionProps = { + selected: boolean; + onPress?: () => void; + children: React.ReactElement | string; +}; + +const FxTabOption = ({ onPress, selected, children }: FxTabOptionProps) => { + const textProps: React.ComponentProps = selected + ? { + variant: 'bodyMediumRegular', + color: 'greenBase', + } + : { + variant: 'bodyMediumLight', + color: 'content2', + }; + const pressableProps: React.ComponentProps = selected + ? { + borderBottomWidth: 1, + borderBottomColor: 'greenBase', + } + : {}; + + return ( + + {children} + + ); +}; + +const FilterBottomSheet = React.forwardRef( + (_, ref) => { + return ( + + <> + + Tower 1 + + + Tower 2 + + + + ); + } +); diff --git a/apps/box/src/screens/Wallet.screen.tsx b/apps/box/src/screens/Wallet.screen.tsx deleted file mode 100644 index 5680e160..00000000 --- a/apps/box/src/screens/Wallet.screen.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import { FxBox, FxText } from '@functionland/component-library'; -import React from 'react'; - -export const WalletScreen = () => { - return ( - - Wallet Dashboard - - ); -};