Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
vicotor
frontend
Commits
c7b55618
Commit
c7b55618
authored
Jun 06, 2023
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix email confirmation for profile menu and verified addresses
parent
6015bb72
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
6 deletions
+49
-6
nextjs-routes.d.ts
types/nextjs-routes.d.ts
+1
-0
VerifiedAddresses.tsx
ui/pages/VerifiedAddresses.tsx
+4
-0
ProfileMenuDesktop.tsx
ui/snippets/profileMenu/ProfileMenuDesktop.tsx
+22
-3
ProfileMenuMobile.tsx
ui/snippets/profileMenu/ProfileMenuMobile.tsx
+22
-3
No files found.
types/nextjs-routes.d.ts
View file @
c7b55618
...
@@ -16,6 +16,7 @@ declare module "nextjs-routes" {
...
@@ -16,6 +16,7 @@ declare module "nextjs-routes" {
|
DynamicRoute
<
"
/address/[hash]/contract_verification
"
,
{
"
hash
"
:
string
}
>
|
DynamicRoute
<
"
/address/[hash]/contract_verification
"
,
{
"
hash
"
:
string
}
>
|
DynamicRoute
<
"
/address/[hash]
"
,
{
"
hash
"
:
string
}
>
|
DynamicRoute
<
"
/address/[hash]
"
,
{
"
hash
"
:
string
}
>
|
StaticRoute
<
"
/api/csrf
"
>
|
StaticRoute
<
"
/api/csrf
"
>
|
StaticRoute
<
"
/api/healthz
"
>
|
StaticRoute
<
"
/api/media-type
"
>
|
StaticRoute
<
"
/api/media-type
"
>
|
StaticRoute
<
"
/api/proxy
"
>
|
StaticRoute
<
"
/api/proxy
"
>
|
StaticRoute
<
"
/api-docs
"
>
|
StaticRoute
<
"
/api-docs
"
>
...
...
ui/pages/VerifiedAddresses.tsx
View file @
c7b55618
...
@@ -99,6 +99,10 @@ const VerifiedAddresses = () => {
...
@@ -99,6 +99,10 @@ const VerifiedAddresses = () => {
});
});
},
[
queryClient
]);
},
[
queryClient
]);
if
(
addressesQuery
.
isError
&&
addressesQuery
.
error
.
status
===
403
)
{
throw
new
Error
(
'
Unverified email error
'
,
{
cause
:
addressesQuery
.
error
});
}
const
addButton
=
(
const
addButton
=
(
<
Skeleton
mt=
{
8
}
isLoaded=
{
!
isLoading
}
display=
"inline-block"
>
<
Skeleton
mt=
{
8
}
isLoaded=
{
!
isLoading
}
display=
"inline-block"
>
<
Button
size=
"lg"
onClick=
{
modalProps
.
onOpen
}
>
<
Button
size=
"lg"
onClick=
{
modalProps
.
onOpen
}
>
...
...
ui/snippets/profileMenu/ProfileMenuDesktop.tsx
View file @
c7b55618
import
type
{
ButtonProps
}
from
'
@chakra-ui/react
'
;
import
{
Popover
,
PopoverContent
,
PopoverBody
,
PopoverTrigger
,
Button
}
from
'
@chakra-ui/react
'
;
import
{
Popover
,
PopoverContent
,
PopoverBody
,
PopoverTrigger
,
Button
}
from
'
@chakra-ui/react
'
;
import
{
route
}
from
'
nextjs-routes
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
useFetchProfileInfo
from
'
lib/hooks/useFetchProfileInfo
'
;
import
useFetchProfileInfo
from
'
lib/hooks/useFetchProfileInfo
'
;
...
@@ -7,9 +9,27 @@ import UserAvatar from 'ui/shared/UserAvatar';
...
@@ -7,9 +9,27 @@ import UserAvatar from 'ui/shared/UserAvatar';
import
ProfileMenuContent
from
'
ui/snippets/profileMenu/ProfileMenuContent
'
;
import
ProfileMenuContent
from
'
ui/snippets/profileMenu/ProfileMenuContent
'
;
const
ProfileMenuDesktop
=
()
=>
{
const
ProfileMenuDesktop
=
()
=>
{
const
{
data
}
=
useFetchProfileInfo
();
const
{
data
,
error
}
=
useFetchProfileInfo
();
const
loginUrl
=
useLoginUrl
();
const
loginUrl
=
useLoginUrl
();
const
buttonProps
:
Partial
<
ButtonProps
>
=
(()
=>
{
if
(
error
?.
status
===
403
)
{
return
{
as
:
'
a
'
,
href
:
route
({
pathname
:
'
/auth/profile
'
}),
};
}
if
(
!
data
)
{
return
{
as
:
'
a
'
,
href
:
loginUrl
,
};
}
return
{};
})();
return
(
return
(
<
Popover
openDelay=
{
300
}
placement=
"bottom-end"
gutter=
{
10
}
isLazy
>
<
Popover
openDelay=
{
300
}
placement=
"bottom-end"
gutter=
{
10
}
isLazy
>
<
PopoverTrigger
>
<
PopoverTrigger
>
...
@@ -18,8 +38,7 @@ const ProfileMenuDesktop = () => {
...
@@ -18,8 +38,7 @@ const ProfileMenuDesktop = () => {
display=
"inline-flex"
display=
"inline-flex"
height=
"auto"
height=
"auto"
flexShrink=
{
0
}
flexShrink=
{
0
}
as=
{
data
?
undefined
:
'
a
'
}
{
...
buttonProps
}
href=
{
data
?
undefined
:
loginUrl
}
>
>
<
UserAvatar
size=
{
50
}
/>
<
UserAvatar
size=
{
50
}
/>
</
Button
>
</
Button
>
...
...
ui/snippets/profileMenu/ProfileMenuMobile.tsx
View file @
c7b55618
import
{
Box
,
Drawer
,
DrawerOverlay
,
DrawerContent
,
DrawerBody
,
useDisclosure
,
Button
}
from
'
@chakra-ui/react
'
;
import
{
Box
,
Drawer
,
DrawerOverlay
,
DrawerContent
,
DrawerBody
,
useDisclosure
,
Button
}
from
'
@chakra-ui/react
'
;
import
type
{
ButtonProps
}
from
'
@chakra-ui/react
'
;
import
{
route
}
from
'
nextjs-routes
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
useFetchProfileInfo
from
'
lib/hooks/useFetchProfileInfo
'
;
import
useFetchProfileInfo
from
'
lib/hooks/useFetchProfileInfo
'
;
...
@@ -9,17 +11,34 @@ import ProfileMenuContent from 'ui/snippets/profileMenu/ProfileMenuContent';
...
@@ -9,17 +11,34 @@ import ProfileMenuContent from 'ui/snippets/profileMenu/ProfileMenuContent';
const
ProfileMenuMobile
=
()
=>
{
const
ProfileMenuMobile
=
()
=>
{
const
{
isOpen
,
onOpen
,
onClose
}
=
useDisclosure
();
const
{
isOpen
,
onOpen
,
onClose
}
=
useDisclosure
();
const
{
data
}
=
useFetchProfileInfo
();
const
{
data
,
error
}
=
useFetchProfileInfo
();
const
loginUrl
=
useLoginUrl
();
const
loginUrl
=
useLoginUrl
();
const
buttonProps
:
Partial
<
ButtonProps
>
=
(()
=>
{
if
(
error
?.
status
===
403
)
{
return
{
as
:
'
a
'
,
href
:
route
({
pathname
:
'
/auth/profile
'
}),
};
}
if
(
!
data
)
{
return
{
as
:
'
a
'
,
href
:
loginUrl
,
};
}
return
{};
})();
return
(
return
(
<>
<>
<
Box
padding=
{
2
}
onClick=
{
data
?
onOpen
:
undefined
}
>
<
Box
padding=
{
2
}
onClick=
{
data
?
onOpen
:
undefined
}
>
<
Button
<
Button
variant=
"unstyled"
variant=
"unstyled"
height=
"auto"
height=
"auto"
as=
{
data
?
undefined
:
'
a
'
}
{
...
buttonProps
}
href=
{
data
?
undefined
:
loginUrl
}
>
>
<
UserAvatar
size=
{
24
}
/>
<
UserAvatar
size=
{
24
}
/>
</
Button
>
</
Button
>
...
...
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