Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sweepstake
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Arjun Jhukal
sweepstake
Commits
c3a60610
Commit
c3a60610
authored
Apr 03, 2026
by
Arjun Jhukal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed the admin and superadmin redirection
parent
687cbc93
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
29 additions
and
121 deletions
+29
-121
DashboardProvider.tsx
...pp/(dashboard)/(user)/(outsideAuth)/DashboardProvider.tsx
+5
-5
DashboardLayout.tsx
src/components/layouts/DashboardLayout.tsx
+10
-4
PaymentModal.tsx
src/components/molecules/PaymentModal.tsx
+1
-0
index.tsx
src/components/organism/Header/index.tsx
+3
-3
index.tsx
src/components/organism/Sidebar/index.tsx
+7
-7
index.tsx
src/components/pages/auth/login/index.tsx
+2
-2
FortPay.tsx
...Dashboard/buyCoins/buyCoinSinlgeGame/checkout/FortPay.tsx
+0
-99
transaction.ts
src/services/transaction.ts
+1
-1
No files found.
src/app/(dashboard)/(user)/(outsideAuth)/DashboardProvider.tsx
View file @
c3a60610
...
...
@@ -6,10 +6,10 @@ import AdminDashboardRoot from '../../(admin)/AdminDashboard';
export
default
function
DashboardProvider
({
children
}:
{
children
:
React
.
ReactNode
})
{
const
user
=
useAppSelector
(
state
=>
state
?.
auth
.
user
);
if
(
user
?.
role
&&
user
.
role
.
toUpperCase
()
===
"ADMIN"
)
{
return
<
AdminDashboardRoot
/>
if
(
user
?.
role
&&
user
.
role
.
toUpperCase
()
===
"USER"
)
{
return
(
<
div
>
{
children
}
</
div
>
)
}
return
(
<
div
>
{
children
}
</
div
>
)
return
<
AdminDashboardRoot
/>
}
src/components/layouts/DashboardLayout.tsx
View file @
c3a60610
...
...
@@ -40,10 +40,16 @@ export default function DashboardLayout({ children }: { children: React.ReactNod
return
(
<
Box
sx=
{
{
display
:
'flex'
}
}
>
<
Header
open=
{
open
}
handleDrawerOpen=
{
handleDrawerOpen
}
handleMobileMenuToggle=
{
handleMobileMenuToggle
}
/>
<
Sidebar
open=
{
open
}
handleDrawerOpen=
{
handleDrawerOpen
}
handleMobileMenuToggle=
{
handleMobileMenuToggle
}
mobileMenuOpen=
{
openMobile
}
/>
<
Header
open=
{
open
}
handleDrawerOpen=
{
handleDrawerOpen
}
handleMobileMenuToggle=
{
handleMobileMenuToggle
}
/>
<
Sidebar
open=
{
open
}
handleDrawerOpen=
{
handleDrawerOpen
}
handleMobileMenuToggle=
{
handleMobileMenuToggle
}
mobileMenuOpen=
{
openMobile
}
/>
<
div
className=
"root_container w-full overflow-hidden"
>
<
DrawerHeader
sx=
{
{
mb
:
{
xs
:
'16px'
,
lg
:
0
}
...
...
src/components/molecules/PaymentModal.tsx
View file @
c3a60610
...
...
@@ -179,6 +179,7 @@ export default function PaymentModal({
data
.
type
===
'payment:success'
||
data
.
type
===
`payment:
${
successMessage
}
`
||
data
.
result
===
'success'
||
data
.
verification_status
===
'verification.accepted'
||
data
.
result
===
successMessage
||
(
typeof
data
===
'string'
&&
(
data
===
successMessage
||
...
...
src/components/organism/Header/index.tsx
View file @
c3a60610
...
...
@@ -106,10 +106,10 @@ export default function Header({ open, handleDrawerOpen, handleMobileMenuToggle
<
HambergerMenu
className=
'!text-para-light'
/>
</
IconButton
>
}
{
user
?.
role
&&
user
.
role
.
toUpperCase
()
===
'ADMIN'
?
(
<
AdminHeader
/>
)
:
(
user
?.
role
&&
user
.
role
.
toUpperCase
()
===
'USER'
?
(
<
UserHeader
/>
)
:
(
<
AdminHeader
/>
)
}
</
Toolbar
>
...
...
src/components/organism/Sidebar/index.tsx
View file @
c3a60610
...
...
@@ -125,7 +125,7 @@ export default function Sidebar({ open, handleMobileMenuToggle, mobileMenuOpen }
if
(
downLG
)
{
return
<
div
className=
{
`mobile__menu__wrapper fixed left-0 top-0 bottom-0 max-h-screen backdrop-blur-2xl bg-[#290139CF] w-full z-[9999] transition-all duration-300 ${mobileMenuOpen ? "opacity-100 visible" : "opacity-0 invisible"}`
}
>
<
div
className=
{
`mobile__primary__menu max-w-[600px] w-full h-screen transition-all duration-300 ${mobileMenuOpen ? "opacity-100 visible translate-x-0" : "opacity-0 invisible translate-x-[-100%]"} ${user?.role && user.role.toUpperCase() === '
ADMIN' ? "bg-white" : "bg-[#11011E]
"}`
}
ref=
{
ref
}
>
<
div
className=
{
`mobile__primary__menu max-w-[600px] w-full h-screen transition-all duration-300 ${mobileMenuOpen ? "opacity-100 visible translate-x-0" : "opacity-0 invisible translate-x-[-100%]"} ${user?.role && user.role.toUpperCase() === '
USER' ? "bg-[#11011E]" : "bg-white
"}`
}
ref=
{
ref
}
>
<
div
className=
"flex justify-between items-center p-4 "
>
{
data
?.
data
?.
logo
&&
<
Link
href=
"/"
>
<
Image
src=
{
data
?.
data
?.
logo
}
alt=
"Logo"
width=
{
102
}
height=
{
56
}
/>
...
...
@@ -147,10 +147,10 @@ export default function Sidebar({ open, handleMobileMenuToggle, mobileMenuOpen }
</
div
>
<
Box
className=
{
`mt-8 menu__wrapper `
}
>
{
user
?.
role
&&
user
.
role
.
toUpperCase
()
===
'ADMIN'
?
(
<
AdminMenu
open=
{
open
}
/>
)
:
(
user
?.
role
&&
user
.
role
.
toUpperCase
()
===
'USER'
?
(
<
UserMenu
open=
{
open
}
/>
)
:
(
<
AdminMenu
open=
{
open
}
/>
)
}
</
Box
>
...
...
@@ -168,10 +168,10 @@ export default function Sidebar({ open, handleMobileMenuToggle, mobileMenuOpen }
<
Box
className=
{
`mt-8 menu__wrapper`
}
>
{
user
?.
role
&&
user
.
role
.
toUpperCase
()
===
'ADMIN'
?
(
<
AdminMenu
open=
{
open
}
/>
)
:
(
user
?.
role
&&
user
.
role
.
toUpperCase
()
===
'USER'
?
(
<
UserMenu
open=
{
open
}
/>
)
:
(
<
AdminMenu
open=
{
open
}
/>
)
}
</
Box
>
...
...
src/components/pages/auth/login/index.tsx
View file @
c3a60610
...
...
@@ -77,8 +77,8 @@ export default function LoginPage() {
secure
:
process
.
env
.
NODE_ENV
===
'production'
,
sameSite
:
'Strict'
,
});
console
.
log
(
"Login Response:"
,
response
?.
data
?.
user
?.
role
.
toLowerCase
()
===
"
admin
"
);
router
.
replace
(
response
?.
data
?.
user
?.
role
?.
toLowerCase
()
===
"
admin"
?
"/"
:
"/credentials
"
);
console
.
log
(
"Login Response:"
,
response
?.
data
?.
user
?.
role
.
toLowerCase
()
===
"
user
"
);
router
.
replace
(
response
?.
data
?.
user
?.
role
?.
toLowerCase
()
===
"
user"
?
"/credentials"
:
"/
"
);
}
catch
(
e
:
any
)
{
dispatch
(
...
...
src/components/pages/dashboard/userDashboard/buyCoins/buyCoinSinlgeGame/checkout/FortPay.tsx
View file @
c3a60610
// 'use client';
// import { useAppDispatch, useAppSelector } from '@/hooks/hook';
// import { useDepositMutation } from '@/services/transaction';
// import { showToast, ToastVariant } from '@/slice/toastSlice';
// import { DepositProps } from '@/types/transaction';
// import { Button, InputLabel, OutlinedInput } from '@mui/material';
// import { useRouter } from 'next/navigation';
// import Script from 'next/script';
// import { PaymentModeProps } from '.';
// declare global {
// interface Window {
// CollectJS: {
// configure: (config: {
// paymentType: string;
// callback: (response: any) => void;
// }) => void;
// };
// }
// }
// export default function PaymentForm({ id, amount, type }: DepositProps & { type: PaymentModeProps }) {
// const dispatch = useAppDispatch();
// const router = useRouter();
// const user = useAppSelector((state) => state.auth.user);
// const [payViaFortPay, { isLoading }] = useDepositMutation();
// const handleCollectJSLoad = () => {
// if (typeof window !== 'undefined' && window.CollectJS) {
// window.CollectJS.configure({
// paymentType: 'cc',
// callback: async (response) => {
// try {
// await payViaFortPay({
// id: id,
// amount: amount,
// type: type as PaymentModeProps,
// payment_token: response.token
// }).unwrap();
// router.push(`/buy-coins/${id}/success`)
// }
// catch (e: any) {
// dispatch(showToast({
// message: e?.data?.message || "Unable to deposit",
// variant: ToastVariant.ERROR
// }))
// }
// }
// });
// }
// };
// return (
// <>
// <Script
// src="https://secure.fppgateway.com/token/Collect.js"
// data-tokenization-key="NAhDuk-7V4u2u-tUAsT5-dCqbH5"
// strategy="afterInteractive"
// onReady={handleCollectJSLoad}
// />
// <form className="theForm">
// <div className="formInner flex flex-col gap-3 md:grid md:grid-cols-2">
// <div className="form-group">
// <InputLabel htmlFor="fname">First Name </InputLabel>
// <OutlinedInput type="text" className="form-control" placeholder="First Name" name="fname" defaultValue={user?.first_name} />
// </div>
// <div className="form-group">
// <InputLabel htmlFor="lname">Last Name </InputLabel>
// <OutlinedInput type="text" className="form-control" placeholder="Last Name" name="lname" defaultValue={user?.last_name} />
// </div>
// <div className="form-group">
// <InputLabel htmlFor="address1">Address </InputLabel>
// <OutlinedInput type="text" className="form-control" placeholder="Street Address" name="address1" defaultValue={user?.address} />
// </div>
// <div className="form-group">
// <InputLabel htmlFor="city">City </InputLabel>
// <OutlinedInput type="text" className="form-control" placeholder="City" name="city" defaultValue={user?.city} />
// </div>
// <div className="form-group">
// <InputLabel htmlFor="state">State </InputLabel>
// <OutlinedInput type="text" className="form-control" placeholder="State" name="state" defaultValue={user?.state} />
// </div>
// <div className="form-group">
// <InputLabel htmlFor="zip">Zip Code </InputLabel>
// <OutlinedInput type="text" className="form-control" placeholder="Zip code" name="zip" defaultValue={""} />
// </div>
// </div>
// {/* <OutlinedInput type="submit" id="payButton" value="Pay $5" className="btn btn-primary btn-block" /> */}
// <Button type="submit" id="payButton" variant='contained' color='primary' className='mt-4!'>{isLoading ? "Proceeding Payment" : "Proceed Payment"}</Button>
// </form>
// <div id="paymentTokenInfo"></div>
// </>
// );
// }
'use client'
;
import
{
useAppDispatch
,
useAppSelector
}
from
'@/hooks/hook'
;
...
...
src/services/transaction.ts
View file @
c3a60610
...
...
@@ -69,7 +69,7 @@ export const transactionApi = createApi({
method
:
"GET"
}),
providesTags
:
[
'Deposit'
,
'Withdrawl'
]
}),
deposit
:
builder
.
mutation
<
DepositResponseProps
,
DepositProps
>
({
query
:
({
id
,
amount
,
type
,
payment_token
,
number
,
hash
,
exp
,
bin
})
=>
({
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment