-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'testnet' into feat/update-sid.js
- Loading branch information
Showing
13 changed files
with
265 additions
and
52 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
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,47 @@ | ||
import React, { useState } from 'react'; | ||
import CopyIcon from "@components/UI/iconsComponents/icons/copyIcon"; | ||
import VerifiedIcon from "@components/UI/iconsComponents/icons/verifiedIcon"; | ||
import Typography from "@components/UI/typography/typography"; | ||
import { TEXT_TYPE } from "@constants/typography"; | ||
|
||
interface CopyAddressProps { | ||
address: string; | ||
className?: string; | ||
iconSize?: string; | ||
wallet:boolean; | ||
} | ||
|
||
const CopyAddress: React.FC<CopyAddressProps> = ({ address, className, iconSize = "24",wallet=false }) => { | ||
const [copied, setCopied] = useState(false); | ||
|
||
|
||
const copyAddress = (e: React.MouseEvent<HTMLButtonElement>) => { | ||
e.stopPropagation(); | ||
setCopied(true); | ||
navigator.clipboard.writeText(address ?? ""); | ||
setTimeout(() => { | ||
setCopied(false); | ||
}, 1500); | ||
}; | ||
|
||
return ( | ||
<button className={className} onClick={copyAddress}> | ||
{!copied ? ( | ||
<CopyIcon width={iconSize} color={wallet ? undefined : "#F4FAFF"} /> | ||
) : ( | ||
<VerifiedIcon width={iconSize} /> | ||
)} | ||
{wallet && ( | ||
<Typography | ||
color="secondary500" | ||
type={TEXT_TYPE.BUTTON_SMALL} | ||
style={{ textTransform: 'none', }} | ||
> | ||
Copy Address | ||
</Typography> | ||
)} | ||
</button> | ||
); | ||
}; | ||
|
||
export default CopyAddress; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import React, { FunctionComponent } from "react"; | ||
import TextInput from "../textInput"; | ||
|
||
type ContractStepProps = { | ||
handleTasksInputChange: ( | ||
e: React.ChangeEvent<HTMLInputElement>, | ||
index: number | ||
) => void; | ||
step: StepMap; | ||
index: number; | ||
}; | ||
|
||
const ContractStep: FunctionComponent<ContractStepProps> = ({ | ||
handleTasksInputChange, | ||
step, | ||
index, | ||
}) => { | ||
return ( | ||
<div className="flex flex-col gap-4 pt-2"> | ||
<TextInput | ||
onChange={(e) => handleTasksInputChange(e, index)} | ||
value={step.data.contract_name || ""} | ||
name="contract_name" | ||
label="Name" | ||
placeholder="Name" | ||
/> | ||
<TextInput | ||
onChange={(e) => handleTasksInputChange(e, index)} | ||
value={step.data.contract_desc || ""} | ||
name="contract_desc" | ||
label="Description" | ||
placeholder="Description" | ||
multiline={4} | ||
/> | ||
<TextInput | ||
onChange={(e) => handleTasksInputChange(e, index)} | ||
value={step.data.contract_href || ""} | ||
name="contract_href" | ||
label="URL" | ||
placeholder="URL" | ||
/> | ||
<TextInput | ||
onChange={(e) => handleTasksInputChange(e, index)} | ||
value={step.data.contract_cta || ""} | ||
name="contract_cta" | ||
label="CTA" | ||
placeholder="CTA" | ||
/> | ||
<TextInput | ||
onChange={(e) => handleTasksInputChange(e, index)} | ||
value={step.data.contract_calls || ""} | ||
name="contract_calls" | ||
label="Calls (JSON)" | ||
placeholder='e.g.: [{ "contract": "0x...", "entry_point": "transfer", "call_data": ["0x..."], "regex": "..." }]' | ||
multiline={4} | ||
/> | ||
</div> | ||
); | ||
}; | ||
|
||
export default ContractStep; |
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.