@@ -8,12 +8,10 @@ import { DevicesIcon, LanguagesIcon } from "@/components/icons/wallets"
88import { Image } from "@/components/Image"
99import { SupportedLanguagesTooltip } from "@/components/SupportedLanguagesTooltip"
1010
11- import { breakpointAsNumber } from "@/lib/utils/screen"
1211import { formatStringList , getWalletPersonas } from "@/lib/utils/wallets"
1312
1413import { NUMBER_OF_SUPPORTED_LANGUAGES_SHOWN } from "@/lib/constants"
1514
16- import MediaQuery from "../MediaQuery"
1715import { ButtonLink } from "../ui/buttons/Button"
1816import { TagsInlineText } from "../ui/tag"
1917
@@ -59,120 +57,79 @@ const WalletInfo = ({ wallet }: WalletInfoProps) => {
5957 } , [ wallet . supportedLanguages ] )
6058
6159 return (
62- < div className = "flex flex-col gap-4" >
60+ < div className = "relative flex flex-col gap-4" >
61+ { /* Open-state stripe (desktop only), sits in the image-column gutter. */ }
62+ < div
63+ aria-hidden
64+ className = { `pointer-events-none absolute inset-s-7 top-16 -bottom-9 hidden w-1 -translate-x-1/2 lg:group-[[open]]/collapsible:block rtl:translate-x-1/2 ${ wallet . twBackgroundColor } ` }
65+ />
66+
6367 < div className = "flex flex-row items-center justify-between gap-4" >
64- < div className = "flex flex-col gap-4" >
65- { /* Desktop layout */ }
66- < MediaQuery queries = { [ `(min-width: ${ breakpointAsNumber . lg } px)` ] } >
67- < div className = "hidden flex-row gap-4 lg:flex" >
68- < Image
69- src = { wallet . image }
70- alt = ""
71- style = { { objectFit : "contain" , width : "56px" , height : "56px" } }
72- />
73- < div className = "flex flex-col gap-2" >
74- < p className = "text-xl font-bold" > { wallet . name } </ p >
75-
76- < PersonaTags walletPersonas = { walletPersonas } />
77-
78- < div
79- className = { `ms-2 ${ walletPersonas . length === 0 ? "mb-4" : "" } mt-1` }
80- >
81- < ChainImages
82- chains = { wallet . supported_chains as ChainName [ ] }
83- className = { `ms-2 ${ walletPersonas . length === 0 ? "mb-4" : "" } ` }
84- />
85- </ div >
86- </ div >
87- </ div >
88- </ MediaQuery >
89-
90- { /* Mobile layout */ }
91- < MediaQuery queries = { [ `(max-width: ${ breakpointAsNumber . lg - 1 } px)` ] } >
92- < div className = "flex flex-col gap-4 lg:hidden" >
93- < div className = "flex flex-row items-center gap-4" >
94- < Image
95- src = { wallet . image }
96- alt = ""
97- style = { {
98- objectFit : "contain" ,
99- width : "24px" ,
100- height : "24px" ,
101- } }
102- />
103- < p className = "text-xl font-bold" > { wallet . name } </ p >
104- </ div >
105- < div >
106- < PersonaTags walletPersonas = { walletPersonas } />
107- </ div >
108- < ChainImages
109- chains = { wallet . supported_chains as ChainName [ ] }
110- className = { walletPersonas . length === 0 ? "mb-4" : "" }
111- />
68+ < div className = "grid flex-1 grid-cols-[auto_1fr] items-start gap-x-4 gap-y-2" >
69+ < Image
70+ src = { wallet . image }
71+ alt = ""
72+ className = "size-6 self-center object-contain lg:row-span-full lg:size-14 lg:self-start"
73+ />
74+
75+ < p className = "self-center text-xl font-bold lg:self-start" >
76+ { wallet . name }
77+ </ p >
78+
79+ { walletPersonas . length > 0 && (
80+ < div className = "col-span-2 lg:col-span-1 lg:col-start-2" >
81+ < PersonaTags walletPersonas = { walletPersonas } />
11282 </ div >
113- </ MediaQuery >
83+ ) }
84+
85+ < div className = "col-span-2 lg:col-span-1 lg:col-start-2" >
86+ < ChainImages chains = { wallet . supported_chains as ChainName [ ] } />
87+ </ div >
11488
115- < div className = "flex flex-row gap-4" >
116- < div className = "relative hidden w-14 lg:block" >
117- < div
118- className = { `absolute -top-0 -bottom-9 left-1/2 hidden w-1 -translate-x-1/2 transform group-data-[state=open]/collapsible:block ${ wallet . twBackgroundColor } ` }
119- />
89+ { deviceLabels . length > 0 && (
90+ < div className = "col-span-2 flex flex-row gap-2 lg:col-span-1 lg:col-start-2" >
91+ < DevicesIcon className = "size-6" />
92+ < TagsInlineText list = { deviceLabels } />
12093 </ div >
121- < div
122- className = { `flex flex-col gap-2 ${ walletPersonas . length === 0 ? "-mt-4" : "" } ` }
123- >
124- { deviceLabels . length > 0 && (
125- < div className = "flex flex-row gap-2" >
126- < DevicesIcon className = "size-6" />
127- < TagsInlineText list = { deviceLabels } />
128- </ div >
94+ ) }
95+
96+ < div className = "col-span-2 flex flex-row gap-2 lg:col-span-1 lg:col-start-2" >
97+ < LanguagesIcon className = "size-6" />
98+ < p className = "text-md" >
99+ { formattedLanguages } { " " }
100+ { hasExtraLanguages && (
101+ < SupportedLanguagesTooltip
102+ supportedLanguages = { wallet . supportedLanguages }
103+ />
129104 ) }
130- < div className = "flex flex-row gap-2" >
131- < LanguagesIcon className = "size-6" />
132- < p className = "text-md" >
133- { formattedLanguages } { " " }
134- { hasExtraLanguages && (
135- < SupportedLanguagesTooltip
136- supportedLanguages = { wallet . supportedLanguages }
137- />
138- ) }
139- </ p >
140- </ div >
141- </ div >
105+ </ p >
142106 </ div >
143107 </ div >
144- < div >
145- < button className = "text-primary" >
146- < ChevronUp className = "text-2xl group-data-[state=closed]/collapsible:hidden" />
147- < ChevronDown className = "text-2xl group-data-[state=open]/collapsible:hidden" />
148- </ button >
149- </ div >
108+
109+ < span className = "text-primary" >
110+ < ChevronUp className = "text-2xl group-[&:not([open])]/collapsible:hidden" />
111+ < ChevronDown className = "text-2xl group-[[open]]/collapsible:hidden" />
112+ </ span >
150113 </ div >
151- < div className = "flex flex-row gap-4" >
152- < div className = "relative hidden w-14 lg:block" >
153- < div
154- className = { `absolute -top-0 -bottom-9 left-1/2 hidden w-1 -translate-x-1/2 transform group-data-[state=open]/collapsible:block ${ wallet . twBackgroundColor } ` }
155- />
156- </ div >
157- < div className = "flex flex-1" >
158- < ButtonLink
159- href = { wallet . url }
160- variant = "outline"
161- className = "p-2 max-sm:w-full"
162- size = "sm"
163- customEventOptions = { {
164- eventCategory : "WalletExternalLinkList" ,
165- eventAction : "Tap main button" ,
166- eventName : `${ wallet . name } ` ,
167- } }
168- onClick = { ( e ) => {
169- // Prevent expanding the wallet more info section when clicking on the "Visit website" button
170- e . stopPropagation ( )
171- } }
172- >
173- { t ( "page-find-wallet-visit-website" ) }
174- </ ButtonLink >
175- </ div >
114+
115+ < div className = "lg:ps-18" >
116+ < ButtonLink
117+ href = { wallet . url }
118+ variant = "outline"
119+ className = "p-2 max-sm:w-full"
120+ size = "sm"
121+ customEventOptions = { {
122+ eventCategory : "WalletExternalLinkList" ,
123+ eventAction : "Tap main button" ,
124+ eventName : `${ wallet . name } ` ,
125+ } }
126+ onClick = { ( e ) => {
127+ // Prevent expanding the wallet more info section when clicking on the "Visit website" button
128+ e . stopPropagation ( )
129+ } }
130+ >
131+ { t ( "page-find-wallet-visit-website" ) }
132+ </ ButtonLink >
176133 </ div >
177134 </ div >
178135 )
0 commit comments