Skip to content

Commit 4ef8d93

Browse files
authored
UI/UX: Dropdown DeFi button fixes (#3126)
Resolves #3104
1 parent 01af6ae commit 4ef8d93

File tree

7 files changed

+13
-5
lines changed

7 files changed

+13
-5
lines changed

deploy/tools/envs-validator/schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ const addressMetadataSchema = yup
649649
const deFiDropdownItemSchema: yup.ObjectSchema<DeFiDropdownItem> = yup
650650
.object({
651651
text: yup.string().required(),
652-
icon: yup.string<IconName>().required(),
652+
icon: yup.string<IconName>(),
653653
dappId: yup.string(),
654654
url: yup.string().test(urlTest),
655655
})

icons/multisend.svg

Lines changed: 3 additions & 0 deletions
Loading

icons/revoke.svg

Lines changed: 3 additions & 0 deletions
Loading

public/icons/name.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@
119119
| "moon"
120120
| "MUD_menu"
121121
| "MUD"
122+
| "multisend"
122123
| "name_services"
123124
| "networks"
124125
| "networks/icon-placeholder"
@@ -142,6 +143,7 @@
142143
| "repeat"
143144
| "restAPI"
144145
| "return"
146+
| "revoke"
145147
| "rocket_xl"
146148
| "rocket"
147149
| "RPC"

types/client/deFiDropdown.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { IconName } from 'ui/shared/IconSvg';
22

33
export type DeFiDropdownItem = {
44
text: string;
5-
icon: IconName;
5+
icon?: IconName;
66
} & (
77
{ dappId: string; url?: never } |
88
{ url: string; dappId?: never }

ui/snippets/topBar/DeFiDropdown.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const DeFiDropdown = () => {
4545
<IconSvg name="arrows/east-mini" boxSize={ 4 } ml={ 1 } transform="rotate(-90deg)"/>
4646
</Button>
4747
</PopoverTrigger>
48-
<PopoverContent w="auto">
48+
<PopoverContent w="auto" minW={{ base: 'auto', lg: '132px' }}>
4949
<PopoverBody >
5050
<Flex flexDirection="column" gap={ 1 }>
5151
{ items.map((item, index) => (
@@ -66,7 +66,7 @@ const DeFiDropdown = () => {
6666
asChild
6767
>
6868
<Button onClick={ items[0].onClick } size="2xs">
69-
<IconSvg name={ items[0].icon } boxSize={ 3 } mr={{ base: 0, sm: 1 }}/>
69+
{ items[0].icon && <IconSvg name={ items[0].icon } boxSize={ 3 } mr={{ base: 0, sm: 1 }}/> }
7070
<Box display={{ base: 'none', sm: 'inline' }}>
7171
{ items[0].text }
7272
</Box>

ui/snippets/topBar/DeFiDropdownItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const DeFiDropdownItem = ({ item }: Props) => {
2222
variant="menu"
2323
onClick={ item.onClick }
2424
>
25-
<IconSvg name={ item.icon } boxSize={ 5 } mr={ 2 }/>
25+
{ item.icon && <IconSvg name={ item.icon } boxSize={ 5 } mr={ 2 }/> }
2626
<Text as="span" fontSize="sm">{ item.text }</Text>
2727
</Link>
2828
);

0 commit comments

Comments
 (0)