Skip to content

Commit

Permalink
..
Browse files Browse the repository at this point in the history
  • Loading branch information
FawadAhmedRaza committed Mar 6, 2021
1 parent f4a6082 commit bcb8997
Show file tree
Hide file tree
Showing 13 changed files with 185 additions and 53 deletions.
50 changes: 50 additions & 0 deletions shoestore/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions shoestore/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"jquery": "^3.5.1",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-owl-carousel": "^2.3.3",
"react-router": "^6.0.0-beta.0",
"react-router-dom": "^6.0.0-beta.0",
"react-scripts": "4.0.3",
Expand Down
9 changes: 5 additions & 4 deletions shoestore/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,30 @@
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<script
src="https://code.jquery.com/jquery-3.6.0.slim.min.js"
integrity="sha256-u7e5khyithlIdTpu22PHhENmPcRdFiHRjhAuHcs05RI="
crossorigin="anonymous"></script>
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>

</html>
27 changes: 21 additions & 6 deletions shoestore/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,35 @@ import './App.css';
import {NavBar} from './Components/NavBar'
import {Slider} from './Components/Slider'
import {Footer} from './Components/Footer'
import {Routes, Route} from "react-router"
import {Products} from './Components/Products'
import{ProductDetails} from './Components/ProductDetails'
import Carousel from './Components/Carousel'
import { GlobalProvider } from './api'
import {Routes,Route,BrowserRouter as Router} from 'react-router-dom'
import About from './Components/About'

function App() {
return (

<GlobalProvider>
<>
<Router>

<GlobalProvider>
<NavBar></NavBar>
<Slider></Slider>

<Products></Products>

<Routes>
<Route path='/' element={<Slider/>}/>
<Route exact path='products' element={<Products/>}/>
<Route exact path='/products/:id' element={<ProductDetails/>}/>
<Route exact path='/about' element={<About/>}/>


</Routes>
<Carousel/>
<Footer></Footer>
</GlobalProvider>

</Router>
</>
);
}

Expand Down
12 changes: 12 additions & 0 deletions shoestore/src/Components/About.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const About = () => {
return (
<>
<h1 className="text-center pt-5">ABOUT NIKE</h1>
<p className="p-5">
Our mission is what drives us to do everything possible to expand human potential. We do that by creating groundbreaking sport innovations, by making our products more sustainably, by building a creative and diverse global team and by making a positive impact in communities where we live and work
Based in Beaverton, Oregon, NIKE, Inc. includes the Nike, Converse, and Jordan brands.</p>
</>
)
}

export default About;
38 changes: 38 additions & 0 deletions shoestore/src/Components/Carousel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { useContext } from 'react'
import OwlCarousel from 'react-owl-carousel'
import 'owl.carousel/dist/assets/owl.carousel.min.css'
import 'owl.carousel/dist/assets/owl.theme.default.min.css'
import { GlobalContext } from '../api'
import { Link } from 'react-router-dom'

const Carousel = () => {
const shoes = useContext(GlobalContext)
return (
<div>
<h1 className="text-center ">New Arrivals</h1>
<OwlCarousel
className="owl-theme"
item="3"
autoplay
nav
dots
>
{Object.entries(shoes).map(([ProductId, { name, img }]) => (

<Link to={`products/${ProductId}`}>
<div id={ProductId} className="card shadow m-1">
<img className="card-img-top" src={img} alt={name} />
<div className="card-body d-flex justify-content-center">
<h5 className="text-center card-title">{name}</h5>

</div>
</div>
</Link>
))
}
</OwlCarousel>
</div>
)
}

export default Carousel;
22 changes: 13 additions & 9 deletions shoestore/src/Components/NavBar.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
import 'bootstrap/dist/css/bootstrap.min.css'
import '../../node_modules/bootstrap/dist/js/bootstrap.bundle'
import logo from '../Images/logo.png'
import {Link} from 'react-router-dom'

