Skip to content

Commit 499e6a0

Browse files
committed
frontend: use back-button component for mobile settings header
Changed mobile settings header to just use BackButton component.
1 parent 096ad4f commit 499e6a0

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

frontends/web/src/routes/settings/components/mobile-header.module.css

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@
55
}
66

77
.backButton {
8+
align-items: center;
89
background-color: transparent;
910
border: none;
1011
color: var(--color-default);
1112
display: flex;
12-
align-items: center;
1313
font-size: var(--size-default);
14+
height: auto;
15+
min-width: 0;
1416
padding: var(--space-quarter);
1517
padding-left: 0;
1618
text-decoration: none;

frontends/web/src/routes/settings/components/mobile-header.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
*/
1616

1717
import { useTranslation } from 'react-i18next';
18-
import { useNavigate } from 'react-router-dom';
1918
import { ChevronLeftDark } from '@/components/icon';
19+
import { BackButton } from '@/components/backbutton/backbutton';
2020
import styles from './mobile-header.module.css';
2121

2222
type TProps = {
@@ -25,15 +25,15 @@ type TProps = {
2525
}
2626

2727
export const MobileHeader = ({ title, withGuide = false }: TProps) => {
28-
const navigate = useNavigate();
2928
const { t } = useTranslation();
30-
const handleClick = () => {
31-
//goes to the 'general settings' page
32-
navigate('/settings');
33-
};
29+
3430
return (
3531
<div className={`${styles.container} ${withGuide ? `${styles.withGuide}` : ''}`}>
36-
<button onClick={handleClick} className={styles.backButton}><ChevronLeftDark /> <span>{t('button.back')}</span></button>
32+
<BackButton className={styles.backButton}>
33+
<ChevronLeftDark />
34+
{' '}
35+
<span>{t('button.back')}</span>
36+
</BackButton>
3737
<h1 className={styles.headerText}>{title}</h1>
3838
</div>
3939
);

0 commit comments

Comments
 (0)