Commit 2061871d by Arjun Jhukal

updated the profile ui issue

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