Commit 2061871d by Arjun Jhukal

updated the profile ui issue

parent 5c8eb0c1
...@@ -26,7 +26,9 @@ export default function AccountTab() { ...@@ -26,7 +26,9 @@ export default function AccountTab() {
case "wallet_information": case "wallet_information":
return <EditUserWallet />; return <EditUserWallet />;
case "change_password": case "change_password":
return <h2>Change Password</h2>; return (<div className="px-8 lg:pt-8 pb-8">
<h2> Change Password</h2>
</div>);
default: default:
return null; return null;
} }
......
...@@ -202,7 +202,7 @@ ...@@ -202,7 +202,7 @@
transform-origin: bottom left; transform-origin: bottom left;
} }
.status.paid,
.status.success { .status.success {
background-color: #12a211; background-color: #12a211;
} }
...@@ -211,7 +211,7 @@ ...@@ -211,7 +211,7 @@
background-color: #d03538; background-color: #d03538;
} }
.status.active { .status.pending {
background-color: #f2bf53; background-color: #f2bf53;
} }
......
...@@ -17,7 +17,7 @@ import { Notification } from '@wandersonalwes/iconsax-react'; ...@@ -17,7 +17,7 @@ import { Notification } from '@wandersonalwes/iconsax-react';
import Link from 'next/link'; import Link from 'next/link';
import { NotificationProps } from '@/types/notification'; import { NotificationProps } from '@/types/notification';
import { Pagination } from '@/types/game'; import { Pagination } from '@/types/game';
import { useReadNotificationMutation } from '@/services/notificationApi'; import { useReadAllNotificationMutation, useReadNotificationMutation } from '@/services/notificationApi';
import { useAppDispatch } from '@/hooks/hook'; import { useAppDispatch } from '@/hooks/hook';
import { showToast, ToastVariant } from '@/slice/toastSlice'; import { showToast, ToastVariant } from '@/slice/toastSlice';
import { formatDateTime } from '@/utils/formatDateTime'; import { formatDateTime } from '@/utils/formatDateTime';
...@@ -44,7 +44,9 @@ export default function NotificationPage({ ...@@ -44,7 +44,9 @@ export default function NotificationPage({
const dispatch = useAppDispatch(); const dispatch = useAppDispatch();
const [readNotification, { isLoading }] = useReadNotificationMutation(); const [readNotification, { isLoading }] = useReadNotificationMutation();
const handleNotificationClick = async (id: string) => { const [readAllNotification, { isLoading: readingAll }] = useReadAllNotificationMutation();
const handleNotificationClick = async (id?: string) => {
if (id) {
try { try {
const response = await readNotification({ id }).unwrap(); const response = await readNotification({ id }).unwrap();
// dispatch( // dispatch(
...@@ -63,6 +65,22 @@ export default function NotificationPage({ ...@@ -63,6 +65,22 @@ export default function NotificationPage({
) )
} }
} }
else {
try {
const response = await readAllNotification().unwrap();
setOpen(false);
}
catch (e: any) {
dispatch(
showToast({
message: e.message || "Unable to read notification",
variant: ToastVariant.ERROR
})
)
}
}
}
return ( return (
<Box> <Box>
<IconButton <IconButton
...@@ -105,7 +123,7 @@ export default function NotificationPage({ ...@@ -105,7 +123,7 @@ export default function NotificationPage({
Notifications Notifications
</Typography> </Typography>
{pagination && pagination?.count > 2 ? <Link href={"#"} className='text-[12px] leading-[120%] hover:text-primary-dark font-medium'>View All</Link> : ""} {pagination && pagination?.count > 2 ? <Link href={"#"} className='text-[12px] leading-[120%] hover:text-primary-dark font-medium'>View All</Link> : ""}
<Link href={"#"} className='text-[12px] leading-[120%] text-primary hover:text-primary-dark font-medium'>Mark All Read</Link> <p onClick={() => handleNotificationClick()} className='text-[12px] leading-[120%] text-primary hover:text-primary-dark font-medium cursor-pointer'>Mark All Read</p>
</div> </div>
{ {
notifications.length ? ( notifications.length ? (
......
...@@ -229,7 +229,7 @@ export default function PlayerListing() { ...@@ -229,7 +229,7 @@ export default function PlayerListing() {
/> />
<div className="px-4"> <div className="px-4">
<TabController <TabController
links={[{ label: "All", value: "" }, { label: "Subspended", value: "suspend" }]} links={[{ label: "All", value: "" }, { label: "Suspended", value: "suspend" }]}
currentTab={currentTab} currentTab={currentTab}
onTabChange={handleTabChange} onTabChange={handleTabChange}
/> />
......
...@@ -8,7 +8,7 @@ export default function AllTransactionsPage() { ...@@ -8,7 +8,7 @@ export default function AllTransactionsPage() {
const [search, setSearch] = React.useState(""); const [search, setSearch] = React.useState("");
return ( return (
<> <>
<PageHeader title='Tranactions' /> <PageHeader title='Transactions' />
<TransactionTable search={search} setSearch={setSearch} /> <TransactionTable search={search} setSearch={setSearch} />
</> </>
......
...@@ -44,6 +44,7 @@ export default function EditUserWallet() { ...@@ -44,6 +44,7 @@ export default function EditUserWallet() {
} }
}) })
return ( return (
<div className="px-8 lg:pt-8 pb-8">
<form onSubmit={formik.handleSubmit} className="wallet-form"> <form onSubmit={formik.handleSubmit} className="wallet-form">
<InputLabel htmlFor="wallet_address">Wallet Address</InputLabel> <InputLabel htmlFor="wallet_address">Wallet Address</InputLabel>
<OutlinedInput <OutlinedInput
...@@ -63,5 +64,6 @@ export default function EditUserWallet() { ...@@ -63,5 +64,6 @@ export default function EditUserWallet() {
fontSize: "12px" fontSize: "12px"
}} startIcon={<WalletCheck />}>Update</Button> }} startIcon={<WalletCheck />}>Update</Button>
</form> </form>
</div>
) )
} }
...@@ -28,8 +28,15 @@ export const notificationApi = createApi({ ...@@ -28,8 +28,15 @@ export const notificationApi = createApi({
method: "POST", method: "POST",
}), }),
invalidatesTags: ["Notification"] invalidatesTags: ["Notification"]
}),
readAllNotification: builder.mutation<GlobalResponse, void>({
query: () => ({
url: `/api/admin/notification/all`,
method: "POST",
}),
invalidatesTags: ["Notification"]
}) })
}) })
}) })
export const { useGetAllNotificationQuery, useReadNotificationMutation } = notificationApi export const { useGetAllNotificationQuery, useReadNotificationMutation, useReadAllNotificationMutation } = notificationApi
\ No newline at end of file \ No newline at end of file
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