-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: support .bit resolution icon of domian (#805)
- Loading branch information
1 parent
330a678
commit 8e24f06
Showing
29 changed files
with
454 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import HashLink from 'components/HashLink' | ||
import Tooltip from 'components/Tooltip' | ||
import { IMG_URL } from 'utils' | ||
|
||
import styles from './styles.module.scss' | ||
|
||
type Props = { | ||
domain: string | ||
hash: string | ||
href: string | ||
leading?: number | ||
} | ||
|
||
const AddressWithDomain = ({ domain, hash, href = '', leading = 8 }: Props) => { | ||
return ( | ||
<div className={styles.container}> | ||
<Tooltip title={domain} placement="top"> | ||
<img src={`${IMG_URL}bit-logo.svg`} loading="lazy" crossOrigin="anonymous" referrerPolicy="no-referrer" /> | ||
</Tooltip> | ||
<Tooltip title={hash} placement="top"> | ||
<div> | ||
<HashLink | ||
label={domain?.length > leading * 2 ? `${domain?.slice(0, leading)}...${domain?.slice(-leading)}` : domain} | ||
href={href} | ||
/> | ||
</div> | ||
</Tooltip> | ||
</div> | ||
) | ||
} | ||
|
||
export default AddressWithDomain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
.container { | ||
display: flex; | ||
align-items: center; | ||
text-transform: initial; | ||
& img { | ||
width: 16px; | ||
height: 16px; | ||
border-radius: 50%; | ||
margin-right: 2px; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.