2023-03-24 05:22:29 -07:00
|
|
|
import { ChevronDownIcon } from '@heroicons/react/20/solid'
|
2023-07-04 21:40:47 -07:00
|
|
|
import { ReactNode } from 'react'
|
2023-05-13 05:17:04 -07:00
|
|
|
import { formatTokenSymbol } from 'utils/tokens'
|
2023-03-24 05:22:29 -07:00
|
|
|
|
|
|
|
const TokenListButton = ({
|
2023-07-04 21:40:47 -07:00
|
|
|
logo,
|
2023-03-24 05:22:29 -07:00
|
|
|
token,
|
|
|
|
setShowList,
|
|
|
|
}: {
|
2023-07-04 21:40:47 -07:00
|
|
|
logo: ReactNode
|
2023-03-24 05:22:29 -07:00
|
|
|
token: string
|
|
|
|
setShowList: (x: boolean) => void
|
|
|
|
}) => {
|
|
|
|
return (
|
|
|
|
<button
|
|
|
|
onClick={() => setShowList(true)}
|
2023-08-17 16:47:11 -07:00
|
|
|
className="flex h-full w-full items-center rounded-lg rounded-r-none border border-r-0 border-th-input-border bg-th-input-bkg px-3 py-2 text-th-fgd-2 focus-visible:bg-th-bkg-2 md:hover:cursor-pointer md:hover:bg-th-bkg-2 md:hover:text-th-fgd-1"
|
2023-03-24 05:22:29 -07:00
|
|
|
>
|
2023-07-04 21:40:47 -07:00
|
|
|
<div className="mr-2.5 flex min-w-[24px] items-center">{logo}</div>
|
2023-03-24 05:22:29 -07:00
|
|
|
<div className="flex w-full items-center justify-between">
|
2023-05-13 05:17:04 -07:00
|
|
|
<div className="text-xl font-bold">{formatTokenSymbol(token)}</div>
|
2023-03-24 05:22:29 -07:00
|
|
|
<ChevronDownIcon className="h-6 w-6" />
|
|
|
|
</div>
|
|
|
|
</button>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default TokenListButton
|