- 🤖 Introduction
- ⚙️ Tech Stack
- 🤸 Quick Start
- 🚀 Live Demo
- 🕸️ Code Snippets to Copy
Built with React, this app is a built With Theming, Tables, Charts, Calendar, Kanban and More.
- React.js
- Javascript
- Chart.js
- Syncfashion
Follow these steps to set up the project locally on your machine.
Prerequisites
Make sure you have the following installed on your machine:
Cloning the Repository
git clone https://github.com/khaled9912/syncfashion-dashboard
cd syncfashion-dashboardInstallation
Install the project dependencies using npm:
npm installRunning the Project
npm startOpen http://localhost:3000 in your browser to view the project.
SideNav
import React from 'react';
import { Link, NavLink } from 'react-router-dom';
import { SiShopware } from 'react-icons/si';
import { MdOutlineCancel } from 'react-icons/md';
import { TooltipComponent } from '@syncfusion/ej2-react-popups';
import { links } from '../data/dummy';
import { useStateContext } from '../contexts/ContextProvider';
const Sidebar = () => {
const { currentColor, activeMenu, setActiveMenu, screenSize } = useStateContext();
const handleCloseSideBar = () => {
if (activeMenu !== undefined && screenSize <= 900) {
setActiveMenu(false);
}
};
const activeLink = 'flex items-center gap-5 pl-4 pt-3 pb-2.5 rounded-lg text-white text-md m-2';
const normalLink = 'flex items-center gap-5 pl-4 pt-3 pb-2.5 rounded-lg text-md text-gray-700 dark:text-gray-200 dark:hover:text-black hover:bg-light-gray m-2';
return (
<div className="ml-3 h-screen md:overflow-hidden overflow-auto md:hover:overflow-auto pb-10">
{activeMenu && (
<>
<div className="flex justify-between items-center">
<Link to="/" onClick={handleCloseSideBar} className="items-center gap-3 ml-3 mt-4 flex text-xl font-extrabold tracking-tight dark:text-white text-slate-900">
<SiShopware /> <span>Shoppy</span>
</Link>
<TooltipComponent content="Menu" position="BottomCenter">
<button
type="button"
onClick={() => setActiveMenu(!activeMenu)}
style={{ color: currentColor }}
className="text-xl rounded-full p-3 hover:bg-light-gray mt-4 block md:hidden"
>
<MdOutlineCancel />
</button>
</TooltipComponent>
</div>
<div className="mt-10 ">
{links.map((item) => (
<div key={item.title}>
<p className="text-gray-400 dark:text-gray-400 m-3 mt-4 uppercase">
{item.title}
</p>
{item.links.map((link) => (
<NavLink
to={`/${link.name}`}
key={link.name}
onClick={handleCloseSideBar}
style={({ isActive }) => ({
backgroundColor: isActive ? currentColor : '',
})}
className={({ isActive }) => (isActive ? activeLink : normalLink)}
>
{link.icon}
<span className="capitalize ">{link.name}</span>
</NavLink>
))}
</div>
))}
</div>
</>
)}
</div>
);
};
export default Sidebar;
Chart
import { MdOutlineCancel } from 'react-icons/md';
import { AiOutlinePlus, AiOutlineMinus } from 'react-icons/ai';
import { useStateContext } from '../contexts/ContextProvider';
import { cartData } from '../data/dummy';
import { Button } from '.';
const Cart = () => {
const { currentColor } = useStateContext();
return (
<div className="bg-half-transparent w-full fixed nav-item top-0 right-0 ">
<div className="float-right h-screen duration-1000 ease-in-out dark:text-gray-200 transition-all dark:bg-[#484B52] bg-white md:w-400 p-8">
<div className="flex justify-between items-center">
<p className="font-semibold text-lg">Shopping Cart</p>
<Button
icon={<MdOutlineCancel />}
color="rgb(153, 171, 180)"
bgHoverColor="light-gray"
size="2xl"
borderRadius="50%"
/>
</div>
{cartData?.map((item, index) => (
<div key={index}>
<div>
<div className="flex items-center leading-8 gap-5 border-b-1 border-color dark:border-gray-600 p-4">
<img className="rounded-lg h-80 w-24" src={item.image} alt="" />
<div>
<p className="font-semibold ">{item.name}</p>
<p className="text-gray-600 dark:text-gray-400 text-sm font-semibold">{item.category}</p>
<div className="flex gap-4 mt-2 items-center">
<p className="font-semibold text-lg">{item.price}</p>
<div className="flex items-center border-1 border-r-0 border-color rounded">
<p className="p-2 border-r-1 dark:border-gray-600 border-color text-red-600 "><AiOutlineMinus /></p>
<p className="p-2 border-r-1 border-color dark:border-gray-600 text-green-600">0</p>
<p className="p-2 border-r-1 border-color dark:border-gray-600 text-green-600"><AiOutlinePlus /></p>
</div>
</div>
</div>
</div>
</div>
</div>
))}
<div className="mt-3 mb-3">
<div className="flex justify-between items-center">
<p className="text-gray-500 dark:text-gray-200">Sub Total</p>
<p className="font-semibold">$890</p>
</div>
<div className="flex justify-between items-center mt-3">
<p className="text-gray-500 dark:text-gray-200">Total</p>
<p className="font-semibold">$890</p>
</div>
</div>
<div className="mt-5">
<Button
color="white"
bgColor={currentColor}
text="Place Order"
borderRadius="10px"
width="full"
/>
</div>
</div>
</div>
);
};
export default Cart;