-
Notifications
You must be signed in to change notification settings - Fork 367
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add depositTo and withdrawTo functionality for smart contract wallets (…
…#9) * add depositTo and withdrawTo functionality for smart contract wallets * tx list updates * compliance check * fix prettier * fix prettier & address nits
- Loading branch information
1 parent
54be786
commit 71b9ec3
Showing
15 changed files
with
310 additions
and
73 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions
35
apps/bridge/src/components/BridgeToInput/BridgeToInput.tsx
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,35 @@ | ||
import { Dispatch, SetStateAction } from 'react'; | ||
import Image from 'next/image'; | ||
|
||
type BridgeToInputProps = { | ||
bridgeTo: string; | ||
setBridgeTo: Dispatch<SetStateAction<string>>; | ||
action: 'deposit' | 'withdraw'; | ||
}; | ||
|
||
export function BridgeToInput({ bridgeTo, setBridgeTo, action }: BridgeToInputProps) { | ||
function handleChangeBridgeTo(e: { target: { value: SetStateAction<string> } }) { | ||
setBridgeTo(e.target.value); | ||
} | ||
|
||
return ( | ||
<div className="flex flex-col p-6"> | ||
<div className="flex flex-row items-center space-x-2 mb-1"> | ||
<span className="font-sans text-sm font-medium text-white">{action === 'deposit' ? 'Deposit to' : 'Withdraw to'}</span> | ||
<div className="has-tooltip"> | ||
<span className="tooltip -mt-10 ml-6 rounded-lg bg-cds-background-gray-90 p-2 text-black shadow-lg"> | ||
Only send funds on networks supported by your wallet provider if it is a smart contract | ||
wallet or there may be permanent loss of funds. | ||
</span> | ||
<Image alt="tooltip" src="/icons/question-mark-circled.svg" width={16} height={16} /> | ||
</div> | ||
</div> | ||
<input | ||
className="bg-transparent font-sans text-md text-white outline-none max-[640px]:grow sm:text-xl border border-cds-background-gray-60 p-4 rounded min-[640px]:w-96" | ||
placeholder="Wallet address" | ||
value={bridgeTo} | ||
onChange={handleChangeBridgeTo} | ||
/> | ||
</div> | ||
); | ||
} |
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.