Skip to content

Commit 65ab8cc

Browse files
authored
feat(dapp): add name options styles (#414)
* feat(dapp): add DropdownMenuOptions * feat(dapp): enhance dropdown menu with additional options * feat(dapp): add text styles * feat(dapp): update dropdown options * chore(dapp): remove dropdown option * chore(dapp): comment out non-functional options * chore(dapp): reduce dropdown min-width
1 parent c6c4cf5 commit 65ab8cc

File tree

2 files changed

+63
-11
lines changed

2 files changed

+63
-11
lines changed

dapp/src/app/(protected)/my-names/page.tsx

Lines changed: 47 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,24 @@
33

44
'use client';
55

6-
import { Settings, Warning } from '@iota/apps-ui-icons';
6+
import {
7+
// Add,
8+
// Assets,
9+
// Calendar,
10+
// Delete,
11+
// Info,
12+
// Link,
13+
// Pined,
14+
Settings,
15+
Warning,
16+
} from '@iota/apps-ui-icons';
717
import { Button, ButtonType, Title } from '@iota/apps-ui-kit';
818
import { useMemo, useState } from 'react';
919

1020
import { UserAuctions } from '@/auctions/components/UserAuctions';
1121
import { DeleteNameDialog, UpdateNameDialog } from '@/components';
1222
import { CreateSubnameDialog } from '@/components/dialogs/CreateSubnameDialog';
23+
import { DropdownMenuOption } from '@/components/DropdownMenuOptions';
1324
import { NameCard } from '@/components/name-card/NameCard';
1425
import { NameCardBody } from '@/components/name-card/NameCardBody';
1526
import { SubnameCountIndicator } from '@/components/name-card/NameCardIndicators';
@@ -43,23 +54,48 @@ export default function MyNamesPage(): JSX.Element {
4354
const renderMenuOptions = (nft: RegistrationNft): MenuListItem[] => [
4455
{
4556
onClick: () => setUpdateNameDialog(nft.name),
46-
children: (
47-
<div className="flex flex-row gap-xxs items-center justify-center">
48-
<Settings /> Manage
49-
</div>
50-
),
57+
children: <DropdownMenuOption icon={<Settings />} label="Manage" />,
5158
hideBottomBorder: true,
5259
},
60+
// {
61+
// onClick: () => {},
62+
// children: <DropdownMenuOption icon={<Pined />} label="Make name default" />,
63+
// hideBottomBorder: true,
64+
// },
5365
{
5466
onClick: () => setDeleteNameDialog(nft),
55-
children: (
56-
<div className="flex flex-row gap-xxs items-center justify-center">
57-
<Warning /> Delete
58-
</div>
59-
),
67+
children: <DropdownMenuOption icon={<Warning />} label="Delete" />,
6068
isHidden: !(nft.isExpired && !namesWithChildren.has(nft.name)),
6169
hideBottomBorder: true,
6270
},
71+
// {
72+
// onClick: () => {},
73+
// children: <DropdownMenuOption icon={<Assets />} label="Personalize Avatar" />,
74+
// hideBottomBorder: true,
75+
// },
76+
// {
77+
// onClick: () => {},
78+
// children: <DropdownMenuOption icon={<Delete />} label="Remove Avatar" />,
79+
// isDisabled: true,
80+
// },
81+
// {
82+
// onClick: () => {},
83+
// children: <DropdownMenuOption icon={<Add />} label="Create Subname" />,
84+
// },
85+
// {
86+
// onClick: () => {},
87+
// children: <DropdownMenuOption icon={<Link />} label="Link to Wallet Address" />,
88+
// },
89+
// {
90+
// onClick: () => {},
91+
// children: <DropdownMenuOption icon={<Calendar />} label="Renew Name" />,
92+
// hideBottomBorder: true,
93+
// },
94+
// {
95+
// onClick: () => {},
96+
// children: <DropdownMenuOption icon={<Info />} label="View All Info" />,
97+
// hideBottomBorder: true,
98+
// },
6399
];
64100

65101
return (
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Copyright (c) 2025 IOTA Stiftung
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
interface DropdownMenuOptionProps {
5+
icon: JSX.Element;
6+
label: string;
7+
}
8+
9+
export function DropdownMenuOption({ icon, label }: DropdownMenuOptionProps) {
10+
return (
11+
<div className="flex items-center gap-sm min-w-[228px] text-body-lg text-names-neutral-92">
12+
<span className="[&_svg]:h-6 [&_svg]:w-6">{icon}</span>
13+
<span>{label}</span>
14+
</div>
15+
);
16+
}

0 commit comments

Comments
 (0)