-
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
5 changed files
with
130 additions
and
121 deletions.
There are no files selected for viewing
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,26 +1,26 @@ | ||
{ | ||
"name": "react-shopping-cart", | ||
"private": true, | ||
"version": "0.0.0", | ||
"type": "module", | ||
"scripts": { | ||
"dev": "vite", | ||
"build": "vite build", | ||
"lint": "eslint src --ext js,jsx --report-unused-disable-directives --max-warnings 0", | ||
"preview": "vite preview" | ||
}, | ||
"dependencies": { | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0" | ||
}, | ||
"devDependencies": { | ||
"@types/react": "^18.0.28", | ||
"@types/react-dom": "^18.0.11", | ||
"@vitejs/plugin-react-swc": "^3.0.0", | ||
"eslint": "^8.38.0", | ||
"eslint-plugin-react": "^7.32.2", | ||
"eslint-plugin-react-hooks": "^4.6.0", | ||
"eslint-plugin-react-refresh": "^0.3.4", | ||
"vite": "^4.3.2" | ||
} | ||
"name": "react-shopping-cart", | ||
"private": true, | ||
"version": "0.0.0", | ||
"type": "module", | ||
"scripts": { | ||
"dev": "vite --open", | ||
"build": "vite build", | ||
"lint": "eslint src --ext js,jsx --report-unused-disable-directives --max-warnings 0", | ||
"preview": "vite preview" | ||
}, | ||
"dependencies": { | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0" | ||
}, | ||
"devDependencies": { | ||
"@types/react": "^18.0.28", | ||
"@types/react-dom": "^18.0.11", | ||
"@vitejs/plugin-react-swc": "^3.0.0", | ||
"eslint": "^8.38.0", | ||
"eslint-plugin-react": "^7.32.2", | ||
"eslint-plugin-react-hooks": "^4.6.0", | ||
"eslint-plugin-react-refresh": "^0.3.4", | ||
"vite": "^4.3.2" | ||
} | ||
} |
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 |
---|---|---|
@@ -1,35 +1,7 @@ | ||
import { useState } from 'react' | ||
import reactLogo from './assets/react.svg' | ||
import viteLogo from '/vite.svg' | ||
import './App.css' | ||
import "./App.css"; | ||
|
||
function App() { | ||
const [count, setCount] = useState(0) | ||
|
||
return ( | ||
<> | ||
<div> | ||
<a href="https://vitejs.dev" target="_blank"> | ||
<img src={viteLogo} className="logo" alt="Vite logo" /> | ||
</a> | ||
<a href="https://react.dev" target="_blank"> | ||
<img src={reactLogo} className="logo react" alt="React logo" /> | ||
</a> | ||
</div> | ||
<h1>Vite + React</h1> | ||
<div className="card"> | ||
<button onClick={() => setCount((count) => count + 1)}> | ||
count is {count} | ||
</button> | ||
<p> | ||
Edit <code>src/App.jsx</code> and save to test HMR | ||
</p> | ||
</div> | ||
<p className="read-the-docs"> | ||
Click on the Vite and React logos to learn more | ||
</p> | ||
</> | ||
) | ||
return <h1>Shopping Cart</h1>; | ||
} | ||
|
||
export default App | ||
export default App; |
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,91 @@ | ||
export function AddToCartIcon() { | ||
return ( | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
width="24" | ||
height="24" | ||
viewBox="0 0 24 24" | ||
strokeWidth="1" | ||
stroke="currentColor" | ||
fill="none" | ||
strokeLinecap="round" | ||
strokeLinejoin="round" | ||
> | ||
<path stroke="none" d="M0 0h24v24H0z" fill="none" /> | ||
<path d="M6 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" /> | ||
<path d="M17 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" /> | ||
<path d="M17 17h-11v-14h-2" /> | ||
<path d="M6 5l6 .429m7.138 6.573l-.143 1h-13" /> | ||
<path d="M15 6h6m-3 -3v6" /> | ||
</svg> | ||
); | ||
} | ||
|
||
export function RemoveFromCartIcon() { | ||
return ( | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
width="24" | ||
height="24" | ||
viewBox="0 0 24 24" | ||
strokeWidth="1" | ||
stroke="currentColor" | ||
fill="none" | ||
strokeLinecap="round" | ||
strokeLinejoin="round" | ||
> | ||
<path stroke="none" d="M0 0h24v24H0z" fill="none" /> | ||
<path d="M6 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" /> | ||
<path d="M17 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" /> | ||
<path d="M17 17h-11v-14h-2" /> | ||
<path d="M6 5l8 .571m5.43 4.43l-.429 3h-13" /> | ||
<path d="M17 3l4 4" /> | ||
<path d="M21 3l-4 4" /> | ||
</svg> | ||
); | ||
} | ||
|
||
export function ClearCartIcon() { | ||
return ( | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
width="24" | ||
height="24" | ||
viewBox="0 0 24 24" | ||
strokeWidth="1" | ||
stroke="currentColor" | ||
fill="none" | ||
strokeLinecap="round" | ||
strokeLinejoin="round" | ||
> | ||
<path stroke="none" d="M0 0h24v24H0z" fill="none" /> | ||
<path d="M6 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" /> | ||
<path d="M17 17a2 2 0 1 0 2 2" /> | ||
<path d="M17 17h-11v-11" /> | ||
<path d="M9.239 5.231l10.761 .769l-1 7h-2m-4 0h-7" /> | ||
<path d="M3 3l18 18" /> | ||
</svg> | ||
); | ||
} | ||
|
||
export function CartIcon() { | ||
return ( | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
width="24" | ||
height="24" | ||
viewBox="0 0 24 24" | ||
strokeWidth="1" | ||
stroke="currentColor" | ||
fill="none" | ||
strokeLinecap="round" | ||
strokeLinejoin="round" | ||
> | ||
<path stroke="none" d="M0 0h24v24H0z" fill="none" /> | ||
<path d="M6 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" /> | ||
<path d="M17 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" /> | ||
<path d="M17 17h-11v-14h-2" /> | ||
<path d="M6 5l14 1l-1 7h-13" /> | ||
</svg> | ||
); | ||
} |
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