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
3294a2f4
Commit
3294a2f4
authored
Apr 03, 2026
by
Arjun Jhukal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reformed the user creations and registraion process
parent
ed0ed73d
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
265 additions
and
75 deletions
+265
-75
index.tsx
src/components/pages/auth/register/index.tsx
+79
-11
AddPlayerForm.tsx
...rd/adminDashboard/players/addPlayerForm/AddPlayerForm.tsx
+137
-37
index.tsx
.../dashboard/adminDashboard/players/addPlayerForm/index.tsx
+13
-8
TransactionTable.tsx
...dashboard/adminDashboard/transaction/TransactionTable.tsx
+8
-4
index.tsx
...board/userDashboard/account/profile/editProfile/index.tsx
+13
-3
FortPay.tsx
...Dashboard/buyCoins/buyCoinSinlgeGame/checkout/FortPay.tsx
+1
-1
index.tsx
...ponents/pages/dashboard/userDashboard/withdrawl/index.tsx
+1
-1
auth.ts
src/types/auth.ts
+6
-5
player.ts
src/types/player.ts
+6
-5
transaction.ts
src/types/transaction.ts
+1
-0
No files found.
src/components/pages/auth/register/index.tsx
View file @
3294a2f4
...
@@ -96,7 +96,10 @@ const validationSchema = Yup.object().shape({
...
@@ -96,7 +96,10 @@ const validationSchema = Yup.object().shape({
last_name
:
Yup
.
string
().
required
(
'Last name is required'
),
last_name
:
Yup
.
string
().
required
(
'Last name is required'
),
city
:
Yup
.
string
().
required
(
"City is Required"
),
city
:
Yup
.
string
().
required
(
"City is Required"
),
state
:
Yup
.
string
().
required
(
"State is Required"
),
state
:
Yup
.
string
().
required
(
"State is Required"
),
// zip_code: Yup.string().required("Zip Code is Required"),
// postal_code: Yup.string().required("Zip Code is Required"),
address
:
Yup
.
string
().
required
(
"Address is Required"
),
address_line_two
:
Yup
.
string
(),
gender
:
Yup
.
string
().
required
(
"Gender is Required"
),
postal_code
:
Yup
.
string
().
required
(
"Postal Code is Required"
),
postal_code
:
Yup
.
string
().
required
(
"Postal Code is Required"
),
ssn
:
Yup
.
string
()
ssn
:
Yup
.
string
()
.
matches
(
/^
\d{4}
$/
,
"SSN must be exactly 4 digits no characters"
)
.
matches
(
/^
\d{4}
$/
,
"SSN must be exactly 4 digits no characters"
)
...
@@ -122,12 +125,13 @@ export default function RegisterPage() {
...
@@ -122,12 +125,13 @@ export default function RegisterPage() {
photoid_number
:
''
,
photoid_number
:
''
,
dob
:
null
as
Dayjs
|
null
,
dob
:
null
as
Dayjs
|
null
,
city
:
''
,
city
:
''
,
pob
:
''
,
agree
:
true
,
agree
:
true
,
state
:
""
,
state
:
""
,
zip_code
:
""
,
postal_code
:
""
,
postal_code
:
""
,
ssn
:
""
ssn
:
""
,
address
:
""
,
address_line_two
:
""
,
gender
:
""
}
}
const
{
handleSubmit
,
handleBlur
,
handleChange
,
errors
,
dirty
,
values
,
touched
,
setFieldValue
,
setFieldTouched
}
=
useFormik
(
const
{
handleSubmit
,
handleBlur
,
handleChange
,
errors
,
dirty
,
values
,
touched
,
setFieldValue
,
setFieldTouched
}
=
useFormik
(
{
{
...
@@ -149,11 +153,12 @@ export default function RegisterPage() {
...
@@ -149,11 +153,12 @@ export default function RegisterPage() {
dob
:
formattedDob
,
dob
:
formattedDob
,
city
:
values
.
city
,
city
:
values
.
city
,
state
:
values
.
state
,
state
:
values
.
state
,
zip_code
:
values
.
zip_code
,
pob
:
values
.
pob
,
agree
:
values
.
agree
,
postal_code
:
values
.
postal_code
,
postal_code
:
values
.
postal_code
,
ssn
:
values
.
ssn
agree
:
values
.
agree
,
ssn
:
values
.
ssn
,
address
:
values
.
address
,
address_line_two
:
values
.
address_line_two
,
gender
:
values
.
gender
}).
unwrap
();
}).
unwrap
();
dispatch
(
dispatch
(
...
@@ -185,7 +190,6 @@ export default function RegisterPage() {
...
@@ -185,7 +190,6 @@ export default function RegisterPage() {
}
}
)
)
console
.
log
(
errors
)
return
(
return
(
<>
<>
<
AuthMessageBlock
<
AuthMessageBlock
...
@@ -276,6 +280,38 @@ export default function RegisterPage() {
...
@@ -276,6 +280,38 @@ export default function RegisterPage() {
</
div
>
</
div
>
</
div
>
</
div
>
<
div
className=
"input__field lg:col-span-3"
>
<
InputLabel
htmlFor=
"address"
>
Address Line 1
<
span
className=
"text-red-500"
>
*
</
span
></
InputLabel
>
<
OutlinedInput
fullWidth
id=
"address"
name=
"address"
placeholder=
"Enter address"
value=
{
values
.
address
}
onChange=
{
handleChange
}
onBlur=
{
handleBlur
}
/>
<
span
className=
"error"
>
{
touched
.
address
&&
errors
.
address
?
errors
.
address
:
""
}
</
span
>
</
div
>
<
div
className=
"input__field lg:col-span-3"
>
<
InputLabel
htmlFor=
"address_line_two"
>
Address Line 2
</
InputLabel
>
<
OutlinedInput
fullWidth
id=
"address_line_two"
name=
"address_line_two"
placeholder=
"Enter address line 2"
value=
{
values
.
address_line_two
}
onChange=
{
handleChange
}
onBlur=
{
handleBlur
}
/>
<
span
className=
"error"
>
{
touched
.
address_line_two
&&
errors
.
address_line_two
?
errors
.
address_line_two
:
""
}
</
span
>
</
div
>
{
/* City */
}
{
/* City */
}
<
div
className=
"lg:col-span-3"
>
<
div
className=
"lg:col-span-3"
>
<
div
className=
"input__field"
>
<
div
className=
"input__field"
>
...
@@ -325,6 +361,37 @@ export default function RegisterPage() {
...
@@ -325,6 +361,37 @@ export default function RegisterPage() {
</
div
>
</
div
>
</
div
>
</
div
>
<
div
className=
"input__field lg:col-span-3"
>
<
InputLabel
htmlFor=
"gender"
>
Gender
<
span
className=
"text-red-500"
>
*
</
span
></
InputLabel
>
<
Select
fullWidth
id=
"gender"
name=
"gender"
displayEmpty
value=
{
values
.
gender
}
onChange=
{
handleChange
}
onBlur=
{
handleBlur
}
renderValue=
{
(
selected
)
=>
selected
===
""
?
"Select a Gender"
:
selected
}
>
<
MenuItem
value=
""
>
<
em
>
Select a Gender
</
em
>
</
MenuItem
>
{
[
{
label
:
"Male"
,
value
:
"M"
},
{
label
:
"Female"
,
value
:
"F"
},
{
label
:
"Other"
,
value
:
"O"
},
].
map
((
state
)
=>
(
<
MenuItem
key=
{
state
.
value
}
value=
{
state
.
value
}
>
{
state
.
label
}
</
MenuItem
>
))
}
</
Select
>
<
span
className=
"error"
>
{
touched
.
gender
&&
errors
.
gender
}
</
span
>
</
div
>
<
div
className=
"lg:col-span-3"
>
<
div
className=
"lg:col-span-3"
>
<
div
className=
"input__field"
>
<
div
className=
"input__field"
>
<
InputLabel
htmlFor=
"postal_code"
>
Postal Code
<
span
className=
"text-red-500"
>
*
</
span
></
InputLabel
>
<
InputLabel
htmlFor=
"postal_code"
>
Postal Code
<
span
className=
"text-red-500"
>
*
</
span
></
InputLabel
>
...
@@ -363,7 +430,7 @@ export default function RegisterPage() {
...
@@ -363,7 +430,7 @@ export default function RegisterPage() {
<
div
className=
"lg:col-span-3"
>
<
div
className=
"lg:col-span-3"
>
<
InputLabel
htmlFor=
"phone"
>
Phone
<
span
className=
"text-red-500"
>
*
</
span
></
InputLabel
>
<
InputLabel
htmlFor=
"phone"
>
Phone
<
span
className=
"text-red-500"
>
*
</
span
></
InputLabel
>
<
div
className=
"grid grid-cols-12 gap-1 items-
end
"
>
<
div
className=
"grid grid-cols-12 gap-1 items-
start
"
>
<
div
className=
"col-span-4 lg:col-span-3"
>
<
div
className=
"col-span-4 lg:col-span-3"
>
<
OutlinedInput
<
OutlinedInput
fullWidth
fullWidth
...
@@ -392,7 +459,8 @@ export default function RegisterPage() {
...
@@ -392,7 +459,8 @@ export default function RegisterPage() {
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
</
div
>
<
div
className=
"lg:col-span-6"
>
<
div
className=
"lg:col-span-3"
>
<
div
className=
"input__field"
>
<
div
className=
"input__field"
>
<
InputLabel
htmlFor=
"dob"
>
Date of Birth
<
span
className=
"text-red-500"
>
*
</
span
></
InputLabel
>
<
InputLabel
htmlFor=
"dob"
>
Date of Birth
<
span
className=
"text-red-500"
>
*
</
span
></
InputLabel
>
<
LocalizationProvider
dateAdapter=
{
AdapterDayjs
}
>
<
LocalizationProvider
dateAdapter=
{
AdapterDayjs
}
>
...
...
src/components/pages/dashboard/adminDashboard/players/addPlayerForm/AddPlayerForm.tsx
View file @
3294a2f4
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
import
InputFile
from
'@/components/atom/InputFile'
;
import
InputFile
from
'@/components/atom/InputFile'
;
import
PasswordField
from
'@/components/molecules/PasswordField'
;
import
PasswordField
from
'@/components/molecules/PasswordField'
;
import
{
US_STATES
}
from
'@/constants/state'
;
import
{
US_STATES
}
from
'@/constants/state'
;
import
{
useAppSelector
}
from
'@/hooks/hook'
;
import
{
PlayerProps
,
SinlgePlayerResponseProps
}
from
'@/types/player'
;
import
{
PlayerProps
,
SinlgePlayerResponseProps
}
from
'@/types/player'
;
import
{
Button
,
InputLabel
,
MenuItem
,
OutlinedInput
,
Select
}
from
'@mui/material'
;
import
{
Button
,
InputLabel
,
MenuItem
,
OutlinedInput
,
Select
}
from
'@mui/material'
;
import
{
DatePicker
,
LocalizationProvider
}
from
'@mui/x-date-pickers'
;
import
{
DatePicker
,
LocalizationProvider
}
from
'@mui/x-date-pickers'
;
...
@@ -10,22 +11,51 @@ import dayjs from 'dayjs';
...
@@ -10,22 +11,51 @@ import dayjs from 'dayjs';
import
{
FormikProps
}
from
'formik'
;
import
{
FormikProps
}
from
'formik'
;
const
formFieldSx
=
{
const
formFieldSx
=
{
"&& .MuiPickersInputBase-input"
:
{
'& .MuiOutlinedInput-root, & .MuiPickersInputBase-root, & .MuiPickersOutlinedInput-root'
:
{
borderRadius
:
"8px !important"
,
borderRadius
:
'27px'
,
padding
:
"10px 0px !important"
,
background
:
'rgba(118, 107, 120, 0.55)'
,
color
:
'#fff'
,
'& .MuiOutlinedInput-notchedOutline, & .MuiPickersOutlinedInput-notchedOutline'
:
{
border
:
'0.576px solid rgba(255, 255, 255, 0.04)'
,
},
'&:hover .MuiOutlinedInput-notchedOutline, &:hover .MuiPickersOutlinedInput-notchedOutline'
:
{
borderColor
:
'rgba(255,255,255,0.2)'
,
},
'&.Mui-focused .MuiOutlinedInput-notchedOutline, &.Mui-focused .MuiPickersOutlinedInput-notchedOutline'
:
{
borderColor
:
'#B801C0'
,
},
},
},
'& .MuiOutlinedInput-input, & .MuiPickersInputBase-input'
:
{
"&& .MuiPickersSectionList-root"
:
{
padding
:
'12px 16px'
,
padding
:
"4px 16px 4px 0 !important"
,
color
:
'#fff'
,
'&::placeholder'
:
{
color
:
'rgba(255, 255, 255, 0.2)'
,
fontWeight
:
300
,
fontSize
:
'12px'
,
opacity
:
1
,
},
},
'& .MuiInputAdornment-root'
:
{
marginRight
:
'8px'
,
},
'& .MuiInputAdornment-root button'
:
{
color
:
'rgba(255, 255, 255, 0.7)'
,
'&:hover'
:
{
color
:
'#fff'
,
background
:
'rgba(255, 255, 255, 0.08)'
,
}
},
},
'& .MuiIconButton-root'
:
{
padding
:
'8px'
,
}
};
};
export
default
function
AddPlayerForm
({
formik
,
id
,
data
,
loading
,
buttonLabel
}:
{
formik
:
FormikProps
<
PlayerProps
>
,
id
?:
string
,
data
?:
SinlgePlayerResponseProps
,
loading
?:
boolean
,
buttonLabel
?:
string
})
{
export
default
function
AddPlayerForm
({
formik
,
id
,
data
,
loading
,
buttonLabel
}:
{
formik
:
FormikProps
<
PlayerProps
>
,
id
?:
string
,
data
?:
SinlgePlayerResponseProps
,
loading
?:
boolean
,
buttonLabel
?:
string
})
{
const
user
=
useAppSelector
(
state
=>
state
.
auth
.
user
);
return
(
return
(
<
form
onSubmit=
{
formik
.
handleSubmit
}
>
<
form
onSubmit=
{
formik
.
handleSubmit
}
>
<
div
className=
"form__fields p-6 lg:p-10 flex flex-col gap-4 lg:gap-6 lg:grid grid-cols-2"
>
<
div
className=
"form__fields p-6 lg:p-10 flex flex-col gap-4 lg:gap-6 lg:grid
lg:
grid-cols-2"
>
<
div
className=
"input__field"
>
<
div
className=
"input__field
col-span-1
"
>
<
InputLabel
htmlFor=
"name"
>
Username
<
span
className=
"text-red-500"
>
*
</
span
></
InputLabel
>
<
InputLabel
htmlFor=
"name"
>
Username
<
span
className=
"text-red-500"
>
*
</
span
></
InputLabel
>
<
OutlinedInput
<
OutlinedInput
fullWidth
fullWidth
...
@@ -41,7 +71,7 @@ export default function AddPlayerForm({ formik, id, data, loading, buttonLabel }
...
@@ -41,7 +71,7 @@ export default function AddPlayerForm({ formik, id, data, loading, buttonLabel }
{
formik
.
touched
.
name
&&
formik
.
errors
.
name
?
formik
.
errors
.
name
:
""
}
{
formik
.
touched
.
name
&&
formik
.
errors
.
name
?
formik
.
errors
.
name
:
""
}
</
span
>
</
span
>
</
div
>
</
div
>
<
div
className=
"input__field"
>
<
div
className=
"input__field
col-span-1
"
>
<
InputLabel
htmlFor=
"email"
>
Email
<
span
className=
"text-red-500"
>
*
</
span
></
InputLabel
>
<
InputLabel
htmlFor=
"email"
>
Email
<
span
className=
"text-red-500"
>
*
</
span
></
InputLabel
>
<
OutlinedInput
<
OutlinedInput
fullWidth
fullWidth
...
@@ -106,8 +136,8 @@ export default function AddPlayerForm({ formik, id, data, loading, buttonLabel }
...
@@ -106,8 +136,8 @@ export default function AddPlayerForm({ formik, id, data, loading, buttonLabel }
</
span
>
</
span
>
</
div
>
</
div
>
<
div
className=
"input__field"
>
<
div
className=
"input__field
col-span-1
"
>
<
InputLabel
htmlFor=
"address"
>
Address
<
span
className=
"text-red-500"
>
*
</
span
></
InputLabel
>
<
InputLabel
htmlFor=
"address"
>
Address
Line 1
<
span
className=
"text-red-500"
>
*
</
span
></
InputLabel
>
<
OutlinedInput
<
OutlinedInput
fullWidth
fullWidth
id=
"address"
id=
"address"
...
@@ -122,47 +152,78 @@ export default function AddPlayerForm({ formik, id, data, loading, buttonLabel }
...
@@ -122,47 +152,78 @@ export default function AddPlayerForm({ formik, id, data, loading, buttonLabel }
</
span
>
</
span
>
</
div
>
</
div
>
<
div
className=
"input__field"
>
<
div
className=
"input__field
col-span-1
"
>
<
InputLabel
htmlFor=
"
city"
>
City
<
span
className=
"text-red-500"
>
*
</
span
>
</
InputLabel
>
<
InputLabel
htmlFor=
"
address_line_two"
>
Address Line 2
</
InputLabel
>
<
OutlinedInput
<
OutlinedInput
fullWidth
fullWidth
id=
"
city
"
id=
"
address_line_two
"
name=
"
city
"
name=
"
address_line_two
"
placeholder=
"Enter
city
"
placeholder=
"Enter
address line 2
"
value=
{
formik
.
values
.
city
}
value=
{
formik
.
values
.
address_line_two
}
onChange=
{
formik
.
handleChange
}
onChange=
{
formik
.
handleChange
}
onBlur=
{
formik
.
handleBlur
}
onBlur=
{
formik
.
handleBlur
}
/>
/>
<
span
className=
"error"
>
<
span
className=
"error"
>
{
formik
.
touched
.
city
&&
formik
.
errors
.
city
?
formik
.
errors
.
city
:
""
}
{
formik
.
touched
.
address_line_two
&&
formik
.
errors
.
address_line_two
?
formik
.
errors
.
address_line_two
:
""
}
</
span
>
</
span
>
</
div
>
</
div
>
<
div
className=
"input__field"
>
<
div
className=
"input__field"
>
<
InputLabel
htmlFor=
"
phone"
>
Phone
<
span
className=
"text-red-500"
>
*
</
span
></
InputLabel
>
<
InputLabel
htmlFor=
"
city"
>
City
<
span
className=
"text-red-500"
>
*
</
span
></
InputLabel
>
<
OutlinedInput
<
OutlinedInput
fullWidth
fullWidth
id=
"
phone
"
id=
"
city
"
name=
"
phone
"
name=
"
city
"
placeholder=
"Enter
phone number
"
placeholder=
"Enter
city
"
value=
{
formik
.
values
.
phone
}
value=
{
formik
.
values
.
city
}
onChange=
{
formik
.
handleChange
}
onChange=
{
formik
.
handleChange
}
onBlur=
{
formik
.
handleBlur
}
onBlur=
{
formik
.
handleBlur
}
/>
/>
<
span
className=
"error"
>
<
span
className=
"error"
>
{
formik
.
touched
.
phone
&&
formik
.
errors
.
phone
?
formik
.
errors
.
phone
:
""
}
{
formik
.
touched
.
city
&&
formik
.
errors
.
city
?
formik
.
errors
.
city
:
""
}
</
span
>
</
span
>
</
div
>
</
div
>
<
div
className=
"input__field"
>
<
div
className=
"lg:col-span-2"
>
<
InputLabel
htmlFor=
"pob"
>
State
<
span
className=
"text-red-500"
>
*
</
span
></
InputLabel
>
<
InputLabel
htmlFor=
"phone"
>
Phone
<
span
className=
"text-red-500"
>
*
</
span
></
InputLabel
>
<
div
className=
"grid grid-cols-12 gap-1 items-start"
>
<
div
className=
"col-span-4 lg:col-span-3"
>
<
OutlinedInput
fullWidth
id=
"country_code"
name=
"country_code"
placeholder=
"Enter country_code number"
value=
{
"+1"
}
onChange=
{
formik
.
handleChange
}
onBlur=
{
formik
.
handleBlur
}
disabled
/>
</
div
>
<
div
className=
"input__field col-span-8 lg:col-span-9"
>
<
OutlinedInput
fullWidth
id=
"phone"
name=
"phone"
placeholder=
"Enter phone number"
value=
{
formik
.
values
.
phone
}
onChange=
{
formik
.
handleChange
}
onBlur=
{
formik
.
handleBlur
}
/>
<
span
className=
"error"
>
{
formik
.
touched
.
phone
&&
formik
.
errors
.
phone
?
formik
.
errors
.
phone
:
""
}
</
span
>
</
div
>
</
div
>
</
div
>
<
div
className=
"input__field"
>
<
InputLabel
htmlFor=
"state"
>
State
<
span
className=
"text-red-500"
>
*
</
span
></
InputLabel
>
<
Select
<
Select
fullWidth
fullWidth
id=
"
pob
"
id=
"
state
"
name=
"
pob
"
name=
"
state
"
displayEmpty
displayEmpty
value=
{
formik
.
values
.
pob
}
value=
{
formik
.
values
.
state
}
onChange=
{
formik
.
handleChange
}
onChange=
{
formik
.
handleChange
}
onBlur=
{
formik
.
handleBlur
}
onBlur=
{
formik
.
handleBlur
}
renderValue=
{
(
selected
)
=>
renderValue=
{
(
selected
)
=>
...
@@ -179,22 +240,53 @@ export default function AddPlayerForm({ formik, id, data, loading, buttonLabel }
...
@@ -179,22 +240,53 @@ export default function AddPlayerForm({ formik, id, data, loading, buttonLabel }
))
}
))
}
</
Select
>
</
Select
>
<
span
className=
"error"
>
{
formik
.
touched
.
pob
&&
formik
.
errors
.
pob
}
</
span
>
<
span
className=
"error"
>
{
formik
.
touched
.
state
&&
formik
.
errors
.
state
}
</
span
>
</
div
>
<
div
className=
"input__field"
>
<
InputLabel
htmlFor=
"gender"
>
Gender
<
span
className=
"text-red-500"
>
*
</
span
></
InputLabel
>
<
Select
fullWidth
id=
"gender"
name=
"gender"
displayEmpty
value=
{
formik
.
values
.
gender
}
onChange=
{
formik
.
handleChange
}
onBlur=
{
formik
.
handleBlur
}
renderValue=
{
(
selected
)
=>
selected
===
""
?
"Select a Gender"
:
selected
}
>
<
MenuItem
value=
""
>
<
em
>
Select a Gender
</
em
>
</
MenuItem
>
{
[
{
label
:
"Male"
,
value
:
"M"
},
{
label
:
"Female"
,
value
:
"F"
},
{
label
:
"Other"
,
value
:
"O"
},
].
map
((
state
)
=>
(
<
MenuItem
key=
{
state
.
value
}
value=
{
state
.
value
}
>
{
state
.
label
}
</
MenuItem
>
))
}
</
Select
>
<
span
className=
"error"
>
{
formik
.
touched
.
gender
&&
formik
.
errors
.
gender
}
</
span
>
</
div
>
</
div
>
<
div
className=
"input__field"
>
<
div
className=
"input__field"
>
<
InputLabel
htmlFor=
"
zip
_code"
>
Zip Code
<
span
className=
"text-red-500"
>
*
</
span
></
InputLabel
>
<
InputLabel
htmlFor=
"
postal
_code"
>
Zip Code
<
span
className=
"text-red-500"
>
*
</
span
></
InputLabel
>
<
OutlinedInput
<
OutlinedInput
fullWidth
fullWidth
id=
"
zip
_code"
id=
"
postal
_code"
name=
"
zip
_code"
name=
"
postal
_code"
placeholder=
"Enter zip code"
placeholder=
"Enter zip code"
value=
{
formik
.
values
.
zip
_code
}
value=
{
formik
.
values
.
postal
_code
}
onChange=
{
formik
.
handleChange
}
onChange=
{
formik
.
handleChange
}
onBlur=
{
formik
.
handleBlur
}
onBlur=
{
formik
.
handleBlur
}
/>
/>
<
span
className=
"error"
>
<
span
className=
"error"
>
{
formik
.
touched
.
p
hone
&&
formik
.
errors
.
phone
?
formik
.
errors
.
phon
e
:
""
}
{
formik
.
touched
.
p
ostal_code
&&
formik
.
errors
.
postal_code
?
formik
.
errors
.
postal_cod
e
:
""
}
</
span
>
</
span
>
</
div
>
</
div
>
...
@@ -217,7 +309,15 @@ export default function AddPlayerForm({ formik, id, data, loading, buttonLabel }
...
@@ -217,7 +309,15 @@ export default function AddPlayerForm({ formik, id, data, loading, buttonLabel }
error
:
Boolean
(
formik
.
touched
.
dob
&&
formik
.
errors
.
dob
),
error
:
Boolean
(
formik
.
touched
.
dob
&&
formik
.
errors
.
dob
),
onBlur
:
formik
.
handleBlur
,
onBlur
:
formik
.
handleBlur
,
helperText
:
formik
.
touched
.
dob
&&
formik
.
errors
.
dob
,
helperText
:
formik
.
touched
.
dob
&&
formik
.
errors
.
dob
,
sx
:
formFieldSx
sx
:
user
?.
role
===
"user"
?
{
...
formFieldSx
}
:
{
"&& .MuiPickersInputBase-input"
:
{
padding
:
"10px 14px !important"
,
},
"&& .MuiPickersSectionList-root"
:
{
borderRadius
:
"8px !important"
,
padding
:
"4px 12px 4px 0 !important"
,
},
}
},
},
}
}
}
}
...
...
src/components/pages/dashboard/adminDashboard/players/addPlayerForm/index.tsx
View file @
3294a2f4
...
@@ -20,16 +20,17 @@ export const PlayerValidationSchema = (isEdit: boolean) => Yup.object().shape({
...
@@ -20,16 +20,17 @@ export const PlayerValidationSchema = (isEdit: boolean) => Yup.object().shape({
wallet_address
:
Yup
.
string
().
nullable
(),
wallet_address
:
Yup
.
string
().
nullable
(),
address
:
Yup
.
string
().
required
(
"Address is required"
),
address
:
Yup
.
string
().
required
(
"Address is required"
),
city
:
Yup
.
string
().
required
(
"City is required"
),
city
:
Yup
.
string
().
required
(
"City is required"
),
zip_code
:
Yup
.
string
().
required
(
"Zip code is required"
),
postal_code
:
Yup
.
string
().
required
(
"Zip code is required"
),
pob
:
Yup
.
string
().
required
(
"State is required"
),
state
:
Yup
.
string
().
required
(
"State is required"
),
gender
:
Yup
.
string
().
required
(
"Gender is required"
),
phone
:
Yup
.
string
()
phone
:
Yup
.
string
()
.
matches
(
/^
\+?\d{7,15}
$/
,
"Invalid phone number"
)
.
matches
(
/^
\+?\d{7,15}
$/
,
"Invalid phone number"
)
.
required
(
"Phone is required"
),
.
required
(
"Phone is required"
),
password
:
isEdit
password
:
isEdit
?
Yup
.
string
().
nullable
()
// not required in edit mode
?
Yup
.
string
().
nullable
()
// not required in edit mode
:
Yup
.
string
().
min
(
6
,
"Password must be at least 6 characters"
).
required
(
"Password is required"
),
:
Yup
.
string
().
min
(
6
,
"Password must be at least 6 characters"
).
required
(
"Password is required"
),
password_confirmation
:
Yup
.
string
().
when
(
"password"
,
{
password_confirmation
:
isEdit
?
Yup
.
string
().
nullable
()
:
Yup
.
string
().
when
(
"password"
,
{
is
:
(
val
:
string
)
=>
!!
val
,
// required only if password is filled
is
:
(
val
:
string
)
=>
!!
val
,
then
:
(
schema
)
=>
schema
.
oneOf
([
Yup
.
ref
(
"password"
)],
"Passwords must match"
).
required
(
"Password confirmation is required"
),
then
:
(
schema
)
=>
schema
.
oneOf
([
Yup
.
ref
(
"password"
)],
"Passwords must match"
).
required
(
"Password confirmation is required"
),
otherwise
:
(
schema
)
=>
schema
.
nullable
(),
otherwise
:
(
schema
)
=>
schema
.
nullable
(),
}),
}),
...
@@ -69,8 +70,10 @@ export default function AddPlayerPage({ id }: { id?: string }) {
...
@@ -69,8 +70,10 @@ export default function AddPlayerPage({ id }: { id?: string }) {
password_confirmation
:
data
?.
data
.
password_confirmation
,
password_confirmation
:
data
?.
data
.
password_confirmation
,
profile_image
:
null
,
profile_image
:
null
,
dob
:
data
?.
data
.
dob
||
null
as
Dayjs
|
null
,
dob
:
data
?.
data
.
dob
||
null
as
Dayjs
|
null
,
zip_code
:
data
?.
data
.
zip_code
||
""
,
postal_code
:
data
?.
data
.
postal_code
||
""
,
pob
:
data
?.
data
.
pob
||
""
,
state
:
data
?.
data
.
state
||
""
,
gender
:
data
?.
data
.
gender
||
""
,
address_line_two
:
data
?.
data
.
address_line_two
||
""
,
}
:
initialPlayerValues
,
}
:
initialPlayerValues
,
validationSchema
:
PlayerValidationSchema
(
!!
id
),
validationSchema
:
PlayerValidationSchema
(
!!
id
),
enableReinitialize
:
true
,
enableReinitialize
:
true
,
...
@@ -87,8 +90,10 @@ export default function AddPlayerPage({ id }: { id?: string }) {
...
@@ -87,8 +90,10 @@ export default function AddPlayerPage({ id }: { id?: string }) {
if
(
values
.
city
)
formData
.
append
(
"city"
,
values
.
city
);
if
(
values
.
city
)
formData
.
append
(
"city"
,
values
.
city
);
if
(
values
.
phone
)
formData
.
append
(
"phone"
,
values
.
phone
);
if
(
values
.
phone
)
formData
.
append
(
"phone"
,
values
.
phone
);
if
(
values
.
dob
)
formData
.
append
(
"dob"
,
values
.
dob
.
toString
());
if
(
values
.
dob
)
formData
.
append
(
"dob"
,
values
.
dob
.
toString
());
if
(
values
.
zip_code
)
formData
.
append
(
"zip_code"
,
values
.
zip_code
);
if
(
values
.
postal_code
)
formData
.
append
(
"postal_code"
,
values
.
postal_code
);
if
(
values
.
pob
)
formData
.
append
(
"pob"
,
values
.
pob
);
if
(
values
.
state
)
formData
.
append
(
"state"
,
values
.
state
);
if
(
values
.
gender
)
formData
.
append
(
"gender"
,
values
.
gender
);
if
(
values
.
address_line_two
)
formData
.
append
(
"address_line_two"
,
values
.
address_line_two
);
if
(
values
.
profile_image
)
{
if
(
values
.
profile_image
)
{
if
(
Array
.
isArray
(
values
.
profile_image
))
{
if
(
Array
.
isArray
(
values
.
profile_image
))
{
values
.
profile_image
.
forEach
((
file
)
=>
formData
.
append
(
"profile_image"
,
file
));
values
.
profile_image
.
forEach
((
file
)
=>
formData
.
append
(
"profile_image"
,
file
));
...
...
src/components/pages/dashboard/adminDashboard/transaction/TransactionTable.tsx
View file @
3294a2f4
...
@@ -103,8 +103,8 @@ export default function TransactionTable({ user_id, game_id, search, setSearch }
...
@@ -103,8 +103,8 @@ export default function TransactionTable({ user_id, game_id, search, setSearch }
accessorKey
:
"status"
,
accessorKey
:
"status"
,
header
:
({
column
})
=>
<
SortableHeader
column=
{
column
}
label=
"Status"
/>,
header
:
({
column
})
=>
<
SortableHeader
column=
{
column
}
label=
"Status"
/>,
cell
:
({
row
})
=>
{
cell
:
({
row
})
=>
{
const
status
=
row
.
original
.
status
.
toLowerCase
()
;
const
status
=
row
?.
original
?.
status
?
row
.
original
?.
status
?.
toLowerCase
()
:
""
;
const
display
=
status
.
charAt
(
0
).
toUpperCase
()
+
status
.
slice
(
1
);
const
display
=
status
?.
charAt
(
0
)?.
toUpperCase
()
+
status
?
.
slice
(
1
);
return
(
return
(
<
span
className=
{
`px-2 py-1 max-w-[60px] block lg: text-[10px] text-white status rounded-[8px] text-center ${status}`
}
>
{
display
}
</
span
>
<
span
className=
{
`px-2 py-1 max-w-[60px] block lg: text-[10px] text-white status rounded-[8px] text-center ${status}`
}
>
{
display
}
</
span
>
);
);
...
@@ -112,11 +112,15 @@ export default function TransactionTable({ user_id, game_id, search, setSearch }
...
@@ -112,11 +112,15 @@ export default function TransactionTable({ user_id, game_id, search, setSearch }
},
},
{
{
accessorKey
:
"amount"
,
accessorKey
:
"amount"
,
header
:
({
column
})
=>
<
SortableHeader
column=
{
column
}
label=
"Amount USD"
/>,
header
:
({
column
})
=>
<
SortableHeader
column=
{
column
}
label=
"Deposit Amount"
/>,
},
{
accessorKey
:
"gc"
,
header
:
({
column
})
=>
<
SortableHeader
column=
{
column
}
label=
"GC Awarded"
/>,
},
},
{
{
accessorKey
:
"sweepcoins"
,
accessorKey
:
"sweepcoins"
,
header
:
({
column
})
=>
<
SortableHeader
column=
{
column
}
label=
"S
weepcoin
s"
/>,
header
:
({
column
})
=>
<
SortableHeader
column=
{
column
}
label=
"S
C Bonu
s"
/>,
},
},
{
{
accessorKey
:
"transaction_date"
,
accessorKey
:
"transaction_date"
,
...
...
src/components/pages/dashboard/userDashboard/account/profile/editProfile/index.tsx
View file @
3294a2f4
...
@@ -30,7 +30,10 @@ export default function EditUserProfile({ id, buttonLabel }: { id: string, butto
...
@@ -30,7 +30,10 @@ export default function EditUserProfile({ id, buttonLabel }: { id: string, butto
password_confirmation
:
''
,
password_confirmation
:
''
,
profile_image
:
null
,
profile_image
:
null
,
dob
:
user
.
dob
||
null
as
Dayjs
|
null
,
dob
:
user
.
dob
||
null
as
Dayjs
|
null
,
zip_code
:
user
.
zip_code
||
""
,
postal_code
:
user
.
postal_code
||
""
,
gender
:
user
.
gender
||
""
,
state
:
user
.
state
||
""
,
address_line_two
:
user
.
address_line_two
||
""
,
}
:
initialPlayerValues
,
}
:
initialPlayerValues
,
validationSchema
:
PlayerValidationSchema
(
user
?.
id
?
true
:
false
),
validationSchema
:
PlayerValidationSchema
(
user
?.
id
?
true
:
false
),
enableReinitialize
:
true
,
enableReinitialize
:
true
,
...
@@ -49,8 +52,11 @@ export default function EditUserProfile({ id, buttonLabel }: { id: string, butto
...
@@ -49,8 +52,11 @@ export default function EditUserProfile({ id, buttonLabel }: { id: string, butto
if
(
values
.
city
)
formData
.
append
(
"city"
,
values
.
city
);
if
(
values
.
city
)
formData
.
append
(
"city"
,
values
.
city
);
if
(
values
.
phone
)
formData
.
append
(
"phone"
,
values
.
phone
);
if
(
values
.
phone
)
formData
.
append
(
"phone"
,
values
.
phone
);
if
(
values
.
dob
)
formData
.
append
(
"dob"
,
formattedDob
);
if
(
values
.
dob
)
formData
.
append
(
"dob"
,
formattedDob
);
if
(
values
.
zip_code
)
formData
.
append
(
"zip_code"
,
values
.
zip_code
);
if
(
values
.
postal_code
)
formData
.
append
(
"postal_code"
,
values
.
postal_code
);
if
(
values
.
pob
)
formData
.
append
(
"pob"
,
values
.
pob
);
if
(
values
.
state
)
formData
.
append
(
"state"
,
values
.
state
);
if
(
values
.
gender
)
formData
.
append
(
"gender"
,
values
.
gender
);
if
(
values
.
address_line_two
)
formData
.
append
(
"address_line_two"
,
values
.
address_line_two
);
if
(
values
.
profile_image
)
{
if
(
values
.
profile_image
)
{
if
(
Array
.
isArray
(
values
.
profile_image
))
{
if
(
Array
.
isArray
(
values
.
profile_image
))
{
...
@@ -110,6 +116,10 @@ export default function EditUserProfile({ id, buttonLabel }: { id: string, butto
...
@@ -110,6 +116,10 @@ export default function EditUserProfile({ id, buttonLabel }: { id: string, butto
total_deposited
:
user
.
total_deposited
??
undefined
,
total_deposited
:
user
.
total_deposited
??
undefined
,
profile_image_file
:
user
.
profile_image_file
??
undefined
,
profile_image_file
:
user
.
profile_image_file
??
undefined
,
dob
:
user
.
dob
?
dayjs
(
user
.
dob
).
format
(
'YYYY-MM-DD'
)
:
undefined
,
dob
:
user
.
dob
?
dayjs
(
user
.
dob
).
format
(
'YYYY-MM-DD'
)
:
undefined
,
postal_code
:
user
?.
postal_code
||
""
,
gender
:
user
?.
gender
||
""
,
address_line_two
:
user
?.
address_line_two
||
""
,
state
:
user
?.
state
||
""
,
}
as
PlayerItem
,
}
as
PlayerItem
,
}
}
:
undefined
;
:
undefined
;
...
...
src/components/pages/dashboard/userDashboard/buyCoins/buyCoinSinlgeGame/checkout/FortPay.tsx
View file @
3294a2f4
...
@@ -61,7 +61,7 @@ export default function PaymentForm({ id, amount, type }: DepositProps & { type:
...
@@ -61,7 +61,7 @@ export default function PaymentForm({ id, amount, type }: DepositProps & { type:
address1
:
user
?.
address
||
''
,
address1
:
user
?.
address
||
''
,
city
:
user
?.
city
||
''
,
city
:
user
?.
city
||
''
,
state
:
user
?.
state
||
''
,
state
:
user
?.
state
||
''
,
zip
:
''
,
zip
:
user
?.
postal_code
||
''
,
},
},
validationSchema
:
billingSchema
,
validationSchema
:
billingSchema
,
onSubmit
:
()
=>
{
onSubmit
:
()
=>
{
...
...
src/components/pages/dashboard/userDashboard/withdrawl/index.tsx
View file @
3294a2f4
...
@@ -155,7 +155,7 @@ export default function WithdrawlPage({
...
@@ -155,7 +155,7 @@ export default function WithdrawlPage({
};
};
const
handleWithdrawClick
=
(
balance
:
number
,
provider
:
string
)
=>
{
const
handleWithdrawClick
=
(
balance
:
number
,
provider
:
string
)
=>
{
if
(
balance
<
1
0
||
balance
>
400
)
{
if
(
balance
<
4
0
||
balance
>
400
)
{
dispatch
(
dispatch
(
showToast
({
showToast
({
message
:
"Withdraw Amount must be at least $40 and below $400"
,
message
:
"Withdraw Amount must be at least $40 and below $400"
,
...
...
src/types/auth.ts
View file @
3294a2f4
...
@@ -17,9 +17,8 @@ export interface User {
...
@@ -17,9 +17,8 @@ export interface User {
address
:
string
;
address
:
string
;
city
:
string
city
:
string
role
:
RoleProps
;
role
:
RoleProps
;
zip
_code
?:
string
;
postal
_code
?:
string
;
state
?:
string
;
state
?:
string
;
postal_code
:
string
;
ssn
:
string
;
ssn
:
string
;
}
}
...
@@ -43,11 +42,12 @@ export interface RegisterProps extends LoginProps {
...
@@ -43,11 +42,12 @@ export interface RegisterProps extends LoginProps {
photoid_number
:
string
;
photoid_number
:
string
;
dob
:
string
;
dob
:
string
;
city
:
string
;
city
:
string
;
pob
:
string
;
agree
:
boolean
;
agree
:
boolean
;
device_id
?:
string
;
device_id
?:
string
;
zip
_code
?:
string
;
postal
_code
?:
string
;
state
?:
string
;
state
?:
string
;
postal_code
:
string
;
ssn
:
string
;
ssn
:
string
;
address
:
string
;
address_line_two
?:
string
;
gender
:
string
;
}
}
\ No newline at end of file
src/types/player.ts
View file @
3294a2f4
...
@@ -16,10 +16,10 @@ export interface CommonPlayerProps {
...
@@ -16,10 +16,10 @@ export interface CommonPlayerProps {
role
?:
string
;
role
?:
string
;
state
?:
string
;
state
?:
string
;
dob
?:
string
|
Dayjs
|
null
;
dob
?:
string
|
Dayjs
|
null
;
zip_code
?:
string
;
postal_code
?:
string
;
pob
?:
string
;
is_acuity_verified
?:
boolean
is_acuity_verified
?:
boolean
gender
:
string
;
address_line_two
?:
string
;
}
}
export
interface
PlayerProps
extends
CommonPlayerProps
{
export
interface
PlayerProps
extends
CommonPlayerProps
{
id
?:
string
;
id
?:
string
;
...
@@ -44,8 +44,9 @@ export const initialPlayerValues: PlayerProps = {
...
@@ -44,8 +44,9 @@ export const initialPlayerValues: PlayerProps = {
password_confirmation
:
""
,
password_confirmation
:
""
,
profile_image
:
null
,
profile_image
:
null
,
dob
:
null
as
Dayjs
|
null
,
dob
:
null
as
Dayjs
|
null
,
zip_code
:
""
,
postal_code
:
""
,
pob
:
""
gender
:
""
,
address_line_two
:
""
,
};
};
type
GameInformation
=
{
type
GameInformation
=
{
...
...
src/types/transaction.ts
View file @
3294a2f4
...
@@ -41,6 +41,7 @@ export interface SingleDepositProps {
...
@@ -41,6 +41,7 @@ export interface SingleDepositProps {
type
:
string
;
type
:
string
;
amount
:
number
;
amount
:
number
;
sweepcoins
:
number
;
sweepcoins
:
number
;
gc
?:
number
;
transaction_date
:
string
;
transaction_date
:
string
;
available_balance
?:
string
;
available_balance
?:
string
;
status
:
TransactionStatus
;
status
:
TransactionStatus
;
...
...
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