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,25 +44,43 @@ export default function NotificationPage({
const dispatch = useAppDispatch();
const [readNotification, { isLoading }] = useReadNotificationMutation();
const handleNotificationClick = async (id: string) => {
try {
const response = await readNotification({ id }).unwrap();
// dispatch(
// showToast({
// message: "Notification read successfully",
// variant: ToastVariant.SUCCESS
// })
// )
const [readAllNotification, { isLoading: readingAll }] = useReadAllNotificationMutation();
const handleNotificationClick = async (id?: string) => {
if (id) {
try {
const response = await readNotification({ id }).unwrap();
// dispatch(
// 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) {
dispatch(
showToast({
message: e.message || "Unable to read notification",
variant: ToastVariant.ERROR
})
)
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,24 +44,26 @@ export default function EditUserWallet() {
}
})
return (
<form onSubmit={formik.handleSubmit} className="wallet-form">
<InputLabel htmlFor="wallet_address">Wallet Address</InputLabel>
<OutlinedInput
name='wallet_address'
id='wallet_address'
value={formik.values.wallet_address}
onChange={formik.handleChange}
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,
change the wallet address and click update</p>
</div>
<Button type="submit" variant='contained' color='secondary' sx={{
color: "#1E3634",
fontSize: "12px"
}} startIcon={<WalletCheck />}>Update</Button>
</form>
<div className="px-8 lg:pt-8 pb-8">
<form onSubmit={formik.handleSubmit} className="wallet-form">
<InputLabel htmlFor="wallet_address">Wallet Address</InputLabel>
<OutlinedInput
name='wallet_address'
id='wallet_address'
value={formik.values.wallet_address}
onChange={formik.handleChange}
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,
change the wallet address and click update</p>
</div>
<Button type="submit" variant='contained' color='secondary' sx={{
color: "#1E3634",
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