[ update bugs ]

This commit is contained in:
YasinShaikh123
2025-06-05 15:18:16 +05:30
parent 1fc5756af0
commit e8f28df886
10 changed files with 86 additions and 61 deletions

4
.env
View File

@@ -4,8 +4,8 @@
# VITE_PASSWORD="71%@L%es^bUX94`J9XT*@bh,._WWM{$%^^&&" # VITE_PASSWORD="71%@L%es^bUX94`J9XT*@bh,._WWM{$%^^&&"
# VITE_APP_NAME=MyViteApp # VITE_APP_NAME=MyViteApp
# VITE_IMG_TEMPLATES='https://ssa.betadelivery.com/storage/app/public/uploads/post_templates/' # 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/testing/apia/v1'
# VITE_API_URL='https://ssa.betadelivery.com/apia/v1' VITE_API_URL='https://ssa.betadelivery.com/apia/v1'
VITE_USER_NAME="Admin" VITE_USER_NAME="Admin"
VITE_PASSWORD="71%@L%es^bUX94`J9XT*@bh,._WWM{$%^^&&" VITE_PASSWORD="71%@L%es^bUX94`J9XT*@bh,._WWM{$%^^&&"
# VITE_PASSWORD="71%@L%es^bUX94`J9XT*%4&^%tUU^%Q^ffgt" # VITE_PASSWORD="71%@L%es^bUX94`J9XT*%4&^%tUU^%Q^ffgt"

View File

