@@ -223,6 +223,9 @@ export function MeDropdown ({ me, dropNavKey }) {
223
223
)
224
224
}
225
225
226
+ // this is the width of the 'switch account' button if no width is given
227
+ const SWITCH_ACCOUNT_BUTTON_WIDTH = '162px'
228
+
226
229
export function SignUpButton ( { className = 'py-0' , width } ) {
227
230
const router = useRouter ( )
228
231
const handleLogin = useCallback ( async pathname => await router . push ( {
@@ -233,7 +236,8 @@ export function SignUpButton ({ className = 'py-0', width }) {
233
236
return (
234
237
< Button
235
238
className = { classNames ( 'align-items-center ps-2 pe-3' , className ) }
236
- style = { { borderWidth : '2px' , width : width || '150px' } }
239
+ // 161px is the width of the 'switch account' button
240
+ style = { { borderWidth : '2px' , width : width || SWITCH_ACCOUNT_BUTTON_WIDTH } }
237
241
id = 'signup'
238
242
onClick = { ( ) => handleLogin ( '/signup' ) }
239
243
>
@@ -257,7 +261,7 @@ export default function LoginButton () {
257
261
< Button
258
262
className = 'align-items-center px-3 py-1'
259
263
id = 'login'
260
- style = { { borderWidth : '2px' , width : '150px' } }
264
+ style = { { borderWidth : '2px' , width : SWITCH_ACCOUNT_BUTTON_WIDTH } }
261
265
variant = 'outline-grey-darkmode'
262
266
onClick = { ( ) => handleLogin ( '/login' ) }
263
267
>
@@ -344,7 +348,7 @@ function SwitchAccountButton ({ handleClose }) {
344
348
< Button
345
349
className = 'align-items-center px-3 py-1'
346
350
variant = 'outline-grey-darkmode'
347
- style = { { borderWidth : '2px' , width : '150px' } }
351
+ style = { { borderWidth : '2px' , width : SWITCH_ACCOUNT_BUTTON_WIDTH } }
348
352
onClick = { ( ) => {
349
353
// login buttons rendered in offcanvas aren't wrapped inside <Dropdown>
350
354
// so we manually close the offcanvas in that case by passing down handleClose here
0 commit comments