Skip to content

Commit 9ff9702

Browse files
authored
Merge pull request #731 from 0xsend/dev
Update Main from dev
2 parents 1de9e37 + b20afb6 commit 9ff9702

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+2487
-2341
lines changed

apps/next/pages/deposit/index.tsx

+2-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { HomeLayout } from 'app/features/home/layout.web'
33
import Head from 'next/head'
44
import { userProtectedGetSSP } from 'utils/userProtected'
55
import type { NextPageWithLayout } from '../_app'
6-
import { ButtonOption, TopNav } from 'app/components/TopNav'
6+
import { TopNav } from 'app/components/TopNav'
77

88
export const Page: NextPageWithLayout = () => {
99
return (
@@ -19,9 +19,7 @@ export const Page: NextPageWithLayout = () => {
1919
export const getServerSideProps = userProtectedGetSSP()
2020

2121
Page.getLayout = (children) => (
22-
<HomeLayout TopNav={<TopNav header="Deposit" button={ButtonOption.PROFILE} />}>
23-
{children}
24-
</HomeLayout>
22+
<HomeLayout TopNav={<TopNav header="Deposit" />}>{children}</HomeLayout>
2523
)
2624

2725
export default Page

packages/app/components/FormFields/BooleanCheckboxField.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@ import {
1212
type ThemeName,
1313
XStack,
1414
useThemeName,
15+
type LabelProps,
1516
} from '@my/ui'
1617
import { useThemeSetting } from '@tamagui/next-theme'
1718

1819
export const BooleanCheckboxField = (
19-
props: Pick<CheckboxProps, 'size' | 'native' | 'defaultChecked'>
20+
props: Pick<CheckboxProps, 'size' | 'native' | 'defaultChecked'> & { labelProps?: LabelProps }
2021
) => {
2122
const {
2223
field,
@@ -47,7 +48,8 @@ export const BooleanCheckboxField = (
4748
lineHeight={52}
4849
htmlFor={id}
4950
textTransform={'uppercase'}
50-
color="$olive"
51+
color={props.labelProps?.color ?? '$olive'}
52+
{...props.labelProps}
5153
>
5254
{label} {isOptional && '(Optional)'}
5355
</Label>

packages/app/components/FormFields/CoinField.tsx

+6-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ import { useSendAccount } from 'app/utils/send-accounts'
2828
import { useId, useState } from 'react'
2929
import { useBalance, type UseBalanceReturnType } from 'wagmi'
3030
import { IconCoin } from '../icons/IconCoin'
31-
export const CoinField = ({ native = false, ...props }: Pick<SelectProps, 'size' | 'native'>) => {
31+
export const CoinField = ({
32+
native = false,
33+
...props
34+
}: Pick<SelectProps, 'size' | 'native' | 'defaultValue'>) => {
3235
const [isOpen, setIsOpen] = useState(false)
3336

3437
const {
@@ -48,9 +51,10 @@ export const CoinField = ({ native = false, ...props }: Pick<SelectProps, 'size'
4851
<Select
4952
native={native}
5053
id={id}
51-
value={field.value || usdcAddress[baseMainnet.id]}
54+
value={field.value}
5255
onValueChange={field.onChange}
5356
onOpenChange={setIsOpen}
57+
defaultValue={usdcAddress[baseMainnet.id]}
5458
open={isOpen}
5559
{...props}
5660
>

packages/app/components/FormFields/TextAreaField.tsx

+10-5
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,14 @@ import {
1111
useThemeName,
1212
FieldError,
1313
Shake,
14+
type LabelProps,
1415
} from '@my/ui'
1516

1617
export const TextAreaField = (
17-
props: Pick<TextAreaProps, 'size' | 'autoFocus' | 'aria-label' | 'placeholder' | 'fontStyle'>
18+
props: Pick<
19+
TextAreaProps,
20+
'size' | 'autoFocus' | 'aria-label' | 'placeholder' | 'fontStyle' | 'backgroundColor' | 'rows'
21+
> & { labelProps?: LabelProps }
1822
) => {
1923
const {
2024
field,
@@ -34,11 +38,12 @@ export const TextAreaField = (
3438
{!!label && (
3539
<Label
3640
size={props.size || '$5'}
37-
fontFamily={'$mono'}
38-
lineHeight={52}
3941
htmlFor={id}
40-
textTransform={'uppercase'}
41-
color="$olive"
42+
fontFamily={props.labelProps?.fontFamily ?? '$mono'}
43+
lineHeight={props.labelProps?.lineHeight ?? 52}
44+
textTransform={props.labelProps?.textTransform ?? 'uppercase'}
45+
color={props.labelProps?.color ?? '$olive'}
46+
{...props.labelProps}
4247
>
4348
{label} {isOptional && '(Optional)'}
4449
</Label>

packages/app/components/FormFields/TextField.tsx

+6-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
Paragraph,
88
Shake,
99
Stack,
10+
type LabelProps,
1011
Theme,
1112
Tooltip,
1213
useMedia,
@@ -17,7 +18,9 @@ import { useId } from 'react'
1718

1819
import { AlertTriangle } from '@tamagui/lucide-icons'
1920

20-
export const TextField = (props: InputProps & { fieldsetProps?: FieldsetProps }) => {
21+
export const TextField = (
22+
props: InputProps & { fieldsetProps?: FieldsetProps } & { labelProps?: LabelProps }
23+
) => {
2124
const media = useMedia()
2225
const {
2326
field,
@@ -44,7 +47,8 @@ export const TextField = (props: InputProps & { fieldsetProps?: FieldsetProps })
4447
lineHeight={'$11'}
4548
htmlFor={id}
4649
textTransform={'uppercase'}
47-
color="$olive"
50+
color={props.labelProps?.color ?? '$olive'}
51+
{...props.labelProps}
4852
>
4953
{label} {isOptional && '(Optional)'}
5054
</Label>

packages/app/components/TopNav.tsx

+12-5
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,19 @@ export function TopNav({
116116
// else, go to home page
117117
if (hasSelectedCoin) {
118118
setRootParams({ ...queryParams, token: undefined })
119+
return
119120
}
120121
const newPath = parts.length > 1 ? parts.slice(0, 1).join('/') : '/'
122+
if (path.includes('/settings')) {
123+
push(`/${newPath}?nav=settings`)
124+
return
125+
}
126+
121127
push(`/${newPath}`)
122128
}
123-
124-
const isSubRoute = (!noSubroute && parts.length > 1) || path.includes('/secret-shop')
129+
//@todo Refactor this so we can put back arrows on screens that need it
130+
const isSubRoute =
131+
(!noSubroute && parts.length > 1) || path.includes('/secret-shop') || path.includes('/deposit')
125132

126133
const renderButton = () => {
127134
switch (true) {
@@ -218,7 +225,7 @@ export function TopNav({
218225
col="$color10"
219226
lineHeight={32}
220227
$gtLg={{ ml: isSubRoute ? '$4' : '$0' }}
221-
display={selectedCoin && !media.gtLg ? 'none' : 'flex'}
228+
display={selectedCoin ? 'none' : 'flex'}
222229
als={'center'}
223230
>
224231
{header}
@@ -233,7 +240,7 @@ export function TopNav({
233240
col="$color10"
234241
lineHeight={32}
235242
$gtLg={{ ml: isSubRoute ? '$4' : '$0' }}
236-
display={selectedCoin && !media.gtLg ? 'none' : 'flex'}
243+
display={isSubRoute ? 'flex' : 'none'}
237244
als={'center'}
238245
>
239246
{header}
@@ -269,7 +276,7 @@ export function TopNav({
269276
<Separator w={'100%'} borderColor="$jet" $lg={{ display: 'none' }} />
270277
</Container>
271278
)}
272-
<Separator w={'100%'} borderColor="$decay" $gtLg={{ display: 'none' }} />
279+
<Separator w={'100%'} borderColor="$decay" $gtLg={{ display: 'none' }} mt="$2" />
273280
{!media.gtLg && selectedCoin && selectedCoin.label !== 'USDC' && (
274281
<Container pos="relative">
275282
<View
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { type IconProps, themed } from '@tamagui/helpers-icon'
2+
import { memo } from 'react'
3+
import { Path, Svg } from 'react-native-svg'
4+
import type { ColorTokens } from '@my/ui/types'
5+
6+
const Leaderboard = (props) => {
7+
const { size, color, ...rest } = props
8+
return (
9+
<Svg
10+
width={size ?? 28}
11+
height={size ?? 28}
12+
color={color as ColorTokens | undefined}
13+
viewBox="0 0 20 18"
14+
fill="none"
15+
{...rest}
16+
>
17+
<Path
18+
fill="currentColor"
19+
d="M2 16h4V8H2v8Zm6 0h4V2H8v14Zm6 0h4v-6h-4v6ZM0 18V6h6V0h8v8h6v10H0Z"
20+
/>
21+
</Svg>
22+
)
23+
}
24+
const IconLeaderboard = memo<IconProps>(themed(Leaderboard))
25+
export { IconLeaderboard }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { type IconProps, themed } from '@tamagui/helpers-icon'
2+
import { memo } from 'react'
3+
import { Path, Svg } from 'react-native-svg'
4+
import type { ColorTokens } from '@my/ui/types'
5+
6+
const QRFull = (props) => {
7+
const { size, color, ...rest } = props
8+
return (
9+
<Svg
10+
width={size ?? 28}
11+
height={size ?? 28}
12+
color={color as ColorTokens | undefined}
13+
viewBox="0 0 30 30"
14+
fill="none"
15+
{...rest}
16+
>
17+
<Path
18+
fill="currentColor"
19+
d="M0 13.611V0h13.611v13.611H0Zm2.778-2.778h8.055V2.778H2.778v8.055ZM0 30V16.389h13.611V30H0Zm2.778-2.778h8.055v-8.055H2.778v8.055Zm13.61-13.61V0H30v13.611H16.389Zm2.779-2.779h8.055V2.778h-8.055v8.055ZM26.61 30v-3.389H30V30h-3.389ZM16.39 19.805V16.39h3.389v3.416h-3.39Zm3.389 3.39v-3.39h3.417v3.39h-3.417Zm-3.39 3.416v-3.416h3.39v3.416h-3.39ZM19.779 30v-3.389h3.417V30h-3.417Zm3.417-3.389v-3.416h3.416v3.416h-3.416Zm0-6.806V16.39h3.416v3.416h-3.416Zm3.416 3.39v-3.39H30v3.39h-3.389Z"
20+
/>
21+
</Svg>
22+
)
23+
}
24+
const IconQRFull = memo<IconProps>(themed(QRFull))
25+
export { IconQRFull }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { memo } from 'react'
2+
import type { IconProps } from '@tamagui/helpers-icon'
3+
import { Svg, Path } from 'react-native-svg'
4+
import { themed } from '@tamagui/helpers-icon'
5+
import type { ColorTokens } from '@my/ui'
6+
7+
const QuestionCircle = (props) => {
8+
const { size, color, ...rest } = props
9+
10+
return (
11+
<Svg
12+
color={color as ColorTokens | undefined}
13+
width={size}
14+
height={size}
15+
viewBox="0 0 20 20"
16+
fill="none"
17+
{...rest}
18+
>
19+
<Path
20+
fill="currentColor"
21+
d="M9.95 16c.35 0 .646-.12.888-.363.241-.241.362-.537.362-.887s-.12-.646-.362-.887a1.207 1.207 0 0 0-.888-.363c-.35 0-.646.12-.887.363a1.207 1.207 0 0 0-.363.887c0 .35.12.646.363.887.241.242.537.363.887.363Zm-.9-3.85h1.85c0-.55.063-.983.188-1.3.125-.317.479-.75 1.062-1.3a7.496 7.496 0 0 0 1.025-1.238c.25-.391.375-.862.375-1.412 0-.933-.342-1.65-1.025-2.15-.683-.5-1.492-.75-2.425-.75-.95 0-1.72.25-2.313.75-.591.5-1.004 1.1-1.237 1.8l1.65.65c.083-.3.27-.625.563-.975.291-.35.737-.525 1.337-.525.533 0 .933.146 1.2.438.267.291.4.612.4.962 0 .333-.1.646-.3.938-.2.291-.45.562-.75.812-.733.65-1.183 1.142-1.35 1.475-.167.333-.25.942-.25 1.825ZM10 20a9.738 9.738 0 0 1-3.9-.788 10.099 10.099 0 0 1-3.175-2.137c-.9-.9-1.612-1.958-2.137-3.175A9.738 9.738 0 0 1 0 10c0-1.383.263-2.683.787-3.9a10.099 10.099 0 0 1 2.138-3.175c.9-.9 1.958-1.612 3.175-2.137A9.738 9.738 0 0 1 10 0c1.383 0 2.683.263 3.9.787a10.098 10.098 0 0 1 3.175 2.138c.9.9 1.613 1.958 2.137 3.175A9.738 9.738 0 0 1 20 10a9.738 9.738 0 0 1-.788 3.9 10.098 10.098 0 0 1-2.137 3.175c-.9.9-1.958 1.613-3.175 2.137A9.738 9.738 0 0 1 10 20Zm0-2c2.233 0 4.125-.775 5.675-2.325C17.225 14.125 18 12.233 18 10c0-2.233-.775-4.125-2.325-5.675C14.125 2.775 12.233 2 10 2c-2.233 0-4.125.775-5.675 2.325C2.775 5.875 2 7.767 2 10c0 2.233.775 4.125 2.325 5.675C5.875 17.225 7.767 18 10 18Z"
22+
/>
23+
</Svg>
24+
)
25+
}
26+
27+
const IconQuestionCircle = memo<IconProps>(themed(QuestionCircle))
28+
export { IconQuestionCircle }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { type IconProps, themed } from '@tamagui/helpers-icon'
2+
import { memo } from 'react'
3+
import { Path, Svg } from 'react-native-svg'
4+
import type { ColorTokens } from '@my/ui/types'
5+
6+
const StarOutline = (props) => {
7+
const { size, color, ...rest } = props
8+
return (
9+
<Svg
10+
width={size ?? 28}
11+
height={size ?? 28}
12+
color={color as ColorTokens | undefined}
13+
viewBox="0 0 20 19"
14+
fill="none"
15+
{...rest}
16+
>
17+
<Path
18+
fill="currentColor"
19+
d="m6.85 14.825 3.15-1.9 3.15 1.925-.825-3.6 2.775-2.4-3.65-.325-1.45-3.4L8.55 8.5l-3.65.325 2.775 2.425-.825 3.575ZM3.825 19l1.625-7.025L0 7.25l7.2-.625L10 0l2.8 6.625 7.2.625-5.45 4.725L16.175 19 10 15.275 3.825 19Z"
20+
/>
21+
</Svg>
22+
)
23+
}
24+
const IconStarOutline = memo<IconProps>(themed(StarOutline))
25+
export { IconStarOutline }

packages/app/components/icons/index.tsx

+4
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export { IconSecurity } from './IconSecurity'
2727
export { IconNotification } from './IconNotification'
2828
export { IconSupport } from './IconSupport'
2929
export { IconQRCode } from './IconQRCode'
30+
export { IconQRFull } from './IconQRFull'
3031
export { IconShare } from './IconShare'
3132
export { IconSLogo } from './IconSLogo'
3233
export { IconDistributions } from './IconDistributions'
@@ -53,3 +54,6 @@ export { IconDots } from './IconDots'
5354
export { IconDeviceReset } from './IconDeviceReset'
5455
export { IconBadgeCheck } from './IconBadgeCheck'
5556
export { IconInfoCircle } from './IconInfoCircle'
57+
export { IconLeaderboard } from './IconLeaderboard'
58+
export { IconStarOutline } from './IconStarOutline'
59+
export { IconQuestionCircle } from './IconQuestionCircle'

0 commit comments

Comments
 (0)