Skip to content

Commit 077fb33

Browse files
authored
[promote production] April 30 2024 10:123 PM (#20)
* [Client]: Refactoring Register UI & Adding more UI components (#17) * [client]: refactoring register ui * Add Zustand state management library * [Client]: Adding more UI components (#19) * Update README.md * fixing build issues
1 parent bb348ea commit 077fb33

File tree

11 files changed

+48
-28
lines changed

11 files changed

+48
-28
lines changed

README.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,15 @@
2020
- Company representatives can view a list of job applicants and can contact them, initiative an interview, or perform some other action related to their post.
2121
- Registered users should be able to search for jobs and filter the results based on location, required skills, salary, experience level, etc
2222

23-
## What will we developing?
23+
## Screenshots
2424

25-
<img width="1512" alt="image" src="https://github.com/drbarzaga/JobPortal/assets/12173976/99bbf7cb-383a-4f4d-b0f6-9985bcc60dfb">
25+
<img width="1512" alt="image" src="https://github.com/drbarzaga/JobPortal/assets/12173976/6d92db8e-d423-4667-adff-206aa6837c87">
2626

27-
<img width="1512" alt="image" src="https://github.com/drbarzaga/JobPortal/assets/12173976/27b31105-8a50-492c-a930-75476e4d8735">
27+
<img width="1512" alt="image" src="https://github.com/drbarzaga/JobPortal/assets/12173976/94ed6f7d-953b-41ae-99ec-b65f83dab8bd">
2828

29-
<img width="1512" alt="image" src="https://github.com/drbarzaga/job-portal/assets/12173976/f83f4a80-fd5f-49f5-b519-f6bb4f9260e5">
29+
<img width="1512" alt="image" src="https://github.com/drbarzaga/JobPortal/assets/12173976/91ada9b1-cde7-46f7-a072-b0bb8321a64f">
30+
31+
<img width="1512" alt="image" src="https://github.com/drbarzaga/JobPortal/assets/12173976/11e3338b-692a-4914-a8ee-d1af804f7b75">
3032

3133
## Tech Stack
3234

Loading

client/src/App.tsx

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { Suspense, lazy } from "react";
1+
import { lazy } from "react";
22
import { PrivateRoute } from "@/components/routers";
33
import HomePage from "@/pages/HomePage";
4-
import { AuthProvider } from "@/providers";
5-
import { Route, Routes } from "react-router-dom";
4+
import { BrowserRouter, Route, Routes } from "react-router-dom";
5+
import AppWrapper from "./AppWrapper";
66

77
const LoginPage = lazy(() => import("@/pages/AuthPages/LoginPage"));
88
const RegisterPage = lazy(() => import("@/pages/AuthPages/RegisterPage"));
@@ -12,9 +12,9 @@ const ForgotPasswordPage = lazy(
1212

1313
function App() {
1414
return (
15-
<AuthProvider>
16-
<Suspense fallback={<div>Loading...</div>}>
17-
<Routes>
15+
<BrowserRouter>
16+
<Routes>
17+
<Route element={<AppWrapper />}>
1818
{/* Public routes */}
1919
<Route path="/login" element={<LoginPage />} />
2020
<Route path="/register" element={<RegisterPage />} />
@@ -27,9 +27,9 @@ function App() {
2727

2828
{/* 404 route */}
2929
<Route path="*" element={<div>Not found page!</div>} />
30-
</Routes>
31-
</Suspense>
32-
</AuthProvider>
30+
</Route>
31+
</Routes>
32+
</BrowserRouter>
3333
);
3434
}
3535

client/src/AppWrapper.tsx

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { Suspense } from "react";
2+
import { Outlet } from "react-router-dom";
3+
import SuspenseLoader from "@/components/loaders/SuspenseLoader";
4+
5+
const AppWrapper = () => {
6+
return (
7+
<Suspense fallback={<SuspenseLoader />}>
8+
<Outlet />
9+
</Suspense>
10+
);
11+
};
12+
13+
export default AppWrapper;

client/src/components/core-ui/Alert/Alert.tsx

+1-11
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {
33
ExclamationTriangleIcon,
44
XMarkIcon,
55
} from "@heroicons/react/24/outline";
6-
import { FC, useEffect, useState } from "react";
6+
import { FC, useState } from "react";
77

88
type Props = {
99
message: string;
@@ -13,16 +13,6 @@ type Props = {
1313
const Alert: FC<Props> = ({ message, type }) => {
1414
const [show, setShow] = useState(true);
1515

16-
useEffect(() => {
17-
const timer = setTimeout(() => {
18-
setShow(false);
19-
}, 2000);
20-
21-
return () => {
22-
clearTimeout(timer);
23-
};
24-
}, []);
25-
2616
const getAlertColor = () => {
2717
switch (type) {
2818
case "success":

client/src/components/core-ui/TopBarProgress/TopBarProgress.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ const TopBarProgress = () => {
1010
loadingBarRef.current.continuousStart();
1111

1212
return () => {
13+
if (!loadingBarRef.current) return;
14+
1315
loadingBarRef.current.complete();
1416
};
1517
}, []);

client/src/components/layouts/public/PublicLayout.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const PublicLayout: FC<Props> = ({ title, children }) => {
1818
<div className="relative hidden w-0 flex-1 lg:block">
1919
<img
2020
className="absolute inset-0 h-full w-full object-cover"
21-
src="https://images.unsplash.com/photo-1496917756835-20cb06e75b4e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1908&q=80"
21+
src="/assets/images/layouts/public_layout_cover.jpg"
2222
alt=""
2323
/>
2424
</div>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const SuspenseLoader = () => {
2+
return (
3+
<div className="flex items-center justify-center h-screen">
4+
<div className="w-8 h-8 border-2 border-t-4 border-gray-200 rounded-full animate-spin"></div>
5+
6+
<div className="ml-2 text-sm text-gray-700">Loading...</div>
7+
</div>
8+
);
9+
};
10+
11+
export default SuspenseLoader;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default } from "./SuspenseLoader";

client/src/forms/auth/RegisterForm/useRegisterForm.ts

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ const useRegisterForm = () => {
4646
const form = useFormik({
4747
initialValues: FORM_INITIAL_VALUES,
4848
validationSchema: validationSchema,
49+
validateOnChange: false,
4950
onSubmit: async (values, { setSubmitting }) => {
5051
try {
5152
setSubmitting(true);

client/src/main.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ import React from "react";
22
import ReactDOM from "react-dom/client";
33
import App from "./App.tsx";
44
import "./index.css";
5-
import { BrowserRouter } from "react-router-dom";
5+
import { AuthProvider } from "./providers/index.ts";
66

77
ReactDOM.createRoot(document.getElementById("root")!).render(
88
<React.StrictMode>
9-
<BrowserRouter>
9+
<AuthProvider>
1010
<App />
11-
</BrowserRouter>
11+
</AuthProvider>
1212
</React.StrictMode>
1313
);

0 commit comments

Comments
 (0)