-
Notifications
You must be signed in to change notification settings - Fork 11
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
Add tips modal and text copies #31
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,23 @@ | ||
import React from "react"; | ||
import React, { useState } from "react"; | ||
import Image from "next/image"; | ||
import styles from "./recoveryProcess.module.css"; | ||
import { CustomPortal } from "~~/components/CustomPortal/CustomPortal"; | ||
import { InputBase } from "~~/components/scaffold-eth"; | ||
import { useShowError } from "~~/hooks/flashbotRecoveryBundle/useShowError"; | ||
import ClockSvg from "~~/public/assets/flashbotRecovery/clock.svg"; | ||
import LogoSvg from "~~/public/assets/flashbotRecovery/logo.svg"; | ||
import SuccessSvg from "~~/public/assets/flashbotRecovery/success.svg"; | ||
import TelegramSvg from "~~/public/assets/flashbotRecovery/telegram.svg"; | ||
import TipsSvg from "~~/public/assets/flashbotRecovery/tips.svg"; | ||
import TwitterSvg from "~~/public/assets/flashbotRecovery/twitter.svg"; | ||
import VideoSvg from "~~/public/assets/flashbotRecovery/video.svg"; | ||
import { RecoveryProcessStatus } from "~~/types/enums"; | ||
|
||
interface IProps { | ||
recoveryStatus: RecoveryProcessStatus; | ||
startSigning: () => void; | ||
finishProcess: () => void; | ||
showTipsModal: () => void; | ||
startProcess: () => void; | ||
connectedAddress: string | undefined; | ||
safeAddress: string; | ||
|
@@ -23,19 +30,24 @@ export const RecoveryProcess = ({ | |
startSigning, | ||
startProcess, | ||
finishProcess, | ||
showTipsModal, | ||
blockCountdown, | ||
connectedAddress, | ||
safeAddress, | ||
hackedAddress, | ||
}: IProps) => { | ||
const {showError} = useShowError(); | ||
const { showError } = useShowError(); | ||
const [donationValue, setDonationValue] = useState<string>(""); | ||
|
||
if (recoveryStatus == RecoveryProcessStatus.INITIAL) { | ||
return <></>; | ||
} | ||
|
||
if (recoveryStatus == RecoveryProcessStatus.GAS_PAID) { | ||
showError("you already covered the gas. If you're in a confussy situation, clear cookies and refresh page."); | ||
showError( | ||
"It appears that gas costs have been covered for this action. If you're encountering any confusion, consider clearing your cookies and refreshing the page.", | ||
); | ||
//TODO provide clear data mechanism title "Gas Covered Already" | ||
return; | ||
} | ||
|
||
|
@@ -44,10 +56,11 @@ export const RecoveryProcess = ({ | |
<CustomPortal | ||
title={"Clear cache"} | ||
description={ | ||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vulputate libero et velit interdum, ac aliquet odio mattis. Class aptent taciti." | ||
"We've encountered an issue due to outdated cached data. Please clear your app's cache to resolve this error." | ||
} | ||
image={VideoSvg} | ||
/> | ||
//TODO provide clear data mechanism | ||
); | ||
} | ||
|
||
|
@@ -56,7 +69,7 @@ export const RecoveryProcess = ({ | |
<CustomPortal | ||
title={"Switch to safe address"} | ||
description={ | ||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vulputate libero et velit interdum, ac aliquet odio mattis. Class aptent taciti." | ||
"To ensure a secure asset transfer, switch to your safe wallet. This step guarantees the safe retrieval of your assets without any further risks." | ||
} | ||
button={{ | ||
text: "Continue", | ||
|
@@ -72,7 +85,7 @@ export const RecoveryProcess = ({ | |
return ( | ||
<CustomPortal | ||
title={"Switching Network"} | ||
description={"Switch to personal Flashbot RPC network to prepare the transacion you will pay"} | ||
description={"Allow us to create and switch to your personal RPC network to prepare the transaction bundle"} | ||
image={VideoSvg} | ||
/> | ||
); | ||
|
@@ -82,7 +95,9 @@ export const RecoveryProcess = ({ | |
return ( | ||
<CustomPortal | ||
title={"Increase the gas"} | ||
description={"Switch to personal Flashbot RPC network to prepare the transacion you will pay"} | ||
description={ | ||
"We recommend set a hight gas to ensure a successful asset recovery. Your increased gas allocation will facilitate the seamless completion of the transaction." | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "We recommend to use a custom gas price to ensure successful asset recovery." |
||
} | ||
image={VideoSvg} | ||
/> | ||
); | ||
|
@@ -91,9 +106,9 @@ export const RecoveryProcess = ({ | |
if (recoveryStatus == RecoveryProcessStatus.SWITCH_TO_HACKED_ACCOUNT) { | ||
return ( | ||
<CustomPortal | ||
title={"Switch to hacked address"} | ||
title={"Switch to Hacked Address"} | ||
description={ | ||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vulputate libero et velit interdum, ac aliquet odio mattis. Class aptent taciti." | ||
"To proceed with asset recovery, switch to the compromised address in your wallet. This step is essential to verify ownership and continue with the recovery process." | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "To proceed with asset recovery, switch to the compromised wallet. This step is essential to verify ownership and continue with the recovery process." |
||
} | ||
button={{ | ||
text: "Continue", | ||
|
@@ -114,7 +129,7 @@ export const RecoveryProcess = ({ | |
<CustomPortal | ||
title={"Sign each transaction"} | ||
description={ | ||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vulputate libero et velit interdum, ac aliquet odio mattis. Class aptent taciti." | ||
"Each bundled transaction requires your individual signature to verify and complete the asset recovery process. Please sign each transaction as they appear." | ||
} | ||
image={LogoSvg} | ||
/> | ||
|
@@ -124,9 +139,9 @@ export const RecoveryProcess = ({ | |
if (recoveryStatus == RecoveryProcessStatus.LISTEN_BUNDLE) { | ||
return ( | ||
<CustomPortal | ||
title={"Wait without refreshing the page"} | ||
title={"Stay Patient, Stay Secure"} | ||
description={ | ||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vulputate libero et velit interdum, ac aliquet odio matt" | ||
"Your asset recovery is in progress. To ensure a successful retrieval and accurate transaction completion stay on the page." | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would remove "and accurate transaction completion". |
||
} | ||
image={ClockSvg} | ||
indicator={blockCountdown} | ||
|
@@ -139,15 +154,57 @@ export const RecoveryProcess = ({ | |
<CustomPortal | ||
title={"Your assets have been recovered!"} | ||
description={ | ||
"If we have helped you please, share the tool and if you want let us a tip to continue contributing" | ||
"Check your safe wallet for your retrieved assets. Share your journey and consider to support us with a tip to continue serving the crypto community." | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "Check your safe wallet for your retrieved assets. If you were helped by this tool, please consider sharing this on social media and if you are feeling generous, consider giving us a small tip so we can continue providing helpful tools to the crypto community." |
||
} | ||
button={{ | ||
text: "Continue", | ||
disabled: connectedAddress !== hackedAddress, | ||
action: () => finishProcess(), | ||
text: "Finish", | ||
disabled: false, | ||
action: () => showTipsModal(), | ||
}} | ||
image={SuccessSvg} | ||
/> | ||
> | ||
<div className={styles.shareButtons}> | ||
<a | ||
href="https://twitter.com/intent/tweet?url=https://yourwebsite.com&text=I%20have%20been%20helped%20to%20recover%20my%20assets%20with%20this%20amazing%20tool" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
<Image width={40} src={TwitterSvg} alt={""} /> | ||
</a> | ||
<a | ||
href="https://t.me/share/url?url=https://yourwebsite.com&text=I%20have%20been%20helped%20to%20recover%20my%20assets%20with%20this%20amazing%20tool" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
<Image width={40} src={TelegramSvg} alt={""} /> | ||
</a> | ||
</div> | ||
</CustomPortal> | ||
); | ||
} | ||
if (recoveryStatus !== RecoveryProcessStatus.DONATE) { | ||
return ( | ||
<CustomPortal | ||
title={"Support Our Mission"} | ||
description={ | ||
"Your contribution can significantly impact our mission to provide safe and free tools that empower the community." | ||
} | ||
button={{ | ||
text: "Finish", | ||
disabled: false, | ||
action: () => finishProcess(), | ||
}} | ||
image={TipsSvg} | ||
> | ||
<div className={styles.inputContainer}> | ||
<label className={styles.label} htmlFor="tip"> | ||
Tip | ||
</label> | ||
<div className="mt-2" /> | ||
<InputBase name="tip" placeholder="0.0" value={donationValue} onChange={setDonationValue} /> | ||
<span className={`${styles.eth} text-base-100`}>ETH</span> | ||
</div> | ||
</CustomPortal> | ||
); | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
.shareButtons { | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
} | ||
.shareButtons a { | ||
margin: 0 10px; | ||
} | ||
.inputContainer{ | ||
width: 80%; | ||
position: relative; | ||
} | ||
.inputContainer > div { | ||
border-radius: 4px; | ||
padding: 4px; | ||
} | ||
|
||
.inputContainer label { | ||
font-size: 16px; | ||
font-style: normal; | ||
font-weight: 600; | ||
line-height: normal; | ||
margin-bottom: 12px; | ||
} | ||
.eth{ | ||
position: absolute; | ||
bottom: 12px; | ||
right: 14px; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The user doesn't need to know that we are creating the personal RPC and they don't need to know about bundles. Maybe we could simplify this while also giving them some safety assurance by linking to flashbots.
Proposed wording: "Now you are being switched to a new Flashbots(link to https://www.flashbots.net/) RPC. This will enable you to send transactions that are undetected by the hacker until after your assets have been recovered. Please approve the network change in your wallet after you read over the RPC details and feel safe moving forward."
It's a little wordy but I feel like it explains just enough to help the user know what is happening and also buys some clout by linking to a reputable site. Users will probably be on high alert after just being hacked so we want to ease their fears as much as possible.