|
1 | | -import React from "react"; |
2 | | -import { AlertTitle, AlertText } from "@site/src/components/Alert"; |
3 | | -import { trackClickForSegment } from "@site/src/lib/segmentAnalytics"; |
| 1 | +import React from 'react' |
| 2 | +import { AlertTitle, AlertText } from '@site/src/components/Alert' |
| 3 | +import { trackClickForSegment } from '@site/src/lib/segmentAnalytics' |
4 | 4 |
|
5 | 5 | const handleClickCommonIssue = () => { |
6 | 6 | trackClickForSegment({ |
7 | | - eventName: "Contact us", |
| 7 | + eventName: 'Contact us', |
8 | 8 | clickType: `Common Issue Alert`, |
9 | | - userExperience: "B", |
| 9 | + userExperience: 'B', |
10 | 10 | responseStatus: null, |
11 | 11 | responseMsg: null, |
12 | 12 | timestamp: Date.now(), |
13 | | - }); |
14 | | -}; |
| 13 | + }) |
| 14 | +} |
15 | 15 |
|
16 | 16 | const handleClickBalanceLow = () => { |
17 | 17 | trackClickForSegment({ |
18 | | - eventName: "Add funds using MetaMask", |
| 18 | + eventName: 'Add funds using MetaMask', |
19 | 19 | clickType: `Low Balance Alert`, |
20 | | - userExperience: "B", |
| 20 | + userExperience: 'B', |
21 | 21 | responseStatus: null, |
22 | 22 | responseMsg: null, |
23 | 23 | timestamp: Date.now(), |
24 | | - }); |
25 | | -}; |
| 24 | + }) |
| 25 | +} |
26 | 26 |
|
27 | 27 | const handleClickCooldown = () => { |
28 | 28 | trackClickForSegment({ |
29 | | - eventName: "Contact us", |
| 29 | + eventName: 'Contact us', |
30 | 30 | clickType: `Cooldown Alert`, |
31 | | - userExperience: "B", |
| 31 | + userExperience: 'B', |
32 | 32 | responseStatus: null, |
33 | 33 | responseMsg: null, |
34 | 34 | timestamp: Date.now(), |
35 | | - }); |
36 | | -}; |
| 35 | + }) |
| 36 | +} |
| 37 | + |
| 38 | +const handleClickPoh = () => { |
| 39 | + trackClickForSegment({ |
| 40 | + eventName: 'PoH', |
| 41 | + clickType: `PoH Alert`, |
| 42 | + userExperience: 'B', |
| 43 | + responseStatus: null, |
| 44 | + responseMsg: null, |
| 45 | + timestamp: Date.now(), |
| 46 | + }) |
| 47 | +} |
37 | 48 |
|
38 | 49 | const handleClickViewTransaction = () => { |
39 | 50 | trackClickForSegment({ |
40 | | - eventName: "View on Etherscan", |
| 51 | + eventName: 'View on Etherscan', |
41 | 52 | clickType: `Success Alert`, |
42 | | - userExperience: "B", |
| 53 | + userExperience: 'B', |
43 | 54 | responseStatus: null, |
44 | 55 | responseMsg: null, |
45 | 56 | timestamp: Date.now(), |
46 | | - }); |
47 | | -}; |
| 57 | + }) |
| 58 | +} |
48 | 59 |
|
49 | 60 | export const AlertCommonIssue = () => ( |
50 | 61 | <div> |
51 | 62 | <AlertTitle>Issue starting transaction</AlertTitle> |
52 | 63 | <AlertText> |
53 | 64 | <span> |
54 | | - There was an issue starting your transaction. Try again in a few |
55 | | - minutes. If the problem persists please{" "} |
| 65 | + There was an issue starting your transaction. Try again in a few minutes. If the problem |
| 66 | + persists please{' '} |
56 | 67 | <a |
57 | 68 | data-testid="alert-common-contact-us" |
58 | 69 | onClick={handleClickCommonIssue} |
59 | 70 | target="_blank" |
60 | | - href="https://support.metamask.io/" |
61 | | - > |
| 71 | + href="https://support.metamask.io/"> |
62 | 72 | contact support |
63 | 73 | </a> |
64 | 74 | . |
65 | 75 | </span> |
66 | 76 | </AlertText> |
67 | 77 | </div> |
68 | | -); |
| 78 | +) |
| 79 | + |
| 80 | +export const AlertFailedPoh = () => ( |
| 81 | + <div> |
| 82 | + <AlertTitle>Please complete Linea Proof of Humanity</AlertTitle> |
| 83 | + <AlertText> |
| 84 | + <span> |
| 85 | + Free users are required to complete Proof of Humanity to access the faucet. Learn more{' '} |
| 86 | + <a |
| 87 | + data-testid="alert-poh" |
| 88 | + onClick={handleClickPoh} |
| 89 | + target="_blank" |
| 90 | + href="https://poh.linea.build/"> |
| 91 | + here |
| 92 | + </a> |
| 93 | + . |
| 94 | + </span> |
| 95 | + </AlertText> |
| 96 | + </div> |
| 97 | +) |
69 | 98 |
|
70 | 99 | export const AlertPastActivity = () => ( |
71 | 100 | <div> |
72 | 101 | <AlertTitle>No past activity</AlertTitle> |
73 | 102 | <AlertText> |
74 | | - The address provided does not have sufficient historical activity or balance on the Ethereum Mainnet. Please use a |
75 | | - different address to proceed. Read the FAQ below for more information. |
| 103 | + The address provided does not have sufficient historical activity or balance on the Ethereum |
| 104 | + Mainnet. Please use a different address to proceed. Read the FAQ below for more information. |
76 | 105 | </AlertText> |
77 | 106 | </div> |
78 | | -); |
| 107 | +) |
79 | 108 |
|
80 | 109 | export const AlertBalanceTooLow = () => ( |
81 | 110 | <div> |
82 | 111 | <AlertTitle>Balance too low</AlertTitle> |
83 | 112 | <AlertText> |
84 | 113 | <span> |
85 | | - Your current Ethereum address does not contain enough ETH on |
86 | | - Ethereum Mainnet. You can add funds to your address using{" "} |
| 114 | + Your current Ethereum address does not contain enough ETH on Ethereum Mainnet. You can add |
| 115 | + funds to your address using{' '} |
87 | 116 | <a |
88 | 117 | data-testid="alert-balance-add-funds" |
89 | 118 | onClick={handleClickBalanceLow} |
90 | 119 | className="underline" |
91 | | - href="https://metamask.io/buy-crypto/" |
92 | | - > |
| 120 | + href="https://metamask.io/buy-crypto/"> |
93 | 121 | MetaMask |
94 | 122 | </a> |
95 | 123 | . |
96 | 124 | </span> |
97 | 125 | </AlertText> |
98 | 126 | </div> |
99 | | -); |
| 127 | +) |
100 | 128 |
|
101 | 129 | export const AlertCooldown = () => ( |
102 | 130 | <div> |
103 | 131 | <AlertTitle>Cooldown period</AlertTitle> |
104 | 132 | <AlertText> |
105 | 133 | <span> |
106 | | - You already got ETH from the faucet today. Try again in 24 hours.{" "} |
| 134 | + You already got ETH from the faucet today. Try again in 24 hours.{' '} |
107 | 135 | <a |
108 | 136 | data-testid="alert-cooldown-contact-us" |
109 | 137 | onClick={handleClickCooldown} |
110 | 138 | target="_blank" |
111 | | - href="https://support.metamask.io/" |
112 | | - > |
| 139 | + href="https://support.metamask.io/"> |
113 | 140 | Contact us |
114 | 141 | </a> |
115 | 142 | . |
116 | 143 | </span> |
117 | 144 | </AlertText> |
118 | 145 | </div> |
119 | | -); |
| 146 | +) |
120 | 147 |
|
121 | 148 | export const AlertSuccess = ({ url }: { url: string }) => ( |
122 | 149 | <div> |
123 | 150 | <AlertTitle>Transaction successful!</AlertTitle> |
124 | 151 | <AlertText> |
125 | 152 | <span> |
126 | | - Your transaction has been sent to the Ethereum/Sepolia network. You |
127 | | - will receive your ETH shortly.{" "} |
| 153 | + Your transaction has been sent to the Ethereum/Sepolia network. You will receive your ETH |
| 154 | + shortly.{' '} |
128 | 155 | <a |
129 | 156 | data-testid="alert-success-etherscan" |
130 | 157 | onClick={handleClickViewTransaction} |
131 | 158 | target="_blank" |
132 | | - href={url} |
133 | | - > |
| 159 | + href={url}> |
134 | 160 | View on Etherscan |
135 | 161 | </a> |
136 | 162 | . |
137 | 163 | </span> |
138 | 164 | </AlertText> |
139 | 165 | </div> |
140 | | -); |
| 166 | +) |
0 commit comments