Skip to content

Commit d03d264

Browse files
authored
Merge pull request #1881 from IndexCoop/chore/refactor-chakra-icon-button
chore: refactor chakra IconButton
2 parents f71fa1d + 8091631 commit d03d264

File tree

2 files changed

+11
-16
lines changed

2 files changed

+11
-16
lines changed

src/components/settings/index.tsx

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import {
22
Flex,
3-
IconButton,
43
Input,
54
Popover,
65
PopoverBody,
76
PopoverContent,
87
PopoverTrigger,
98
} from '@chakra-ui/react'
9+
import { Button } from '@headlessui/react'
1010
import { Cog8ToothIcon } from '@heroicons/react/20/solid'
1111
import { useMemo, useRef, useState } from 'react'
1212

@@ -71,15 +71,9 @@ export const Settings = (props: SettingsProps) => {
7171
return (
7272
<Popover placement='bottom-end'>
7373
<PopoverTrigger>
74-
<IconButton
75-
aria-label='Trade Settings'
76-
icon={
77-
<Cog8ToothIcon className='dark:text-ic-gray-400 text-ic-black m-1.5 size-4' />
78-
}
79-
size='sm'
80-
style={{ border: 0 }}
81-
variant='unstyled'
82-
/>
74+
<Button aria-label='Trade Settings' className='my-0.5 mr-1'>
75+
<Cog8ToothIcon className='dark:text-ic-gray-400 text-ic-black m-1.5 size-4' />
76+
</Button>
8377
</PopoverTrigger>
8478
<PopoverContent
8579
bg={'linear-gradient(187deg, #FCFFFF -184.07%, #F7F8F8 171.05%)'}

src/components/swap/index.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { Flex, IconButton } from '@chakra-ui/react'
1+
import { Flex } from '@chakra-ui/react'
2+
import { Button } from '@headlessui/react'
23
import { ChevronUpDownIcon } from '@heroicons/react/20/solid'
34
import { useAtom } from 'jotai'
45
import { useCallback, useEffect, useState } from 'react'
@@ -225,13 +226,13 @@ export const Swap = (props: SwapProps) => {
225226
}}
226227
/>
227228
<div className='flex h-1.5 self-center'>
228-
<IconButton
229-
className='bg-ic-white text-ic-gray-400'
230-
margin={'-16px 0 0 0'}
229+
<Button
230+
className='text-ic-gray-400 border-ic-gray-400 bg-ic-white hover:bg-ic-gray-100 relative z-50 flex self-center rounded-lg border px-2 py-1'
231231
aria-label='switch input/output tokens'
232-
icon={<ChevronUpDownIcon className='h-7 w-5 text-gray-500' />}
233232
onClick={onSwitchTokens}
234-
/>
233+
>
234+
<ChevronUpDownIcon className='h-7 w-5 text-gray-500' />
235+
</Button>
235236
</div>
236237
<TradeOutput
237238
caption={'You receive'}

0 commit comments

Comments
 (0)