Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
interface
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
LuckySwap
interface
Commits
acdca350
Unverified
Commit
acdca350
authored
Aug 11, 2022
by
cartcrom
Committed by
GitHub
Aug 11, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: removing duplicate AccountDetails code (#4329)
fixed redundant code
parent
fe55c7ae
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
54 deletions
+16
-54
index.tsx
src/components/AccountDetails/index.tsx
+16
-54
No files found.
src/components/AccountDetails/index.tsx
View file @
acdca350
...
...
@@ -129,7 +129,7 @@ const AccountControl = styled.div`
}
`
const
AddressLink
=
styled
(
ExternalLink
)
<
{
hasENS
:
boolean
;
isENS
:
boolean
}
>
`
const
AddressLink
=
styled
(
ExternalLink
)
`
font-size: 0.825rem;
color:
${({
theme
})
=>
theme
.
deprecated_text3
}
;
margin-left: 1rem;
...
...
@@ -281,59 +281,21 @@ export default function AccountDetails({
</
AccountControl
>
</
AccountGroupingRow
>
<
AccountGroupingRow
>
{
ENSName
?
(
<>
<
AccountControl
>
<
div
>
{
account
&&
(
<
CopyHelper
toCopy=
{
account
}
iconPosition=
"left"
>
<
span
style=
{
{
marginLeft
:
'
4px
'
}
}
>
<
Trans
>
Copy Address
</
Trans
>
</
span
>
</
CopyHelper
>
)
}
{
chainId
&&
account
&&
(
<
AddressLink
hasENS=
{
!!
ENSName
}
isENS=
{
true
}
href=
{
getExplorerLink
(
chainId
,
ENSName
,
ExplorerDataType
.
ADDRESS
)
}
>
<
LinkIcon
size=
{
16
}
/>
<
span
style=
{
{
marginLeft
:
'
4px
'
}
}
>
<
Trans
>
View on Explorer
</
Trans
>
</
span
>
</
AddressLink
>
)
}
</
div
>
</
AccountControl
>
</>
)
:
(
<>
<
AccountControl
>
<
div
>
{
account
&&
(
<
CopyHelper
toCopy=
{
account
}
iconPosition=
"left"
>
<
span
style=
{
{
marginLeft
:
'
4px
'
}
}
>
<
Trans
>
Copy Address
</
Trans
>
</
span
>
</
CopyHelper
>
)
}
{
chainId
&&
account
&&
(
<
AddressLink
hasENS=
{
!!
ENSName
}
isENS=
{
false
}
href=
{
getExplorerLink
(
chainId
,
account
,
ExplorerDataType
.
ADDRESS
)
}
>
<
LinkIcon
size=
{
16
}
/>
<
span
style=
{
{
marginLeft
:
'
4px
'
}
}
>
<
Trans
>
View on Explorer
</
Trans
>
</
span
>
</
AddressLink
>
)
}
</
div
>
</
AccountControl
>
</>
)
}
<
AccountControl
>
<
div
>
{
account
&&
(
<
CopyHelper
toCopy=
{
account
}
iconPosition=
"left"
>
<
Trans
>
Copy Address
</
Trans
>
</
CopyHelper
>
)
}
{
chainId
&&
account
&&
(
<
AddressLink
href=
{
getExplorerLink
(
chainId
,
ENSName
??
account
,
ExplorerDataType
.
ADDRESS
)
}
>
<
LinkIcon
size=
{
16
}
/>
<
Trans
>
View on Explorer
</
Trans
>
</
AddressLink
>
)
}
</
div
>
</
AccountControl
>
</
AccountGroupingRow
>
</
InfoCard
>
</
YourAccount
>
...
...
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