-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from ivanbatchev/dev
Refactoring Routes
- Loading branch information
Showing
40 changed files
with
256 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"trailingComma": "none", | ||
"tabWidth": 2, | ||
"semi": false, | ||
"singleQuote": true, | ||
"printWidth": 80 | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,39 @@ | ||
import { BrowserRouter, Routes, Route } from 'react-router-dom' | ||
import { Home, About, Vans, VanDetails } from './pages' | ||
import { | ||
Home, | ||
About, | ||
Vans, | ||
VanDetails, | ||
Dashboard, | ||
Income, | ||
Reviews | ||
} from './pages' | ||
import { HeaderLayout, HostLayout } from './shared/layouts' | ||
import './App.css' | ||
import { Layout } from './shared/components' | ||
|
||
const App = () => { | ||
return ( | ||
<BrowserRouter> | ||
<Routes> | ||
<Route element={<Layout />}> | ||
<Route path='/' element={<Home />} /> | ||
<Route path='/about' element={<About />} /> | ||
<Route path='/vans' element={<Vans />} /> | ||
<Route path='/vans/:id' element={<VanDetails />} /> | ||
<Route path="/" element={<HeaderLayout />}> | ||
<Route index element={<Home />} /> | ||
<Route path="about" element={<About />} /> | ||
{/* VANS related pages */} | ||
<Route path="vans"> | ||
<Route index element={<Vans />} /> | ||
<Route path=":id" element={<VanDetails />} /> | ||
</Route> | ||
{/* Host related pages */} | ||
<Route path="host" element={<HostLayout />}> | ||
<Route index element={<Dashboard />} /> | ||
<Route path="income" element={<Income />} /> | ||
<Route path="reviews" element={<Reviews />} /> | ||
</Route> | ||
{/* ================================================= */} | ||
</Route> | ||
</Routes> | ||
</BrowserRouter> | ||
) | ||
} | ||
|
||
export default App | ||
export default App |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export { About as default } from './About' | ||
export { About as default } from './About' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,38 @@ | ||
/*** ABOUT PAGE ***/ | ||
.about-hero-image { | ||
max-width: 100%; | ||
max-width: 100%; | ||
} | ||
|
||
.about-page-content { | ||
padding-inline: 23px; | ||
color: #161616; | ||
margin-bottom: 55px; | ||
padding-inline: 23px; | ||
color: #161616; | ||
margin-bottom: 55px; | ||
} | ||
|
||
.about-page-content h1 { | ||
line-height: 38px; | ||
line-height: 38px; | ||
} | ||
|
||
.about-page-content p { | ||
line-height: 22px; | ||
line-height: 22px; | ||
} | ||
|
||
.about-page-cta { | ||
background-color: #FFCC8D; | ||
color: #161616; | ||
padding-inline: 32px; | ||
padding-bottom: 32px; | ||
margin-inline: 27px; | ||
border-radius: 5px; | ||
background-color: #ffcc8d; | ||
color: #161616; | ||
padding-inline: 32px; | ||
padding-bottom: 32px; | ||
margin-inline: 27px; | ||
border-radius: 5px; | ||
} | ||
|
||
.about-page-cta h2 { | ||
margin: 0; | ||
padding-block: 37px; | ||
margin: 0; | ||
padding-block: 37px; | ||
} | ||
|
||
.about-page-cta .link-button { | ||
background-color: #161616; | ||
color: white; | ||
border-radius: 10px; | ||
} | ||
background-color: #161616; | ||
color: white; | ||
border-radius: 10px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export { Home as default } from './Home' | ||
export { Home as default } from './Home' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,42 @@ | ||
|
||
/*** HOME PAGE ***/ | ||
.home-container { | ||
background: linear-gradient(0deg, rgba(0, 0, 0, 0.46), rgba(0, 0, 0, 0.46)), url("../../shared/assets/images/home-hero.png") no-repeat center center; | ||
-webkit-background-size: cover; | ||
-moz-background-size: cover; | ||
-o-background-size: cover; | ||
background-size: cover; | ||
min-height: 350px; | ||
color: white; | ||
padding: 45px 23px; | ||
background: linear-gradient(0deg, rgba(0, 0, 0, 0.46), rgba(0, 0, 0, 0.46)), | ||
url('../../shared/assets/images/home-hero.png') no-repeat center center; | ||
-webkit-background-size: cover; | ||
-moz-background-size: cover; | ||
-o-background-size: cover; | ||
background-size: cover; | ||
min-height: 350px; | ||
color: white; | ||
padding: 45px 23px; | ||
} | ||
|
||
.home-container h1 { | ||
font-weight: 700; | ||
font-size: 2.25rem; | ||
line-height: 42px; | ||
font-weight: 700; | ||
font-size: 2.25rem; | ||
line-height: 42px; | ||
} | ||
|
||
.home-container p { | ||
line-height: 24px; | ||
line-height: 24px; | ||
} | ||
|
||
.home-container a { | ||
display: inline-block; | ||
text-align: center; | ||
text-decoration: none; | ||
background-color: #FF8C38; | ||
border: none; | ||
width: 100%; | ||
margin-top: 27px; | ||
padding-block: .75rem; | ||
color: white; | ||
font-weight: 700; | ||
border-radius: 5px; | ||
cursor: pointer; | ||
transition: transform .1s ease-in-out; | ||
display: inline-block; | ||
text-align: center; | ||
text-decoration: none; | ||
background-color: #ff8c38; | ||
border: none; | ||
width: 100%; | ||
margin-top: 27px; | ||
padding-block: 0.75rem; | ||
color: white; | ||
font-weight: 700; | ||
border-radius: 5px; | ||
cursor: pointer; | ||
transition: transform 0.1s ease-in-out; | ||
} | ||
|
||
.home-container a:hover { | ||
transform: translate(1px, 1px); | ||
transform: translate(1px, 1px); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { Outlet } from 'react-router-dom' | ||
|
||
export const Dashboard = () => { | ||
return ( | ||
<> | ||
<div>Dashboard</div> | ||
</> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { Dashboard as default } from './Dashboard' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export const Income = () => { | ||
return <div>Income</div> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { Income as default } from './Income' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export const Reviews = () => { | ||
return <div>Reviews</div> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { Reviews as default } from './Reviews' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import Reviews from './Reviews' | ||
import Dashboard from './Dashboard' | ||
import Income from './Income' | ||
|
||
export { Reviews, Dashboard, Income } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,35 @@ | ||
import { useVans } from "../../shared/lib/hooks" | ||
import { useParams } from "react-router-dom" | ||
import { Loader } from "../../shared/components" | ||
import { useVans } from '../../shared/lib/hooks' | ||
import { useParams } from 'react-router-dom' | ||
import { Loader } from '../../shared/components' | ||
import './styles.css' | ||
|
||
export const VanDetails = () => { | ||
const { id } = useParams() | ||
const { loading, data: van } = useVans(id); | ||
const { loading, data: van } = useVans(id) | ||
|
||
if (loading) { | ||
return <Loader /> | ||
} | ||
|
||
return ( | ||
<section className="van-detail-container"> | ||
{van ? | ||
{van ? ( | ||
<div className="van-detail"> | ||
<img src={van.imageUrl} /> | ||
<i className={`van-type ${van.type} selected`}>{van.type}</i> | ||
<h2>{van.name}</h2> | ||
<p className="van-price"><span>${van.price}</span>/day</p> | ||
<p className="van-price"> | ||
<span>${van.price}</span>/day | ||
</p> | ||
<p>{van.description}</p> | ||
<button className="link-button">Rent this van</button> | ||
</div> : <h2>Van not found...<br /> Sorry...</h2>} | ||
|
||
</div> | ||
) : ( | ||
<h2> | ||
Van not found... | ||
<br /> Sorry... | ||
</h2> | ||
)} | ||
</section> | ||
) | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export { VanDetails as default } from './VanDetails' | ||
export { VanDetails as default } from './VanDetails' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export { Vans as default } from './Vans' | ||
export { Vans as default } from './Vans' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
.van-list-container { | ||
padding-inline: 24px; | ||
padding-bottom: 24px; | ||
padding-inline: 24px; | ||
padding-bottom: 24px; | ||
} | ||
|
||
.van-list { | ||
display: grid; | ||
grid-template-columns: 1fr 1fr; | ||
justify-items: center; | ||
gap: 34px; | ||
margin-top: 57px; | ||
} | ||
display: grid; | ||
grid-template-columns: 1fr 1fr; | ||
justify-items: center; | ||
gap: 34px; | ||
margin-top: 57px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,7 @@ | ||
import Home from './Home' | ||
import About from './About' | ||
import Vans from './Vans' | ||
import VanDetails from './VanDetails' | ||
import { Dashboard, Income, Reviews } from './Host' | ||
|
||
import Home from "./Home"; | ||
import About from "./About"; | ||
import Vans from "./Vans"; | ||
import VanDetails from "./VanDetails"; | ||
|
||
export { | ||
Home, | ||
About, | ||
Vans, | ||
VanDetails | ||
} | ||
export { Home, About, Vans, VanDetails, Dashboard, Income, Reviews } |
Oops, something went wrong.