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,25 +44,43 @@ export default function NotificationPage({ ...@@ -44,25 +44,43 @@ 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();
try { const handleNotificationClick = async (id?: string) => {
const response = await readNotification({ id }).unwrap(); if (id) {
// dispatch( try {
// showToast({ const response = await readNotification({ id }).unwrap();
// message: "Notification read successfully", // dispatch(
// variant: ToastVariant.SUCCESS // showToast({
// }) // message: "Notification read successfully",
// ) // variant: ToastVariant.SUCCESS
// })
// )
}
catch (e: any) {
dispatch(
showToast({
message: e.message || "Unable to read notification",
variant: ToastVariant.ERROR
})
)
}
} }
catch (e: any) { else {
dispatch( try {
showToast({ const response = await readAllNotification().unwrap();
message: e.message || "Unable to read notification", setOpen(false);
variant: ToastVariant.ERROR }
}) 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,24 +44,26 @@ export default function EditUserWallet() { ...@@ -44,24 +44,26 @@ export default function EditUserWallet() {
} }
}) })
return ( return (
<form onSubmit={formik.handleSubmit} className="wallet-form"> <div className="px-8 lg:pt-8 pb-8">
<InputLabel htmlFor="wallet_address">Wallet Address</InputLabel> <form onSubmit={formik.handleSubmit} className="wallet-form">
<OutlinedInput <InputLabel htmlFor="wallet_address">Wallet Address</InputLabel>
name='wallet_address' <OutlinedInput
id='wallet_address' name='wallet_address'
value={formik.values.wallet_address} id='wallet_address'
onChange={formik.handleChange} value={formik.values.wallet_address}
onBlur={formik.handleBlur} onChange={formik.handleChange}
placeholder='Enter your bitcoin address' onBlur={formik.handleBlur}
/> placeholder='Enter your bitcoin address'
<div className="info my-4"> />
<p className='flex items-center bg-[#EEFEC4] text-[#547D16] p-2 rounded-lg text-[10px] lg:text-[12px] gap-1 '><InfoCircle size={12} />You can only connect one wallet at a time. To update the wallet address, <div className="info my-4">
change the wallet address and click update</p> <p className='flex items-center bg-[#EEFEC4] text-[#547D16] p-2 rounded-lg text-[10px] lg:text-[12px] gap-1 '><InfoCircle size={12} />You can only connect one wallet at a time. To update the wallet address,
</div> change the wallet address and click update</p>
<Button type="submit" variant='contained' color='secondary' sx={{ </div>
color: "#1E3634", <Button type="submit" variant='contained' color='secondary' sx={{
fontSize: "12px" color: "#1E3634",
}} startIcon={<WalletCheck />}>Update</Button> fontSize: "12px"
</form> }} startIcon={<WalletCheck />}>Update</Button>
</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