Skip to content

Commit 00b3cd5

Browse files
authored
Merge pull request #156 from h0wter/fix/th-125-fix-header
th-125: Fix content positioning below the header
2 parents f9eeb04 + 4123b2f commit 00b3cd5

File tree

7 files changed

+26
-19
lines changed

7 files changed

+26
-19
lines changed

frontend/src/libs/components/components.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export { Link } from './link/link.js';
1515
export { LocationInput } from './location-input/location-input.js';
1616
export { Modal } from './modal/modal.js';
1717
export { Notification } from './notification/notification.js';
18+
export { PageLayout } from './page-layout/page-layout.js';
1819
export { Pagination } from './pagination/pagination.js';
1920
export { ProtectedRoute } from './protected-route/protected-route.js';
2021
export { Radio } from './radio/radio.js';

frontend/src/libs/components/input/styles.module.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ $error-message-height: calc($error-font-size * $line-height-coefficient);
8888
top: 8px;
8989
right: 15px;
9090
cursor: pointer;
91+
user-select: none;
9192
}
9293

9394
.inputWrapper {

frontend/src/libs/components/page-layout/page-layout.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ import { useCallback, useState } from '~/libs/hooks/hooks.js';
44
import { type TabName } from '~/libs/types/types.js';
55
import { Sidebar } from '~/pages/dashboard/components/sidebar/sidebar.js';
66

7-
import { Header } from '../components.js';
7+
import { Header } from '../header/header.js';
8+
import { RouterOutlet } from '../router/router.js';
89
import styles from './styles.module.scss';
910

1011
type Properties = {
1112
isHeaderHidden?: boolean;
1213
isSidebarHidden?: boolean;
13-
children: JSX.Element;
14+
children?: JSX.Element;
1415
};
1516

1617
const PageLayout: FC<Properties> = ({
@@ -37,7 +38,10 @@ const PageLayout: FC<Properties> = ({
3738
<Sidebar selectedTab={selectedTab} onTabClick={handleTabSelect} />
3839
</div>
3940
)}
40-
<main className={styles.content}>{children}</main>
41+
<main className={styles.content}>
42+
<RouterOutlet />
43+
{children}
44+
</main>
4145
</div>
4246
);
4347
};

frontend/src/libs/components/router/router.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,12 @@ import { Dashboard } from '~/pages/dashboard/dashboard.js';
77
import { NotFound } from '~/pages/not-found/not-found.js';
88
import { WelcomePage } from '~/pages/welcome/welcome.js';
99

10-
import { App } from '../app/app.js';
11-
import { ProtectedRoute } from '../components.js';
12-
import { PageLayout } from '../page-layout/page-layout.js';
10+
import { PageLayout, ProtectedRoute } from '../components.js';
1311
import { RouterProvider } from '../router-provider/router-provider.js';
1412

1513
const Router = (): JSX.Element => (
1614
<RouterProvider>
17-
<Route path={AppRoute.ROOT} element={<App />}>
15+
<Route path={AppRoute.ROOT} element={<PageLayout isSidebarHidden />}>
1816
<Route path={AppRoute.WELCOME} element={<WelcomePage />} />
1917
<Route path={AppRoute.SIGN_IN} element={<Auth />} />
2018
<Route path={AppRoute.SIGN_UP} element={<Auth />} />

frontend/src/pages/auth/auth.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
import { actions as authActions } from '~/slices/auth/auth.js';
1616

1717
import { SignInForm, SignUpForm } from './components/components.js';
18-
import styles from './styles.module.css';
18+
import styles from './styles.module.scss';
1919

2020
const Auth: React.FC = () => {
2121
const dispatch = useAppDispatch();

frontend/src/pages/auth/styles.module.css

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
@import "src/assets/css/vars.scss";
2+
3+
.page {
4+
display: flex;
5+
justify-content: center;
6+
align-items: center;
7+
min-height: 100%;
8+
background-color: $blue-dark;
9+
background-image: url("src/assets/img/auth-page-bg.svg");
10+
background-repeat: no-repeat;
11+
background-position: center;
12+
background-size: cover;
13+
padding-block: 57px;
14+
}

0 commit comments

Comments
 (0)