print base
This commit is contained in:
@@ -74,4 +74,7 @@ export const Paths = {
|
|||||||
create: "/learning/create",
|
create: "/learning/create",
|
||||||
category: "/learning/category",
|
category: "/learning/category",
|
||||||
},
|
},
|
||||||
|
print: {
|
||||||
|
list: '/print/list'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
import { type FC } from 'react'
|
||||||
|
import { useGetSections } from './hooks/usePrintData'
|
||||||
|
import { Link } from 'react-router-dom'
|
||||||
|
import { Paths } from '@/config/Paths'
|
||||||
|
import Button from '@/components/Button'
|
||||||
|
import { AddSquare } from 'iconsax-react'
|
||||||
|
|
||||||
|
const SectionList: FC = () => {
|
||||||
|
|
||||||
|
const { data } = useGetSections()
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className='mt-5'>
|
||||||
|
<div className='flex justify-between items-center'>
|
||||||
|
<h1 className='text-lg font-light'>محصولات</h1>
|
||||||
|
|
||||||
|
<Link
|
||||||
|
to={Paths.print.list}
|
||||||
|
>
|
||||||
|
<Button
|
||||||
|
className='w-fit px-6'
|
||||||
|
>
|
||||||
|
<div className='flex gap-1.5'>
|
||||||
|
<AddSquare size={18} color='black' />
|
||||||
|
<div className='text-[13px] font-light'>محصول جدید</div>
|
||||||
|
</div>
|
||||||
|
</Button>
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default SectionList
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
import { useQuery } from "@tanstack/react-query";
|
||||||
|
import * as api from "../service/PrintService";
|
||||||
|
|
||||||
|
export const useGetSections = () => {
|
||||||
|
return useQuery({
|
||||||
|
queryKey: ["sections"],
|
||||||
|
queryFn: api.getSections,
|
||||||
|
});
|
||||||
|
};
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
import axios from "@/config/axios";
|
||||||
|
|
||||||
|
export const getSections = async () => {
|
||||||
|
const { data } = await axios.get(`/admin/section`);
|
||||||
|
return data;
|
||||||
|
};
|
||||||
@@ -40,6 +40,7 @@ import FormBuilderValues from '@/pages/formBuilder/AttributeValues'
|
|||||||
import OrderDetail from '@/pages/order/OrderDetail'
|
import OrderDetail from '@/pages/order/OrderDetail'
|
||||||
import NewOrder from '@/pages/order/NewOrder'
|
import NewOrder from '@/pages/order/NewOrder'
|
||||||
import EditOrder from '@/pages/order/EditOrder'
|
import EditOrder from '@/pages/order/EditOrder'
|
||||||
|
import SectionList from '@/pages/print/List'
|
||||||
|
|
||||||
const MainRouter: FC = () => {
|
const MainRouter: FC = () => {
|
||||||
return (
|
return (
|
||||||
@@ -78,6 +79,8 @@ const MainRouter: FC = () => {
|
|||||||
<Route path={Paths.order.create} element={<NewOrder />} />
|
<Route path={Paths.order.create} element={<NewOrder />} />
|
||||||
<Route path={Paths.order.edit + ':id'} element={<EditOrder />} />
|
<Route path={Paths.order.edit + ':id'} element={<EditOrder />} />
|
||||||
|
|
||||||
|
<Route path={Paths.print.list} element={<SectionList />} />
|
||||||
|
|
||||||
<Route path={Paths.features.list} element={<FeaturesList />} />
|
<Route path={Paths.features.list} element={<FeaturesList />} />
|
||||||
<Route path={Paths.features.create} element={<CreateFeature />} />
|
<Route path={Paths.features.create} element={<CreateFeature />} />
|
||||||
<Route path={Paths.service.print} element={<PrintService />} />
|
<Route path={Paths.service.print} element={<PrintService />} />
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { type FC } from 'react'
|
import { type FC } from 'react'
|
||||||
import LogoImage from '@/assets/images/logo.svg'
|
import LogoImage from '@/assets/images/logo.svg'
|
||||||
import { AddSquare, DocumentText, Element3, ElementEqual, Home2, Messages3, MessageText, NotificationStatus, People, Profile2User, Receipt21, Teacher } from 'iconsax-react'
|
import { AddSquare, DocumentText, Element3, ElementEqual, Home2, Messages3, MessageText, NotificationStatus, People, Printer, Profile2User, Receipt21, Teacher } from 'iconsax-react'
|
||||||
import SideBarItem from './SidebarItem'
|
import SideBarItem from './SidebarItem'
|
||||||
import { useLocation } from 'react-router-dom'
|
import { useLocation } from 'react-router-dom'
|
||||||
import { Paths } from '../config/Paths'
|
import { Paths } from '../config/Paths'
|
||||||
@@ -85,6 +85,13 @@ const SideBar: FC = () => {
|
|||||||
link={'Paths.'}
|
link={'Paths.'}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<SideBarItem
|
||||||
|
icon={<Printer size={iconSizeSideBar} color='#4F5260' />}
|
||||||
|
title={'چاپ'}
|
||||||
|
isActive={isActive('print')}
|
||||||
|
link={Paths.print.list}
|
||||||
|
/>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className='mt-10 px-6 text-description text-sm font-bold'>
|
<div className='mt-10 px-6 text-description text-sm font-bold'>
|
||||||
|
|||||||
Reference in New Issue
Block a user