Skip to content

Commit 242901d

Browse files
authored
tweak(styles): header back button hovers micro-interaction
Co-authored-by: ux-git <ux-git@users.noreply.github.com>
1 parent 0ff6fdd commit 242901d

File tree

5 files changed

+46
-12
lines changed

5 files changed

+46
-12
lines changed

src/components/button/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ const Button: FC<ButtonPropsType> = (props) => {
202202
href={props.href}
203203
sx={{
204204
cursor: 'pointer',
205-
minHeight: props.minHeight ? `${props.minHeight}px` : '44px',
205+
minHeight: props.minHeight ? `${props.minHeight}px` : '40px',
206206
fontFeatureSettings: '"cv05"',
207207
padding: variant === 'small' ? '4px 8px' : '8px 16px',
208208
backgroundColor: getBackgroundColor(),

src/components/page_title/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { NavBarOptionsType } from '@definition/app';
22
import { navBarOptionsState } from '@states/app';
33
import { useSetAtom } from 'jotai';
4-
import { useEffect } from 'react';
4+
import { useLayoutEffect } from 'react';
55

66
const PageTitle = (props: NavBarOptionsType) => {
77
const setNavBarOptions = useSetAtom(navBarOptionsState);
88

9-
useEffect(() => {
9+
useLayoutEffect(() => {
1010
setNavBarOptions(props);
1111
}, [props, setNavBarOptions]);
1212

src/features/app_start/shared/page_header/index.tsx

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,22 @@ const PageHeader = ({
2222
}}
2323
>
2424
{onClick && (
25-
<IconButton sx={{ margin: 0, padding: 0 }} onClick={onClick}>
25+
<IconButton
26+
sx={{
27+
margin: 0,
28+
marginLeft: '-8px',
29+
'&:hover': {
30+
backgroundColor: 'var(--accent-200)',
31+
'& svg': {
32+
transform: 'translateX(4px)',
33+
},
34+
},
35+
'& svg': {
36+
transition: 'transform 0.2s ease-in-out',
37+
},
38+
}}
39+
onClick={onClick}
40+
>
2641
<IconArrowBack color="var(--black)" />
2742
</IconButton>
2843
)}

src/layouts/navbar/index.tsx

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ const NavBar = ({ isSupported }: NavBarType) => {
9494
sx={{
9595
backgroundColor: 'var(--accent-100)',
9696
borderBottom: '1px solid var(--accent-200)',
97-
minHeight: '56px',
97+
minHeight: '62px',
9898
position: 'fixed',
9999
top: 0,
100100
left: 0,
@@ -104,15 +104,15 @@ const NavBar = ({ isSupported }: NavBarType) => {
104104
boxShadow: 'none',
105105
}}
106106
>
107-
<Toolbar sx={{ padding: 0 }}>
107+
<Toolbar sx={{ padding: 0, minHeight: '62px', alignItems: 'center' }}>
108108
<Container
109109
maxWidth={false}
110110
sx={{
111111
maxWidth: '1440px',
112112
padding:
113113
navBarOptions.title !== null
114-
? { mobile: '4px 16px', tablet: '4px 32px' }
115-
: { mobile: '8px 16px', tablet: '8px 32px' },
114+
? { mobile: '4px 16px', tablet: '6px 32px' }
115+
: { mobile: '8px 16px', tablet: '6px 32px' },
116116
display: 'flex',
117117
alignItems: 'center',
118118
justifyContent: 'space-between',
@@ -452,14 +452,26 @@ const NavBar = ({ isSupported }: NavBarType) => {
452452
<IconButton
453453
aria-label={t('tr_back')}
454454
onClick={handleBack}
455-
disableHover
455+
sx={{
456+
marginLeft: '-10px',
457+
'&:hover': {
458+
backgroundColor: 'var(--accent-200)',
459+
'& svg': {
460+
transform: 'translateX(4px)',
461+
},
462+
},
463+
'& svg': {
464+
transition: 'transform 0.2s ease-in-out',
465+
},
466+
}}
456467
>
457468
<IconArrowBack color="var(--black)" />
458469
</IconButton>
459470
<Box
460471
sx={{
461472
display: 'flex',
462473
flexDirection: 'column',
474+
marginLeft: '-8px',
463475
}}
464476
>
465477
<Typography
@@ -489,6 +501,13 @@ const NavBar = ({ isSupported }: NavBarType) => {
489501
<IconButton
490502
onClick={handleQuickSettings}
491503
aria-label={t('tr_quickSettings')}
504+
sx={{
505+
marginRight: '-8px',
506+
transition: 'background-color 50ms ease-in-out',
507+
'&:hover': {
508+
backgroundColor: 'var(--accent-200)',
509+
},
510+
}}
492511
>
493512
<IconSettings color="var(--black)" />
494513
</IconButton>
@@ -498,15 +517,15 @@ const NavBar = ({ isSupported }: NavBarType) => {
498517
)
499518
)}
500519
</Box>
501-
{!!tablet688Up && (
520+
{!!tablet688Up && navBarOptions.buttons && (
502521
<Box
503522
sx={{
504523
display: 'flex',
505524
gap: '8px',
506525
padding: '4px',
507526
flexDirection: 'row',
508527
backgroundColor: 'var(--accent-150)',
509-
borderRadius: 'var(--radius-l)',
528+
borderRadius: 'var(--radius-xl)',
510529
}}
511530
>
512531
{navBarOptions.buttons}

src/layouts/navbar/useNavbar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ const useNavbar = () => {
106106
await userSignOut();
107107
disconnectCongAccount();
108108

109-
location.reload();
109+
globalThis.location.reload();
110110
};
111111

112112
return {

0 commit comments

Comments
 (0)