Skip to content

Commit

Permalink
chore: add hover and refactor metod dropdown layout
Browse files Browse the repository at this point in the history
  • Loading branch information
edis committed Apr 24, 2024
1 parent 72b4cfe commit 7d31850
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,25 +64,21 @@ export function DropdownButton({
<button
type="button"
className={clsx(
'md:text-md block w-full rounded-full py-2 text-sm',
'md:text-md block w-full rounded-full py-2 px-1 text-sm',
isActive ? variants[variant] : null,
selected ? variantsSelected[variant] : variantsSelectedElse[variant]
)}
onClick={() => handleBtn(children as string)}
onMouseEnter={handleMouseEnter}
onMouseLeave={handleMouseLeave}
>
<div className="grid grid-cols-6">
<span>
{selected ? (
<CheckIcon className="ml-3 h-4 w-4 lg:h-5 lg:w-5" />
) : (
''
)}
</span>
<span className="col-span-4 col-start-2 text-center">
<div className="grid grid-cols-8 items-center px-1">
<span className="col-span-6 flex justify-start items-center">
{children === 'did:key:jwk_jcs-pub' ? 'did:key (EBSI)' : children}
</span>
<span className="col-span-2">
{selected && <CheckIcon className="ml-3 h-4 w-4 lg:h-5 lg:w-5" />}
</span>
</div>
</button>
</DropdownMenuItem>
Expand Down
6 changes: 3 additions & 3 deletions packages/dapp/src/components/MethodDropdownMenu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,10 @@ export default function MethodDropdownMenu() {
<DropdownMenu onOpenChange={() => setOpen(!open)}>
<DropdownMenuTrigger
className={clsx(
'dark:text-navy-blue-400 text-h5 font-ubuntu animated-transition inline-flex w-full justify-center rounded-3xl px-4 py-2 font-thin text-gray-600 outline-none focus:outline-none focus-visible:outline-none',
'dark:text-navy-blue-400 text-h5 font-ubuntu animated-transition inline-flex justify-center items-center rounded-3xl px-4 py-2 font-thin text-gray-600 outline-none focus:outline-none focus-visible:outline-none',
open
? 'dark:bg-navy-blue-800 bg-orange-100/50'
: 'dark:hover:bg-navy-blue-800 hover:bg-orange-100/50'
: 'dark:hover:bg-navy-blue-800 hover:bg-white/50'
)}
disabled={currMethod === null}
>
Expand All @@ -126,7 +126,7 @@ export default function MethodDropdownMenu() {
{currMethod && (
<ChevronDownIcon
className={clsx(
'dark:text-navy-blue-400 animated-transition ml-2 mr-2 h-5 w-5 text-gray-600',
'dark:text-navy-blue-400 animated-transition ml-1 h-5 w-5 text-gray-600',
open ? 'rotate-180' : ''
)}
/>
Expand Down
6 changes: 3 additions & 3 deletions packages/dapp/src/components/NetworkDropDownMenu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export default function NetworkDropDownMenu({
<DropdownMenu onOpenChange={() => setOpen(!open)}>
<DropdownMenuTrigger
className={clsx(
'animated-transition flex items-center justify-center focus:outline-none',
'animated-transition flex items-center justify-center focus:outline-none hover:bg-white/50',
variants[variant],
sizes[size],
`rounded-${rounded}`,
Expand All @@ -117,7 +117,7 @@ export default function NetworkDropDownMenu({
open ? variantsHover[variant] : ''
)}
>
<div className="flex items-center justify-center p-1">
<div className="flex items-center justify-center">
{selected && (
<Image
src={items.find((item) => item.name === selected)?.logo ?? ''}
Expand All @@ -135,7 +135,7 @@ export default function NetworkDropDownMenu({
<div>
{selected && (
<ChevronDownIcon
className={`animated-transition h-5 w-5 ml-2 mr-2 ${
className={`animated-transition h-5 w-5 ml-2 ${
open ? 'rotate-180 ' : ''
}`}
aria-hidden="true"
Expand Down

0 comments on commit 7d31850

Please sign in to comment.