Skip to content

Commit 596c8d7

Browse files
jungcome7claude
andcommitted
feat: add setting icon to account switch modal and update plus icon
- Add SettingOutlineIcon (gear) to account switch dropdown title - Clicking gear navigates to /wallet/select for account ordering - Replace fill-based plus icon with stroke-based design system icon - Update title typography to Semi Bold 14px (lh 1.4, ls -0.14px) - Add 8px spacing below title row - Apply hovered_1 style (0.7 opacity) on icon hover - Icons exported from Figma REST API (nodes 5612:26339, 5612:26343) KEPLR-2012 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d806e87 commit 596c8d7

File tree

4 files changed

+147
-58
lines changed

4 files changed

+147
-58
lines changed

apps/extension/src/components/icon/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export * from "./loading";
3030
export * from "./menu";
3131
export * from "./percentage";
3232
export * from "./plus";
33+
export * from "./plus-stroke";
3334
export * from "./profile";
3435
export * from "./profile-circle";
3536
export * from "./profile-outlined";
@@ -38,6 +39,7 @@ export * from "./right-arrow";
3839
export * from "./rocket-launch";
3940
export * from "./search";
4041
export * from "./setting";
42+
export * from "./setting-outline";
4143
export * from "./star";
4244
export * from "./shield-exclamation";
4345
export * from "./trash";
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import React, { FunctionComponent } from "react";
2+
import { IconProps } from "./types";
3+
4+
export const PlusStrokeIcon: FunctionComponent<IconProps> = ({
5+
width = "1.5rem",
6+
height = "1.5rem",
7+
color,
8+
}) => {
9+
return (
10+
<svg
11+
width={width}
12+
height={height}
13+
viewBox="0 0 24 24"
14+
fill="none"
15+
xmlns="http://www.w3.org/2000/svg"
16+
>
17+
<path
18+
d="M12 5V19M5 12H19"
19+
stroke={color || "currentColor"}
20+
strokeWidth="2"
21+
strokeLinecap="round"
22+
strokeLinejoin="round"
23+
/>
24+
</svg>
25+
);
26+
};
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import React, { FunctionComponent } from "react";
2+
import { IconProps } from "./types";
3+
4+
export const SettingOutlineIcon: FunctionComponent<IconProps> = ({
5+
width = "1.5rem",
6+
height = "1.5rem",
7+
color,
8+
}) => {
9+
return (
10+
<svg
11+
width={width}
12+
height={height}
13+
viewBox="0 0 24 24"
14+
fill="none"
15+
xmlns="http://www.w3.org/2000/svg"
16+
>
17+
<path
18+
d="M9.59353 3.94017C9.68394 3.39771 10.1533 3.00012 10.7032 3.00012H13.2972C13.8471 3.00012 14.3165 3.39771 14.4069 3.94017L14.6204 5.22122C14.6827 5.59527 14.9327 5.90683 15.2645 6.09048C15.3386 6.13154 15.412 6.17396 15.4844 6.21769C15.8094 6.41396 16.2048 6.47499 16.5603 6.34178L17.7772 5.8859C18.2922 5.69297 18.8712 5.90063 19.1461 6.3769L20.4431 8.62333C20.7181 9.0996 20.6084 9.70485 20.1839 10.0544L19.1795 10.8812C18.887 11.122 18.742 11.4938 18.749 11.8727C18.7498 11.915 18.7502 11.9575 18.7502 12.0001C18.7502 12.0427 18.7498 12.0852 18.749 12.1276C18.742 12.5064 18.887 12.8782 19.1795 13.119L20.1839 13.9458C20.6084 14.2954 20.7181 14.9006 20.4431 15.3769L19.1461 17.6233C18.8712 18.0996 18.2922 18.3073 17.7772 18.1143L16.5603 17.6585C16.2048 17.5252 15.8094 17.5863 15.4844 17.7825C15.412 17.8263 15.3386 17.8687 15.2645 17.9098C14.9327 18.0934 14.6827 18.405 14.6204 18.779L14.4069 20.0601C14.3165 20.6025 13.8471 21.0001 13.2972 21.0001H10.7032C10.1533 21.0001 9.68394 20.6025 9.59353 20.0601L9.38002 18.779C9.31768 18.405 9.06771 18.0934 8.73594 17.9098C8.66176 17.8687 8.58844 17.8263 8.51601 17.7826C8.19098 17.5863 7.79565 17.5253 7.44008 17.6585L6.22322 18.1143C5.70822 18.3073 5.12923 18.0996 4.85426 17.6233L3.55728 15.3769C3.28231 14.9006 3.39196 14.2954 3.81654 13.9459L4.82089 13.119C5.1134 12.8782 5.2584 12.5064 5.25138 12.1276C5.2506 12.0852 5.2502 12.0427 5.2502 12.0001C5.2502 11.9575 5.2506 11.9151 5.25138 11.8727C5.2584 11.4939 5.1134 11.122 4.82089 10.8812L3.81654 10.0544C3.39196 9.70487 3.28231 9.09961 3.55728 8.62335L4.85426 6.37691C5.12923 5.90065 5.70822 5.69298 6.22321 5.88591L7.44007 6.34179C7.79563 6.475 8.19096 6.41397 8.516 6.2177C8.58843 6.17396 8.66176 6.13154 8.73594 6.09048C9.06771 5.90683 9.31768 5.59527 9.38002 5.22122L9.59353 3.94017Z"
19+
stroke={color || "currentColor"}
20+
strokeWidth="1.5"
21+
strokeLinecap="round"
22+
strokeLinejoin="round"
23+
/>
24+
<path
25+
d="M15 12C15 13.6569 13.6568 15 12 15C10.3431 15 8.99997 13.6569 8.99997 12C8.99997 10.3432 10.3431 9.00004 12 9.00004C13.6568 9.00004 15 10.3432 15 12Z"
26+
stroke={color || "currentColor"}
27+
strokeWidth="1.5"
28+
strokeLinecap="round"
29+
strokeLinejoin="round"
30+
/>
31+
</svg>
32+
);
33+
};

