Skip to content

Commit fa37d67

Browse files
committed
SD-34: Make adjustments based on feedback
1 parent 9ce878e commit fa37d67

File tree

5 files changed

+50
-46
lines changed

5 files changed

+50
-46
lines changed
Lines changed: 2 additions & 11 deletions
Loading

src/domains/misc/components/Layout/Navigation.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ import router from 'src/domains/routing/utils/router';
66
const tabsConfig = [
77
{
88
key: 'shield',
9-
label: 'Shield',
9+
label: 'Trace Breaker',
1010
routeNames: ['Shield'],
1111
onClick: () => void router.push('Shield'),
1212
},
1313
{
1414
key: 'yield',
15-
label: 'Yield',
15+
label: 'Shielded Yield',
1616
routeNames: ['Yield'],
1717
onClick: () => void router.push('Yield'),
1818
comingSoon: true,

src/domains/misc/components/Tabs/Tab.tsx

Lines changed: 37 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
import { useMediaQuery } from '@react-hookz/web';
12
import { m as motion } from 'motion/react';
23
import type { ReactElement } from 'react';
34
import styled, { RuleSet } from 'styled-components';
45

56
import Badge from 'src/domains/misc/components/Badge';
7+
import { BOTTOM_MENU_BREAKPOINT } from 'src/domains/misc/consts/consts.ts';
68
import composeFluidSize from 'src/domains/styling/utils/composeFluidSize';
79
import { transitionTime, typography } from 'src/domains/styling/utils/tokens';
810
import vars from 'src/domains/styling/utils/vars';
@@ -36,36 +38,42 @@ const positionStyles = {
3638
},
3739
};
3840

39-
const Tab = ({ label, selected, onClick, layoutId, size = 'medium', position = 'floor', icon, comingSoon }: Props) => (
40-
<Wrapper
41-
initial={{ opacity: 0 }}
42-
animate={{ opacity: 1, transition: { delay: 0.1 }}}
43-
exit={{ opacity: 0 }}
44-
>
45-
<Container
46-
selected={selected}
47-
onClick={onClick}
48-
disabled={comingSoon}
49-
title={label}
50-
$size={size}
51-
layout
41+
const Tab = ({ label, selected, onClick, layoutId, size = 'medium', position = 'floor', icon, comingSoon }: Props) => {
42+
const isSmallScreen = useMediaQuery(`(max-width: ${BOTTOM_MENU_BREAKPOINT})`);
43+
44+
return (
45+
<Wrapper
46+
initial={{ opacity: 0 }}
47+
animate={{ opacity: 1, transition: { delay: 0.1 }}}
48+
exit={{ opacity: 0 }}
5249
>
53-
<LabelContainer>
54-
{icon}
55-
{label}
56-
</LabelContainer>
57-
<HoverBar style={positionStyles[position]} />
58-
{selected && (
59-
<SelectionBar
60-
// set as an inline style for scale correction during transition (https://www.framer.com/motion/layout-animations/##scale-correction)
61-
style={positionStyles[position]}
62-
layoutId={layoutId}
63-
/>
50+
<Container
51+
selected={selected}
52+
onClick={onClick}
53+
disabled={comingSoon}
54+
title={label}
55+
$size={size}
56+
layout
57+
>
58+
<LabelContainer>
59+
{icon}
60+
{label}
61+
</LabelContainer>
62+
<HoverBar style={positionStyles[position]} />
63+
{selected && (
64+
<SelectionBar
65+
// set as an inline style for scale correction during transition (https://www.framer.com/motion/layout-animations/##scale-correction)
66+
style={positionStyles[position]}
67+
layoutId={layoutId}
68+
/>
69+
)}
70+
</Container>
71+
{comingSoon && (
72+
<Badge size="medium" variant="subtle" design="tint" text={isSmallScreen ? 'Soon' : 'Coming soon'} circular />
6473
)}
65-
</Container>
66-
{comingSoon && <Badge size="medium" variant="subtle" design="tint" text="Coming soon" circular />}
67-
</Wrapper>
68-
);
74+
</Wrapper>
75+
);
76+
};
6977

7078
export default Tab;
7179

@@ -102,6 +110,7 @@ const LabelContainer = styled.div`
102110
display: flex;
103111
gap: ${vars('--spacing-xxs')};
104112
align-items: center;
113+
white-space: nowrap;
105114
106115
svg {
107116
fill: ${vars('--color-brand-foreground-compound-rest')};

src/domains/misc/consts/consts.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { UseQueryOptions } from '@tanstack/react-query';
22

33
export const BREAKPOINTS = { xs: '355px', sm: '500px', md: '770px', lg: '970px', xl: '1160px' };
44

5-
export const BOTTOM_MENU_BREAKPOINT = BREAKPOINTS.lg;
5+
export const BOTTOM_MENU_BREAKPOINT = '1060px';
66

77
export const BOTTOM_NAVIGATION_HEIGHT = '48px';
88

src/domains/shielder/components/Shielder.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@ import Skeleton from 'src/domains/misc/components/Skeleton';
88
import Title from 'src/domains/misc/components/Title.tsx';
99
import AccountTypeSelector from 'src/domains/shielder/components/AccountTypeSelector';
1010
import TokenList from 'src/domains/shielder/components/TokenList';
11+
import { useShielderStore } from 'src/domains/shielder/stores/shielder';
1112
import useShielderClient from 'src/domains/shielder/utils/useShielderClient';
1213
import { typography } from 'src/domains/styling/utils/tokens';
1314
import vars from 'src/domains/styling/utils/vars';
1415

1516
const Shielder = () => {
1617
const chainConfig = useChain();
1718
const { isSuccess } = useShielderClient();
19+
const { selectedAccountType } = useShielderStore();
1820

1921
const nonNativeTokens = chainConfig ?
2022
objectEntries(chainConfig.whitelistedTokens).map(([address, token]) => ({
@@ -38,10 +40,12 @@ const Shielder = () => {
3840
<>
3941
<Title size="medium">Your accounts</Title>
4042
<AccountTypeSelector />
41-
<Disclaimer>
42-
<CIcon icon="Info" size={20} />
43-
<p>Tokens that can be moved to shielded account:</p>
44-
</Disclaimer>
43+
{selectedAccountType === 'public' && (
44+
<Disclaimer>
45+
<CIcon icon="Info" size={20} />
46+
<p>Tokens that can be moved to shielded account:</p>
47+
</Disclaimer>
48+
)}
4549
<TokensWrapper>
4650
<TokenList tokens={tokens} />
4751
</TokensWrapper>

0 commit comments

Comments
 (0)