Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat(frontend): create auth wrapper components bb-189 #201

Merged
merged 31 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
a6a4d4a
feat: slicing form design ui bb-9
iqbalalayubbi Aug 18, 2024
6789363
Merge branch '9-feat-sign-up' into fix-lint
iqbalalayubbi Aug 18, 2024
1a07082
fix: remove lint css root folder bb-0
iqbalalayubbi Aug 18, 2024
0d9786c
feat: make toggle visibility password bb-9
iqbalalayubbi Aug 19, 2024
91c4a09
feat: add user data in redux store bb-9
iqbalalayubbi Aug 19, 2024
eef6fb3
feat: make validation confirm password bb-9
iqbalalayubbi Aug 19, 2024
4f1c228
fix: refactor unused code and comment bb-9
iqbalalayubbi Aug 20, 2024
5fc8a04
style: adjust css variabel to match with other bb-9
iqbalalayubbi Aug 20, 2024
fcffd3e
refactor: make other props instead className bb-9
iqbalalayubbi Aug 20, 2024
f6aaac0
style: adjust css variabel conflict bb-9
iqbalalayubbi Aug 21, 2024
5842e98
Merge branch 'main' into 9-feat-sign-up
iqbalalayubbi Aug 21, 2024
8c9ae6e
Merge branch 'main' into 9-feat-sign-up
iqbalalayubbi Aug 21, 2024
18bc6f6
Merge branch 'main' into 9-feat-sign-up
iqbalalayubbi Aug 21, 2024
d97f37c
chore: release-1.6.0 (#95)
github-actions[bot] Aug 21, 2024
dc53cac
fix: handle conflict with main branch bb-9
iqbalalayubbi Aug 21, 2024
2e7c7b7
fix: update version in package.json bb-9
iqbalalayubbi Aug 21, 2024
a1bfc0e
refactor: using getValidClassNames and seperate each style in compone…
iqbalalayubbi Aug 21, 2024
cd1c522
fix: solve all conflict bb-60
iqbalalayubbi Aug 22, 2024
6baed8a
Merge branch 'main' of https://github.com/BinaryStudioAcademy/bsa-202…
iqbalalayubbi Aug 24, 2024
5cfdd3e
fix: merge and solve conflict bb-189
iqbalalayubbi Aug 26, 2024
9d29814
style: wrap header, sidebar, and quiz components in authWrap bb-189
iqbalalayubbi Aug 26, 2024
d055e4a
Merge branch 'main' of https://github.com/BinaryStudioAcademy/bsa-202…
iqbalalayubbi Aug 26, 2024
7048115
refactor: remove assets folder in auth page bb-189
iqbalalayubbi Aug 26, 2024
86c7333
style: pass the auth wrap into protected route directly bb-189
iqbalalayubbi Aug 26, 2024
3e3240f
fix: add newline in changelog.md to pass the code linting checker bb-189
iqbalalayubbi Aug 26, 2024
b70de7e
feat: make left sidebar component bb-189
iqbalalayubbi Aug 26, 2024
fa40896
Merge branch 'main' of https://github.com/BinaryStudioAcademy/bsa-202…
iqbalalayubbi Aug 26, 2024
202447a
style: pass Root as prop in protected route component bb-189
iqbalalayubbi Aug 26, 2024
3743663
fix: remove my code in changelog.md bb-189
iqbalalayubbi Aug 26, 2024
d4de23f
fix: remove tsx in folder name component bb-189
iqbalalayubbi Aug 26, 2024
a8b7550
fix: update changelog.md with main branch bb-189
iqbalalayubbi Aug 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions apps/frontend/src/libs/components/app/app.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import {
Header,
Loader,
Notification,
RouterOutlet,
Sidebar,
} from "~/libs/components/components.js";
import { AppRoute, DataStatus } from "~/libs/enums/enums.js";
import {
Expand Down Expand Up @@ -41,8 +39,6 @@ const App: React.FC = () => {
{isLoading && <Loader />}
{!isLoading && isRoot && (
<>
<Header />
<Sidebar />
<QuizForm />
</>
)}
Expand Down
22 changes: 22 additions & 0 deletions apps/frontend/src/libs/components/auth-wrapper/auth-wrapper.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { Header, Sidebar } from "../components.js";
import style from "./style.module.css";

type Properties = {
children: React.ReactNode;
};

const AuthWrapper: React.FC<Properties> = ({ children }: Properties) => {
return (
<main className={style["auth-wrapper-container"]}>
<section className={style["left-side-section"]}>
<Sidebar />
</section>
<section className={style["right-side-section"]}>
<Header />
{children}
</section>
</main>
);
};

export { AuthWrapper };
12 changes: 12 additions & 0 deletions apps/frontend/src/libs/components/auth-wrapper/style.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.auth-wrapper-container {
display: flex;
height: 100vh;
}

.left-side-section {
height: 100%;
}

.right-side-section {
width: 100%;
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { type AppRoute } from "~/libs/enums/enums.js";
import { useAppSelector } from "~/libs/hooks/hooks.js";
import { type ValueOf } from "~/libs/types/types.js";

import { AuthWrapper } from "../auth-wrapper/auth-wrapper.js";

type Properties = {
component: React.ReactNode;
redirectTo: ValueOf<typeof AppRoute>;
Expand All @@ -15,7 +17,7 @@ const ProtectedRoute: React.FC<Properties> = ({
const user = useAppSelector(({ auth }) => auth.user);

if (user) {
return component;
return <AuthWrapper>{component}</AuthWrapper>;
}

return <Navigate replace to={redirectTo} />;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.sidebar-container {
height: 100%;
background-color: var(--background-gray);
}

Expand Down
Loading