diff --git a/frontend/src/App.js b/frontend/src/App.js index eb5b42d..9c62eed 100644 --- a/frontend/src/App.js +++ b/frontend/src/App.js @@ -21,7 +21,7 @@ const router = createBrowserRouter([ element: , }, { - path:'service', + path:'/service', element: }, { @@ -64,10 +64,3 @@ function App() { } export default App; - - -///todo -//messages not incoming when ad is showw -//responsiveness -//loading spinner -// \ No newline at end of file diff --git a/frontend/src/components/HomeComponents/NavList.js b/frontend/src/components/HomeComponents/NavList.js index 3589b92..cd3fa3a 100644 --- a/frontend/src/components/HomeComponents/NavList.js +++ b/frontend/src/components/HomeComponents/NavList.js @@ -1,13 +1,9 @@ -import React from "react"; -import { NavLink } from "react-router-dom"; -import "./navbar.css"; -export default function NavList() { - function ScrollDown() { - const value = window.innerHeight; - window.scrollTo({ top: value, behavior: "smooth" }); - } +import React from 'react'; +import { NavLink } from 'react-router-dom'; +import './navbar.css'; +export default function NavList() { function onToggleMenu(e) { e.target.name = e.target.name === "grid" ? "close" : "grid"; @@ -17,24 +13,15 @@ export default function NavList() { return (
-
); } diff --git a/frontend/src/pages/Home.js b/frontend/src/pages/Home.js index 2b7a65a..a176c3e 100644 --- a/frontend/src/pages/Home.js +++ b/frontend/src/pages/Home.js @@ -1,49 +1,49 @@ -import React, { useEffect } from 'react' -import NavBar from '../components/HomeComponents/NavBar' -import Description from '../components/HomeComponents/Description' -import Service from './Service' -import { useState } from 'react' -import LoadingPage from './LoadingPage' +import React, { useEffect, useState } from 'react'; +import NavBar from '../components/HomeComponents/NavBar'; +import Description from '../components/HomeComponents/Description'; +import Service from './Service'; +import LoadingPage from './LoadingPage'; +import { useNavigate } from 'react-router-dom'; +import '../scrollbar.css'; -import { useNavigate } from 'react-router-dom' export default function Home() { + const navigate = useNavigate(); + const [isLoading, setIsLoading] = useState(true); - const navigate=useNavigate(); - const [isLoading,setIsLoading]=useState(true); + useEffect(() => { + const checkIfLoggedIn = async () => { + const cookie = localStorage.getItem('jwt'); + const response = await fetch(`${process.env.REACT_APP_API_URL}/api/v1/users/protect`, { + method: 'post', + headers: { + 'Content-type': 'application/json', + 'Authorization': `Bearer ${cookie}` + } + }); - useEffect(()=>{ - - const checkIfLoggedIn=async()=>{ - const cookie=localStorage.getItem('jwt'); - const response=await fetch(`${process.env.REACT_APP_API_URL}/api/v1/users/protect`,{ - method:'post', - headers:{ - 'Content-type':'application/json', - 'Authorization':`Bearer ${cookie}` + const data = await response.json(); + if (data.status === 'success') { + navigate('/home/message', { replace: true }); + } else { + setIsLoading(false); } - }) - - const data=await response.json(); - if(data.status==='success') - { - navigate('/home/message',{replace:true}) - } - else{ - setIsLoading(false); - } + }; - } - checkIfLoggedIn() - },[navigate]) + checkIfLoggedIn(); + }, [navigate]); return ( -
- {isLoading&&} - {!isLoading&&(<>
- - -
- )} -
- ) +
+ {isLoading && } + {!isLoading && ( + <> +
+ + +
+ + + )} +
+ ); } diff --git a/frontend/src/pages/Service.js b/frontend/src/pages/Service.js index 22f5b92..2eb05f3 100644 --- a/frontend/src/pages/Service.js +++ b/frontend/src/pages/Service.js @@ -1,21 +1,25 @@ -import React from 'react' -import Card from '../components/HomeComponents/Card' + +import React from 'react'; +import Card from '../components/HomeComponents/Card'; +import NavList from '../components/HomeComponents/NavList'; export default function Service() { return ( -
-
-
-
Get the best of all the features
-
-
- - - - +
+ +
+
+
+
Get the best of all the features
+
+
+ + + + +
+
-
- - ) + ); } diff --git a/frontend/src/scrollbar.css b/frontend/src/scrollbar.css new file mode 100644 index 0000000..dedea30 --- /dev/null +++ b/frontend/src/scrollbar.css @@ -0,0 +1,26 @@ +/* src/scrollbar.css */ +.scrollbar-thin { + scrollbar-width: thin; + scrollbar-color: rgb(1, 36, 120) transparent; + } + + .scrollbar-thin::-webkit-scrollbar { + width: 8px; + height: 8px; + } + + .scrollbar-thin::-webkit-scrollbar-track { + background: transparent; + } + + .scrollbar-thin::-webkit-scrollbar-thumb { + background-color: rgb(1, 36, 120); + border-radius: 10px; + border: 0; + + } + + .scrollbar-thin::-webkit-scrollbar-thumb:hover { + background-color: rgb(1, 36, 120); + } + \ No newline at end of file diff --git a/frontend/tailwind.config.js b/frontend/tailwind.config.js index fd0bf5f..02f69ad 100644 --- a/frontend/tailwind.config.js +++ b/frontend/tailwind.config.js @@ -12,5 +12,6 @@ module.exports = { 'Poppins': ['Poppins', 'serif'] // Ensure fonts with spaces have " " surrounding it. }, }, - plugins: [], + plugins: [ + ], } \ No newline at end of file