Skip to content

Commit 7a6916c

Browse files
authored
Merge pull request #164 from w3bdesign/development
Improve and update README
2 parents 32c23e8 + ea7b11d commit 7a6916c

File tree

7 files changed

+25
-15
lines changed

7 files changed

+25
-15
lines changed

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Start the server with ```npm run dev ```
2727
- Able to place orders remotely with Woocommerce (bank transfers only for now)
2828
- Algolia search (work in progress)
2929
- Apollo Client with GraphQL
30-
- Animations with React-Spring
30+
- Animations with React-Spring and Animate.css
3131
- Shows loading spinner created with Styled Components while loading data and error message if data can not be loaded
3232
- Shows page load progress with Nprogress during navigation
3333
- Mobile menu and cart slide-out with animations
@@ -41,9 +41,7 @@ Start the server with ```npm run dev ```
4141

4242
## TODO
4343

44-
- Validate remote Woocommerce session (or delete old session?)
4544
- Hide products not in stock
4645
- Add better SEO
47-
- Add price to Algolia search (Wordpress plugin has been developed, needs to be integrated)
4846
- Add a better README.md
4947
- Implement https://github.com/cyrilwanner/next-optimized-images for production

components/Cart/AddToCartButton.component.jsx

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ import {
2525
const AddToCartButton = (props) => {
2626
const [cart, setCart] = useContext(AppContext);
2727
const [requestError, setRequestError] = useState(null);
28-
const [showViewCart, setShowViewCart] = useState(false);
28+
const [showViewCart, setShowViewCart] = useState(false);
29+
const [showAddToCart, setshowAddToCart] = useState(false);
2930

3031
const product = props.product;
3132

@@ -63,7 +64,8 @@ const AddToCartButton = (props) => {
6364
refetch();
6465
// Show View Cart Button
6566
setShowViewCart(true);
66-
console.warn('Completed ADD_TO_CART', data);
67+
setshowAddToCart(true)
68+
6769
},
6870
onError: (error) => {
6971
if (error) {
@@ -81,14 +83,14 @@ const AddToCartButton = (props) => {
8183

8284
return (
8385
<>
84-
{!addToCartLoading && (
85-
<button
86-
onClick={handleAddToCartClick}
87-
className="px-4 py-2 font-bold bg-white border border-gray-400 border-solid rounded hover:bg-gray-400"
88-
>
89-
KJØP
90-
</button>
91-
)}
86+
<button
87+
onClick={handleAddToCartClick}
88+
className={`px-4 py-2 font-bold bg-white border border-gray-400 border-solid rounded hover:bg-gray-400 ${
89+
addToCartLoading && `animate__animated animate__fadeOut`} ${showAddToCart && `animate__animated animate__fadeIn` }`}
90+
>
91+
KJØP
92+
</button>
93+
9294
{addToCartLoading && (
9395
<>
9496
<div className="mt-4 text-xl text-left">

components/Product/IndexProducts.component.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const IndexProducts = ({ products }) => {
3535
<img
3636
id="product-image"
3737
className="transition duration-500 ease-in-out transform hover:grow hover:shadow-lg hover:scale-105"
38-
//className="w-64 transition duration-500 ease-in-out transform hover:grow hover:shadow-lg hover:scale-105"
38+
alt={name}
3939
src={image.sourceUrl}
4040
/>
4141
</a>

components/Product/SingleProduct.component.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ const SingleProduct = ({ product }) => {
4444
<img
4545
id="product-image"
4646
className="h-auto p-8 transition duration-500 ease-in-out transform xl:p-2 md:p-2 lg:p-2 hover:grow hover:shadow-lg hover:scale-105"
47+
alt={name}
4748
src={image.sourceUrl}
4849
/>
4950
<div className="ml-8">

pages/_app.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import Footer from '../components/Footer/Footer.component';
99

1010
import '../styles/index.css';
1111
import '../styles/algolia.min.css';
12+
import '../styles/animate.min.css';
1213
import 'nprogress/nprogress.css';
1314

1415
import client from '../utils/apollo/ApolloClient';

pages/produkt/[slug].js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { request } from 'graphql-request';
21
import { withRouter } from 'next/router';
32

43
import SingleProduct from 'components/Product/SingleProduct.component';

styles/animate.min.css

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)