Skip to content

Commit 289ac1b

Browse files
committed
Sort by name and price features, 404 page and About page completed
1 parent 88b5826 commit 289ac1b

18 files changed

+131
-412
lines changed

client/src/App.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import './App.css';
22
import React, { useState, useEffect } from 'react';
33
import { useRoutes } from 'react-router-dom'
4-
// import { Link } from 'react-router-dom'
54
import ReadSneakers from './pages/ReadSneakers'
65
import SneakerDetails from './pages/SneakerDetails'
76
import CreateComment from './pages/CreateComment'
87
import About from './pages/About'
8+
import PageNotFound from './pages/PageNotFound'
99

1010

1111
const App = () => {
@@ -39,20 +39,17 @@ const App = () => {
3939
{
4040
path:"/about",
4141
element: <About />
42+
},
43+
{
44+
path:"/*",
45+
element: <PageNotFound />
4246
}
4347
]);
4448

4549

4650
return (
4751

4852
<div className="App">
49-
50-
{/* <div className="header">
51-
<h1>👟 Sneaker World</h1>
52-
<Link to="/"><button className="headerBtn">Sneakers</button></Link>
53-
<Link to="/order"><button className="headerBtn">Order</button></Link>
54-
</div> */}
55-
5653
{element}
5754
</div>
5855

client/src/assets/sneaker.jpg

-130 KB
Binary file not shown.

client/src/components/SneakersCard.css

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,9 @@
88
margin-bottom: 15px;
99
width:550px;
1010
height: 500px;
11-
/* background-size: cover;
12-
background-position: 50% 50%; */
13-
background-size: 45%;
14-
background-repeat: no-repeat;
15-
background-position: center;
11+
background-size: cover;
12+
background-position: 50% 50%;
1613
text-align: center;
17-
/* background-color: #DEE5ED; */
1814
background-blend-mode: multiply;
1915
color:#1A202C;
2016
font-size: 15px;

client/src/pages/About.css

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,3 @@
1-
.About {
2-
/* background-color: #fbfaf6; */
3-
color: #242f37;
4-
padding: 20px;
5-
overflow: hidden;
6-
margin: 0 20px;
7-
}
8-
9-
.AboutText {
10-
margin-left: 25px;
11-
margin-top: 20px;
12-
}
13-
14-
.float-right {
15-
float: right;
16-
margin-left: 20px;
17-
margin-top: 155px;
18-
box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
19-
width: 3px;
20-
height: 3px;
21-
}
22-
23-
.image-container {
24-
background-position: cover;
25-
width: 3px;
26-
height: 3px;
27-
28-
}
1+
.About .About-paragraph {
2+
color: #486284;
3+
}

client/src/pages/About.js

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,24 @@
11
import React from 'react'
22
import './About.css'
3-
// import { Link } from 'react-router-dom'
43

54
const About = () => {
65

7-
const sneaker = 'https://static.nike.com/a/images/t_default/c2643901-9e8c-41b5-b17d-36802f3102e9/dunk-low-retro-mens-shoes-M0t9Sv.png';
6+
const sneaker = 'https://static.nike.com/a/images/t_PDP_1728_v1/f_auto,q_auto:eco/9f5d3ab4-98b4-44fe-9823-3b409603b520/dunk-low-retro-mens-shoes-M0t9Sv.png';
87

98
return (
10-
<div>
11-
12-
<div className="float-right">
13-
<div className="image-container">
14-
<img src={ sneaker } alt="sneaker" style={{ width: "100%", height: "auto" }} />
15-
</div>
16-
</div>
17-
18-
<div className="About">
19-
<div className="AboutText">
20-
<p>We are beyond e-commerce: we are a labor of love.</p>
21-
<h2>Welcome to Sneaker World!</h2>
22-
<p>Sneaker World is where sneaker culture and innovation come together. <br />
23-
We're not just an online store; <br />
9+
<div className="About">
10+
<div className="flex-container">
11+
<div className="left-side">
12+
<h2>👋 Welcome to <br /> Sneaker World!</h2>
13+
<p className="About-paragraph">Sneaker World is where sneaker culture and innovation come together. <br />
14+
We're not just an online store:
2415
we're your gateway to exclusive collaborations, curated collections, and a thriving sneaker community.</p>
25-
</div>
26-
</div>
27-
16+
</div>
17+
<div className="right-side" style={{ backgroundImage: `url(${sneaker})`, backgroundSize: "cover", backgroundPosition: "center" }}>
18+
</div>
2819
</div>
20+
</div>
2921
);
3022
};
3123

32-
export default About;
24+
export default About;

client/src/pages/PageNotFound.css

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
.fof-container{
2+
display: table;
3+
width: 100%;
4+
height: 60vh;
5+
text-align: center;
6+
color: #1A202C;
7+
}
8+
9+
.fof{
10+
display: table-cell;
11+
vertical-align: middle;
12+
}
13+
14+
.fof h1{
15+
color:#1A202C;
16+
font-size: 50px;
17+
display: inline-block;
18+
padding-right: 12px;
19+
animation: type .6s alternate infinite;
20+
}
21+
22+
@keyframes type{
23+
from{box-shadow: inset -3px 0px 0px #888;}
24+
to{box-shadow: inset -3px 0px 0px transparent;}
25+
}

client/src/pages/PageNotFound.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import React from 'react'
2+
import { Link } from 'react-router-dom'
3+
import './PageNotFound.css'
4+
5+
const PageNotFound = () => {
6+
return (
7+
<div className="PageNotFound">
8+
<main className="fof-container">
9+
<div class="fof">
10+
<h1>😮 404</h1> <br /> <br />
11+
<h6>Page Not Found</h6> <br /> <br />
12+
13+
<Link to="/"><button>Go To Sneakers</button></Link>
14+
15+
</div>
16+
</main>
17+
</div>
18+
)
19+
}
20+
21+
export default PageNotFound

client/src/pages/ReadSneakers.css

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,22 @@
1010
text-align: center;
1111
}
1212

13+
.Sort {
14+
display: flex;
15+
align-items: center;
16+
}
17+
18+
.Sort p {
19+
margin-right: 20px;
20+
font-size: 18px;
21+
font-weight: bold;
22+
}
23+
24+
.Sort button {
25+
margin-right: 20px;
26+
}
27+
28+
1329
.welcome-paragraph {
1430
margin-top: 20px;
1531
color: #486284;

client/src/pages/ReadSneakers.js

Lines changed: 47 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,62 @@ import './ReadSneakers.css';
66
const ReadSneakers = (props) => {
77

88
const [posts, setPosts] = useState([]);
9-
9+
const [brandSortOrder, setBrandSortOrder] = useState('descending');
10+
const [priceSortOrder, setPriceSortOrder] = useState('descending');
1011

1112
useEffect(() => {
1213
setPosts(props.data);
1314
}, [props]);
1415

16+
17+
const handleBrandSort = () => {
18+
const sortedSneakers = [...posts].sort((a, b) => {
19+
if (brandSortOrder === 'ascending') {
20+
return a.brand_name.localeCompare(b.brand_name);
21+
} else {
22+
return b.brand_name.localeCompare(a.brand_name);
23+
}
24+
});
25+
setPosts([...sortedSneakers]);
26+
27+
setBrandSortOrder(brandSortOrder === 'descending' ? 'ascending' : 'descending');
28+
};
29+
30+
const handlePriceSort = () => {
31+
const sortedSneakers = [...posts].sort((a, b) => {
32+
const priceA = parseFloat(a.price.replace('$', ''));
33+
const priceB = parseFloat(b.price.replace('$', ''));
34+
35+
if (priceSortOrder === 'ascending') {
36+
return priceA - priceB;
37+
} else {
38+
return priceB - priceA;
39+
}
40+
});
41+
setPosts([...sortedSneakers]);
42+
43+
setPriceSortOrder(priceSortOrder === 'descending' ? 'ascending' : 'descending');
44+
};
45+
1546
return (
1647
<div>
1748

1849
<div className="ReadSneakers">
19-
<div className="banner">
20-
<h3>Your Sneaker Journey</h3>
21-
<p className="welcome-paragraph">Thank you for joining us on this exciting journey through sneaker culture, fashion, and innovation. <br /> We invite you to explore, discover, and be inspired as we continue to fuel our passion and yours.</p>
22-
</div>
50+
<div className="banner">
51+
<h3>Your Sneaker Journey</h3>
52+
<p className="welcome-paragraph">Thank you for joining us on this exciting journey through sneaker culture, fashion, and innovation. <br /> We invite you to explore, discover, and be inspired as we continue to fuel our passion and yours.</p>
53+
</div><br />
54+
55+
<div className="Sort">
56+
<p>Sort By:</p>
57+
<button onClick={handleBrandSort}>
58+
Brand ({brandSortOrder === 'ascending' ? ' A-Z' : ' Z-A'})
59+
</button> <br /><br />
60+
61+
<button onClick={handlePriceSort}>
62+
Price ({priceSortOrder === 'ascending' ? ' Low-High' : ' High-Low'})
63+
</button>
64+
</div>
2365

2466
{
2567
posts && posts.length > 0 ?

milestones/milestone1.md

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)