-
Notifications
You must be signed in to change notification settings - Fork 3
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
17 changed files
with
192 additions
and
75 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,37 @@ | ||
import React, { useState } from 'react'; | ||
import { | ||
ButtonsWrapper, | ||
AddToCartButton, | ||
QuantityButton, | ||
PlusMinusButton, | ||
} from './styles'; | ||
|
||
export default function Buttons() { | ||
const [quantity, setQuantity] = useState<number>(1); | ||
|
||
const increaseQuantity = () => { | ||
setQuantity(quantity + 1); | ||
}; | ||
|
||
const decreaseQuantity = () => { | ||
if (quantity > 1) { | ||
setQuantity(quantity - 1); | ||
} | ||
}; | ||
|
||
// used hyphen instead of dash for display | ||
return ( | ||
<ButtonsWrapper> | ||
<QuantityButton> | ||
<PlusMinusButton type="button" onClick={decreaseQuantity}> | ||
– | ||
</PlusMinusButton> | ||
<span>{quantity}</span> | ||
<PlusMinusButton type="button" onClick={increaseQuantity}> | ||
+ | ||
</PlusMinusButton> | ||
</QuantityButton> | ||
<AddToCartButton>Add to cart</AddToCartButton> | ||
</ButtonsWrapper> | ||
); | ||
} |
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 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 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 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 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,40 @@ | ||
import Image from 'next/image'; | ||
import Link from 'next/link'; | ||
import React from 'react'; | ||
|
||
import { NavBarComp, ButtonsDiv } from '../styles/components'; | ||
|
||
export default function NavBar() { | ||
return ( | ||
<NavBarComp> | ||
<Link href="../storefront"> | ||
<Image | ||
src="/images/ShantiLogo.png" | ||
alt="Shanti Logo" | ||
width={125} | ||
height={70} | ||
/> | ||
</Link> | ||
|
||
<ButtonsDiv> | ||
<Link href="../profileScreen"> | ||
<Image | ||
src="/images/Profile.png" | ||
alt="Profile icon" | ||
width={40} | ||
height={40} | ||
/> | ||
</Link> | ||
|
||
<Link href="../checkout"> | ||
<Image | ||
src="/images/Cart.png" | ||
alt="Cart icon" | ||
width={30} | ||
height={40} | ||
/> | ||
</Link> | ||
</ButtonsDiv> | ||
</NavBarComp> | ||
); | ||
} |
Oops, something went wrong.