This repository was archived by the owner on Apr 17, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathExchanges.tsx
More file actions
146 lines (141 loc) · 3.83 KB
/
Exchanges.tsx
File metadata and controls
146 lines (141 loc) · 3.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
import { Divider, Flex, Link as ChakraLink, Text } from '@chakra-ui/layout'
import { IconButton } from '@chakra-ui/react'
import React from 'react'
import BinanceIcon from '../icons/binance'
import { OneInch } from '../icons/1inch'
import { Upbit } from '../icons/Upbit'
import ArrowIcon from '../icons/arrow'
import { Fraxswap } from '../icons/fraxswap'
import { useTranslations } from 'next-intl'
import { Link } from '@/i18n/routing'
interface IconButtonProps {
href: string
logEventLabel: string
icon: React.ReactElement
ariaLabel: string
}
const ExchangeLink: React.FC<IconButtonProps> = ({
href,
logEventLabel,
icon,
ariaLabel,
}) => {
return (
<Link
href={href}
target="_blank"
data-ph-capture-attribute-exchange_link_click={logEventLabel}
>
<IconButton
variant="outline"
fontSize="xx-large"
isRound
border="none"
icon={icon}
aria-label={ariaLabel}
minW={0}
/>
</Link>
)
}
const Exchanges = () => {
const t = useTranslations('dashboard.tokenData')
return (
<Flex
direction={{ base: 'row', md: 'column' }}
align={{ base: 'center', md: 'inherit' }}
gap="14px"
px={{ base: '12px', md: '16px' }}
py={'14px'}
rounded="lg"
border="solid 1px "
borderColor="divider"
justify={'space-between'}
>
<ChakraLink
href="/dashboard/swap"
display={'flex'}
alignItems={'center'}
gap={2}
role="group"
>
<Text
color="brandText"
fontSize="14px"
_groupHover={{ textDecoration: 'underline' }}
>
{t('exchanges')}
</Text>
<ArrowIcon />
</ChakraLink>
<Flex alignItems="center" justifyContent="center">
<ExchangeLink
href="https://frax.com/?tokenA=0xfc00000000000000000000000000000000000001&tokenB=0x6efb84bda519726fa1c65558e520b92b51712101&originChainId=252&destinationChainId=252"
logEventLabel="Frax"
icon={
<Fraxswap
w={{ base: '24px', md: '33px' }}
h={{ base: '24px', md: '33px' }}
/>
}
ariaLabel="Frax"
/>
<Divider
orientation="vertical"
color={'gray.200'}
_dark={{ color: 'whiteAlpha.400' }}
mx={{ base: 3, md: 4, lg: 3, xl: 3, '2xl': 4 }}
height={'40px'}
/>
<ExchangeLink
href="https://www.binance.com/en/trade/IQ_USDT?theme=dark&type=spot"
logEventLabel="Binance"
icon={
<BinanceIcon
w={{ base: '24px', md: '33px' }}
h={{ base: '24px', md: '33px' }}
/>
}
ariaLabel="binance"
/>
<Divider
orientation="vertical"
color={'gray.200'}
_dark={{ color: 'whiteAlpha.400' }}
mx={{ base: 3, md: 4, lg: 3, xl: 3, '2xl': 4 }}
height={'40px'}
/>
<ExchangeLink
href="https://app.1inch.io/#/1/simple/swap/USDT/IQ"
logEventLabel="1inch"
icon={
<OneInch
w={{ base: '24px', md: '33px' }}
h={{ base: '24px', md: '33px' }}
/>
}
ariaLabel="One Inch"
/>
<Divider
orientation="vertical"
color={'gray.200'}
_dark={{ color: 'whiteAlpha.400' }}
mx={{ base: 3, md: 4, lg: 3, xl: 3, '2xl': 4 }}
height={'40px'}
/>
<ExchangeLink
href="https://upbit.com/exchange?code=CRIX.UPBIT.KRW-IQ"
logEventLabel="upbit"
icon={
<Upbit
w={{ base: '24px', md: '33px' }}
h={{ base: '24px', md: '33px' }}
/>
}
ariaLabel="Upbit"
/>
</Flex>
</Flex>
)
}
export default Exchanges