Skip to content

Commit

Permalink
Merge pull request #4 from reef-chain/evm-addr
Browse files Browse the repository at this point in the history
feat: do not show evm addr if not claimed
  • Loading branch information
matjazonline authored Aug 10, 2023
2 parents 3ecf8ff + 1358d91 commit dc64bdb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/example/components/AccountSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ const accounts = [
{
name: "Test Account 2",
address: "5HW5AhtsiFhqN6K2TfZHmanh9kboyuLrCddWpNtBuu2XzVPc",
evmAddress: "0x9f704566B7A3725f05A434959bA69e97B73c5B66"
evmAddress: "0x9f704566B7A3725f05A434959bA69e97B73c5B66",
isEvmClaimed:false
},
{
name: "Test Account 3",
Expand Down
6 changes: 4 additions & 2 deletions src/ui-kit/components/organisms/AccountSelector/Account.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ export interface Props {
source?: string,
isSelected?: boolean,
onSelect?: (...args: any[]) => any,
className?: string
className?: string,
isEvmClaimed?:boolean,
}

const Account = ({
Expand All @@ -21,6 +22,7 @@ const Account = ({
evmAddress,
source,
isSelected,
isEvmClaimed,
onSelect,
className
}: Props): JSX.Element => (
Expand Down Expand Up @@ -59,7 +61,7 @@ const Account = ({
</div>

{
!!evmAddress &&
!!evmAddress && isEvmClaimed!=false &&
<div className='uik-account-selector-account__address'>
<div>{localizedStrings.reef_evm_address}: { formatAddress(evmAddress) }</div>
<CopyButton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ export type Account = {
name?: string,
address: string,
evmAddress?: string,
source?: string
source?: string,
isEvmClaimed?:boolean,
}

export type Network = 'mainnet' | 'testnet'
Expand Down Expand Up @@ -158,6 +159,7 @@ const AccountSelector = ({
address={account.address}
evmAddress={account.evmAddress}
source={account.source}
isEvmClaimed={account.isEvmClaimed}
onSelect={() => select(account)}
isSelected={isSelected(account)}
/>
Expand Down

0 comments on commit dc64bdb

Please sign in to comment.