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
0a2e890b
Commit
0a2e890b
authored
Mar 06, 2026
by
Arjun Jhukal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated the minor changes
parent
da08a393
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
92 additions
and
2 deletions
+92
-2
AddPlayerForm.tsx
...rd/adminDashboard/players/addPlayerForm/AddPlayerForm.tsx
+32
-1
index.tsx
.../dashboard/adminDashboard/players/addPlayerForm/index.tsx
+3
-1
index.tsx
...board/userDashboard/account/profile/editProfile/index.tsx
+2
-0
state.ts
src/constants/state.ts
+53
-0
player.ts
src/types/player.ts
+2
-0
No files found.
src/components/pages/dashboard/adminDashboard/players/addPlayerForm/AddPlayerForm.tsx
View file @
0a2e890b
"use client"
;
import
InputFile
from
'@/components/atom/InputFile'
;
import
PasswordField
from
'@/components/molecules/PasswordField'
;
import
{
US_STATES
}
from
'@/constants/state'
;
import
{
PlayerProps
,
SinlgePlayerResponseProps
}
from
'@/types/player'
;
import
{
Button
,
InputLabel
,
OutlinedInpu
t
}
from
'@mui/material'
;
import
{
Button
,
InputLabel
,
MenuItem
,
OutlinedInput
,
Selec
t
}
from
'@mui/material'
;
import
{
DatePicker
,
LocalizationProvider
}
from
'@mui/x-date-pickers'
;
import
{
AdapterDayjs
}
from
'@mui/x-date-pickers/AdapterDayjs'
;
import
dayjs
from
'dayjs'
;
...
...
@@ -181,6 +182,36 @@ export default function AddPlayerForm({ formik, id, data, loading, buttonLabel }
{
formik
.
touched
.
phone
&&
formik
.
errors
.
phone
?
formik
.
errors
.
phone
:
""
}
</
span
>
</
div
>
<
div
className=
"input__field"
>
<
InputLabel
htmlFor=
"pob"
>
State
</
InputLabel
>
<
Select
fullWidth
id=
"pob"
name=
"pob"
displayEmpty
value=
{
formik
.
values
.
pob
}
onChange=
{
formik
.
handleChange
}
onBlur=
{
formik
.
handleBlur
}
sx=
{
formFieldSx
}
renderValue=
{
(
selected
)
=>
selected
===
""
?
"Select a State"
:
selected
}
>
<
MenuItem
value=
""
>
<
em
>
Select a State
</
em
>
</
MenuItem
>
{
US_STATES
.
map
((
state
)
=>
(
<
MenuItem
key=
{
state
.
value
}
value=
{
state
.
value
}
>
{
state
.
label
}
</
MenuItem
>
))
}
</
Select
>
<
span
className=
"error"
>
{
formik
.
touched
.
pob
&&
formik
.
errors
.
pob
}
</
span
>
</
div
>
<
div
className=
"input__field"
>
<
InputLabel
htmlFor=
"zip_code"
>
Zip Code
<
span
className=
"text-red-500"
>
*
</
span
></
InputLabel
>
<
OutlinedInput
...
...
src/components/pages/dashboard/adminDashboard/players/addPlayerForm/index.tsx
View file @
0a2e890b
...
...
@@ -21,6 +21,7 @@ export const PlayerValidationSchema = (isEdit: boolean) => Yup.object().shape({
address
:
Yup
.
string
().
required
(
"Address is required"
),
city
:
Yup
.
string
().
required
(
"City is required"
),
zip_code
:
Yup
.
string
().
required
(
"Zip code is required"
),
pob
:
Yup
.
string
().
required
(
"State is required"
),
phone
:
Yup
.
string
()
.
matches
(
/^
\+?\d{7,15}
$/
,
"Invalid phone number"
)
.
required
(
"Phone is required"
),
...
...
@@ -69,6 +70,7 @@ export default function AddPlayerPage({ id }: { id?: string }) {
profile_image
:
null
,
dob
:
data
?.
data
.
dob
||
null
as
Dayjs
|
null
,
zip_code
:
data
?.
data
.
zip_code
||
""
,
pob
:
data
?.
data
.
pob
||
""
,
}
:
initialPlayerValues
,
validationSchema
:
PlayerValidationSchema
(
!!
id
),
enableReinitialize
:
true
,
...
...
@@ -86,7 +88,7 @@ export default function AddPlayerPage({ id }: { id?: string }) {
if
(
values
.
phone
)
formData
.
append
(
"phone"
,
values
.
phone
);
if
(
values
.
dob
)
formData
.
append
(
"dob"
,
values
.
dob
.
toString
());
if
(
values
.
zip_code
)
formData
.
append
(
"zip_code"
,
values
.
zip_code
);
if
(
values
.
pob
)
formData
.
append
(
"pob"
,
values
.
pob
);
if
(
values
.
profile_image
)
{
if
(
Array
.
isArray
(
values
.
profile_image
))
{
values
.
profile_image
.
forEach
((
file
)
=>
formData
.
append
(
"profile_image"
,
file
));
...
...
src/components/pages/dashboard/userDashboard/account/profile/editProfile/index.tsx
View file @
0a2e890b
...
...
@@ -49,6 +49,8 @@ export default function EditUserProfile({ id, buttonLabel }: { id: string, butto
if
(
values
.
city
)
formData
.
append
(
"city"
,
values
.
city
);
if
(
values
.
phone
)
formData
.
append
(
"phone"
,
values
.
phone
);
if
(
values
.
dob
)
formData
.
append
(
"dob"
,
formattedDob
);
if
(
values
.
zip_code
)
formData
.
append
(
"zip_code"
,
values
.
zip_code
);
if
(
values
.
pob
)
formData
.
append
(
"pob"
,
values
.
pob
);
if
(
values
.
profile_image
)
{
if
(
Array
.
isArray
(
values
.
profile_image
))
{
...
...
src/constants/state.ts
0 → 100644
View file @
0a2e890b
export
const
US_STATES
=
[
{
label
:
"Alabama"
,
value
:
"AL"
},
{
label
:
"Alaska"
,
value
:
"AK"
},
{
label
:
"Arizona"
,
value
:
"AZ"
},
{
label
:
"Arkansas"
,
value
:
"AR"
},
{
label
:
"California"
,
value
:
"CA"
},
{
label
:
"Colorado"
,
value
:
"CO"
},
{
label
:
"Connecticut"
,
value
:
"CT"
},
{
label
:
"Delaware"
,
value
:
"DE"
},
{
label
:
"District Of Columbia"
,
value
:
"DC"
},
{
label
:
"Florida"
,
value
:
"FL"
},
{
label
:
"Georgia"
,
value
:
"GA"
},
{
label
:
"Hawaii"
,
value
:
"HI"
},
{
label
:
"Idaho"
,
value
:
"ID"
},
{
label
:
"Illinois"
,
value
:
"IL"
},
{
label
:
"Indiana"
,
value
:
"IN"
},
{
label
:
"Iowa"
,
value
:
"IA"
},
{
label
:
"Kansas"
,
value
:
"KS"
},
{
label
:
"Kentucky"
,
value
:
"KY"
},
{
label
:
"Louisiana"
,
value
:
"LA"
},
{
label
:
"Maine"
,
value
:
"ME"
},
{
label
:
"Maryland"
,
value
:
"MD"
},
{
label
:
"Massachusetts"
,
value
:
"MA"
},
{
label
:
"Michigan"
,
value
:
"MI"
},
{
label
:
"Minnesota"
,
value
:
"MN"
},
{
label
:
"Mississippi"
,
value
:
"MS"
},
{
label
:
"Missouri"
,
value
:
"MO"
},
{
label
:
"Montana"
,
value
:
"MT"
},
{
label
:
"Nebraska"
,
value
:
"NE"
},
{
label
:
"Nevada"
,
value
:
"NV"
},
{
label
:
"New Hampshire"
,
value
:
"NH"
},
{
label
:
"New Jersey"
,
value
:
"NJ"
},
{
label
:
"New Mexico"
,
value
:
"NM"
},
{
label
:
"New York"
,
value
:
"NY"
},
{
label
:
"North Carolina"
,
value
:
"NC"
},
{
label
:
"North Dakota"
,
value
:
"ND"
},
{
label
:
"Ohio"
,
value
:
"OH"
},
{
label
:
"Oklahoma"
,
value
:
"OK"
},
{
label
:
"Oregon"
,
value
:
"OR"
},
{
label
:
"Pennsylvania"
,
value
:
"PA"
},
{
label
:
"Rhode Island"
,
value
:
"RI"
},
{
label
:
"South Carolina"
,
value
:
"SC"
},
{
label
:
"South Dakota"
,
value
:
"SD"
},
{
label
:
"Tennessee"
,
value
:
"TN"
},
{
label
:
"Texas"
,
value
:
"TX"
},
{
label
:
"Utah"
,
value
:
"UT"
},
{
label
:
"Vermont"
,
value
:
"VT"
},
{
label
:
"Virginia"
,
value
:
"VA"
},
{
label
:
"Washington"
,
value
:
"WA"
},
{
label
:
"West Virginia"
,
value
:
"WV"
},
{
label
:
"Wisconsin"
,
value
:
"WI"
},
{
label
:
"Wyoming"
,
value
:
"WY"
},
];
src/types/player.ts
View file @
0a2e890b
...
...
@@ -17,6 +17,7 @@ export interface CommonPlayerProps {
state
?:
string
;
dob
?:
string
|
Dayjs
|
null
;
zip_code
?:
string
;
pob
?:
string
;
}
export
interface
PlayerProps
extends
CommonPlayerProps
{
...
...
@@ -43,6 +44,7 @@ export const initialPlayerValues: PlayerProps = {
profile_image
:
null
,
dob
:
null
as
Dayjs
|
null
,
zip_code
:
""
,
pob
:
""
};
type
GameInformation
=
{
...
...
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