Fixes the Navbar situation

This commit is contained in:
Vazhin Tayeb 2021-01-15 10:52:02 +03:00 committed by Muhammad Azeez
parent 632fc0c166
commit d1c906ebfa
7 changed files with 55 additions and 10 deletions

View File

@ -16,7 +16,7 @@ function App() {
useEffect(() => { useEffect(() => {
// Commented out not to check the localStorage for the user's existence ** Temporary ** // Commented out not to check the localStorage for the user's existence ** Temporary **
// fetch current user from cookies // fetch current user from cookies
// loadUserFromStorage(store); loadUserFromStorage(store);
}, []); }, []);
// Should be removed ** Temporary ** // Should be removed ** Temporary **
@ -27,7 +27,7 @@ function App() {
}; };
// ** Temporary ** // ** Temporary **
logUserIn(); // logUserIn();
return ( return (
<Provider store={store}> <Provider store={store}>

View File

@ -5,7 +5,7 @@ import VehiclesMain from "./components/VehiclesMain";
const YourVehicles = () => { const YourVehicles = () => {
return ( return (
<div className="h-screen overflow-hidden"> <div>
<Navbar /> <Navbar />
<Main Component={VehiclesMain} /> <Main Component={VehiclesMain} />
</div> </div>

View File

@ -12,7 +12,7 @@ const LoginWindow = () => {
}; };
return ( return (
<div className="xl:w-1/3 lg:w-5/12 md:w-2/4 sm:w-9/12 w-11/12 flex flex-col justify-center shadow md:px-32 sm:px-28 md:py-40 sm:py-36 px-20 py-16"> <div className="xl:w-1/3 lg:w-5/12 md:w-2/4 sm:w-9/12 w-11/12 flex flex-col justify-center shadow md:px-32 sm:px-28 md:py-36 sm:py-36 px-20 py-16 mt-20">
<Heading1 text={"Traffic Police Service"} /> <Heading1 text={"Traffic Police Service"} />
<p className="text-black-custom font-light text-3xl mb-20"> <p className="text-black-custom font-light text-3xl mb-20">

View File

@ -4,7 +4,7 @@ const Main = ({ Component, styles = {} }) => {
return ( return (
<div <div
className="flex flex-col items-center justify-center h-4/5" className="flex flex-col items-center justify-center h-4/5"
style={{ ...styles }} style={{ ...styles, marginTop: "90px" }}
> >
<Component /> <Component />
</div> </div>

View File

@ -13,11 +13,13 @@ const Navbar = () => {
return ( return (
<div <div
className="w-100 bg-blue-custom flex justify-center items-center" className="w-screen bg-blue-custom flex justify-center items-center fixed top-0 left-0"
style={{ height: "90px" }} style={{ height: "90px" }}
> >
<nav className="flex items-center justify-between w-4/5"> <nav className="flex items-center justify-between w-4/5">
<Link to="/">
<img src={logo} alt="logo" className="h-28" /> <img src={logo} alt="logo" className="h-28" />
</Link>
{user ? ( {user ? (
<ul className="list-none flex items-center justify-between w-2/6 m-0"> <ul className="list-none flex items-center justify-between w-2/6 m-0">
<li className="m-0"> <li className="m-0">

View File

@ -45,6 +45,49 @@ const VehiclesMain = () => {
licensePlate: "9956443", licensePlate: "9956443",
type: 1, type: 1,
}, },
{
id: Math.floor(Math.random() * 200) + 1,
color: "White",
model: "Toyota Camry",
licensePlate: "9956443",
type: 1,
},
{
id: Math.floor(Math.random() * 200) + 1,
color: "White",
model: "Toyota Camry",
licensePlate: "9956443",
type: 1,
},
{
id: Math.floor(Math.random() * 200) + 1,
color: "White",
model: "Toyota Camry",
licensePlate: "9956443",
type: 1,
},
{
id: Math.floor(Math.random() * 200) + 1,
color: "White",
model: "Toyota Camry",
licensePlate: "9956443",
type: 1,
},
{
id: Math.floor(Math.random() * 200) + 1,
color: "White",
model: "Toyota Camry",
licensePlate: "9956443",
type: 1,
},
{
id: Math.floor(Math.random() * 200) + 1,
color: "White",
model: "Toyota Camry",
licensePlate: "9956443",
type: 1,
},
]); ]);
useEffect(() => { useEffect(() => {
@ -62,9 +105,9 @@ const VehiclesMain = () => {
<div className="flex flex-col"> <div className="flex flex-col">
<Heading1 <Heading1
text={"Traffic Police Service"} text={"Traffic Police Service"}
classes="mt-24"
styles={{ styles={{
marginBottom: "0", marginBottom: "0",
...(!vehicleData && { marginTop: "10%" }),
}} }}
/> />
{/* <p>Hello, {user.profile.given_name}.</p> */} {/* <p>Hello, {user.profile.given_name}.</p> */}
@ -83,7 +126,7 @@ const VehiclesMain = () => {
)} )}
<Button <Button
text="Register A Vehicle" text="Register A Vehicle"
classes={vehicleData && "self-start mt-20"} classes={vehicleData && "self-start my-24"}
/> />
</div> </div>
); );

View File

@ -16,7 +16,7 @@ function Login() {
return user ? ( return user ? (
<Redirect to={"/"} /> <Redirect to={"/"} />
) : ( ) : (
<div className="h-screen"> <div>
<Navbar /> <Navbar />
<Main Component={LoginWindow} /> <Main Component={LoginWindow} />
</div> </div>