Skip to content

Commit

Permalink
Setup files
Browse files Browse the repository at this point in the history
  • Loading branch information
Darkk3n committed May 28, 2023
1 parent 1b69260 commit 3613028
Show file tree
Hide file tree
Showing 5 changed files with 130 additions and 121 deletions.
48 changes: 24 additions & 24 deletions package.json
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"
}
}
42 changes: 0 additions & 42 deletions src/App.css

This file was deleted.

34 changes: 3 additions & 31 deletions src/App.jsx
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;
91 changes: 91 additions & 0 deletions src/components/Icons.jsx
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>
);
}
36 changes: 12 additions & 24 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,12 @@
-webkit-text-size-adjust: 100%;
}

a {
font-weight: 500;
color: #646cff;
text-decoration: inherit;
}
a:hover {
color: #535bf2;
#root {
max-width: 600px;
margin: 0 auto;
padding: 2rem;
text-align: center;
width: 100%;
}

body {
Expand All @@ -31,11 +30,6 @@ body {
min-height: 100vh;
}

h1 {
font-size: 3.2em;
line-height: 1.1;
}

button {
border-radius: 8px;
border: 1px solid transparent;
Expand All @@ -47,23 +41,17 @@ button {
cursor: pointer;
transition: border-color 0.25s;
}

button:hover {
border-color: #646cff;
}

button:focus,
button:focus-visible {
outline: 4px auto -webkit-focus-ring-color;
}

@media (prefers-color-scheme: light) {
:root {
color: #213547;
background-color: #ffffff;
}
a:hover {
color: #747bff;
}
button {
background-color: #f9f9f9;
}
}
ul {
list-style: none;
padding: 0;
}

0 comments on commit 3613028

Please sign in to comment.