Commit 3868fb5b by Arjun Jhukal

updated the withdrawl history validation

parent 905d8f67
...@@ -24,7 +24,7 @@ export default function RootLayout({ ...@@ -24,7 +24,7 @@ export default function RootLayout({
return ( return (
<html lang="en"> <html lang="en">
{/* className="dark" */} {/* className="dark" */}
<body className={`${inter.className} scroll-smooth dark`}> <body className={`${inter.className} scroll-smooth dark`} cz-shortcut-listen="true">
<ProviderWrapper> <ProviderWrapper>
{children} {children}
......
"use client"; "use client";
import { useThemeContext } from "@/context/ThemeContext";
import { InputLabel } from "@mui/material"; import { InputLabel } from "@mui/material";
import React from "react"; import React from "react";
...@@ -32,6 +33,8 @@ export default function SelectField({ ...@@ -32,6 +33,8 @@ export default function SelectField({
error, error,
touched, touched,
}: SelectFieldProps) { }: SelectFieldProps) {
const theme = useThemeContext();
console.log("theme", theme);
return ( return (
<div className="input__field"> <div className="input__field">
<InputLabel className="block text-sm font-semibold mb-2"> <InputLabel className="block text-sm font-semibold mb-2">
......
...@@ -19,7 +19,7 @@ export default function CustomTable<TData>({ table, loading = false, ...@@ -19,7 +19,7 @@ export default function CustomTable<TData>({ table, loading = false,
if (user?.role && user?.role.toUpperCase() !== "USER") { if (user?.role && user?.role.toUpperCase() !== "USER") {
return ( return (
<table className="min-w-full border-collapse border border-gray-200 text-left"> <table className="min]-w-full border-collapse border border-gray-200 text-left">
<thead> <thead>
{table.getHeaderGroups().map((headerGroup) => ( {table.getHeaderGroups().map((headerGroup) => (
<tr key={headerGroup.id}> <tr key={headerGroup.id}>
...@@ -101,8 +101,8 @@ export default function CustomTable<TData>({ table, loading = false, ...@@ -101,8 +101,8 @@ export default function CustomTable<TData>({ table, loading = false,
Array.from({ length: skeletonRows }).map((_, rowIndex) => ( Array.from({ length: skeletonRows }).map((_, rowIndex) => (
<tr key={`skeleton-${rowIndex}`} className="animate-pulse"> <tr key={`skeleton-${rowIndex}`} className="animate-pulse">
{Array.from({ length: columnCount }).map((_, colIndex) => ( {Array.from({ length: columnCount }).map((_, colIndex) => (
<td key={`skeleton-cell-${rowIndex}-${colIndex}`} className="text-[14px] p-2 lg:p-4 "> <td key={`skeleton-cell-${rowIndex}-${colIndex}`} className="text-[14px] p-2 lg:p-4 " >
<div className="h-4 w-full rounded-xl bg-[rgba(255, 255, 255, 0.10)]" /> <div className="h-4 w-full rounded-xl bg-[rgba(255, 255, 255, 0.10)]" style={{ background: "rgba(255, 255, 255, 0.10)" }} />
</td> </td>
))} ))}
</tr> </tr>
......
...@@ -51,6 +51,8 @@ export default function WithdrawnHistoryPage() { ...@@ -51,6 +51,8 @@ export default function WithdrawnHistoryPage() {
} }
] ]
console.log(data);
const table = useReactTable({ const table = useReactTable({
data: data?.data?.data || [], data: data?.data?.data || [],
// data: dummyDeposits, // data: dummyDeposits,
...@@ -62,9 +64,8 @@ export default function WithdrawnHistoryPage() { ...@@ -62,9 +64,8 @@ export default function WithdrawnHistoryPage() {
return ( return (
<> <>
<CustomTable table={table} loading={isLoading} emptyMessage="You haven't deposite yet!" /> <CustomTable table={table} loading={isLoading} emptyMessage="You haven't deposite yet!" />
<div className="flex justify-between items-center mt-4 px-8 py-6"> {data && data?.data?.data.length > 5 ? <div className="flex justify-between items-center mt-4 px-8 py-6">
<Pagination count={data?.data?.pagination?.total_pages || 1}
<Pagination count={data?.data?.pagination.total_pages || 1}
page={page} page={page}
onChange={(_, value) => setPage(value)} variant="outlined" shape="rounded" sx={{ gap: "8px" }} /> onChange={(_, value) => setPage(value)} variant="outlined" shape="rounded" sx={{ gap: "8px" }} />
<div> <div>
...@@ -81,7 +82,7 @@ export default function WithdrawnHistoryPage() { ...@@ -81,7 +82,7 @@ export default function WithdrawnHistoryPage() {
))} ))}
</select> </select>
</div> </div>
</div> </div> : ""}
</> </>
) )
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment