-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2b4642f
commit e674775
Showing
6 changed files
with
119 additions
and
3 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
54 changes: 54 additions & 0 deletions
54
...s/blockchains/detail_v3/account-abstraction_v2/components/AddressPaymasterInput/index.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,54 @@ | ||
import { useAAModule } from '@/modules/blockchains/detail_v4/hook/useAAModule'; | ||
import { Flex, Image, Input } from '@chakra-ui/react'; | ||
import copy from 'copy-to-clipboard'; | ||
import toast from 'react-hot-toast'; | ||
import s from './styles.module.scss'; | ||
|
||
const AddressPaymasterInput = () => { | ||
const { aaInstalledData } = useAAModule(); | ||
|
||
const paymasterAddress = aaInstalledData?.aaPaymasterContract || ''; | ||
|
||
return ( | ||
<Flex flexDir={'row'} align={'center'} gap={'10px'}> | ||
<Flex flexDir={'column'} justify={'center'} gap={'4px'}> | ||
<Flex flexDir={'row'} align={'center'} gap={'4px'}> | ||
<Input | ||
className={s.input} | ||
mt={'0px'} | ||
type="text" | ||
fontSize={'14px'} | ||
value={paymasterAddress} | ||
borderColor={'transparent'} | ||
borderWidth={'none'} | ||
disabled={true} | ||
_focus={{ | ||
borderColor: 'transparent', | ||
}} | ||
_disabled={{ | ||
color: '#fff', | ||
}} | ||
/> | ||
<Image | ||
src={'/icons/ic-copy.svg'} | ||
w={['16px', '18px', '20px']} | ||
h={'auto'} | ||
objectFit={'contain'} | ||
_hover={{ | ||
cursor: 'pointer', | ||
opacity: 0.8, | ||
}} | ||
onClick={() => { | ||
if (paymasterAddress) { | ||
copy(paymasterAddress); | ||
toast.success('Copied successully!'); | ||
} | ||
}} | ||
/> | ||
</Flex> | ||
</Flex> | ||
</Flex> | ||
); | ||
}; | ||
|
||
export default AddressPaymasterInput; |
25 changes: 25 additions & 0 deletions
25
...ains/detail_v3/account-abstraction_v2/components/AddressPaymasterInput/styles.module.scss
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,25 @@ | ||
.input { | ||
background-color: #ffffff !important; | ||
color: #000000 !important; | ||
width: 200px !important; | ||
padding: 0 12px !important; | ||
border-radius: 99999px !important; | ||
outline: none !important; | ||
height: 22px !important; | ||
line-height: calc(20 / 14); | ||
font-family: var(--font-SFProDisplay); | ||
|
||
&::placeholder { | ||
color: #000000 !important; | ||
opacity: 0.5 !important; | ||
} | ||
|
||
&__disabled { | ||
pointer-events: none !important; | ||
cursor: not-allowed !important; | ||
} | ||
} | ||
|
||
.fontError { | ||
font-family: var(--font-SFProDisplay); | ||
} |
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