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
f3cb3711
Commit
f3cb3711
authored
Oct 25, 2024
by
Max Alekseenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove profile button skeleton
parent
478dbec0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
20 deletions
+21
-20
UserProfileButton.tsx
ui/snippets/user/profile/UserProfileButton.tsx
+21
-20
No files found.
ui/snippets/user/profile/UserProfileButton.tsx
View file @
f3cb3711
import
type
{
ButtonProps
}
from
'
@chakra-ui/react
'
;
import
{
Button
,
Skeleton
,
Tooltip
,
Box
,
HStack
}
from
'
@chakra-ui/react
'
;
import
{
Button
,
Tooltip
,
Box
,
HStack
}
from
'
@chakra-ui/react
'
;
import
type
{
UseQueryResult
}
from
'
@tanstack/react-query
'
;
import
React
from
'
react
'
;
...
...
@@ -22,7 +22,7 @@ interface Props {
isPending
?:
boolean
;
}
const
UserProfileButton
=
({
profileQuery
,
size
,
variant
,
onClick
,
isPending
}:
Props
,
ref
:
React
.
ForwardedRef
<
HTML
Div
Element
>
)
=>
{
const
UserProfileButton
=
({
profileQuery
,
size
,
variant
,
onClick
,
isPending
}:
Props
,
ref
:
React
.
ForwardedRef
<
HTML
Button
Element
>
)
=>
{
const
[
isFetched
,
setIsFetched
]
=
React
.
useState
(
false
);
const
isMobile
=
useIsMobile
();
...
...
@@ -60,6 +60,8 @@ const UserProfileButton = ({ profileQuery, size, variant, onClick, isPending }:
);
})();
const
isButtonLoading
=
isPending
||
!
isFetched
;
return
(
<
Tooltip
label=
{
<
span
>
Sign in to My Account to add tags,
<
br
/>
create watchlists, access API keys and more
</
span
>
}
...
...
@@ -68,24 +70,23 @@ const UserProfileButton = ({ profileQuery, size, variant, onClick, isPending }:
isDisabled=
{
isMobile
||
isLoading
||
Boolean
(
data
)
}
openDelay=
{
500
}
>
<
Skeleton
isLoaded=
{
isFetched
}
borderRadius=
"base"
ref=
{
ref
}
w=
"fit-content"
>
<
Button
size=
{
size
}
variant=
{
variant
}
onClick=
{
onClick
}
onFocus=
{
e
=>
e
.
preventDefault
()
}
// eslint-disable-line
data
-
selected=
{
Boolean
(
data
)
||
Boolean
(
web3AccountWithDomain
.
address
)
}
data
-
warning=
{
isAutoConnectDisabled
}
fontSize=
"sm"
lineHeight=
{
5
}
px=
{
data
?
2.5
:
4
}
fontWeight=
{
data
?
700
:
600
}
isLoading=
{
isPending
}
loadingText=
{
isMobile
?
undefined
:
'
Connecting
'
}
>
{
content
}
</
Button
>
</
Skeleton
>
<
Button
ref=
{
ref
}
size=
{
size
}
variant=
{
variant
}
onClick=
{
onClick
}
onFocus=
{
e
=>
e
.
preventDefault
()
}
// eslint-disable-line
data
-
selected=
{
!
isButtonLoading
&&
(
Boolean
(
data
)
||
Boolean
(
web3AccountWithDomain
.
address
))
}
data
-
warning=
{
isAutoConnectDisabled
}
fontSize=
"sm"
lineHeight=
{
5
}
px=
{
data
?
2.5
:
4
}
fontWeight=
{
data
?
700
:
600
}
isLoading=
{
isButtonLoading
}
loadingText=
{
isMobile
?
undefined
:
'
Log in
'
}
>
{
content
}
</
Button
>
</
Tooltip
>
);
};
...
...
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