Skip to content

Commit b9bdcea

Browse files
feat(faucet): mdd-75 added copy to faucet (#1743)
* feat(faucet): mdd-75 added copy to faucet * feat(faucet): mdd-75 added light tag styles * feat(faucet): updated color
1 parent 0cd876e commit b9bdcea

File tree

2 files changed

+94
-23
lines changed

2 files changed

+94
-23
lines changed

src/components/NavbarWallet/index.tsx

Lines changed: 50 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,25 @@ import BrowserOnly from "@docusaurus/BrowserOnly";
99
import styles from "./navbarWallet.module.scss";
1010
import { Tooltip } from "@site/src/components/Tooltip";
1111
import { trackClickForSegment } from "@site/src/lib/segmentAnalytics";
12+
import Link from "@docusaurus/Link";
1213

1314
interface INavbarWalletComponent {
1415
includeUrl: string[];
1516
}
1617

1718
const LOGIN_FF = "mm-unified-login";
1819

20+
const EndIcon = () => (
21+
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
22+
<path
23+
fill-rule="evenodd"
24+
clip-rule="evenodd"
25+
d="M4.2915 3.33332C4.2915 2.96514 4.58998 2.66666 4.95817 2.66666H11.9998C12.368 2.66666 12.6665 2.96514 12.6665 3.33332V10.375C12.6665 10.7432 12.368 11.0417 11.9998 11.0417C11.6316 11.0417 11.3332 10.7432 11.3332 10.375V4.9428L3.80458 12.4714C3.54422 12.7317 3.12212 12.7317 2.86176 12.4714C2.60142 12.2111 2.60142 11.7889 2.86176 11.5286L10.3904 3.99999H4.95817C4.58998 3.99999 4.2915 3.70151 4.2915 3.33332Z"
26+
fill="currentColor"
27+
/>
28+
</svg>
29+
);
30+
1931
const reformatMetamaskAccount = (account) =>
2032
account ? `${account.slice(0, 7)}...${account.slice(-5)}` : null;
2133

@@ -157,29 +169,44 @@ const NavbarWalletComponent: FC = ({
157169
{dropdownOpen && (
158170
<ul ref={dialogRef} className={styles.dropdown}>
159171
<li className={styles.item}>
160-
<img
161-
src="/img/icons/jazzicon.png"
162-
className={styles.avatar}
163-
alt="avatar"
164-
/>{" "}
165-
<span className={styles.walletId}>
166-
{metaMaskAccountEns || reformatMetamaskAccount(userAccount)}
167-
</span>
168-
<button
169-
data-testid="navbar-account-copy"
170-
className={styles.copyButton}
171-
onClick={handleCopy}
172-
>
173-
<Tooltip
174-
message={copyMessage}
175-
className={styles.tooltip}
176-
onHidden={() => {
177-
setCopyMessage(COPY_TEXT);
178-
}}
179-
>
180-
<CopyIcon />
181-
</Tooltip>
182-
</button>
172+
<div>
173+
<div className={styles.innerItemWrap}>
174+
<img
175+
src="/img/icons/jazzicon.png"
176+
className={styles.avatar}
177+
alt="avatar"
178+
/>{" "}
179+
<span className={styles.walletId}>
180+
{metaMaskAccountEns || reformatMetamaskAccount(userAccount)}
181+
</span>
182+
<button
183+
data-testid="navbar-account-copy"
184+
className={styles.copyButton}
185+
onClick={handleCopy}
186+
>
187+
<Tooltip
188+
message={copyMessage}
189+
className={styles.tooltip}
190+
onHidden={() => {
191+
setCopyMessage(COPY_TEXT);
192+
}}
193+
>
194+
<CopyIcon />
195+
</Tooltip>
196+
</button>
197+
</div>
198+
{
199+
!metaMaskAccountEns && (
200+
<div className={styles.extLinkWrap}>
201+
<Link to="https://names.linea.build/" className={styles.extLink}>
202+
Claim Linea Name
203+
<EndIcon />
204+
</Link>
205+
<span className={styles.extTag}>New</span>
206+
</div>
207+
)
208+
}
209+
</div>
183210
</li>
184211
<li className={styles.item}>
185212
<Button

src/components/NavbarWallet/navbarWallet.module.scss

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
:root[data-theme="dark"] {
22
--navbarWallet-color: #fff;
3+
--tag-bg-color: #213949;
4+
--tag-border-color: transparent;
5+
--tag-color: #43AEFC;
36
}
47

58
:root[data-theme="light"] {
69
--navbarWallet-color: #141618;
10+
--tag-bg-color: #fff;
11+
--tag-border-color: #0376c9;
12+
--tag-color: #0376c9;
713
}
814

915
:global([class*="navbarSearchContainer"]) {
@@ -111,3 +117,41 @@
111117
.tooltip {
112118
font-size: 14px !important;
113119
}
120+
121+
.innerItemWrap {
122+
display: flex;
123+
flex-direction: row;
124+
flex-wrap: nowrap;
125+
align-items: center;
126+
}
127+
128+
.extLinkWrap {
129+
display: flex;
130+
align-items: center;
131+
padding-top: 10px;
132+
}
133+
134+
.extLink {
135+
display: inline-flex;
136+
align-items: center;
137+
color: var(--tag-color);
138+
}
139+
140+
.extLink svg {
141+
display: block;
142+
margin-left: 5px;
143+
}
144+
145+
.extTag {
146+
display: inline-flex;
147+
align-items: center;
148+
justify-content: center;
149+
height: 25px;
150+
min-width: 45px;
151+
padding: 4px 4px 6px 4px;
152+
margin-left: 10px;
153+
background-color: var(--tag-bg-color);
154+
color: var(--tag-color);
155+
border-radius: 12px;
156+
border: 1px solid var(--tag-border-color);
157+
}

0 commit comments

Comments
 (0)