apps/extension/src/pages/main/components/account-switch-float-modal/index.tsx

Lines changed: 86 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
1-
import React, {
2-
FunctionComponent,
3-
useCallback,
4-
useEffect,
5-
useRef,
6-
useState,
7-
} from "react";
1+
import React, { useCallback, useEffect, useRef, useState } from "react";
82
import styled, { useTheme } from "styled-components";
93
import SimpleBar from "simplebar-react";
104
import { ColorPalette } from "../../../../styles";
11-
import { Subtitle3 } from "../../../../components/typography";
125
import { useStore } from "../../../../stores";
136
import { KeyInfo } from "@keplr-wallet/background";
147
import { observer } from "mobx-react-lite";
@@ -21,8 +14,12 @@ import { ReferenceType, UseFloatingReturn } from "@floating-ui/react-dom";
2114
import { FloatModal } from "../../../../components/float-modal";
2215
import { useSearchKeyInfos } from "../../../../hooks/use-search-key-infos";
2316
import { useGetAllSortedKeyInfos } from "../../../../hooks/key-info";
24-
import { IconProps } from "../../../../components/icon/types";
17+
import {
18+
SettingOutlineIcon,
19+
PlusStrokeIcon,
20+
} from "../../../../components/icon";
2521
import { Box } from "../../../../components/box";
22+
import { useNavigate } from "react-router";
2623
import { Stack } from "../../../../components/stack";
2724
import { AccountItemSwitchModal } from "./account-item";
2825