@@ -82,7 +82,7 @@ define(['./workbox-54d0af47'], (function (workbox) { 'use strict';
"revision": "3ca0b8505b4bec776b69afdba2768812" "revision": "3ca0b8505b4bec776b69afdba2768812"
}, { }, {
"url": "index.html", "url": "index.html",
"revision": "0.bma87cujt8g" "revision": "0.p75md0vraj"
}], {}); }], {});
workbox.cleanupOutdatedCaches(); workbox.cleanupOutdatedCaches();
workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), { workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), {

View File

@@ -101,7 +101,7 @@ function FaqAddModel({ refetch }: { refetch: VoidFunction }) {
<Stack py={3}> <Stack py={3}>
<Field.Root> <Field.Root>
<Field.Label color="black" pt={1} fontSize="12px">Select User Type</Field.Label> <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 <select
style={{ style={{
width: "100%", width: "100%",

View File

@@ -131,7 +131,7 @@ function PrivacyPolicyAddModel({ policyData, refetch }: { policyData: any, refet
'list', 'bullet', 'list', 'bullet',
'link', 'image' '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' }}
/> />
)} )}
/> />

View File

@@ -89,7 +89,7 @@ function TermsAndConditionsAddModel({ termsData, refetch }: { termsData: any, re
</DialogHeader> </DialogHeader>
<DialogBody bg="white"> <DialogBody bg="white">
<Stack py={3} mb={8}> <Stack py={3}>
<Field.Root> <Field.Root>
<Field.Label color="black" pt={1} fontSize="12px"> <Field.Label color="black" pt={1} fontSize="12px">
TermsAndConditions TermsAndConditions
@@ -128,15 +128,15 @@ function TermsAndConditionsAddModel({ termsData, refetch }: { termsData: any, re
'list', 'bullet', 'list', 'bullet',
'link', 'image' '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> </Field.Root>
</Stack> </Stack>
</DialogBody> </DialogBody>
<DialogFooter display="flex" justifyContent="center" pt={"2"}> <DialogFooter display="flex" justifyContent="center" pt={"2"}>
<Button w="100%" bg="#02A0A0" color={"#fff"} mt={'4'} onClick={handleSubmit(onSubmit)}> <Button w="100%" bg="#02A0A0" color={"#fff"} mt={'4'} onClick={handleSubmit(onSubmit)}>
Save Save
</Button> </Button>
</DialogFooter> </DialogFooter>

View File

@@ -60,6 +60,9 @@ const SubAdmin = () => {
const [deleteModal, setDeleteModal] = useState(false) const [deleteModal, setDeleteModal] = useState(false)
const [deleteSubAdminPost] = useDeleteSubAdminPostMutation() const [deleteSubAdminPost] = useDeleteSubAdminPostMutation()
console.log("============================",data);
useEffect(() => { useEffect(() => {
if (data?.data.data) { if (data?.data.data) {
setLocalData(data?.data.data); setLocalData(data?.data.data);

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

View File

@@ -1,6 +1,12 @@
import { useState } from "react"; import { useState } from "react";
import { HStack, Stack, Table } from "@chakra-ui/react"; import { Box, HStack, Image, Stack, Table, Text } from "@chakra-ui/react";
import { PaginationItems, PaginationNextTrigger, PaginationPrevTrigger, PaginationRoot } from "./ui/pagination"; import {
PaginationItems,
PaginationNextTrigger,
PaginationPrevTrigger,
PaginationRoot,
} from "./ui/pagination";
import EmptyFile from "../assets/empty-file.png";
// import { // import {
// PaginationItems, // PaginationItems,
// PaginationNextTrigger, // PaginationNextTrigger,
@@ -17,7 +23,7 @@ interface TableProps {
last_page: number; last_page: number;
per_page: number; per_page: number;
total: number; total: number;
}, };
onPageChange?: (page: number) => void; onPageChange?: (page: number) => void;
} }
@@ -26,7 +32,7 @@ const DataTable: React.FC<TableProps> = ({
data, data,
sortableColumns = [], sortableColumns = [],
paginationData, paginationData,
onPageChange onPageChange,
}: TableProps) => { }: TableProps) => {
const { current_page = 1, last_page = 1 } = paginationData || {}; const { current_page = 1, last_page = 1 } = paginationData || {};
const [sortConfig, setSortConfig] = useState<{ const [sortConfig, setSortConfig] = useState<{
@@ -90,61 +96,76 @@ const DataTable: React.FC<TableProps> = ({
{sortableColumns.includes(item) && {sortableColumns.includes(item) &&
sortConfig?.key === item && ( sortConfig?.key === item && (
<span style={{ marginLeft: "4px" }}> <span style={{ marginLeft: "4px" }}>
{sortConfig.direction === "asc" ? "\u25B2" : "\u25BC"} {sortConfig.direction === "asc" ? "" : ""}
</span> </span>
)} )}
</Table.ColumnHeader> </Table.ColumnHeader>
))} ))}
</Table.Row> </Table.Row>
</Table.Header> </Table.Header>
<Table.Body> {data?.length === 0 ? (
{data.map((item: any, index) => ( <Box>
<Table.Row <Box textAlign={"center"} py={20} position={'absolute'} w={'84%'}>
key={index} <Image src={EmptyFile} alt="No data" maxW="65px" mx="auto" />
bg={index % 2 === 0 ? "#fff" : "#007F3310"} <Text fontSize={"18px"} fontWeight={500} mt={2}>
> We do not have any records
{tableHeadRow.map((heading, colIndex) => ( </Text>
<Table.Cell </Box>
// className="oxygen" </Box>
px={4} ) : (
p={2} <Table.Body h={"100%"}>
key={`${index}-${colIndex}`} {data.map((item: any, index) => (
fontSize={"xs"} <Table.Row
fontWeight={500} key={index}
border={"none"} bg={index % 2 === 0 ? "#fff" : "#007F3310"}
> >
{/* {item[heading]} */} {tableHeadRow.map((heading, colIndex) => (
{(() => { <Table.Cell
const words = item[heading]?.toString().split(" ") || []; px={4}
return words.length > 5 p={2}
? `${words.slice(0, 5).join(" ")}...` key={`${index}-${colIndex}`}
: item[heading]; fontSize={"xs"}
})()} fontWeight={500}
</Table.Cell> border={"none"}
))} >
</Table.Row> {(() => {
))} const words =
</Table.Body> item[heading]?.toString().split(" ") || [];
return words.length > 5
? `${words.slice(0, 5).join(" ")}...`
: item[heading];
})()}
</Table.Cell>
))}
</Table.Row>
))}
</Table.Body>
)}
</Table.Root> </Table.Root>
</Table.ScrollArea> </Table.ScrollArea>
{last_page > 1 && (<PaginationRoot {last_page > 1 && (
count={paginationData?.total ?? 0} <PaginationRoot
pageSize={paginationData?.per_page ?? 0} count={paginationData?.total ?? 0}
page={current_page} pageSize={paginationData?.per_page ?? 0}
onPageChange={handlePageChange} page={current_page}
size={"xs"} onPageChange={handlePageChange}
siblingCount={1} size={"xs"}
// count={20} siblingCount={1}
// pageSize={2} mb={4}
// defaultPage={1} >
mb={4} <HStack justifyContent="flex-end">
> <PaginationPrevTrigger
<HStack justifyContent="flex-end"> onClick={() => handlePageChange({ page: current_page - 1 })}
<PaginationPrevTrigger onClick={() => handlePageChange({ page: current_page - 1 })} disabled={current_page === 1} /> disabled={current_page === 1}
<PaginationItems /> />
<PaginationNextTrigger onClick={() => handlePageChange({ page: current_page + 1 })} disabled={current_page === last_page} /> <PaginationItems />
</HStack> <PaginationNextTrigger
</PaginationRoot>)} onClick={() => handlePageChange({ page: current_page + 1 })}
disabled={current_page === last_page}
/>
</HStack>
</PaginationRoot>
)}
</Stack> </Stack>
); );
}; };

View File

@@ -24,7 +24,8 @@ const MainFrame: FC<MainFrameProps> = ({ children, transperant, props }) => {
rounded="lg" rounded="lg"
boxShadow={transperant?'none':'rgba(99, 99, 99, 0.2) 0px 2px 8px 0px'} boxShadow={transperant?'none':'rgba(99, 99, 99, 0.2) 0px 2px 8px 0px'}
pt={transperant?0:3} pt={transperant?0:3}
h={'100%'}
overflow={'auto'}
> >
{children} {children}
</Box> </Box>