Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Added route #309

Merged
merged 4 commits into from
May 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
82 changes: 47 additions & 35 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,43 +1,55 @@

import './App.css';
import Navbar from './Components/Navbar/Navbar';
import { BrowserRouter,Routes,Route } from 'react-router-dom';
import Shop from './Pages/Shop';
import ShopCategory from './Pages/ShopCategory';
import Product from './Pages/Product';
import Cart from './Pages/Cart';
import LoginSignup from './Pages/LoginSignup';
import Footer from './Components/Footer/Footer';
import men_banner from './Components/Assets/banner_mens.png'
import women_banner from './Components/Assets/banner_women.png'
import kids_banner from './Components/Assets/banner_kids.png'
import About from './Pages/About';
import Contact from './Pages/Contact';
import ScrollToTop from 'react-scroll-to-top';
import { useContext,useEffect } from 'react';
import { ShopContext } from './Context/ShopContext';
import "./App.css";
import Navbar from "./Components/Navbar/Navbar";
import { BrowserRouter, Routes, Route } from "react-router-dom";
import Shop from "./Pages/Shop";
import ShopCategory from "./Pages/ShopCategory";
import Product from "./Pages/Product";
import Cart from "./Pages/Cart";
import LoginSignup from "./Pages/LoginSignup";
import Footer from "./Components/Footer/Footer";
import men_banner from "./Components/Assets/banner_mens.png";
import women_banner from "./Components/Assets/banner_women.png";
import kids_banner from "./Components/Assets/banner_kids.png";
import About from "./Pages/About";
import Contact from "./Pages/Contact";
import ScrollToTop from "react-scroll-to-top";
import { useContext, useEffect } from "react";
import { ShopContext } from "./Context/ShopContext";
import Collections from "./Pages/Collections";
import Offers from "./Pages/Offers";
function App() {
const {theme}=useContext(ShopContext);
const { theme } = useContext(ShopContext);
return (
<div className={`${theme}_app`}>
<BrowserRouter>
<Navbar/>
<Routes>
<Route path='/' element={<Shop/>} />
<Route path='/men' element={<ShopCategory banner={men_banner} category="men"/>} />
<Route path='/women' element={<ShopCategory banner={women_banner} category="women"/>} />
<Route path='/kids' element={<ShopCategory banner={kids_banner} category="kids"/>} />
<Route path='/product' element={<Product/>}>
<Route path=':productId' element={<Product/>}/>
</Route>
<Route path='/cart' element={<Cart/>} />
<Route path='/login' element={<LoginSignup/>} />
<Route path='/about' element={<About/>} />
<Route path='/contact' element={<Contact/>} />
</Routes>
<Footer/>
<Navbar />
<Routes>
<Route path="/" element={<Shop />} />
<Route
path="/men"
element={<ShopCategory banner={men_banner} category="men" />}
/>
<Route
path="/women"
element={<ShopCategory banner={women_banner} category="women" />}
/>
<Route
path="/kids"
element={<ShopCategory banner={kids_banner} category="kids" />}
/>
<Route path="/product" element={<Product />}>
<Route path=":productId" element={<Product />} />
</Route>
<Route path="/cart" element={<Cart />} />
<Route path="/login" element={<LoginSignup />} />
<Route path="/about" element={<About />} />
<Route path="/contact" element={<Contact />} />
<Route path="/offers" element={<Offers />} />
<Route path="/collections" element={<Collections />} />
</Routes>
<Footer />
</BrowserRouter>
<ScrollToTop smooth component={<p style={{ color: "blue" }}>↑</p>}/>
<ScrollToTop smooth component={<p style={{ color: "blue" }}>↑</p>} />
</div>
);
}
Expand Down
4 changes: 4 additions & 0 deletions src/Components/Hero/Hero.css
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,7 @@
margin-top: 150px;
margin-left: 138px;
}