@@ -46,6 +43,7 @@ export const AccountSwitchFloatModal = observer(
4643
const searchInputRef = useRef<HTMLInputElement>(null);
4744
const intl = useIntl();
4845
const theme = useTheme();
46+
const navigate = useNavigate();
4947
const { searchText, setSearchText, searchedKeyInfos } = useSearchKeyInfos();
5048

5149
const closeModalInner = useCallback(() => {
@@ -109,9 +107,29 @@ export const AccountSwitchFloatModal = observer(
109107
ref={floating.refs.setFloating}
110108
>
111109
<Styles.TitleContainer>
112-
<Subtitle3>
110+
<Styles.TitleText>
113111
{intl.formatMessage({ id: "page.wallet.title" })}
114-
</Subtitle3>
112+
</Styles.TitleText>
113+
<Box
114+
cursor="pointer"
115+
hover={{
116+
opacity: COMMON_HOVER_OPACITY,
117+
}}
118+
onClick={() => {
119+
closeModalInner();
120+
navigate("/wallet/select");
121+
}}
122+
>
123+
<SettingOutlineIcon
124+
width="1.5rem"
125+
height="1.5rem"
126+
color={
127+
theme.mode === "light"
128+
? ColorPalette["gray-700"]
129+
: ColorPalette["gray-10"]
130+
}
131+
/>
132+
</Box>
115133
<Box
116134
cursor="pointer"
117135
hover={{
@@ -123,9 +141,18 @@ export const AccountSwitchFloatModal = observer(
123141
});
124142
}}
125143
>
126-
<_PlusIcon width="1.5rem" height="1.5rem" />
144+
<PlusStrokeIcon
145+
width="1.5rem"
146+
height="1.5rem"
147+
color={
148+
theme.mode === "light"
149+
? ColorPalette["gray-700"]
150+
: ColorPalette["gray-10"]
151+
}
152+
/>
127153
</Box>
128154
</Styles.TitleContainer>
155+
<Gutter size="0.5rem" />
129156

130157
<SimpleBar
131158
style={{
@@ -135,33 +162,39 @@ export const AccountSwitchFloatModal = observer(
135162
}}
136163
>
137164
{shouldShowSearch && (
138-
<Styles.SearchContainer>
139-
<SearchTextInput
140-
ref={searchInputRef}
141-
value={searchText}
142-
onChange={(e) => {
143-
e.preventDefault();
144-
setSearchText(e.target.value);
145-
}}
146-
placeholder="Search"
147-
placeholderColor={
148-
theme.mode === "dark"
149-
? ColorPalette["gray-300"]
150-
: undefined
151-
}
152-
iconColor={
153-
theme.mode === "dark"
154-
? ColorPalette["gray-300"]
155-
: undefined
156-
}
157-
textInputContainerStyle={{
158-
backgroundColor: "transparent",
159-
}}
160-
inputStyle={{
161-
backgroundColor: "transparent",
162-
}}
163-
/>
164-
</Styles.SearchContainer>
165+
<React.Fragment>
166+
<Styles.SearchContainer>
167+
<SearchTextInput
168+
ref={searchInputRef}
169+
value={searchText}
170+
onChange={(e) => {
171+
e.preventDefault();
172+
setSearchText(e.target.value);
173+
}}
174+
placeholder="Search"
175+
placeholderColor={
176+
theme.mode === "dark"
177+
? ColorPalette["gray-300"]
178+
: undefined
179+
}
180+
iconColor={
181+
theme.mode === "dark"
182+
? ColorPalette["gray-300"]
183+
: undefined
184+
}
185+
textInputContainerStyle={{
186+
backgroundColor: "transparent",
187+
borderRadius: "1rem",
188+
minHeight: "3.75rem",
189+
}}
190+
inputStyle={{
191+
backgroundColor: "transparent",
192+
height: "3.75rem",
193+
}}
194+
/>
195+
</Styles.SearchContainer>
196+
<Gutter size="0.75rem" />
197+
</React.Fragment>
165198
)}
166199
<Stack gutter="0.5rem">
167200
{sortedKeyInfos.map((keyInfo) => {
@@ -193,23 +226,6 @@ export const AccountSwitchFloatModal = observer(
193226
}
194227
);
195228

196-
const _PlusIcon: FunctionComponent<IconProps> = ({ width, height, color }) => {
197-
return (
198-
<svg
199-
xmlns="http://www.w3.org/2000/svg"
200-
width={width}
201-
height={height}
202-
viewBox="0 0 24 24"
203-
fill="none"
204-
>
205-
<path
206-
d="M12.9 5.69993C12.9 5.20287 12.4971 4.79993 12 4.79993C11.503 4.79993 11.1 5.20287 11.1 5.69993V11.0999H5.70005C5.20299 11.0999 4.80005 11.5029 4.80005 11.9999C4.80005 12.497 5.20299 12.8999 5.70005 12.8999L11.1 12.8999V18.2999C11.1 18.797 11.503 19.1999 12 19.1999C12.4971 19.1999 12.9 18.797 12.9 18.2999V12.8999H18.3C18.7971 12.8999 19.2 12.497 19.2 11.9999C19.2 11.5029 18.7971 11.0999 18.3 11.0999H12.9V5.69993Z"
207-
fill={color || "currentColor"}
208-
/>
209-
</svg>
210-
);
211-
};
212-
213229
const Styles = {
214230
ModalContainer: styled.div<{
215231
top: number;
@@ -239,16 +255,28 @@ const Styles = {
239255
`,
240256

241257
TitleContainer: styled.div`
242-
padding: 0 0.5rem 0.25rem 0.5rem;
258+
padding: 0.5rem 0.5rem 0.25rem 0.5rem;
243259
display: flex;
244260
flex-direction: row;
245-
justify-content: space-between;
246261
align-items: center;
262+
gap: 0.75rem;
247263
248264
color: ${({ theme }) =>
249265
theme.mode === "light" ? ColorPalette["gray-700"] : ColorPalette.white};
250266
`,
251267

268+
TitleText: styled.div`
269+
flex: 1;
270+
font-weight: 600;
271+
font-size: 0.875rem;
272+
line-height: 1.4;
273+
letter-spacing: -0.14px;
274+
color: ${({ theme }) =>
275+
theme.mode === "light"
276+
? ColorPalette["gray-700"]
277+
: ColorPalette["gray-10"]};
278+
`,
279+
252280
SearchContainer: styled.div`
253281
padding: 0 0.3125rem;
254282
margin: 0.5rem 0;

0 commit comments

Comments
 (0)