Skip to content

Commit 18f698d

Browse files
Revert "Separate Cash,Savings,Invest"
This reverts commit d2995dc.
1 parent 54101ea commit 18f698d

File tree

13 files changed

+353
-662
lines changed

13 files changed

+353
-662
lines changed

apps/next/pages/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export const Page: NextPageWithLayout<InferGetServerSidePropsType<typeof getServ
4949
<title>Send</title>
5050
</Head>
5151
{session ? (
52-
<HomeLayout TopNav={<TopNav header="Home" showLogo={true} backFunction="router" />}>
52+
<HomeLayout TopNav={<TopNav header="Home" showLogo={true} />}>
5353
<HomeScreen />
5454
</HomeLayout>
5555
) : (

packages/app/components/TopNav.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,16 +101,23 @@ export function TopNav({
101101
showOnGtLg = false,
102102
hideRightActions = false,
103103
}: TopNavProps) {
104-
const [queryParams] = useRootScreenParams()
104+
const [queryParams, setRootParams] = useRootScreenParams()
105105
const path = usePathname()
106106
const parts = path.split('/').filter(Boolean)
107107
const { push, back } = useRouter()
108108
const media = useMedia()
109+
const { coin: selectedCoin } = useCoinFromTokenParam()
109110
const { profile } = useUser()
110111

112+
const hasSelectedCoin = Boolean(selectedCoin)
113+
111114
const handleBack = () => {
112115
// pop to the base path if subroute. e.g. /account/settings/edit-profile -> /account
113116
// else, go to home page
117+
if (hasSelectedCoin) {
118+
setRootParams({ ...queryParams, token: undefined })
119+
return
120+
}
114121
if (backFunction === 'router') {
115122
back()
116123
return
@@ -162,7 +169,7 @@ export function TopNav({
162169
)
163170
case media.gtLg && !showOnGtLg:
164171
return null
165-
case Boolean(queryParams.token):
172+
case hasSelectedCoin:
166173
return (
167174
<XStack ai="center" f={1}>
168175
<Button onPress={handleBack}>
@@ -174,6 +181,9 @@ export function TopNav({
174181
/>
175182
</ButtonOg.Icon>
176183
</Button>
184+
<Paragraph size={'$8'} col={'$color10'}>
185+
Balance
186+
</Paragraph>
177187
</XStack>
178188
)
179189
case !isSubRoute:

packages/app/features/home/HomeQuickActions.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ const Send = () => {
8484
)
8585
}
8686

87-
const Invest = () => {
87+
const Trade = () => {
8888
const { coin } = useCoinFromTokenParam()
8989
const media = useMedia()
9090
const isSmallScreen = !media.gtXs
@@ -109,8 +109,8 @@ const Invest = () => {
109109
height={'auto'}
110110
>
111111
<Theme name="green">
112-
<IconPlus
113-
size={'$1.5'}
112+
<IconSwap
113+
size={'$1'}
114114
$theme-dark={{ color: '$primary' }}
115115
$theme-light={{ color: '$color12' }}
116116
/>
@@ -123,7 +123,7 @@ const Invest = () => {
123123
numberOfLines={1}
124124
ellipsizeMode="tail"
125125
>
126-
Invest
126+
Trade
127127
</ButtonText>
128128
</YStack>
129129
</QuickActionButton>
@@ -200,5 +200,5 @@ const Earn = () => {
200200

201201
HomeQuickActions.Deposit = Deposit
202202
HomeQuickActions.Send = Send
203-
HomeQuickActions.Invest = Invest
203+
HomeQuickActions.Trade = Trade
204204
HomeQuickActions.Earn = Earn

packages/app/features/home/InvestmentsBalanceCard.tsx

Lines changed: 0 additions & 154 deletions
This file was deleted.

packages/app/features/home/SavingsBalanceCard.tsx

Lines changed: 0 additions & 87 deletions
This file was deleted.

0 commit comments

Comments
 (0)