Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(BIDS-2432) Remove text-primary style from 0x in FormatAddressLong #2530

Merged
merged 3 commits into from
Sep 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions utils/eth1.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,14 +237,15 @@ func FormatAddressAsTokenLink(token, address []byte, name string, verified bool,

func FormatHashLong(hash common.Hash) template.HTML {
address := hash.String()
test := `
<div class="d-flex text-monospace">
<span class="">%s</span>
<span class="flex-shrink-1 text-truncate">%s</span>
<span class="">%s</span>
</div>`
if len(address) > 4 {
return template.HTML(fmt.Sprintf(test, address[:4], address[4:len(address)-4], address[len(address)-4:]))
htmlFormat := `
<div class="d-flex text-monospace">
%s
<span class="flex-shrink-1 text-truncate">%s</span>
%s
</div>`

return template.HTML(fmt.Sprintf(htmlFormat, address[:4], address[4:len(address)-4], address[len(address)-4:]))
}

return template.HTML(address)
Expand All @@ -255,10 +256,11 @@ func FormatAddressLong(address string) template.HTML {
return template.HTML(address)
}
address = FixAddressCasing(address)
test := `
<span class="text-monospace mw-100"><span class="text-primary">%s</span><span class="text-truncate">%s</span><span class="text-primary">%s</span></span>`
if len(address) > 4 {
return template.HTML(fmt.Sprintf(test, address[:6], address[6:len(address)-4], address[len(address)-4:]))
htmlFormat := `
<span class="text-monospace mw-100">%s<span class="text-primary">%s</span>%s<span class="text-primary">%s</span></span>`

return template.HTML(fmt.Sprintf(htmlFormat, address[:2], address[2:6], address[6:len(address)-4], address[len(address)-4:]))
}

return template.HTML(address)
Expand Down
Loading