.link{
text-decoration: none;
}
63 changes: 33 additions & 30 deletions src/Components/Hero/Hero.jsx
Original file line number Diff line number Diff line change
@@ -1,34 +1,37 @@
import React, { useContext } from 'react'
import './Hero.css'
import hand_icon from '../Assets/hand_icon.png'
import arrow_icon from '../Assets/arrow.png'
import hero_image from '../Assets/hero_image.png'
import { ShopContext } from '../../Context/ShopContext'
import React, { useContext } from "react";
import "./Hero.css";
import hand_icon from "../Assets/hand_icon.png";
import arrow_icon from "../Assets/arrow.png";
import hero_image from "../Assets/hero_image.png";
import { ShopContext } from "../../Context/ShopContext";
import { Link } from "react-router-dom";

const Hero = () => {
const {theme}=useContext(ShopContext)
return (
<div className={'hero_'+theme}>
<div className="hero-left">
<h2 className={'h2h_'+theme}>NEW ARRIVALS ONLY</h2>
<div>
<div className="hero-hand-icon">
<p className={'ph_'+theme}>New</p>
<img src={hand_icon} alt="" />
</div>
<p className={'ph_'+theme}>Collections</p>
<p className={'ph_'+theme}>For Everyone</p>
</div>
<div className="hero-latest-btn">
<div className={'div_'+theme}>Latest Collection</div>
<img src={arrow_icon} alt="" />
</div>
</div>
<div className="hero-right">
<img src={hero_image} alt="" />
</div>
const { theme } = useContext(ShopContext);
return (
<div className={"hero_" + theme}>
<div className="hero-left">
<h2 className={"h2h_" + theme}>NEW ARRIVALS ONLY</h2>
<div>
<div className="hero-hand-icon">
<p className={"ph_" + theme}>New</p>
<img src={hand_icon} alt="" />
</div>
<p className={"ph_" + theme}>Collections</p>
<p className={"ph_" + theme}>For Everyone</p>
</div>
)
}
<Link className="link" to={"/collections"}>
<div className="hero-latest-btn">
<div className={"div_" + theme}>Latest Collection</div>
<img src={arrow_icon} alt="" />
</div>
</Link>
</div>
<div className="hero-right">
<img src={hero_image} alt="" />
</div>
</div>
);
};

export default Hero
export default Hero;
39 changes: 21 additions & 18 deletions src/Components/Offers/Offers.jsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
import React, { useContext } from 'react'
import './Offers.css'
import exclusive_image from '../Assets/exclusive_image.png'
import { ShopContext } from '../../Context/ShopContext'
import React, { useContext } from "react";
import "./Offers.css";
import exclusive_image from "../Assets/exclusive_image.png";
import { ShopContext } from "../../Context/ShopContext";
import { Link } from "react-router-dom";

const Offers = () => {
const {theme}=useContext(ShopContext);
const { theme } = useContext(ShopContext);
return (
<div className='offers'>
<div className="offers-left">
<h1 className={`h1_${theme}`}>Exclusive</h1>
<h1 className={`h1_${theme}`}>Offers For You</h1>
<p className={`p_${theme}`}>ONLY ON BEST SELLERS PRODUCTS</p>
<button>Check Now</button>
<Link className="link" to={`/offers`}>
<div className="offers">
<div className="offers-left">
<h1 className={`h1_${theme}`}>Exclusive</h1>
<h1 className={`h1_${theme}`}>Offers For You</h1>
<p className={`p_${theme}`}>ONLY ON BEST SELLERS PRODUCTS</p>
<button>Check Now</button>
</div>
<div className="offers-right">
<img src={exclusive_image} alt="" />
</div>
</div>
<div className="offers-right">
<img src={exclusive_image} alt="" />
</div>
</div>
)
}
</Link>
);
};

export default Offers
export default Offers;
9 changes: 9 additions & 0 deletions src/Pages/Collections.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react'

const Collections = () => {
return (
<div>Collections</div>
)
}

export default Collections
7 changes: 7 additions & 0 deletions src/Pages/Offers.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import React from "react";

const Offers = () => {
return <div>Offers</div>;
};

export default Offers;
Loading