-
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.
- Loading branch information
Showing
18 changed files
with
220 additions
and
178 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,15 @@ | ||
// import Link from 'next/link' | ||
|
||
|
||
// export default function BagsTrial({bags}) { | ||
// console.log(bags) | ||
// return( | ||
// <ul className='h-96 w-full border-2 border-red-500'> | ||
// {bags && bags.data.map(bag => { | ||
// return <li key={bag.id}> | ||
// <Link href={`bag/` + bag.attributes.slug}>{bag.attributes.product_name}</Link> | ||
// </li> | ||
// })} | ||
// </ul> | ||
// ) | ||
// } |
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,14 +1,14 @@ | ||
import Link from 'next/link' | ||
// import Link from 'next/link' | ||
|
||
|
||
export default function Bags({cloths}) { | ||
return( | ||
<ul> | ||
{cloths && cloths.data.map(cloth => { | ||
return <li key={cloth.id}> | ||
<Link href={`cloth/` + cloth.attributes.slug}>{cloth.attributes.product_name}</Link> | ||
</li> | ||
})} | ||
</ul> | ||
) | ||
} | ||
// export default function Bags({cloths}) { | ||
// return( | ||
// <ul> | ||
// {cloths && cloths.data.map(cloth => { | ||
// return <li key={cloth.id}> | ||
// <Link href={`cloth/` + cloth.attributes.slug}>{cloth.attributes.product_name}</Link> | ||
// </li> | ||
// })} | ||
// </ul> | ||
// ) | ||
// } |
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,43 @@ | ||
import React, { useState, useContext } from 'react'; | ||
|
||
const GlobalContext = React.createContext(); | ||
|
||
const GlobalProvider = ({ children }) => { | ||
//STATE AND FUNCTIONS FOR MANAGING CART ITEMS | ||
const [cartItemsNo, setCartItemsNo] = useState(0); | ||
const [cartItems, setCartItems] = useState([]); | ||
const addCartItem = () => { | ||
setCartItemsNo(cartItemsNo + 1) | ||
}; | ||
const removeCartItem = () => { | ||
setCartItemsNo(cartItemsNo - 1) | ||
}; | ||
const addToCart = (item) => { | ||
cartItems.every(cartItem => cartItem.id !== item.id) && ( | ||
setCartItems([...cartItems, item]), | ||
setCartItemsNo(cartItemsNo + 1) | ||
) | ||
}; | ||
|
||
|
||
|
||
return ( | ||
<GlobalContext.Provider | ||
value={{ | ||
cartItemsNo, | ||
addCartItem, | ||
removeCartItem, | ||
addToCart, | ||
cartItems | ||
}} | ||
> | ||
{children} | ||
</GlobalContext.Provider> | ||
); | ||
}; | ||
// make sure use | ||
export const useGlobalContext = () => { | ||
return useContext(GlobalContext); | ||
}; | ||
|
||
export { GlobalContext, GlobalProvider }; |
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
This file was deleted.
Oops, something went wrong.
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,28 +1,7 @@ | ||
/** @type {import('next').NextConfig} */ | ||
|
||
const nextConfig = { | ||
reactStrictMode: true, | ||
swcMinify: true, | ||
} | ||
|
||
|
||
module.exports = { | ||
|
||
// env: { | ||
// API_URL: process.env.NEXT_PUBLIC_STRAPI_URL, | ||
// IMAGES_DOMAIN: process.env.IMAGES_DOMAIN | ||
// }, | ||
// publicRuntimeConfig: { | ||
// API_URL: process.env.NEXT_PUBLIC_STRAPI_URL, | ||
// IMAGES_DOMAIN: process.env.IMAGES_DOMAIN | ||
// }, | ||
|
||
// images: { | ||
// deviceSizes: [640, 768, 1024, 1280, 1600], | ||
// imageSizes: [16, 32, 48, 64, 96], | ||
// domains: [process.env.IMAGES_DOMAIN], | ||
// path: '/_next/images', | ||
// loader: 'default' | ||
// }, | ||
nextConfig | ||
} | ||
module.exports = nextConfig |
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 was deleted.
Oops, something went wrong.
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
Oops, something went wrong.