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" ;
82import styled , { useTheme } from "styled-components" ;
93import SimpleBar from "simplebar-react" ;
104import { ColorPalette } from "../../../../styles" ;
11- import { Subtitle3 } from "../../../../components/typography" ;
125import { useStore } from "../../../../stores" ;
136import { KeyInfo } from "@keplr-wallet/background" ;
147import { observer } from "mobx-react-lite" ;
@@ -21,8 +14,12 @@ import { ReferenceType, UseFloatingReturn } from "@floating-ui/react-dom";
2114import { FloatModal } from "../../../../components/float-modal" ;
2215import { useSearchKeyInfos } from "../../../../hooks/use-search-key-infos" ;
2316import { useGetAllSortedKeyInfos } from "../../../../hooks/key-info" ;
24- import { IconProps } from "../../../../components/icon/types" ;
17+ import {
18+ SettingOutlineIcon ,
19+ PlusStrokeIcon ,
20+ } from "../../../../components/icon" ;
2521import { Box } from "../../../../components/box" ;
22+ import { useNavigate } from "react-router" ;
2623import { Stack } from "../../../../components/stack" ;
2724import { 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-
213229const 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