export const NavBar=()=>{
return(
<>
<nav class=" shadow navbar navbar-expand-lg navbar-light bg-light">
<a class="navbar-brand" href="#"><img src={logo} width="150"/></a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavAltMarkup" aria-controls="navbarNavAltMarkup" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
<nav className=" shadow navbar navbar-expand-lg navbar-light bg-light">
<a className="navbar-brand"><img src={logo} width="100"/></a>
<button className="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavAltMarkup" aria-controls="navbarNavAltMarkup" aria-expanded="false" aria-label="Toggle navigation">
<span className="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNavAltMarkup">
<div class="navbar-nav">
<a class="nav-item nav-link active" href="#">Men <span class="sr-only">(current)</span></a>
<a class="nav-item nav-link" href="#">Women</a>
<a class="nav-item nav-link" href="#">Kids</a>
<div className="collapse navbar-collapse" id="navbarNavAltMarkup">
<div className="navbar-nav">
<Link className="nav-item nav-link active" to={'/'}>Home <span className="sr-only"></span></Link>
<Link className="nav-item nav-link active" to={'products'}>Products <span className="sr-only"></span></Link>
<Link className="nav-item nav-link active" to={'about'}>About US <span className="sr-only"></span></Link>



</div>
</div>
</nav>
Expand Down
18 changes: 18 additions & 0 deletions shoestore/src/Components/ProductDetails.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import {useParams} from 'react-router-dom'
import {useContext} from 'react'
import { GlobalContext } from '../api'

export const ProductDetails=()=>{

const {id}=useParams()
const shoes = useContext(GlobalContext)
const shoe=shoes[id]
const {Pid,name,img}=shoe
return(
<div>
<h1>{name}</h1>
<img src={img}/>
</div>

)
}
44 changes: 20 additions & 24 deletions shoestore/src/Components/Products.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,24 @@
import reactDom from "react-dom"
import {useContext} from "react";
import {GlobalContext} from '../api'
import {link} from 'react-router'
import { useContext } from "react";
import { GlobalContext } from '../api'
import { Link } from 'react-router-dom'

export const Products=()=>{
const shoes=useContext(GlobalContext)

return(

<div className="p-3 d-flex flex-wrap">
{Object.entries(shoes).map(([ProductId,{name,img}])=>(

<div id={ProductId} className="card shadow m-2" style={{width: "18rem"}}>
<img className="card-img-top" src={img} alt={name}/>
<div className="card-body">
<h5 className="card-title">{name}</h5>

<a href="#" className="btn btn-primary">Details</a>
</div>
</div>

))

}
export const Products = () => {
const shoes = useContext(GlobalContext)
return (
<div className="p-3 d-flex flex-wrap justify-content-around">
{Object.entries(shoes).map(([ProductId, { name, img }]) => (
<Link to={`${ProductId}`}>
<div id={ProductId} className="card shadow m-1" style={{ width: "18rem" }}>
<img className="card-img-top" src={img} alt={name} />
<div className="card-body">
<h5 className="card-title">{name}</h5>

</div>
</div>
</Link>
))
}
</div>
)
)
}
Binary file not shown.
Binary file added shoestore/src/Images/Minutes - 37th Meeting.pdf
Binary file not shown.
8 changes: 4 additions & 4 deletions shoestore/src/api/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import React, { createContext } from 'react';

const Products = {

"Nike-Air-Force-1-'07-Craft": {
name: "Nike Air Force 1 '07 Craft",
img: "https://static.nike.com/a/images/c_limit,w_592,f_auto/t_product_v1/95e882a6-384c-4638-9055-e45f79672637/air-force-1-07-craft-shoe-jCGMCm.jpg"
}

, "Nike-Air-VaporMax-Evo": {
}, "Nike-Air-VaporMax-Evo": {
name: "Nike Air VaporMax Evo",
img: "https://static.nike.com/a/images/t_PDP_864_v1/f_auto,b_rgb:f5f5f5/a16929ed-fff6-4f62-9ecb-7df009579f2d/jordan-ma2-shoe-qw1Z6m.jpg"
}
Expand Down Expand Up @@ -34,7 +33,8 @@
name: "Nike D/MS/X Waffle",
img: "https://static.nike.com/a/images/t_PDP_864_v1/f_auto,b_rgb:f5f5f5/8e488a06-528f-48e5-8368-691009080ad0/custom-nike-air-max-90-premium-by-you.jpg"
}
}

}

export const GlobalContext = createContext(Products)
export const GlobalProvider=({children})=>{
Expand Down
9 changes: 3 additions & 6 deletions shoestore/src/index.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
import React from 'react';
import ReactDOM from 'react-dom';
import {BrowserRouter } from 'react-router-dom'

import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';


ReactDOM.render(
<BrowserRouter>
<App />
</BrowserRouter>,
<App />,
document.getElementById('root')
);

// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();

0 comments on commit bcb8997

Please sign in to comment.