Skip to content

Commit

Permalink
firstRoute
Browse files Browse the repository at this point in the history
  • Loading branch information
mohammadpy8 committed Aug 26, 2023
1 parent 39de060 commit a0b7bb1
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 14 deletions.
61 changes: 60 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-icons": "^4.10.1"
"react-icons": "^4.10.1",
"react-router-dom": "^6.15.0",
"sweetalert": "^2.1.2"
},
"devDependencies": {
"@types/react": "^18.0.28",
Expand Down
21 changes: 9 additions & 12 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
import React from "react";
import { AiFillStar, AiOutlineStar, AiOutlineShoppingCart } from "react-icons/ai";

import Headers from "./components/Headers";
import "./App.css";
import { AiFillStar, AiOutlineStar } from "react-icons/ai";
import { useRoutes } from "react-router-dom";
import routes from "./routes";
function App() {

const router = useRoutes(routes);

return (
// <ContextDataProvider>
<div className="app">
<header>
<a className="logo" href="#">
shop cart
</a>
<a href="#">
{/* <AiOutlineShoppingCart className="shop-icon" /> */}
<span>2</span>
</a>
</header>

{/* Start Content */}

<Headers />
<section>
<p className="title">All Products:</p>
</section>
Expand Down
19 changes: 19 additions & 0 deletions src/components/Headers.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React from 'react'

import { AiOutlineShoppingCart } from 'react-icons/ai'

const Headers = () => {
return (
<header>
<a className="logo" href="#">
shop cart
</a>
<a href="#">
<AiOutlineShoppingCart className="shop-icon" />
<span>2</span>
</a>
</header>
)
}

export default Headers
9 changes: 9 additions & 0 deletions src/routes.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import App from "./App";
import Cart from "./Pages/Cart";

const routes = [
{ path: "/", element: <App /> },
{ path: "/cart", element: <Cart /> }
];

export default routes;

0 comments on commit a0b7bb1

Please sign in to comment.