Skip to content

Commit 6e60393

Browse files
committed
Remove unneeded nav in navbar
1 parent 2931a3e commit 6e60393

File tree

7 files changed

+53
-70
lines changed

7 files changed

+53
-70
lines changed

components/Header/Navbar.component.jsx

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,22 @@ const Navbar = () => {
1919
className="order-3 hidden w-full md:flex md:items-center md:w-auto md:order-1"
2020
id="menu"
2121
>
22-
<nav>
23-
<ul className="items-center justify-between pt-4 text-base text-gray-700 md:flex md:pt-0">
24-
<li>
25-
<Link href="/produkter">
26-
<a className="inline-block px-4 py-2 no-underline hover:text-black hover:underline">
27-
Produkter
28-
</a>
29-
</Link>
30-
</li>
31-
<li>
32-
<Link href="/kategorier">
33-
<a className="inline-block px-4 py-2 no-underline hover:text-black hover:underline">
34-
Kategorier
35-
</a>
36-
</Link>
37-
</li>
38-
</ul>
39-
</nav>
22+
<ul className="items-center justify-between pt-4 text-base text-gray-700 md:flex md:pt-0">
23+
<li>
24+
<Link href="/produkter">
25+
<a className="inline-block px-4 py-2 no-underline hover:text-black hover:underline">
26+
Produkter
27+
</a>
28+
</Link>
29+
</li>
30+
<li>
31+
<Link href="/kategorier">
32+
<a className="inline-block px-4 py-2 no-underline hover:text-black hover:underline">
33+
Kategorier
34+
</a>
35+
</Link>
36+
</li>
37+
</ul>
4038
</div>
4139
<div className="order-1 md:order-2">
4240
<Link href="/">

components/Index/Hero.component.jsx

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,25 @@
33
*/
44
const Hero = () => {
55
return (
6-
<>
7-
<section
8-
id="hero"
9-
className="flex w-full pt-12 mx-auto mt-24 bg-right bg-cover md:pt-0 md:items-center"
10-
>
11-
<div className="container mx-auto">
12-
<div className="flex flex-col items-start justify-center w-full px-6 tracking-wide lg:w-1/2">
13-
<h1 className="my-4 text-2xl text-black">
14-
Stripete Zig Zag Jigsaw Pute Sett
15-
</h1>
6+
<section
7+
id="hero"
8+
className="flex w-full pt-12 mx-auto mt-24 bg-right bg-cover md:pt-0 md:items-center"
9+
>
10+
<div className="container mx-auto">
11+
<div className="flex flex-col items-start justify-center w-full px-6 tracking-wide lg:w-1/2">
12+
<h1 className="my-4 text-2xl text-black">
13+
Stripete Zig Zag Jigsaw Pute Sett
14+
</h1>
1615

17-
<a
18-
className="inline-block px-6 py-3 text-xl leading-relaxed border border-gray-600 border-solid hover:underline"
19-
href="#"
20-
>
21-
Kjøp Nå
22-
</a>
23-
</div>
16+
<a
17+
className="inline-block px-6 py-3 text-xl leading-relaxed border border-gray-600 border-solid hover:underline"
18+
href="#"
19+
>
20+
Kjøp Nå
21+
</a>
2422
</div>
25-
</section>
26-
</>
23+
</div>
24+
</section>
2725
);
2826
};
2927

components/Product/IndexProducts.component.jsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ import PageTitle from 'components/Header/PageTitle.component';
1111
const IndexProducts = ({ products }) => {
1212
return (
1313
<>
14-
<PageTitle title="Produkter" />
15-
16-
<section className="py-4 bg-white">
17-
<div className="container flex flex-wrap items-center mx-auto">
14+
15+
<PageTitle title="Produkter" />
16+
17+
<section className="py-4 bg-white">
18+
<div id="product-container" className="container flex flex-wrap items-center mx-auto overflow-hidden">
1819
{products ? (
1920
products.map(
2021
({
@@ -38,7 +39,8 @@ const IndexProducts = ({ products }) => {
3839
<a>
3940
<img
4041
id="product-image"
41-
className="object-cover w-full h-64 transition duration-500 ease-in-out transform hover:grow hover:shadow-lg hover:scale-105"
42+
// className="object-cover w-full h-64 transition duration-500 ease-in-out transform hover:grow hover:shadow-lg hover:scale-105"
43+
className="w-64 transition duration-500 ease-in-out transform hover:grow hover:shadow-lg hover:scale-105"
4244
src={image.sourceUrl}
4345
/>
4446
</a>
@@ -73,6 +75,8 @@ const IndexProducts = ({ products }) => {
7375
)}
7476
</div>
7577
</section>
78+
79+
7680
</>
7781
);
7882
};

pages/cart.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ import CartItemsContainer from '../components/Cart/CartPage/CartItemsContainer.c
33
const Cart = () => {
44
return (
55
<>
6-
76
<CartItemsContainer />
8-
97
</>
108
);
119
};

pages/index.js

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,19 @@
11
import Hero from 'components/Index/Hero.component';
22
import IndexProducts from 'components/Product/IndexProducts.component';
3-
import LoadingSpinner from 'components/LoadingSpinner/LoadingSpinner.component';
3+
import client from 'utils/apollo/ApolloClient.js';
44

55
import { FETCH_ALL_PRODUCTS_QUERY } from 'utils/const/GQL_QUERIES';
6-
import client from 'utils/apollo/ApolloClient.js';
76

87
/**
98
* Main index page
10-
* @param {Object} props
9+
* @param {Object} products
1110
* Initial static data is sent as props from getStaticProps and loaded through 'utils/const/INITIAL_PRODUCTS'
1211
*/
13-
const HomePage = ({ products, loading, networkStatus }) => {
12+
const HomePage = ({ products }) => {
1413
return (
1514
<>
1615
<Hero />
1716
{products && <IndexProducts products={products} />}
18-
19-
{
20-
// TODO
21-
// Add Hoodies section here
22-
}
23-
24-
{loading && (
25-
<div className="h-64 mt-8 text-2xl text-center">
26-
Laster produkter ...
27-
<br />
28-
<LoadingSpinner />
29-
</div>
30-
)}
31-
{/* Display error message if error occured */}
32-
{networkStatus === 8 && (
33-
<div className="h-12 mt-8 text-2xl text-center">
34-
Feil under lasting av produkter ...
35-
</div>
36-
)}
3717
</>
3818
);
3919
};
@@ -49,7 +29,6 @@ export async function getServerSideProps() {
4929

5030
return {
5131
props: {
52-
// products: result.data.products.nodes,
5332
products: data.products.nodes,
5433
loading: loading,
5534
networkStatus: networkStatus,

public/images/hero.jpg

76 KB
Loading

styles/index.css

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
@tailwind components;
33

44
#hero {
5-
background-image: url('https://images.unsplash.com/photo-1422190441165-ec2956dc9ecc?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1000&q=80');
6-
max-width: 1000px;
5+
background-image: url('https://images.unsplash.com/photo-1422190441165-ec2956dc9ecc?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1050&q=80');
6+
max-width: 1050px;
77
height: 24rem;
88
}
99

@@ -23,6 +23,12 @@
2323
margin-top:-20px;
2424
}
2525

26+
#product-container {
27+
max-width: 1100px;
28+
}
29+
30+
31+
2632
.ais-SearchBox-reset {
2733
margin-left: 10px;
2834
}

0 commit comments

Comments
 (0)