[ update bugs ]
This commit is contained in:
4
.env
4
.env
@@ -4,8 +4,8 @@
|
||||
# VITE_PASSWORD="71%@L%es^bUX94`J9XT*@bh,._WWM{$%^^&&"
|
||||
# VITE_APP_NAME=MyViteApp
|
||||
# VITE_IMG_TEMPLATES='https://ssa.betadelivery.com/storage/app/public/uploads/post_templates/'
|
||||
VITE_API_URL='https://ssa.betadelivery.com/testing/apia/v1'
|
||||
# VITE_API_URL='https://ssa.betadelivery.com/apia/v1'
|
||||
# VITE_API_URL='https://ssa.betadelivery.com/testing/apia/v1'
|
||||
VITE_API_URL='https://ssa.betadelivery.com/apia/v1'
|
||||
VITE_USER_NAME="Admin"
|
||||
VITE_PASSWORD="71%@L%es^bUX94`J9XT*@bh,._WWM{$%^^&&"
|
||||
# VITE_PASSWORD="71%@L%es^bUX94`J9XT*%4&^%tUU^%Q^ffgt"
|
||||
|
||||
@@ -82,7 +82,7 @@ define(['./workbox-54d0af47'], (function (workbox) { 'use strict';
|
||||
"revision": "3ca0b8505b4bec776b69afdba2768812"
|
||||
}, {
|
||||
"url": "index.html",
|
||||
"revision": "0.bma87cujt8g"
|
||||
"revision": "0.p75md0vraj"
|
||||
}], {});
|
||||
workbox.cleanupOutdatedCaches();
|
||||
workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), {
|
||||
|
||||
@@ -101,7 +101,7 @@ function FaqAddModel({ refetch }: { refetch: VoidFunction }) {
|
||||
<Stack py={3}>
|
||||
<Field.Root>
|
||||
<Field.Label color="black" pt={1} fontSize="12px">Select User Type</Field.Label>
|
||||
<Box bgColor="#EEEEEE" borderRadius="md" p={1}>
|
||||
<Box bgColor="#EEEEEE" borderRadius="md" p={1} w={'100%'}>
|
||||
<select
|
||||
style={{
|
||||
width: "100%",
|
||||
|
||||
@@ -131,7 +131,7 @@ function PrivacyPolicyAddModel({ policyData, refetch }: { policyData: any, refet
|
||||
'list', 'bullet',
|
||||
'link', 'image'
|
||||
]}
|
||||
style={{ color: "black", border: "none", fontSize: "12px", height: "170px", width: "100%" }}
|
||||
style={{ color: "black", border: "none", fontSize: "12px", height: "220px", width: "100%",marginBottom:'20px' }}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
|
||||
@@ -89,7 +89,7 @@ function TermsAndConditionsAddModel({ termsData, refetch }: { termsData: any, re
|
||||
</DialogHeader>
|
||||
|
||||
<DialogBody bg="white">
|
||||
<Stack py={3} mb={8}>
|
||||
<Stack py={3}>
|
||||
<Field.Root>
|
||||
<Field.Label color="black" pt={1} fontSize="12px">
|
||||
TermsAndConditions
|
||||
@@ -128,15 +128,15 @@ function TermsAndConditionsAddModel({ termsData, refetch }: { termsData: any, re
|
||||
'list', 'bullet',
|
||||
'link', 'image'
|
||||
]}
|
||||
style={{ color: "black", border: "none", fontSize: "12px", height: "170px", width: "100%" }}
|
||||
style={{ color: "black", border: "none", fontSize: "12px", height: "220px", width: "100%",marginBottom:'20px' }}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
</Field.Root>
|
||||
</Stack>
|
||||
</DialogBody>
|
||||
<DialogFooter display="flex" justifyContent="center" pt={"2"}>
|
||||
<Button w="100%" bg="#02A0A0" color={"#fff"} mt={'4'} onClick={handleSubmit(onSubmit)}>
|
||||
<DialogFooter display="flex" justifyContent="center" pt={"2"}>
|
||||
<Button w="100%" bg="#02A0A0" color={"#fff"} mt={'4'} onClick={handleSubmit(onSubmit)}>
|
||||
Save
|
||||
</Button>
|
||||
</DialogFooter>
|
||||
|
||||
@@ -60,6 +60,9 @@ const SubAdmin = () => {
|
||||
const [deleteModal, setDeleteModal] = useState(false)
|
||||
const [deleteSubAdminPost] = useDeleteSubAdminPostMutation()
|
||||
|
||||
console.log("============================",data);
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
if (data?.data.data) {
|
||||
setLocalData(data?.data.data);
|
||||
|
||||
BIN
src/assets/empty-file.png
Normal file
BIN
src/assets/empty-file.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 226 KiB |
BIN
src/assets/empty-file2.png
Normal file
BIN
src/assets/empty-file2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 54 KiB |
@@ -1,6 +1,12 @@
|
||||
import { useState } from "react";
|
||||
import { HStack, Stack, Table } from "@chakra-ui/react";
|
||||
import { PaginationItems, PaginationNextTrigger, PaginationPrevTrigger, PaginationRoot } from "./ui/pagination";
|
||||
import { Box, HStack, Image, Stack, Table, Text } from "@chakra-ui/react";
|
||||
import {
|
||||
PaginationItems,
|
||||
PaginationNextTrigger,
|
||||
PaginationPrevTrigger,
|
||||
PaginationRoot,
|
||||
} from "./ui/pagination";
|
||||
import EmptyFile from "../assets/empty-file.png";
|
||||
// import {
|
||||
// PaginationItems,
|
||||
// PaginationNextTrigger,
|
||||
@@ -17,7 +23,7 @@ interface TableProps {
|
||||
last_page: number;
|
||||
per_page: number;
|
||||
total: number;
|
||||
},
|
||||
};
|
||||
onPageChange?: (page: number) => void;
|
||||
}
|
||||
|
||||
@@ -26,7 +32,7 @@ const DataTable: React.FC<TableProps> = ({
|
||||
data,
|
||||
sortableColumns = [],
|
||||
paginationData,
|
||||
onPageChange
|
||||
onPageChange,
|
||||
}: TableProps) => {
|
||||
const { current_page = 1, last_page = 1 } = paginationData || {};
|
||||
const [sortConfig, setSortConfig] = useState<{
|
||||
@@ -90,61 +96,76 @@ const DataTable: React.FC<TableProps> = ({
|
||||
{sortableColumns.includes(item) &&
|
||||
sortConfig?.key === item && (
|
||||
<span style={{ marginLeft: "4px" }}>
|
||||
{sortConfig.direction === "asc" ? "\u25B2" : "\u25BC"}
|
||||
{sortConfig.direction === "asc" ? "▲" : "▼"}
|
||||
</span>
|
||||
)}
|
||||
</Table.ColumnHeader>
|
||||
))}
|
||||
</Table.Row>
|
||||
</Table.Header>
|
||||
<Table.Body>
|
||||
{data.map((item: any, index) => (
|
||||
<Table.Row
|
||||
key={index}
|
||||
bg={index % 2 === 0 ? "#fff" : "#007F3310"}
|
||||
>
|
||||
{tableHeadRow.map((heading, colIndex) => (
|
||||
<Table.Cell
|
||||
// className="oxygen"
|
||||
px={4}
|
||||
p={2}
|
||||
key={`${index}-${colIndex}`}
|
||||
fontSize={"xs"}
|
||||
fontWeight={500}
|
||||
border={"none"}
|
||||
>
|
||||
{/* {item[heading]} */}
|
||||
{(() => {
|
||||
const words = item[heading]?.toString().split(" ") || [];
|
||||
return words.length > 5
|
||||
? `${words.slice(0, 5).join(" ")}...`
|
||||
: item[heading];
|
||||
})()}
|
||||
</Table.Cell>
|
||||
))}
|
||||
</Table.Row>
|
||||
))}
|
||||
</Table.Body>
|
||||
{data?.length === 0 ? (
|
||||
<Box>
|
||||
<Box textAlign={"center"} py={20} position={'absolute'} w={'84%'}>
|
||||
<Image src={EmptyFile} alt="No data" maxW="65px" mx="auto" />
|
||||
<Text fontSize={"18px"} fontWeight={500} mt={2}>
|
||||
We do not have any records
|
||||
</Text>
|
||||
</Box>
|
||||
</Box>
|
||||
) : (
|
||||
<Table.Body h={"100%"}>
|
||||
{data.map((item: any, index) => (
|
||||
<Table.Row
|
||||
key={index}
|
||||
bg={index % 2 === 0 ? "#fff" : "#007F3310"}
|
||||
>
|
||||
{tableHeadRow.map((heading, colIndex) => (
|
||||
<Table.Cell
|
||||
px={4}
|
||||
p={2}
|
||||
key={`${index}-${colIndex}`}
|
||||
fontSize={"xs"}
|
||||
fontWeight={500}
|
||||
border={"none"}
|
||||
>
|
||||
{(() => {
|
||||
const words =
|
||||
item[heading]?.toString().split(" ") || [];
|
||||
return words.length > 5
|
||||
? `${words.slice(0, 5).join(" ")}...`
|
||||
: item[heading];
|
||||
})()}
|
||||
</Table.Cell>
|
||||
))}
|
||||
</Table.Row>
|
||||
))}
|
||||
</Table.Body>
|
||||
)}
|
||||
</Table.Root>
|
||||
</Table.ScrollArea>
|
||||
{last_page > 1 && (<PaginationRoot
|
||||
count={paginationData?.total ?? 0}
|
||||
pageSize={paginationData?.per_page ?? 0}
|
||||
page={current_page}
|
||||
onPageChange={handlePageChange}
|
||||
size={"xs"}
|
||||
siblingCount={1}
|
||||
// count={20}
|
||||
// pageSize={2}
|
||||
// defaultPage={1}
|
||||
mb={4}
|
||||
>
|
||||
<HStack justifyContent="flex-end">
|
||||
<PaginationPrevTrigger onClick={() => handlePageChange({ page: current_page - 1 })} disabled={current_page === 1} />
|
||||
<PaginationItems />
|
||||
<PaginationNextTrigger onClick={() => handlePageChange({ page: current_page + 1 })} disabled={current_page === last_page} />
|
||||
</HStack>
|
||||
</PaginationRoot>)}
|
||||
{last_page > 1 && (
|
||||
<PaginationRoot
|
||||
count={paginationData?.total ?? 0}
|
||||
pageSize={paginationData?.per_page ?? 0}
|
||||
page={current_page}
|
||||
onPageChange={handlePageChange}
|
||||
size={"xs"}
|
||||
siblingCount={1}
|
||||
mb={4}
|
||||
>
|
||||
<HStack justifyContent="flex-end">
|
||||
<PaginationPrevTrigger
|
||||
onClick={() => handlePageChange({ page: current_page - 1 })}
|
||||
disabled={current_page === 1}
|
||||
/>
|
||||
<PaginationItems />
|
||||
<PaginationNextTrigger
|
||||
onClick={() => handlePageChange({ page: current_page + 1 })}
|
||||
disabled={current_page === last_page}
|
||||
/>
|
||||
</HStack>
|
||||
</PaginationRoot>
|
||||
)}
|
||||
</Stack>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -24,7 +24,8 @@ const MainFrame: FC<MainFrameProps> = ({ children, transperant, props }) => {
|
||||
rounded="lg"
|
||||
boxShadow={transperant?'none':'rgba(99, 99, 99, 0.2) 0px 2px 8px 0px'}
|
||||
pt={transperant?0:3}
|
||||
|
||||
h={'100%'}
|
||||
overflow={'auto'}
|
||||
>
|
||||
{children}
|
||||
</Box>
|
||||
|
||||
Reference in New Issue
Block a user