Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .env
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
VITE_BACKEND_BASE_URL="http://localhost:9004/api"
VITE_APP_PORT="5175"
VITE_BACKEND_BASE_URL="http://localhost:9001/api/v1"
VITE_APP_PORT="5173"
131 changes: 127 additions & 4 deletions package-lock.json

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

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@
"preview": "vite preview"
},
"dependencies": {
"@reduxjs/toolkit": "^2.1.0",
"@tanstack/react-table": "^8.11.7",
"axios": "^1.6.7",
"framer-motion": "^11.0.3",
"moment": "^2.30.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-icons": "^5.0.1",
"react-redux": "^9.1.0",
"react-responsive": "^9.0.2",
"react-router-dom": "^6.21.3"
},
Expand Down
58 changes: 30 additions & 28 deletions src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,33 +1,35 @@
import { Route, Routes } from 'react-router-dom';
import RootLayout from './layouts/RootLayout';
import Users from './pages/Users';
import Dashboard from './pages/Dashboard';
import Products from './pages/Products';
import Discount from './pages/Discount';
import Order from './pages/Order';
import Profile from './pages/Profile';
import Settings from './pages/Settings';
import AddProducts from './pages/AddProducts';
import Health from './pages/health';
import { Route, Routes } from "react-router-dom";
import RootLayout from "./layouts/RootLayout";
import Users from "./pages/Users";
import Dashboard from "./pages/Dashboard";
import Products from "./pages/Products";
import Discount from "./pages/Discount";
import Order from "./pages/Order";
import Profile from "./pages/Profile";
import Settings from "./pages/Settings";
import AddProducts from "./pages/AddProducts";
import Health from "./pages/health";
import EditProducts from "./pages/EditProducts";

const App = () => {
return (
<>
<RootLayout>
<Routes>
<Route path="/" element={<Dashboard />} />
<Route path="/users" element={<Users />} />
<Route path="/add-products" element={<AddProducts />} />
<Route path="/products" element={<Products />} />
<Route path="/discount" element={<Discount />} />
<Route path="/order" element={<Order />} />
<Route path="/profile" element={<Profile />} />
<Route path="/settings" element={<Settings />} />
<Route path="/health" element={<Health />} />
</Routes>
</RootLayout>
</>
);
return (
<>
<RootLayout>
<Routes>
<Route path="/" element={<Dashboard />} />
<Route path="/users" element={<Users />} />
<Route path="/add-products" element={<AddProducts />} />
<Route path="/products/:id" element={<EditProducts />} />
<Route path="/products" element={<Products />} />
<Route path="/discount" element={<Discount />} />
<Route path="/order" element={<Order />} />
<Route path="/profile" element={<Profile />} />
<Route path="/settings" element={<Settings />} />
<Route path="/health" element={<Health />} />
</Routes>
</RootLayout>
</>
);
};

export default App;
18 changes: 10 additions & 8 deletions src/components/Box.jsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import React from 'react';
import React from "react";

const Box = ({ children, className }) => {
return (
<>
<div className={`${className} p-4 border shadow-md rounded-lg bg-white`}>
{children}
</div>
</>
);
return (
<>
<div
className={`${className} overflow-x-auto p-4 border shadow-md rounded-lg bg-white`}
>
{children}
</div>
</>
);
};

export default Box;
14 changes: 14 additions & 0 deletions src/components/Button.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React from 'react';

const Button = ({ children, className, onClick }) => {
return (
<button
className={`${className} px-5 py-2 bg-mod-color-orange-100 hover:bg-[#ff5a13] text-white font-semibold rounded`}
onClick={onClick}
>
{children}
</button>
);
};

export default Button;
36 changes: 36 additions & 0 deletions src/components/Input.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import React from 'react';

const Input = ({
label,
type,
placeholder,
onChange,
name,
cols,
rows,
className = 'w-1/2 mt-1 mb-3 p-2 font-medium bg-slate-100 border shadow border-zinc-200 focus:outline-none rounded-md',
}) => {
return (
<div className="flex flex-col mb-4">
<label>{label}</label>
{type === 'textarea' ? (
<textarea
name={name}
cols={cols}
rows={rows}
className={className}
onChange={onChange}
></textarea>
) : (
<input
type={type}
placeholder={placeholder}
onChange={onChange}
className={className}
/>
)}
</div>
);
};

export default Input;
2 changes: 1 addition & 1 deletion src/layouts/RootLayout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function RootLayout({ children }) {
return (
<div className="flex ">
<Sidebar />
<div className="flex flex-col w-full">
<div className="flex flex-col w-full">
<NavBar />
<main className="container mx-auto px-5 py-4">{children}</main>
</div>
Expand Down
Loading