Compare commits
3 Commits
1d31d5eb34
...
cd6e47903b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cd6e47903b | ||
|
|
cea1277edb | ||
|
|
fe6e8aae95 |
|
|
@ -18,7 +18,6 @@ const SearchField: React.FC<Props> = ({ placeholder, searchBy }) => {
|
|||
const handleInputChange = (value: string) => {
|
||||
setSearchQuery(value);
|
||||
};
|
||||
console.log(searchBy,"searchBy");
|
||||
|
||||
const handleInputChangeWithDebounce = useDebounce((value: string) => {
|
||||
setFilter({
|
||||
|
|
|
|||
|
|
@ -29,14 +29,14 @@ const OrderBySelect = () => {
|
|||
options={[
|
||||
{ value: "ascending", label: t("select.array.order.ascending") },
|
||||
{ value: "descending", label: t("select.array.order.descending") },
|
||||
{
|
||||
value: "recently_viewed",
|
||||
label: t("select.array.order.recently_viewed"),
|
||||
},
|
||||
{
|
||||
value: "recently_arrived",
|
||||
label: t("select.array.order.recently_arrived"),
|
||||
},
|
||||
// {
|
||||
// value: "recently_viewed",
|
||||
// label: t("select.array.order.recently_viewed"),
|
||||
// },
|
||||
// {
|
||||
// value: "recently_arrived",
|
||||
// label: t("select.array.order.recently_arrived"),
|
||||
// },
|
||||
]}
|
||||
/>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import { useState } from "react";
|
|||
import { useTranslation } from "react-i18next";
|
||||
import { MdExpandLess, MdExpandMore } from "react-icons/md";
|
||||
import { Link, useNavigate } from "react-router-dom";
|
||||
import { useFilterStateState } from "../../../zustand/Filter";
|
||||
|
||||
export const MenuItem = ({ item, location, index, isOpen }: any) => {
|
||||
const isActive = location.pathname.split("/")[1] === item.path?.slice(1);
|
||||
|
|
@ -12,12 +13,17 @@ export const MenuItem = ({ item, location, index, isOpen }: any) => {
|
|||
const isDropdownOpen = openDropdown === index;
|
||||
const [t] = useTranslation();
|
||||
const navigate = useNavigate();
|
||||
const { setFilter} = useFilterStateState();
|
||||
const handleNavigate = ()=>{
|
||||
setFilter({})
|
||||
navigate(item.path || "/")
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<div
|
||||
className={`link ${isActive ? "active" : ""} ${item?.children && "DropDownLink"}`}
|
||||
onClick={() => navigate(item.path || "/")}
|
||||
onClick={() => handleNavigate()}
|
||||
>
|
||||
<i>{item.icon}</i>
|
||||
{/* Conditionally render the text based on sidebar width */}
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ const TextField = ({
|
|||
showCount
|
||||
maxLength={1000}
|
||||
autoSize={{ minRows: 4, maxRows: 10 }}
|
||||
|
||||
onChange={onChange || TextFilehandleChange}
|
||||
id={name}
|
||||
{...props}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import useModalHandler from "../../utils/useModalHandler";
|
|||
import { deletePathSegments } from "../../utils/deletePathSegments";
|
||||
import { getPrevPathRoute } from "../../utils/getPrevPathRoute";
|
||||
import PageTitleComponent from "./PageTitle";
|
||||
import { useFilterStateState } from "../../zustand/Filter";
|
||||
|
||||
const PageHeader = ({
|
||||
canAdd,
|
||||
|
|
@ -27,8 +28,12 @@ const PageHeader = ({
|
|||
const { t } = useTranslation();
|
||||
|
||||
const PrevPath = getPrevPathRoute(location.pathname);
|
||||
const { setFilter } = useFilterStateState();
|
||||
|
||||
const handleNavigateToPage = (location: string) => {
|
||||
setFilter({})
|
||||
navigate(location);
|
||||
|
||||
};
|
||||
|
||||
console.log();
|
||||
|
|
|
|||
|
|
@ -1,16 +1,21 @@
|
|||
import React from 'react'
|
||||
import { useLocation, useNavigate } from 'react-router-dom'
|
||||
import { usePageTitleState } from '../../zustand/PageTitleState'
|
||||
import { useFilterStateState } from '../../zustand/Filter'
|
||||
|
||||
const PageTitleComponent = () => {
|
||||
|
||||
const {PageTitle,setPageTitle} = usePageTitleState()
|
||||
const {PageTitle} = usePageTitleState()
|
||||
const navigate = useNavigate()
|
||||
const location = useLocation()
|
||||
const { setFilter } = useFilterStateState();
|
||||
|
||||
|
||||
const handleNavigate = (path:string)=>{
|
||||
const currentPath = location.pathname ;
|
||||
const newPath = currentPath?.split(path)?.[0] + path ;
|
||||
if(newPath !== currentPath){
|
||||
setFilter({})
|
||||
navigate(newPath)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import { CiMenuBurger, CiSettings } from "react-icons/ci";
|
|||
import { IoIosMenu } from "react-icons/io";
|
||||
import { HiMenuAlt2, HiMenuAlt3 } from "react-icons/hi";
|
||||
import { RoleByType } from "../../utils/RoleByType";
|
||||
import { useFilterStateState } from "../../zustand/Filter";
|
||||
|
||||
const SideBar = ({
|
||||
isOpen,
|
||||
|
|
@ -25,7 +26,6 @@ const SideBar = ({
|
|||
const navigate = useNavigate();
|
||||
const { logout } = useAuthState();
|
||||
const [t] = useTranslation();
|
||||
const branch_name = getLocalStorage(BRANCH_OBJECT_KEY)?.name;
|
||||
|
||||
const toggleSidebar = () => {
|
||||
setIsOpen((prev: boolean) => (prev === true ? false : true));
|
||||
|
|
|
|||
|
|
@ -3,13 +3,18 @@ import React from "react";
|
|||
import DataTable from "../../../Layout/Dashboard/Table/DataTable";
|
||||
import { useGetAllGrade } from "../../../api/grade";
|
||||
import { useFilterState } from "../../../Components/Utils/Filter/FilterState";
|
||||
import { useFilterStateState } from "../../../zustand/Filter";
|
||||
|
||||
const App: React.FC = () => {
|
||||
const { filterState } = useFilterState();
|
||||
|
||||
const { Filter } = useFilterStateState();
|
||||
const name = Filter?.name ;
|
||||
const sort_by = Filter?.sort_by ;
|
||||
const response = useGetAllGrade({
|
||||
pagination: true,
|
||||
...filterState,
|
||||
name,
|
||||
sort_by
|
||||
});
|
||||
|
||||
return <DataTable response={response} useColumns={useColumns} />;
|
||||
|
|
|
|||
|
|
@ -1,17 +1,22 @@
|
|||
import React from "react";
|
||||
import DataTable from "../../../Layout/Dashboard/Table/DataTable";
|
||||
import { useColumns } from "./useTableColumns";
|
||||
import useSearchQuery from "../../../api/utils/useSearchQuery";
|
||||
import { useGetAllParam } from "../../../api/param";
|
||||
import { useFilterState } from "../../../Components/Utils/Filter/FilterState";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useFilterStateState } from "../../../zustand/Filter";
|
||||
|
||||
const App: React.FC = () => {
|
||||
const [searchQuery] = useSearchQuery("name");
|
||||
const { filterState } = useFilterState();
|
||||
const { Filter } = useFilterStateState();
|
||||
|
||||
const name = Filter?.name ;
|
||||
const sort_by = Filter?.sort_by ;
|
||||
|
||||
|
||||
const response = useGetAllParam({
|
||||
name: searchQuery,
|
||||
name,
|
||||
sort_by,
|
||||
pagination: true,
|
||||
...filterState,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -9,13 +9,15 @@ import { useFilterStateState } from "../../../zustand/Filter";
|
|||
const App: React.FC = () => {
|
||||
const { filterState } = useFilterState();
|
||||
const { setFilter,Filter } = useFilterStateState();
|
||||
const sort_by = Filter?.sort_by ;
|
||||
|
||||
console.log(filterState,"filterState");
|
||||
|
||||
const response = useGetAllQuestion({
|
||||
pagination: true,
|
||||
...filterState,
|
||||
content:Filter?.content
|
||||
content:Filter?.content,
|
||||
sort_by,
|
||||
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -1,16 +1,20 @@
|
|||
import React from "react";
|
||||
import { useGetAllTag } from "../../../api/tags";
|
||||
import DataTable from "../../../Layout/Dashboard/Table/DataTable";
|
||||
import { useColumns } from "./useTableColumns";
|
||||
import useSearchQuery from "../../../api/utils/useSearchQuery";
|
||||
import { useGetAllReport } from "../../../api/report";
|
||||
import { useFilterState } from "../../../Components/Utils/Filter/FilterState";
|
||||
import { useFilterStateState } from "../../../zustand/Filter";
|
||||
const App: React.FC = () => {
|
||||
const [searchQuery] = useSearchQuery("name");
|
||||
const { filterState } = useFilterState();
|
||||
|
||||
const { Filter } = useFilterStateState();
|
||||
const name = Filter?.name ;
|
||||
const sort_by = Filter?.sort_by ;
|
||||
|
||||
|
||||
const response = useGetAllReport({
|
||||
name: searchQuery,
|
||||
name,
|
||||
sort_by,
|
||||
pagination: true,
|
||||
...filterState,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -4,12 +4,17 @@ import { useColumns } from "./useTableColumns";
|
|||
import useSearchQuery from "../../../api/utils/useSearchQuery";
|
||||
import { useGetAllReseller } from "../../../api/reseller";
|
||||
import { useFilterState } from "../../../Components/Utils/Filter/FilterState";
|
||||
import { useFilterStateState } from "../../../zustand/Filter";
|
||||
const App: React.FC = () => {
|
||||
const [searchQuery] = useSearchQuery("name");
|
||||
const { filterState } = useFilterState();
|
||||
const { Filter } = useFilterStateState();
|
||||
|
||||
const name = Filter?.name ;
|
||||
const sort_by = Filter?.sort_by ;
|
||||
|
||||
const response = useGetAllReseller({
|
||||
name: searchQuery,
|
||||
name,
|
||||
sort_by,
|
||||
pagination: true,
|
||||
...filterState,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -3,11 +3,20 @@ import React from "react";
|
|||
import DataTable from "../../../Layout/Dashboard/Table/DataTable";
|
||||
import { useGetAllStudent } from "../../../api/student";
|
||||
import { useFilterState } from "../../../Components/Utils/Filter/FilterState";
|
||||
import { useFilterStateState } from "../../../zustand/Filter";
|
||||
|
||||
const App: React.FC = () => {
|
||||
const { filterState } = useFilterState();
|
||||
|
||||
const { Filter } = useFilterStateState();
|
||||
|
||||
const name = Filter?.name ;
|
||||
const sort_by = Filter?.sort_by ;
|
||||
|
||||
|
||||
const response = useGetAllStudent({
|
||||
name,
|
||||
sort_by,
|
||||
pagination: true,
|
||||
...filterState,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -2,15 +2,19 @@ import React from "react";
|
|||
import { useGetAllTag } from "../../../api/tags";
|
||||
import DataTable from "../../../Layout/Dashboard/Table/DataTable";
|
||||
import { useColumns } from "./useTableColumns";
|
||||
import useSearchQuery from "../../../api/utils/useSearchQuery";
|
||||
import { useFilterState } from "../../../Components/Utils/Filter/FilterState";
|
||||
import { useFilterStateState } from "../../../zustand/Filter";
|
||||
const App: React.FC = () => {
|
||||
const [searchQuery] = useSearchQuery("name");
|
||||
|
||||
const { filterState } = useFilterState();
|
||||
const { Filter } = useFilterStateState();
|
||||
const name = Filter?.name ;
|
||||
const sort_by = Filter?.sort_by ;
|
||||
|
||||
const response = useGetAllTag({
|
||||
name: searchQuery,
|
||||
pagination: true,
|
||||
name,
|
||||
sort_by,
|
||||
...filterState,
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ const LoadingLottie = React.lazy(
|
|||
import { useTranslation } from "react-i18next";
|
||||
import { useColumns } from "./useTableColumns";
|
||||
import { useFilterState } from "../../../Components/Utils/Filter/FilterState";
|
||||
import { useFilterStateState } from "../../../zustand/Filter";
|
||||
|
||||
interface DataType {
|
||||
id: string; // Unique identifier for each row
|
||||
|
|
@ -93,10 +94,14 @@ const Row: React.FC<RowProps> = (props) => {
|
|||
const DrapableTable: React.FC = () => {
|
||||
const { subject_id } = useParams<ParamsEnum>();
|
||||
const { filterState } = useFilterState();
|
||||
|
||||
const { Filter } = useFilterStateState();
|
||||
const name = Filter?.name ;
|
||||
const sort_by = Filter?.sort_by ;
|
||||
const response = useGetAllUnit({
|
||||
subject_id: subject_id,
|
||||
pagination: false,
|
||||
name,
|
||||
sort_by,
|
||||
...filterState,
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -6,20 +6,24 @@ import { useParams } from "react-router-dom";
|
|||
import { ParamsEnum } from "../../../enums/params";
|
||||
import { useObjectToEdit } from "../../../zustand/ObjectToEditState";
|
||||
import { useFilterState } from "../../../Components/Utils/Filter/FilterState";
|
||||
import { useFilterStateState } from "../../../zustand/Filter";
|
||||
|
||||
const App: React.FC = () => {
|
||||
const { subject_id } = useParams<ParamsEnum>();
|
||||
|
||||
const { Filter } = useFilterStateState();
|
||||
const name = Filter?.name ;
|
||||
const sort_by = Filter?.sort_by ;
|
||||
const response = useGetAllUnit({
|
||||
subject_id: subject_id,
|
||||
pagination: true,
|
||||
name,
|
||||
sort_by
|
||||
});
|
||||
|
||||
|
||||
const { setOldObjectToEdit } = useObjectToEdit();
|
||||
// console.log(response?.data?.data, "response?.data");
|
||||
const data = response?.data?.data;
|
||||
const lastElement =
|
||||
response?.data?.data && response?.data?.data[data?.length - 1];
|
||||
// console.log(lastElement);
|
||||
const lastElement = response?.data?.data && response?.data?.data[data?.length - 1];
|
||||
|
||||
useEffect(() => {
|
||||
if (lastElement) {
|
||||
|
|
|
|||
|
|
@ -2,15 +2,18 @@ import React from "react";
|
|||
import { useGetAllTag } from "../../../api/tags";
|
||||
import DataTable from "../../../Layout/Dashboard/Table/DataTable";
|
||||
import { useColumns } from "./useTableColumns";
|
||||
import useSearchQuery from "../../../api/utils/useSearchQuery";
|
||||
import { useGetAllUser } from "../../../api/user";
|
||||
import { useFilterState } from "../../../Components/Utils/Filter/FilterState";
|
||||
import { useFilterStateState } from "../../../zustand/Filter";
|
||||
const App: React.FC = () => {
|
||||
const [searchQuery] = useSearchQuery("name");
|
||||
const { filterState } = useFilterState();
|
||||
const { Filter } = useFilterStateState();
|
||||
const name = Filter?.name ;
|
||||
const sort_by = Filter?.sort_by ;
|
||||
|
||||
const response = useGetAllUser({
|
||||
name: searchQuery,
|
||||
name,
|
||||
sort_by,
|
||||
pagination: true,
|
||||
...filterState,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ const LoadingLottie = React.lazy(
|
|||
import { useTranslation } from "react-i18next";
|
||||
import { useColumns } from "./useTableColumns";
|
||||
import { useFilterState } from "../../../Components/Utils/Filter/FilterState";
|
||||
import { useFilterStateState } from "../../../zustand/Filter";
|
||||
|
||||
interface DataType {
|
||||
id: string; // Unique identifier for each row
|
||||
|
|
@ -94,9 +95,15 @@ const DrapableTable: React.FC = () => {
|
|||
const { unit_id } = useParams<ParamsEnum>();
|
||||
const { filterState } = useFilterState();
|
||||
|
||||
const { Filter } = useFilterStateState();
|
||||
const name = Filter?.name ;
|
||||
const sort_by = Filter?.sort_by ;
|
||||
|
||||
const response = useGetAllLesson({
|
||||
unit_id: unit_id,
|
||||
pagination: false,
|
||||
name,
|
||||
sort_by,
|
||||
...filterState,
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ import { useGetAllUnit } from "../../../api/unit";
|
|||
import { ModalEnum } from "../../../enums/Model";
|
||||
import { useDeleteLesson } from "../../../api/lesson";
|
||||
import { useGetAllGrade } from "../../../api/grade";
|
||||
import { useGetAllCurriculum } from "../../../api/curriculum";
|
||||
import { useGetAllSubject } from "../../../api/subject";
|
||||
import PageHeader from "../../../Layout/Dashboard/PageHeader";
|
||||
import FilterLayout from "../../../Layout/Dashboard/FilterLayout";
|
||||
|
|
|
|||
|
|
@ -6,13 +6,21 @@ import { useParams } from "react-router-dom";
|
|||
import { ParamsEnum } from "../../../enums/params";
|
||||
import { useObjectToEdit } from "../../../zustand/ObjectToEditState";
|
||||
import { useFilterState } from "../../../Components/Utils/Filter/FilterState";
|
||||
import { useFilterStateState } from "../../../zustand/Filter";
|
||||
|
||||
const App: React.FC = () => {
|
||||
const { unit_id } = useParams<ParamsEnum>();
|
||||
|
||||
const { Filter } = useFilterStateState();
|
||||
const name = Filter?.name ;
|
||||
const sort_by = Filter?.sort_by ;
|
||||
|
||||
|
||||
const response = useGetAllLesson({
|
||||
unit_id: unit_id,
|
||||
pagination: true,
|
||||
name,
|
||||
sort_by
|
||||
});
|
||||
|
||||
const { setOldObjectToEdit } = useObjectToEdit();
|
||||
|
|
|
|||
|
|
@ -60,7 +60,8 @@ const TextField = ({
|
|||
showCount
|
||||
maxLength={1000}
|
||||
onChange={onChange || TextFilehandleChange}
|
||||
style={{ height: 120 }}
|
||||
autoSize={{ minRows: 4, maxRows: 10 }}
|
||||
|
||||
id={id}
|
||||
/>
|
||||
</Form.Item>
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ const TextField = ({
|
|||
showCount
|
||||
maxLength={1000}
|
||||
onChange={onChange || TextFilehandleChange}
|
||||
style={{ height: 120 }}
|
||||
autoSize={{ minRows: 4, maxRows: 10 }}
|
||||
/>
|
||||
</Form.Item>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ const TextField = ({
|
|||
showCount
|
||||
maxLength={1000}
|
||||
onChange={onChange || TextFilehandleChange}
|
||||
style={{ height: 120 }}
|
||||
autoSize={{ minRows: 4, maxRows: 10 }}
|
||||
/>
|
||||
</Form.Item>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -10,13 +10,16 @@ import { useFilterStateState } from "../../../zustand/Filter";
|
|||
const App: React.FC = () => {
|
||||
const { lesson_id } = useParams<ParamsEnum>();
|
||||
const { filterState } = useFilterState();
|
||||
const { setFilter,Filter } = useFilterStateState();
|
||||
const { Filter } = useFilterStateState();
|
||||
const sort_by = Filter?.sort_by ;
|
||||
const content = Filter?.content ;
|
||||
|
||||
const response = useGetAllQuestion({
|
||||
lessonsIds: [lesson_id],
|
||||
pagination: true,
|
||||
...filterState,
|
||||
content:Filter?.content
|
||||
content,
|
||||
sort_by
|
||||
});
|
||||
return <DataTable response={response} useColumns={useColumns} />;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -21,12 +21,12 @@ const DeleteModalForm = lazy(
|
|||
);
|
||||
|
||||
const TableWithHeader = () => {
|
||||
const { handel_open_model } = useModalHandler();
|
||||
const [t] = useTranslation();
|
||||
const deleteMutation = useDeleteSubject();
|
||||
|
||||
const { grade_id } = useParams<ParamsEnum>();
|
||||
|
||||
console.log(grade_id);
|
||||
|
||||
const { data: grade } = useGetAllGrade({
|
||||
show: grade_id,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -4,15 +4,20 @@ import DataTable from "../../../../Layout/Dashboard/Table/DataTable";
|
|||
import { useColumns } from "./useTableColumns";
|
||||
import { ParamsEnum } from "../../../../enums/params";
|
||||
import { useFilterState } from "../../../../Components/Utils/Filter/FilterState";
|
||||
import { useFilterStateState } from "../../../../zustand/Filter";
|
||||
|
||||
const TablePage: React.FC = () => {
|
||||
const { grade_id } = useParams<ParamsEnum>();
|
||||
const { filterState } = useFilterState();
|
||||
|
||||
const { Filter } = useFilterStateState();
|
||||
const name = Filter?.name ;
|
||||
const sort_by = Filter?.sort_by ;
|
||||
const response = useGetAllSubject({
|
||||
grade_id: grade_id,
|
||||
pagination: true,
|
||||
...filterState,
|
||||
name,
|
||||
sort_by
|
||||
});
|
||||
|
||||
return <DataTable response={response} useColumns={useColumns} />;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
--primary: #3d5ee1;
|
||||
--secondary: #303972;
|
||||
--field: #b0d9ff;
|
||||
--text: black;
|
||||
--text: #202C4B;
|
||||
--subtext: #9d9d9d;
|
||||
--label: #0d5190;
|
||||
--bg: rgb(255, 255, 255);
|
||||
|
|
@ -38,35 +38,3 @@
|
|||
--fieldHeight: 40px;
|
||||
}
|
||||
|
||||
:root:has(.dark) {
|
||||
--primary: #3d5ee1;
|
||||
--secondary: #303972;
|
||||
--field: #b0d9ff;
|
||||
--text: white;
|
||||
--subtext: #9d9d9d;
|
||||
--label: #0d5190;
|
||||
--bg: rgb(51, 51, 51);
|
||||
--bg2: black;
|
||||
--bg3: rgba(255, 255, 255, 0.82);
|
||||
--border-color: #b0d9ff;
|
||||
--shadow: rgba(0, 0, 0, 0.15);
|
||||
--white: white;
|
||||
--bgSideBar: #0f0c1c;
|
||||
--textSideBar: #ffffff;
|
||||
--sideBarWidth: 14vw;
|
||||
--sideBarMinWidth: 14vw;
|
||||
--sideBarSpace: 1%;
|
||||
--links: #25638f;
|
||||
|
||||
--button: #2d3748;
|
||||
--layoutPadding: 3%;
|
||||
--border-radius: 10px;
|
||||
|
||||
--utils_color_one: #fb7d5b;
|
||||
--utils_color_tow: #fcc43e;
|
||||
|
||||
--presence: #31ce83;
|
||||
--absence: #ce3131;
|
||||
--lateArrival: #f0e43b;
|
||||
--earlyDeparture: #3d5ee1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,19 +1,5 @@
|
|||
@font-face {
|
||||
font-family: "Poppins_Bold";
|
||||
src: url("../../font/Poppins-Bold.ttf") format("truetype"); /* Specify the path to the font file */
|
||||
font-display: swap;
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Arabic:wght@400;700&display=swap');
|
||||
|
||||
body {
|
||||
font-family: "Poppins", sans-serif; /* Use ABeeZee font for body text */
|
||||
}
|
||||
|
||||
@mixin Font_Poppins {
|
||||
font-family: "Poppins"; /* Use ABeeZee font for body text */
|
||||
}
|
||||
|
||||
@mixin Font_Poppins_Bold {
|
||||
font-family: "Poppins-Bold"; /* Use ABeeZee font for body text */
|
||||
font-family: "Noto Sans Arabic", sans-serif; /* Use Noto Sans Arabic for body text */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@
|
|||
transition: 1s ease-in-out;
|
||||
animation: fadeInRight 1s ease-in-out;
|
||||
max-height: 90vh;
|
||||
min-height: 90vh;
|
||||
overflow-y: scroll;
|
||||
@include Scrollbar;
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,6 @@
|
|||
h5 {
|
||||
color: var(--secondary);
|
||||
font-size: 0.8vw;
|
||||
@include Font_Poppins;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -37,7 +37,6 @@
|
|||
h6 {
|
||||
font-weight: bold;
|
||||
color: var(--secondary);
|
||||
@include Font_Poppins_Bold;
|
||||
font-size: 1.5vw;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,9 +3,6 @@ import useAxios from "./useAxios";
|
|||
import { useLocation } from "react-router-dom";
|
||||
import { PaginationParams } from "../utils/PaginationParams";
|
||||
import { filterParams } from "../utils/filterParams";
|
||||
import useAuthState from "../../zustand/AuthState";
|
||||
import { useFilterStateState } from "../../zustand/Filter";
|
||||
|
||||
function useGetQuery(
|
||||
KEY: string | string[],
|
||||
url: string,
|
||||
|
|
@ -13,18 +10,18 @@ function useGetQuery(
|
|||
options: any = {},
|
||||
) {
|
||||
const axios = useAxios();
|
||||
const { Filter } = useFilterStateState();
|
||||
const sort_by = Filter?.sort_by ?? null;
|
||||
const name = Filter?.name ?? null;
|
||||
const { show, pagination, ...remainingParams } = params;
|
||||
|
||||
const location = useLocation();
|
||||
|
||||
|
||||
const { page, per_page } = PaginationParams(location);
|
||||
|
||||
console.log(remainingParams)
|
||||
const paramToSend = pagination
|
||||
? { page: page, per_page: per_page, name, ...remainingParams, sort_by }
|
||||
: { name, ...remainingParams, sort_by };
|
||||
|
||||
|
||||
? { page: page, per_page: per_page, ...remainingParams }
|
||||
: { ...remainingParams };
|
||||
|
||||
const filteredParams = filterParams(paramToSend);
|
||||
|
||||
|
|
|
|||
Binary file not shown.
16
src/utils/shallowEqual.ts
Normal file
16
src/utils/shallowEqual.ts
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
export function shallowEqual(obj1: any, obj2: any): boolean {
|
||||
const keys1 = Object.keys(obj1);
|
||||
const keys2 = Object.keys(obj2);
|
||||
|
||||
if (keys1.length !== keys2.length) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (const key of keys1) {
|
||||
if (obj1[key] !== obj2[key]) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user