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
3f60ac1c
Commit
3f60ac1c
authored
Mar 04, 2026
by
Arjun Jhukal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated the minor changes
parent
0396e588
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
10 deletions
+23
-10
AgeGate.tsx
src/components/organism/dialog/AgeGate.tsx
+0
-1
index.tsx
src/components/pages/auth/register/index.tsx
+23
-9
No files found.
src/components/organism/dialog/AgeGate.tsx
View file @
3f60ac1c
...
...
@@ -23,7 +23,6 @@ export default function AgeGate() {
if
(
data
.
data
.
is_age_verified
)
return
;
const
uuid
=
data
.
data
.
age_verify_uuid
;
// 1. Set config BEFORE loading the script
(
window
as
any
).
AgeCheckerConfig
=
{
key
:
process
.
env
.
NEXT_PUBLIC_AGE_CHECKER_KEY
,
mode
:
"manual"
,
...
...
src/components/pages/auth/register/index.tsx
View file @
3f60ac1c
...
...
@@ -111,18 +111,30 @@ export default function RegisterPage() {
useEffect
(()
=>
{
const
fetchCountries
=
async
()
=>
{
try
{
const
res
=
await
fetch
(
"https://restcountries.com/v3.1/all?fields=name,idd"
);
const
res
=
await
fetch
(
"https://restcountries.com/v3.1/all?fields=name,idd"
);
if
(
!
res
.
ok
)
{
throw
new
Error
(
"Failed to fetch countries"
);
}
const
data
=
await
res
.
json
();
const
formatted
=
data
.
filter
((
c
:
any
)
=>
c
.
idd
?.
root
)
.
map
((
c
:
any
)
=>
{
const
dial
=
`
${
c
.
idd
.
root
}${
c
.
idd
.
suffixes
?.[
0
]
||
''
}
`;
.
filter
((
country
:
any
)
=>
country
?.
idd
?.
root
)
.
map
((
country
:
any
)
=>
{
const
root
=
country
.
idd
.
root
;
const
suffix
=
country
.
idd
.
suffixes
?.[
0
]
||
""
;
// 🔥 Special case: If root is "+1", do NOT append suffix
const
dialCode
=
root
===
"+1"
?
root
:
`
${
root
}${
suffix
}
`
;
return
{
name: c.name.common,
label: `
$
{
c
.
name
.
common
}
(
$
{
dial
})
`,
dialCode
: dial
,
name
:
c
ountry
.
name
.
common
,
label
:
`
${
c
ountry
.
name
.
common
}
(
${
dialCode
}
)
`
,
dialCode
,
};
})
.
sort
((
a
:
any
,
b
:
any
)
=>
...
...
@@ -130,8 +142,10 @@ export default function RegisterPage() {
);
setCountryCodes
(
formatted
);
} catch (err: any) {
console.error(err.message || "Country fetch failed");
}
catch
(
error
:
any
)
{
console
.
error
(
error
?.
message
||
"Country fetch failed"
);
}
};
...
...
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