💄(frontend) position the login hint dynamically next to the button

Compute the position of the login hint at render time so it is
always displayed close to the login button, regardless of the
button's placement or the current viewport size.
This commit is contained in:
lebaudantoine
2026-09-06 23:09:41 +02:00
committed by aleb_the_flash
parent 7844dfcc12
commit e1cc8105db
2 changed files with 8 additions and 15 deletions
+1
View File
@@ -32,6 +32,7 @@ and this project adheres to
- ⚡️(frontend) add trailing slash on the /me endpoint call
- ⚡️(backend) refactor lobby storage to bound key lookups per room
- ⚡️(backend) refactor presence cache to bound key lookups per room
- 💄(frontend) position the login hint dynamically next to the button
## [1.30.0] - 2026-09-01
+7 -15
View File
@@ -35,30 +35,21 @@ const LoginHint = () => {
<div
className={css({
position: 'absolute',
top: '103px',
right: '110px',
top: 'calc(100% + 12px)',
right: 0,
zIndex: '100',
outline: 'none',
padding: '1.25rem',
maxWidth: '350px',
width: 'max-content',
maxWidth: 'min(350px, calc(100vw - 2rem))',
boxShadow: '0 2px 5px rgba(0 0 0 / 0.1)',
borderRadius: '1rem',
backgroundColor: 'primary.200',
display: 'none',
xsm: {
display: 'block',
},
sm: {
top: '131px',
right: '100px',
zIndex: '100',
},
_after: {
content: '""',
position: 'absolute',
top: '-10px',
right: '20%',
marginLeft: '-10px',
right: '1.5rem',
borderWidth: '0 10px 10px 10px',
borderStyle: 'solid',
borderColor: 'transparent transparent #E3E3FB transparent',
@@ -171,12 +162,13 @@ export const Header = () => {
<>
<div
className={css({
position: 'relative',
display: { base: 'none', xsm: 'block' },
})}
>
<LoginButton proConnectHint={false} />
<LoginHint />
</div>
<LoginHint />
</>
)}
{!!user && (