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
fed42c9c
Commit
fed42c9c
authored
Oct 22, 2024
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Blockscout account V2
Fixes #2029
parent
10b4c5e2
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
21 deletions
+24
-21
UserProfileContent.tsx
ui/snippets/user/profile/UserProfileContent.tsx
+21
-13
UserProfileContentNavLink.tsx
ui/snippets/user/profile/UserProfileContentNavLink.tsx
+2
-7
UserProfileContentWallet.tsx
ui/snippets/user/profile/UserProfileContentWallet.tsx
+1
-1
UserProfileDesktop.pw.tsx_default_without-address-1.png
..._/UserProfileDesktop.pw.tsx_default_without-address-1.png
+0
-0
UserProfileDesktop.pw.tsx_default_without-email-1.png
...s__/UserProfileDesktop.pw.tsx_default_without-email-1.png
+0
-0
No files found.
ui/snippets/user/profile/UserProfileContent.tsx
View file @
fed42c9c
import
{
Box
,
Button
,
Divider
,
Flex
,
Link
,
VStack
}
from
'
@chakra-ui/react
'
;
import
{
Box
,
Button
,
Divider
,
Flex
,
Link
,
VStack
,
useColorModeValue
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
type
{
NavLink
}
from
'
./types
'
;
import
type
{
NavLink
}
from
'
./types
'
;
...
@@ -18,6 +18,11 @@ import UserProfileContentNavLink from './UserProfileContentNavLink';
...
@@ -18,6 +18,11 @@ import UserProfileContentNavLink from './UserProfileContentNavLink';
import
UserProfileContentWallet
from
'
./UserProfileContentWallet
'
;
import
UserProfileContentWallet
from
'
./UserProfileContentWallet
'
;
const
navLinks
:
Array
<
NavLink
>
=
[
const
navLinks
:
Array
<
NavLink
>
=
[
{
text
:
'
My profile
'
,
href
:
route
({
pathname
:
'
/auth/profile
'
}),
icon
:
'
profile
'
as
const
,
},
{
{
text
:
'
Watch list
'
,
text
:
'
Watch list
'
,
href
:
route
({
pathname
:
'
/account/watchlist
'
}),
href
:
route
({
pathname
:
'
/account/watchlist
'
}),
...
@@ -57,6 +62,8 @@ const UserProfileContent = ({ data, onClose, onLogin, onAddEmail, onAddAddress }
...
@@ -57,6 +62,8 @@ const UserProfileContent = ({ data, onClose, onLogin, onAddEmail, onAddAddress }
const
{
isAutoConnectDisabled
}
=
useMarketplaceContext
();
const
{
isAutoConnectDisabled
}
=
useMarketplaceContext
();
const
logout
=
useLogout
();
const
logout
=
useLogout
();
const
accountTextColor
=
useColorModeValue
(
'
gray.500
'
,
'
gray.300
'
);
if
(
!
data
)
{
if
(
!
data
)
{
return
(
return
(
<
Box
>
<
Box
>
...
@@ -71,15 +78,16 @@ const UserProfileContent = ({ data, onClose, onLogin, onAddEmail, onAddAddress }
...
@@ -71,15 +78,16 @@ const UserProfileContent = ({ data, onClose, onLogin, onAddEmail, onAddAddress }
<
Box
>
<
Box
>
{
isAutoConnectDisabled
&&
<
UserWalletAutoConnectAlert
/>
}
{
isAutoConnectDisabled
&&
<
UserWalletAutoConnectAlert
/>
}
<
UserProfileContentNavLink
<
Box
fontSize=
"xs"
lineHeight=
{
6
}
fontWeight=
"500"
px=
{
1
}
mb=
"2px"
>
Account
</
Box
>
text=
"My profile"
<
Box
href=
{
route
({
pathname
:
'
/auth/profile
'
})
}
fontSize=
"xs"
icon=
"profile"
lineHeight=
{
4
}
onClick=
{
onClose
}
fontWeight=
"500"
py=
"8px"
borderColor=
"divider"
/>
borderWidth=
"1px"
borderRadius=
"base"
<
Box
fontSize=
"xs"
lineHeight=
{
4
}
fontWeight=
"500"
borderColor=
"divider"
borderWidth=
"1px"
borderRadius=
"base"
>
color=
{
accountTextColor
}
>
{
config
.
features
.
blockchainInteraction
.
isEnabled
&&
(
{
config
.
features
.
blockchainInteraction
.
isEnabled
&&
(
<
Flex
p=
{
2
}
borderColor=
"divider"
borderBottomWidth=
"1px"
>
<
Flex
p=
{
2
}
borderColor=
"divider"
borderBottomWidth=
"1px"
>
<
Box
>
Address
</
Box
>
<
Box
>
Address
</
Box
>
...
@@ -91,7 +99,7 @@ const UserProfileContent = ({ data, onClose, onLogin, onAddEmail, onAddAddress }
...
@@ -91,7 +99,7 @@ const UserProfileContent = ({ data, onClose, onLogin, onAddEmail, onAddAddress }
/>
/>
{
data
?.
address_hash
?
{
data
?.
address_hash
?
<
Box
>
{
shortenString
(
data
?.
address_hash
)
}
</
Box
>
:
<
Box
>
{
shortenString
(
data
?.
address_hash
)
}
</
Box
>
:
<
Link
onClick=
{
onAddAddress
}
color=
"
text_secondary
"
_hover=
{
{
color
:
'
link_hovered
'
,
textDecoration
:
'
none
'
}
}
>
Add address
</
Link
>
<
Link
onClick=
{
onAddAddress
}
color=
"
icon_info
"
_hover=
{
{
color
:
'
link_hovered
'
,
textDecoration
:
'
none
'
}
}
>
Add address
</
Link
>
}
}
</
Flex
>
</
Flex
>
)
}
)
}
...
@@ -99,14 +107,14 @@ const UserProfileContent = ({ data, onClose, onLogin, onAddEmail, onAddAddress }
...
@@ -99,14 +107,14 @@ const UserProfileContent = ({ data, onClose, onLogin, onAddEmail, onAddAddress }
<
Box
mr=
"auto"
>
Email
</
Box
>
<
Box
mr=
"auto"
>
Email
</
Box
>
{
data
?.
email
?
{
data
?.
email
?
<
TruncatedValue
value=
{
data
.
email
}
/>
:
<
TruncatedValue
value=
{
data
.
email
}
/>
:
<
Link
onClick=
{
onAddEmail
}
color=
"
text_secondary
"
_hover=
{
{
color
:
'
link_hovered
'
,
textDecoration
:
'
none
'
}
}
>
Add email
</
Link
>
<
Link
onClick=
{
onAddEmail
}
color=
"
icon_info
"
_hover=
{
{
color
:
'
link_hovered
'
,
textDecoration
:
'
none
'
}
}
>
Add email
</
Link
>
}
}
</
Flex
>
</
Flex
>
</
Box
>
</
Box
>
{
config
.
features
.
blockchainInteraction
.
isEnabled
&&
<
UserProfileContentWallet
onClose=
{
onClose
}
mt=
{
3
}
/>
}
{
config
.
features
.
blockchainInteraction
.
isEnabled
&&
<
UserProfileContentWallet
onClose=
{
onClose
}
mt=
{
3
}
/>
}
<
VStack
as=
"ul"
spacing=
"0"
alignItems=
"flex-start"
overflow=
"hidden"
mt=
{
3
}
>
<
VStack
as=
"ul"
spacing=
"0"
alignItems=
"flex-start"
overflow=
"hidden"
mt=
{
4
}
>
{
navLinks
.
map
((
item
)
=>
(
{
navLinks
.
map
((
item
)
=>
(
<
UserProfileContentNavLink
<
UserProfileContentNavLink
key=
{
item
.
text
}
key=
{
item
.
text
}
...
...
ui/snippets/user/profile/UserProfileContentNavLink.tsx
View file @
fed42c9c
import
type
{
SpaceProps
}
from
'
@chakra-ui/react
'
;
import
{
Box
}
from
'
@chakra-ui/react
'
;
import
{
Box
}
from
'
@chakra-ui/react
'
;
import
React
from
'
react
'
;
import
React
from
'
react
'
;
...
@@ -7,11 +6,7 @@ import type { NavLink } from './types';
...
@@ -7,11 +6,7 @@ import type { NavLink } from './types';
import
IconSvg
from
'
ui/shared/IconSvg
'
;
import
IconSvg
from
'
ui/shared/IconSvg
'
;
import
LinkInternal
from
'
ui/shared/links/LinkInternal
'
;
import
LinkInternal
from
'
ui/shared/links/LinkInternal
'
;
type
Props
=
NavLink
&
{
const
UserProfileContentNavLink
=
({
href
,
icon
,
text
,
onClick
}:
NavLink
)
=>
{
py
?:
SpaceProps
[
'
py
'
];
}
const
UserProfileContentNavLink
=
({
href
,
icon
,
text
,
onClick
,
py
}:
Props
)
=>
{
return
(
return
(
<
LinkInternal
<
LinkInternal
...
@@ -19,7 +14,7 @@ const UserProfileContentNavLink = ({ href, icon, text, onClick, py }: Props) =>
...
@@ -19,7 +14,7 @@ const UserProfileContentNavLink = ({ href, icon, text, onClick, py }: Props) =>
display=
"flex"
display=
"flex"
alignItems=
"center"
alignItems=
"center"
columnGap=
{
3
}
columnGap=
{
3
}
py=
{
py
??
'
14px
'
}
py=
"14px"
color=
"inherit"
color=
"inherit"
_hover=
{
{
textDecoration
:
'
none
'
,
color
:
'
link_hovered
'
}
}
_hover=
{
{
textDecoration
:
'
none
'
,
color
:
'
link_hovered
'
}
}
onClick=
{
onClick
}
onClick=
{
onClick
}
...
...
ui/snippets/user/profile/UserProfileContentWallet.tsx
View file @
fed42c9c
...
@@ -73,7 +73,7 @@ const UserProfileContentWallet = ({ onClose, className }: Props) => {
...
@@ -73,7 +73,7 @@ const UserProfileContentWallet = ({ onClose, className }: Props) => {
return
(
return
(
<
Box
className=
{
className
}
>
<
Box
className=
{
className
}
>
<
Flex
px=
{
2
}
py=
{
1
}
mb=
{
1
}
fontSize=
"xs"
lineHeight=
{
4
}
fontWeight=
"500"
>
<
Flex
px=
{
1
}
mb=
"2px"
fontSize=
"xs"
alignItems=
"center"
lineHeight=
{
6
}
fontWeight=
"500"
>
<
span
>
Connected wallet
</
span
>
<
span
>
Connected wallet
</
span
>
<
Hint
<
Hint
label=
{
label=
{
...
...
ui/snippets/user/profile/__screenshots__/UserProfileDesktop.pw.tsx_default_without-address-1.png
View replaced file @
10b4c5e2
View file @
fed42c9c
28.1 KB
|
W:
|
H:
29 KB
|
W:
|
H:
2-up
Swipe
Onion skin
ui/snippets/user/profile/__screenshots__/UserProfileDesktop.pw.tsx_default_without-email-1.png
View replaced file @
10b4c5e2
View file @
fed42c9c
25.5 KB
|
W:
|
H:
25.7 KB
|
W:
|
H:
2-up
Swipe
Onion skin
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