style upfate pagination

main
Dilmurod 2 months ago
parent 8cbe5f9939
commit c3b922a083

@ -827,14 +827,14 @@
) !important; /* Используйте нужный вам цвет фона */ ) !important; /* Используйте нужный вам цвет фона */
} }
.ant-pagination { /* .ant-pagination {
position: fixed; position: fixed;
bottom: 90px;
bottom: 0;
right: 20px; right: 20px;
color: #f99e2c; } */
}
.ant-pagination-item-active { /* .ant-pagination-item-active {
background-color: #f99e2c; background-color: #f99e2c;
color: white; color: white;
} }
@ -854,17 +854,16 @@
} }
.ant-pagination .ant-pagination-item-active:hover { .ant-pagination .ant-pagination-item-active:hover {
border-color: #f99e3c; border-color: #f99e3c;
} } */
.ant-pagination-prev, /* .ant-pagination-prev,
.ant-pagination-next { .ant-pagination-next {
width: 40px; width: 40px;
height: 32px; height: 32px;
background-color: #fff; background-color: #fff;
border: 1px solid #d7d8e0; border: 1px solid #d7d8e0;
border-radius: 8px; border-radius: 8px;
background-color: transparent; } */
}
.btn-refresh-dark img { .btn-refresh-dark img {
animation: none; animation: none;
@ -888,10 +887,6 @@
animation: spin 1s linear; animation: spin 1s linear;
} }
.ant-btn-default {
color: #0f111c;
}
@keyframes spin { @keyframes spin {
0% { 0% {
transform: rotate(0deg); transform: rotate(0deg);

@ -391,6 +391,7 @@ const App: React.FC = () => {
onCollapse={toggleCollapsed} onCollapse={toggleCollapsed}
style={{ style={{
height: "100vh", height: "100vh",
zIndex: 9999,
background: background:
theme === true ? "#202020" : "rgba(20, 22, 41, 1)", theme === true ? "#202020" : "rgba(20, 22, 41, 1)",
}} }}

@ -1,7 +1,12 @@
import React from "react"; import React from "react";
import { Button, Card, Input, Space } from "antd"; import { Button, Card, Input, Space } from "antd";
import { Form, Field } from "react-final-form"; import { Form, Field } from "react-final-form";
import { LockOutlined, UserOutlined } from "@ant-design/icons"; import {
EyeInvisibleOutlined,
EyeTwoTone,
LockOutlined,
UserOutlined,
} from "@ant-design/icons";
import { LoginApi } from "../API/auth/Login"; import { LoginApi } from "../API/auth/Login";
import { Link } from "react-router-dom"; import { Link } from "react-router-dom";
@ -25,7 +30,12 @@ const Login: React.FC = () => {
}; };
return ( return (
<div className="ContainerClassName" style={{ height: "100vh" }}> <div
className="ContainerClassName"
style={{
height: "100vh",
}}
>
<Form <Form
onSubmit={onSubmit} onSubmit={onSubmit}
validate={validate} validate={validate}
@ -42,7 +52,7 @@ const Login: React.FC = () => {
}} }}
> >
<Card <Card
bodyStyle={{ background: "rgb(250, 250, 250)" }} bodyStyle={{ backgroundColor: "rgb(250, 250, 250)" }}
title="Login" title="Login"
className="login-form-card " className="login-form-card "
style={{ width: 400 }} style={{ width: 400 }}
@ -84,6 +94,13 @@ const Login: React.FC = () => {
{...input} {...input}
type="password" type="password"
placeholder="Password" placeholder="Password"
iconRender={(visible) =>
visible ? (
<EyeTwoTone style={{ color: "#bbb" }} />
) : (
<EyeInvisibleOutlined style={{ color: "#bbb" }} />
)
}
/> />
{meta.error && meta.touched && ( {meta.error && meta.touched && (
<span style={{ color: "red" }}>{meta.error}</span> <span style={{ color: "red" }}>{meta.error}</span>

@ -1,4 +1,4 @@
import { Button, Input, Modal, Space, Table } from "antd"; import { Button, Input, Modal, Space, Table, theme } from "antd";
import { TCall } from "../../types/CallRequests/TCall"; import { TCall } from "../../types/CallRequests/TCall";
import { EditOutlined } from "@ant-design/icons"; import { EditOutlined } from "@ant-design/icons";
// @ts-ignore // @ts-ignore
@ -12,6 +12,7 @@ import {
} from "react-query"; } from "react-query";
import { useState } from "react"; import { useState } from "react";
import { TPagination } from "../../types/common/TPagination"; import { TPagination } from "../../types/common/TPagination";
import useToken from "antd/es/theme/useToken";
const CallTable = ({ const CallTable = ({
data, data,
isLoading, isLoading,
@ -57,6 +58,9 @@ const CallTable = ({
const handleNoteChange = (e: React.ChangeEvent<HTMLInputElement>) => { const handleNoteChange = (e: React.ChangeEvent<HTMLInputElement>) => {
setNote(e.target.value); setNote(e.target.value);
}; };
const { token } = theme.useToken();
return ( return (
<div> <div>
<Table <Table
@ -134,7 +138,22 @@ const CallTable = ({
index % 2 === 0 ? "odd-row" : "even-row" index % 2 === 0 ? "odd-row" : "even-row"
} }
scroll={{ x: "768px" }} scroll={{ x: "768px" }}
pagination={{ pageSize: 10, size: "default" }} pagination={{
pageSize: 10,
size: "default",
style: {
margin: 0,
justifyContent: "end",
position: "fixed",
bottom: 0,
left: 0,
width: "100%",
backgroundColor: token.colorBgContainer,
boxShadow: "0 4px 8px rgba(0, 0, 0, 0.4)",
padding: "10px 0",
zIndex: 1000,
},
}}
bordered bordered
/> />
</div> </div>

@ -1,9 +1,16 @@
import { useRef, useState } from "react"; import { useRef, useState } from "react";
import AddCompany from "./AddCompanies"; import AddCompany from "./AddCompanies";
import CompanyTable from "./CompaniesTable"; import CompanyTable from "./CompaniesTable";
import { StepForwardOutlined, StepBackwardOutlined } from "@ant-design/icons"; import {
StepForwardOutlined,
StepBackwardOutlined,
LeftOutlined,
RightOutlined,
} from "@ant-design/icons";
import { useCompanyPaginated } from "../../Hooks/Companies"; import { useCompanyPaginated } from "../../Hooks/Companies";
import { Button, Input, Space, Typography } from "antd"; import { Button, Input, Pagination, Space, Typography } from "antd";
import { theme } from "antd";
// @ts-ignore // @ts-ignore
import IconSearch from "../../assets/searchIcon.png"; import IconSearch from "../../assets/searchIcon.png";
//@ts-ignore //@ts-ignore
@ -50,7 +57,15 @@ const Company = () => {
} }
}; };
const theme = localStorage.getItem("theme") === "true" ? true : false; const { token } = theme.useToken();
const page_size = 15;
const handlePageChange = (page: number) => {
setPage(page);
};
const themes = localStorage.getItem("theme") === "true" ? true : false;
return ( return (
<div> <div>
@ -72,7 +87,7 @@ const Company = () => {
<div className="search-div"> <div className="search-div">
<img src={IconSearch} alt="" /> <img src={IconSearch} alt="" />
<input <input
className={`search-input-${theme}`} className={`search-input-${themes}`}
type="text" type="text"
placeholder="Search" placeholder="Search"
onChange={handleSearchChange} onChange={handleSearchChange}
@ -81,13 +96,43 @@ const Company = () => {
</div> </div>
<CompanyTable data={data?.data} isLoading={isLoading} /> <CompanyTable data={data?.data} isLoading={isLoading} />
{/* <Space style={{ width: "100%", marginTop: 10 }} direction="vertical"> <Space style={{ width: "100%", marginTop: 10 }} direction="vertical">
<Space style={{ width: "100%", justifyContent: "flex-end" }} wrap> <Space
<Button onClick={Previos} disabled={data?.previous ? false : true}> style={{
<img src={leftPagination} /> justifyContent: "end",
position: "fixed",
bottom: 0,
left: 0,
width: "100%",
backgroundColor: token.colorBgContainer,
boxShadow: "0 4px 8px rgba(0, 0, 0, 0.4)",
padding: "10px 0",
zIndex: 1000,
}}
wrap
>
<Button
onClick={Previos}
disabled={data?.previous ? false : true}
style={{
backgroundColor: token.colorBgContainer,
color: token.colorText,
border: "none",
}}
>
<LeftOutlined />
</Button> </Button>
<Input <Input
style={{ width: 30, textAlign: "center" }} disabled
style={{
width: 40,
textAlign: "center",
background: token.colorBgContainer,
border: "1px solid",
borderColor: token.colorText,
color: token.colorText,
cursor: "pointer",
}}
value={page} value={page}
onChange={(e) => { onChange={(e) => {
let num = e.target.value; let num = e.target.value;
@ -96,11 +141,25 @@ const Company = () => {
} }
}} }}
/> />
<Button onClick={Next} disabled={data?.next ? false : true}> <Button
<img src={rightPagination} /> onClick={Next}
disabled={data?.next ? false : true}
style={{
backgroundColor: token.colorBgContainer,
color: token.colorText,
border: "none",
}}
>
<RightOutlined />
</Button> </Button>
{/* <Pagination
current={page}
total={data?.page_size}
pageSize={page_size}
onChange={handlePageChange}
/> */}
</Space> </Space>
</Space> */} </Space>
</div> </div>
); );
}; };

@ -18,6 +18,8 @@ import tt from "../../assets/tticon.svg";
import tagIcon from "../../assets/tagIcon.png"; import tagIcon from "../../assets/tagIcon.png";
import { role } from "../../App"; import { role } from "../../App";
import { theme } from "antd";
function CompanyTable({ function CompanyTable({
data, data,
isLoading, isLoading,
@ -35,6 +37,8 @@ function CompanyTable({
} }
} }
const { token } = theme.useToken();
const getImageSource = (source: string) => { const getImageSource = (source: string) => {
switch (source) { switch (source) {
case "Zippy": case "Zippy":
@ -139,10 +143,23 @@ function CompanyTable({
} }
size="small" size="small"
scroll={{ x: "768px" }} scroll={{ x: "768px" }}
pagination={{ // pagination={{
pageSize: 10, // pageSize: 10,
size: "default", // size: "default",
}} // style: {
// margin: 0,
// justifyContent: "end",
// position: "fixed",
// bottom: 0,
// left: 0,
// width: "100%",
// backgroundColor: token.colorBgContainer,
// boxShadow: "0 4px 8px rgba(0, 0, 0, 0.4)",
// padding: "10px 0",
// zIndex: 1000,
// },
// }}
pagination={false}
bordered bordered
/> />
</div> </div>

@ -1,16 +1,16 @@
import { useRef, useState } from "react"; import { useRef, useState } from "react";
import AddCustomer from "./AddCustomer"; import AddCustomer from "./AddCustomer";
import CustomerTable from "./CustomersTable"; import CustomerTable from "./CustomersTable";
import { StepForwardOutlined, StepBackwardOutlined } from "@ant-design/icons"; import { LeftOutlined, RightOutlined } from "@ant-design/icons";
import { useCustomerData } from "../../Hooks/Customers"; import { useCustomerData } from "../../Hooks/Customers";
//@ts-ignore //@ts-ignore
import addicon from "../../assets/addiconpng.png"; import addicon from "../../assets/addiconpng.png";
// @ts-ignore // @ts-ignore
import leftPagination from "../../assets/pagination-left.png";
import rightPagination from "../../assets/right-pagination.png";
import IconSearch from "../../assets/searchIcon.png"; import IconSearch from "../../assets/searchIcon.png";
import { Button, Input, Space, Typography } from "antd"; import { Button, Input, Pagination, Space, Typography } from "antd";
import { theme } from "antd";
const Customer = () => { const Customer = () => {
const [open, setOpen] = useState(false); const [open, setOpen] = useState(false);
@ -19,6 +19,14 @@ const Customer = () => {
setOpen(true); setOpen(true);
}; };
const page_size = 10;
const handlePageChange = (page: number) => {
setPage(page);
};
const { token } = theme.useToken();
const [search, setSearch] = useState(""); const [search, setSearch] = useState("");
const { data, isLoading, refetch } = useCustomerData({ const { data, isLoading, refetch } = useCustomerData({
name: search, name: search,
@ -50,7 +58,7 @@ const Customer = () => {
setSearch(searchText); setSearch(searchText);
}, 1000); }, 1000);
}; };
const theme = localStorage.getItem("theme") === "true" ? true : false; const themes = localStorage.getItem("theme") === "true" ? true : false;
return ( return (
<div> <div>
@ -66,7 +74,7 @@ const Customer = () => {
<div className="search-div"> <div className="search-div">
<img src={IconSearch} alt="" /> <img src={IconSearch} alt="" />
<input <input
className={`search-input-${theme}`} className={`search-input-${themes}`}
type="text" type="text"
placeholder="Search" placeholder="Search"
onChange={handleSearchChange} onChange={handleSearchChange}
@ -74,13 +82,43 @@ const Customer = () => {
</div> </div>
</div> </div>
<CustomerTable data={data?.data} isLoading={isLoading} /> <CustomerTable data={data?.data} isLoading={isLoading} />
{/* <Space style={{ width: "100%", marginTop: 10 }} direction="vertical"> <Space style={{ width: "100%", marginTop: 10 }} direction="vertical">
<Space style={{ width: "100%", justifyContent: "flex-end" }} wrap> <Space
<Button onClick={Previos} disabled={!data?.previous}> style={{
<img src={leftPagination} /> justifyContent: "end",
position: "fixed",
bottom: 0,
left: 0,
width: "100%",
backgroundColor: token.colorBgContainer,
boxShadow: "0 4px 8px rgba(0, 0, 0, 0.4)",
padding: "10px 0",
zIndex: 1000,
}}
wrap
>
<Button
type="primary"
onClick={Previos}
disabled={!data?.previous}
style={{
backgroundColor: token.colorBgContainer,
color: token.colorText,
border: "none",
}}
>
<LeftOutlined />
</Button> </Button>
<Input <Input
style={{ width: 30, textAlign: "center" }} disabled
style={{
width: 40,
textAlign: "center",
background: token.colorBgContainer,
border: "1px solid",
borderColor: token.colorText,
color: token.colorText,
}}
value={page} value={page}
onChange={(e) => { onChange={(e) => {
let num = e.target.value; let num = e.target.value;
@ -89,11 +127,27 @@ const Customer = () => {
} }
}} }}
/> />
<Button onClick={Next} disabled={!data?.next}> <Button
<img src={rightPagination} /> type="primary"
onClick={Next}
disabled={!data?.next}
style={{
backgroundColor: token.colorBgContainer,
color: token.colorText,
border: "none",
}}
>
<RightOutlined />
</Button> </Button>
{/* <Pagination
current={page}
total={10}
pageSize={page_size}
onChange={handlePageChange}
/> */}
</Space> </Space>
</Space> */} </Space>
</div> </div>
); );
}; };

@ -15,6 +15,9 @@ import ontime from "../../assets/ontimeicon.svg";
import tt from "../../assets/tticon.svg"; import tt from "../../assets/tticon.svg";
import { role } from "../../App"; import { role } from "../../App";
import { theme } from "antd";
import { useState } from "react";
function CustomerTable({ function CustomerTable({
data, data,
isLoading, isLoading,
@ -26,6 +29,11 @@ function CustomerTable({
id: number; id: number;
}; };
const { token } = theme.useToken();
const [pageSize, setPageSize] = useState(10); // Default sahifa hajmi
const [currentPage, setCurrentPage] = useState(1);
const Row = (record: RowProps) => { const Row = (record: RowProps) => {
return { return {
onClick: () => { onClick: () => {
@ -95,11 +103,24 @@ function CustomerTable({
} }
size="middle" size="middle"
bordered bordered
pagination={{ // pagination={{
pageSize: 10, // pageSize: 10,
size: "default", // size: "default",
}} // style: {
// margin: 0,
// justifyContent: "end",
// position: "fixed",
// bottom: 0,
// left: 0,
// width: "100%",
// backgroundColor: token.colorBgContainer,
// boxShadow: "0 4px 8px rgba(0, 0, 0, 0.4)",
// padding: "10px 0",
// zIndex: 1000,
// },
// }}
scroll={{ x: "768px" }} scroll={{ x: "768px" }}
pagination={false}
/> />
</div> </div>
); );

@ -178,7 +178,7 @@ const Profile = () => {
</Form> </Form>
)} )}
<div className=""> <div className="">
<h2 style={{ marginBottom: 20 }}>Your Statistics</h2> <h2 style={{ marginBottom: 20 }}>My Statistics</h2>
<div <div
style={{ style={{
display: "flex", display: "flex",

@ -1,6 +1,11 @@
import { useEffect, useRef, useState } from "react"; import { useEffect, useRef, useState } from "react";
import { useRequestsData } from "../../Hooks/Requests"; import { useRequestsData } from "../../Hooks/Requests";
import { StepForwardOutlined, StepBackwardOutlined } from "@ant-design/icons"; import {
StepForwardOutlined,
StepBackwardOutlined,
LeftOutlined,
RightOutlined,
} from "@ant-design/icons";
import { import {
Button, Button,
Input, Input,
@ -8,6 +13,7 @@ import {
RadioChangeEvent, RadioChangeEvent,
Space, Space,
Typography, Typography,
theme,
} from "antd"; } from "antd";
import { TRequests } from "../../types/Requests/TRequests"; import { TRequests } from "../../types/Requests/TRequests";
import { TSocket } from "../../types/common/TSocket"; import { TSocket } from "../../types/common/TSocket";
@ -43,7 +49,7 @@ const Requests = ({ socketData }: { socketData: TSocket | undefined }) => {
}, 1000); }, 1000);
}; };
const theme = localStorage.getItem("theme") === "true" ? true : false; const themes = localStorage.getItem("theme") === "true" ? true : false;
useEffect(() => { useEffect(() => {
if (data) { if (data) {
@ -75,6 +81,9 @@ const Requests = ({ socketData }: { socketData: TSocket | undefined }) => {
setPage(a); setPage(a);
} }
}; };
const { token } = theme.useToken();
return ( return (
<div> <div>
{modalOpen && ( {modalOpen && (
@ -92,7 +101,7 @@ const Requests = ({ socketData }: { socketData: TSocket | undefined }) => {
<div className="search-div"> <div className="search-div">
<img src={IconSearch} alt="" /> <img src={IconSearch} alt="" />
<input <input
className={`search-input-${theme}`} className={`search-input-${themes}`}
type="text" type="text"
placeholder="Search" placeholder="Search"
onChange={handleSearchChange} onChange={handleSearchChange}
@ -117,13 +126,41 @@ const Requests = ({ socketData }: { socketData: TSocket | undefined }) => {
setRequestData={setRequestData} setRequestData={setRequestData}
/> />
{/* <Space style={{ width: "100%", marginTop: 10 }} direction="vertical"> <Space style={{ width: "100%", marginTop: 10 }} direction="vertical">
<Space style={{ width: "100%", justifyContent: "flex-end" }} wrap> <Space
<Button onClick={Previos} disabled={data?.previous ? false : true}> style={{
<img src={leftPagination} /> justifyContent: "end",
position: "fixed",
bottom: 0,
left: 0,
width: "100%",
backgroundColor: token.colorBgContainer,
boxShadow: "0 4px 8px rgba(0, 0, 0, 0.4)",
padding: "10px 0",
zIndex: 1000,
}}
wrap
>
<Button
onClick={Previos}
disabled={data?.previous ? false : true}
style={{
backgroundColor: token.colorBgContainer,
color: token.colorText,
border: "none",
}}
>
<LeftOutlined />
</Button> </Button>
<Input <Input
style={{ width: 30, textAlign: "center" }} style={{
width: 40,
textAlign: "center",
background: token.colorBgContainer,
border: "1px solid",
borderColor: token.colorText,
color: token.colorText,
}}
value={page} value={page}
onChange={(e) => { onChange={(e) => {
let num = e.target.value; let num = e.target.value;
@ -132,11 +169,19 @@ const Requests = ({ socketData }: { socketData: TSocket | undefined }) => {
} }
}} }}
/> />
<Button onClick={Next} disabled={data?.next ? false : true}> <Button
<img src={rightPagination} /> onClick={Next}
disabled={data?.next ? false : true}
style={{
backgroundColor: token.colorBgContainer,
color: token.colorText,
border: "none",
}}
>
<RightOutlined />
</Button> </Button>
</Space> </Space>
</Space> */} </Space>
</div> </div>
); );
}; };

@ -1,4 +1,4 @@
import { Button, Space, Table } from "antd"; import { Button, Space, Table, theme } from "antd";
import { import {
QueryObserverResult, QueryObserverResult,
RefetchOptions, RefetchOptions,
@ -68,6 +68,9 @@ const RequestsTable = ({
refetch(); refetch();
}); });
}; };
const { token } = theme.useToken();
return ( return (
<div> <div>
<Table <Table
@ -161,7 +164,23 @@ const RequestsTable = ({
index % 2 === 0 ? "odd-row" : "even-row" index % 2 === 0 ? "odd-row" : "even-row"
} }
scroll={{ x: "768px" }} scroll={{ x: "768px" }}
pagination={{ pageSize: 10, size: "default" }} // pagination={{
// pageSize: 10,
// size: "default",
// style: {
// margin: 0,
// justifyContent: "end",
// position: "fixed",
// bottom: 0,
// left: 0,
// width: "100%",
// backgroundColor: token.colorBgContainer,
// boxShadow: "0 4px 8px rgba(0, 0, 0, 0.4)",
// padding: "10px 0",
// zIndex: 1000,
// },
// }}
pagination={false}
bordered bordered
/> />
</div> </div>

@ -9,6 +9,8 @@ import { TService } from "../../types/Service/TService";
// @ts-ignore // @ts-ignore
import tagIcon from "../../assets/tagIcon.png"; import tagIcon from "../../assets/tagIcon.png";
import { role } from "../../App"; import { role } from "../../App";
import { theme } from "antd";
type numStr = string | number; type numStr = string | number;
interface serviceSource { interface serviceSource {
@ -45,6 +47,9 @@ const ServiceTable = ({
dataIndex: "points", dataIndex: "points",
}, },
]; ];
const { token } = theme.useToken();
return ( return (
<div> <div>
<Table <Table
@ -75,6 +80,18 @@ const ServiceTable = ({
pagination={{ pagination={{
pageSize: 10, pageSize: 10,
size: "default", size: "default",
style: {
margin: 0,
justifyContent: "end",
position: "fixed",
bottom: 0,
left: 0,
width: "100%",
backgroundColor: token.colorBgContainer,
boxShadow: "0 4px 8px rgba(0, 0, 0, 0.4)",
padding: "10px 0",
zIndex: 1000,
},
}} }}
bordered bordered
/> />

@ -5,9 +5,20 @@ import ServiceTable from "./ServiceTable";
//@ts-ignore //@ts-ignore
import addicon from "../../assets/addiconpng.png"; import addicon from "../../assets/addiconpng.png";
import { role } from "../../App"; import { role } from "../../App";
import { Typography } from "antd"; import { Pagination, Space, Typography } from "antd";
import { theme } from "antd";
const Service = () => { const Service = () => {
const [page, setPage] = useState(1);
const { token } = theme.useToken();
const page_size = 10;
const handlePageChange = (page: number) => {
setPage(page);
};
const { data, isLoading, refetch } = useServiceData(); const { data, isLoading, refetch } = useServiceData();
const [open, setOpen] = useState(false); const [open, setOpen] = useState(false);
const showModal = () => { const showModal = () => {
@ -27,6 +38,48 @@ const Service = () => {
)} )}
</div> </div>
<ServiceTable data={data} isLoading={isLoading} refetch={refetch} /> <ServiceTable data={data} isLoading={isLoading} refetch={refetch} />
{/* <Space style={{ width: "100%", marginTop: 10 }} direction="vertical">
<Space
style={{
justifyContent: "end",
position: "fixed",
bottom: 0,
left: 0,
width: "100%",
backgroundColor: token.colorBgContainer,
boxShadow: "0 4px 8px rgba(0, 0, 0, 0.4)",
padding: "10px 0",
zIndex: 1000,
}}
wrap
>
<Button onClick={Previos} disabled={data?.previous ? false : true}>
</Button>
<Input
style={{ width: 30, textAlign: "center" }}
value={page}
onChange={(e) => {
let num = e.target.value;
if (Number(num) && num !== "0") {
setPage(Number(num));
}
}}
/>
<Button onClick={Next} disabled={data?.next ? false : true}>
</Button>
<Pagination
// current={page}
// total={10}
// pageSize={2}
// onChange={handlePageChange}
/>
</Space>
</Space> */}
</div> </div>
); );
}; };

@ -7,6 +7,9 @@ import {
} from "react-query"; } from "react-query";
// @ts-ignore // @ts-ignore
import tagIcon from "../../assets/tagIcon.png"; import tagIcon from "../../assets/tagIcon.png";
import { theme } from "antd";
const StatTable = ({ const StatTable = ({
data, data,
isLoading, isLoading,
@ -18,6 +21,8 @@ const StatTable = ({
data: { data: TStat[] | undefined }; data: { data: TStat[] | undefined };
isLoading: boolean; isLoading: boolean;
}) => { }) => {
const { token } = theme.useToken();
return ( return (
<div> <div>
<Table <Table
@ -53,6 +58,18 @@ const StatTable = ({
pagination={{ pagination={{
pageSize: 10, pageSize: 10,
size: "default", size: "default",
style: {
margin: 0,
justifyContent: "end",
position: "fixed",
bottom: 0,
left: 0,
width: "100%",
backgroundColor: token.colorBgContainer,
boxShadow: "0 4px 8px rgba(0, 0, 0, 0.4)",
padding: "10px 0",
zIndex: 1000,
},
}} }}
rowClassName={(record, index) => rowClassName={(record, index) =>
index % 2 === 0 ? "odd-row" : "even-row" index % 2 === 0 ? "odd-row" : "even-row"

@ -20,6 +20,8 @@ import tagIcon from "../../assets/tagIcon.png";
import tgIcon from "../../assets/telegram.png"; import tgIcon from "../../assets/telegram.png";
import { isMobile, role } from "../../App"; import { isMobile, role } from "../../App";
import { theme } from "antd";
const admin_id = localStorage.getItem("admin_id"); const admin_id = localStorage.getItem("admin_id");
const TaskTable = ({ const TaskTable = ({
data, data,
@ -81,6 +83,8 @@ const TaskTable = ({
const [isTextSelected, setIsTextSelected] = useState(false); const [isTextSelected, setIsTextSelected] = useState(false);
const { token } = theme.useToken();
useEffect(() => { useEffect(() => {
const handleSelectionChange = () => { const handleSelectionChange = () => {
const selection = window.getSelection(); const selection = window.getSelection();
@ -427,10 +431,23 @@ const TaskTable = ({
rowClassName={rowClassName} rowClassName={rowClassName}
scroll={{ x: "768px" }} scroll={{ x: "768px" }}
bordered bordered
pagination={{ // pagination={{
pageSize: 10, // pageSize: 10,
size: "default", // size: "default",
}} // style: {
// margin: 0,
// justifyContent: "end",
// position: "fixed",
// bottom: 0,
// left: 0,
// width: "100%",
// backgroundColor: token.colorBgContainer,
// boxShadow: "0 4px 8px rgba(0, 0, 0, 0.4)",
// padding: "10px 0",
// zIndex: 1000,
// },
// }}
pagination={false}
/> />
</div> </div>
); );

@ -1,6 +1,6 @@
import { useEffect, useRef, useState } from "react"; import { useEffect, useRef, useState } from "react";
import AddTask from "./AddTask"; import AddTask from "./AddTask";
import { Button, Input, Select, Space, Typography } from "antd"; import { Button, Input, Pagination, Select, Space, Typography } from "antd";
import TaskTable from "./TaskTable"; import TaskTable from "./TaskTable";
import { useTeamData } from "../../Hooks/Teams"; import { useTeamData } from "../../Hooks/Teams";
import { useTasks } from "../../Hooks/Tasks"; import { useTasks } from "../../Hooks/Tasks";
@ -17,6 +17,10 @@ import TaskUploadModal from "./TaskUploadModal";
import { TSocket } from "../../types/common/TSocket"; import { TSocket } from "../../types/common/TSocket";
import ErrorUncompletedTasksModal from "./ErrorUncompletedTasksModal"; import ErrorUncompletedTasksModal from "./ErrorUncompletedTasksModal";
import { LeftOutlined, RightOutlined } from "@ant-design/icons";
import { theme } from "antd";
const { Option } = Select; const { Option } = Select;
const Task = ({ const Task = ({
socketData, socketData,
@ -38,6 +42,8 @@ const Task = ({
const [errorModal, setErrorModal] = useState(false); const [errorModal, setErrorModal] = useState(false);
const [uncomletedData, setUncomletedData] = useState<TTask[]>(); const [uncomletedData, setUncomletedData] = useState<TTask[]>();
const [pageSize, setPageSize] = useState(10);
useEffect(() => { useEffect(() => {
if ( if (
socketData && socketData &&
@ -123,13 +129,13 @@ const Task = ({
label: item?.name, label: item?.name,
value: item?.id, value: item?.id,
})); }));
const page_size = isMobile ? 10 : 15; const page_size = 10;
const { data, isLoading, refetch } = useTasks({ const { data, isLoading, refetch } = useTasks({
search, search,
status, status,
team, team,
page, page,
page_size, page_size: 10,
}); });
useEffect(() => { useEffect(() => {
if (data) { if (data) {
@ -167,6 +173,11 @@ const Task = ({
} }
}; };
const handlePageChange = (page: number, pageSize: number) => {
setPage(page);
setPageSize(pageSize);
};
const timerRef = useRef<NodeJS.Timeout | null>(null); const timerRef = useRef<NodeJS.Timeout | null>(null);
const handleSearchChange = (e: React.ChangeEvent<HTMLInputElement>) => { const handleSearchChange = (e: React.ChangeEvent<HTMLInputElement>) => {
if (timerRef.current) { if (timerRef.current) {
@ -178,7 +189,9 @@ const Task = ({
setSearch(searchText); setSearch(searchText);
}, 1000); }, 1000);
}; };
const theme = localStorage.getItem("theme") === "true" ? true : false; const themes = localStorage.getItem("theme") === "true" ? true : false;
const { token } = theme.useToken();
return ( return (
<div> <div>
@ -210,10 +223,6 @@ const Task = ({
)} )}
<div className="header d-flex"> <div className="header d-flex">
<div className="header-title d-flex"> <div className="header-title d-flex">
{/* <p className="title " style={{ color: theme ? "#fff" : "#000" }}>
Tasks
</p> */}
<Typography className="title">Tasks</Typography> <Typography className="title">Tasks</Typography>
</div> </div>
<div className="d-flex"> <div className="d-flex">
@ -229,6 +238,10 @@ const Task = ({
)} )}
<button <button
className={`btn-refresh-${false && "dark"} d-flex`} className={`btn-refresh-${false && "dark"} d-flex`}
style={{
backgroundColor: token.colorBgContainer,
color: token.colorText,
}}
onClick={() => { onClick={() => {
refetch(); refetch();
if (!isLive) { if (!isLive) {
@ -249,7 +262,7 @@ const Task = ({
<div className="search-div"> <div className="search-div">
<img src={IconSearch} alt="" /> <img src={IconSearch} alt="" />
<input <input
className={`search-input-${theme}`} className={`search-input-${themes}`}
type="text" type="text"
placeholder="Search" placeholder="Search"
onChange={handleSearchChange} onChange={handleSearchChange}
@ -287,14 +300,43 @@ const Task = ({
showErrorModal={showErrorModal} showErrorModal={showErrorModal}
setErrorModal={setErrorModal} setErrorModal={setErrorModal}
/> />
{/* <Space style={{ width: "100%", marginTop: 10 }} direction="vertical"> <Space style={{ width: "100%", marginTop: 10 }} direction="vertical">
<Space style={{ width: "100%", justifyContent: "flex-end" }} wrap> <Space
<Button onClick={Previos} disabled={data?.previous ? false : true}> style={{
<img src={leftPagination} /> justifyContent: "end",
position: "fixed",
bottom: 0,
left: 0,
width: "100%",
backgroundColor: token.colorBgContainer,
boxShadow: "0 4px 8px rgba(0, 0, 0, 0.4)",
padding: "10px 0",
zIndex: 1000,
}}
wrap
>
<Button
onClick={Previos}
disabled={data?.previous ? false : true}
style={{
backgroundColor: token.colorBgContainer,
color: token.colorText,
border: "none",
}}
>
<LeftOutlined />
</Button> </Button>
<Input <Input
style={{ width: 30, textAlign: "center" }} disabled
style={{
width: 40,
textAlign: "center",
background: token.colorBgContainer,
border: "1px solid",
borderColor: token.colorText,
color: token.colorText,
}}
value={page} value={page}
onChange={(e) => { onChange={(e) => {
let num = e.target.value; let num = e.target.value;
@ -304,11 +346,25 @@ const Task = ({
}} }}
/> />
<Button onClick={Next} disabled={data?.next ? false : true}> <Button
<img src={rightPagination} /> onClick={Next}
disabled={data?.next ? false : true}
style={{
backgroundColor: token.colorBgContainer,
color: token.colorText,
border: "none",
}}
>
<RightOutlined />
</Button> </Button>
{/* <Pagination
current={page}
total={data?.data.length}
pageSize={pageSize}
onChange={handlePageChange}
/> */}
</Space> </Space>
</Space> */} </Space>
</div> </div>
); );
}; };

@ -9,6 +9,9 @@ import {
import { timeZone } from "../../App"; import { timeZone } from "../../App";
// @ts-ignore // @ts-ignore
import tagIcon from "../../assets/tagIcon.png"; import tagIcon from "../../assets/tagIcon.png";
import { theme } from "antd";
const TeamTable = ({ const TeamTable = ({
data, data,
isLoading, isLoading,
@ -23,6 +26,8 @@ const TeamTable = ({
const navigate = useNavigate(); const navigate = useNavigate();
const moment = require("moment-timezone"); const moment = require("moment-timezone");
const { token } = theme.useToken();
return ( return (
<Table <Table
loading={isLoading} loading={isLoading}
@ -56,7 +61,22 @@ const TeamTable = ({
dataIndex: "created", dataIndex: "created",
}, },
]} ]}
pagination={{ pageSize: 10, size: "default" }} pagination={{
pageSize: 10,
size: "default",
style: {
margin: 0,
justifyContent: "end",
position: "fixed",
bottom: 0,
left: 0,
width: "100%",
backgroundColor: token.colorBgContainer,
boxShadow: "0 4px 8px rgba(0, 0, 0, 0.4)",
padding: "10px 0",
zIndex: 1000,
},
}}
bordered bordered
/> />
); );

@ -1,6 +1,6 @@
import { useState } from "react"; import { useState } from "react";
import AddUpdate from "./AddUpdate"; import AddUpdate from "./AddUpdate";
import { Select, Typography } from "antd"; import { Select, Typography, theme } from "antd";
import UpdateTable from "./UpdateTable"; import UpdateTable from "./UpdateTable";
import { useUpdateData } from "../../Hooks/Update"; import { useUpdateData } from "../../Hooks/Update";
//@ts-ignore //@ts-ignore
@ -22,7 +22,9 @@ const Update = () => {
const showModal = () => { const showModal = () => {
setOpen(true); setOpen(true);
}; };
const theme = localStorage.getItem("theme") === "true" ? true : false;
const { token } = theme.useToken();
return ( return (
<div> <div>
{open && <AddUpdate refetch={refetch} open={open} setOpen={setOpen} />} {open && <AddUpdate refetch={refetch} open={open} setOpen={setOpen} />}
@ -35,6 +37,10 @@ const Update = () => {
</button> </button>
<button <button
className={`btn-refresh-${false && "dark"} d-flex`} className={`btn-refresh-${false && "dark"} d-flex`}
style={{
backgroundColor: token.colorBgContainer,
color: token.colorText,
}}
onClick={() => { onClick={() => {
refetch(); refetch();
}} }}

@ -1,4 +1,4 @@
import { Space, Table, Tooltip } from "antd"; import { Space, Table, Tooltip, theme } from "antd";
import moment from "moment"; import moment from "moment";
import { useCompanyData } from "../../Hooks/Companies"; import { useCompanyData } from "../../Hooks/Companies";
import { useCustomerData } from "../../Hooks/Customers"; import { useCustomerData } from "../../Hooks/Customers";
@ -27,6 +27,7 @@ import zeelog from "../../assets/zeelogicon.svg";
import ontime from "../../assets/ontimeicon.svg"; import ontime from "../../assets/ontimeicon.svg";
// @ts-ignore // @ts-ignore
import tt from "../../assets/tticon.svg"; import tt from "../../assets/tticon.svg";
const UpdateTable = ({ const UpdateTable = ({
data = [], data = [],
isLoading, isLoading,
@ -82,6 +83,8 @@ const UpdateTable = ({
} }
}; };
const { token } = theme.useToken();
return ( return (
<div> <div>
<Table <Table
@ -293,7 +296,22 @@ const UpdateTable = ({
loading={isLoading} loading={isLoading}
size="small" size="small"
scroll={{ x: "768px" }} scroll={{ x: "768px" }}
pagination={{ pageSize: 10, size: "default" }} pagination={{
pageSize: 10,
size: "default",
style: {
margin: 0,
justifyContent: "end",
position: "fixed",
bottom: 0,
left: 0,
width: "100%",
backgroundColor: token.colorBgContainer,
boxShadow: "0 4px 8px rgba(0, 0, 0, 0.4)",
padding: "10px 0",
zIndex: 1000,
},
}}
bordered bordered
/> />
</div> </div>

@ -11,6 +11,9 @@ import { useNavigate } from "react-router-dom";
import tagIcon from "../../assets/tagIcon.png"; import tagIcon from "../../assets/tagIcon.png";
import { isMobile, role } from "../../App"; import { isMobile, role } from "../../App";
import { userController } from "../../API/LayoutApi/users"; import { userController } from "../../API/LayoutApi/users";
import { theme } from "antd";
const UserTable = ({ const UserTable = ({
data, data,
isLoading, isLoading,
@ -33,6 +36,7 @@ const UserTable = ({
isTextSelected = false; isTextSelected = false;
} }
}); });
return { return {
onClick: () => { onClick: () => {
if (isTextSelected) { if (isTextSelected) {
@ -43,6 +47,8 @@ const UserTable = ({
}; };
}; };
const { token } = theme.useToken();
return ( return (
<div> <div>
<Table <Table
@ -100,7 +106,23 @@ const UserTable = ({
index % 2 === 0 ? "odd-row" : "even-row" index % 2 === 0 ? "odd-row" : "even-row"
} }
scroll={{ x: "768px" }} scroll={{ x: "768px" }}
pagination={{ pageSize: 10, size: "default" }} pagination={{
pageSize: 50,
size: "default",
style: {
margin: 0,
justifyContent: "end",
position: "fixed",
bottom: 0,
left: 0,
width: "100%",
backgroundColor: token.colorBgContainer,
boxShadow: "0 4px 8px rgba(0, 0, 0, 0.4)",
padding: "10px 0",
zIndex: 1000,
},
showLessItems: true,
}}
bordered bordered
/> />
</div> </div>

@ -6,7 +6,7 @@ import UserTable from "./UserTable";
import IconSearch from "../../assets/searchIcon.png"; import IconSearch from "../../assets/searchIcon.png";
//@ts-ignore //@ts-ignore
import addicon from "../../assets/addiconpng.png"; import addicon from "../../assets/addiconpng.png";
import { Typography } from "antd"; import { Pagination, Space, Typography } from "antd";
const User = () => { const User = () => {
const [open, setOpen] = useState(false); const [open, setOpen] = useState(false);
@ -58,6 +58,48 @@ const User = () => {
</div> </div>
</div> </div>
<UserTable data={data} isLoading={isLoading} refetch={refetch} /> <UserTable data={data} isLoading={isLoading} refetch={refetch} />
{/* <Space style={{ width: "100%", marginTop: 10 }} direction="vertical">
<Space
style={{
justifyContent: "end",
position: "fixed",
bottom: 0,
left: 0,
width: "100%",
// backgroundColor: token.colorBgContainer,
boxShadow: "0 4px 8px rgba(0, 0, 0, 0.4)",
padding: "10px 0",
zIndex: 1000,
}}
wrap
>
<Button onClick={Previos} disabled={data?.previous ? false : true}>
</Button>
<Input
style={{ width: 30, textAlign: "center" }}
value={page}
onChange={(e) => {
let num = e.target.value;
if (Number(num) && num !== "0") {
setPage(Number(num));
}
}}
/>
<Button onClick={Next} disabled={data?.next ? false : true}>
</Button>
<Pagination
// current={page}
// total={}
// pageSize={page_size}
// onChange={handlePageChange}
/>
</Space>
</Space> */}
</div> </div>
); );
}; };

@ -97,6 +97,13 @@ export const dark = {
colorPrimary: "rgba(249, 158, 44, 1)", colorPrimary: "rgba(249, 158, 44, 1)",
hoverBorderColor: "#BBBBBB", hoverBorderColor: "#BBBBBB",
}, },
Pagination: {
itemActiveBg: "#3a3a3a",
colorPrimary: "#bbb",
colorPrimaryHover: "rgba(249, 158, 44, 1)",
colorText: "#fff",
colorTextDisabled: "#fff",
},
Empty: { Empty: {
colorText: "rgba(249, 158, 44, 1)", colorText: "rgba(249, 158, 44, 1)",
colorTextDisabled: "rgba(249, 158, 44, 1)", colorTextDisabled: "rgba(249, 158, 44, 1)",
@ -106,6 +113,7 @@ export const dark = {
fontFamily: "Inter, sans-serif", fontFamily: "Inter, sans-serif",
colorText: "#bbb", colorText: "#bbb",
borderRadius: 8, borderRadius: 8,
colorBgContainer: "#3a3a3a",
}, },
}; };
export const light = { export const light = {
@ -138,10 +146,16 @@ export const light = {
Menu: { Menu: {
darkItemSelectedBg: "rgba(255, 255, 255, 0.08)", darkItemSelectedBg: "rgba(255, 255, 255, 0.08)",
}, },
Pagination: {
colorPrimary: "#262626",
colorPrimaryHover: "rgba(249, 158, 44, 1)",
colorBorder: "#000",
},
}, },
token: { token: {
fontFamily: "Inter, sans-serif", fontFamily: "Inter, sans-serif",
color: "#262626", color: "#262626",
colorBgContainer: "#fff",
borderRadius: 8, borderRadius: 8,
}, },
}; };

Loading…
Cancel
Save