Skip to content

Commit

Permalink
fix: handle escrow tipping / reveal content with DeBio Network (#1712)
Browse files Browse the repository at this point in the history
  • Loading branch information
abdulhakim2902 authored Feb 12, 2023
1 parent d1e4908 commit 62614ca
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/components/ExclusiveContentCreate/CurrencyOption.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export type CurrencyOptionProps = {
currentCurrency: Currency;
balances: Currency[];
isMobile?: boolean;
handleSelect: (Currency) => void;
handleSelect: (currency: Currency) => void;
};

export const CurrencyOption: React.FC<CurrencyOptionProps> = ({
Expand All @@ -47,6 +47,11 @@ export const CurrencyOption: React.FC<CurrencyOptionProps> = ({
if (balance.networkId === 'myriad' || balance.networkId === 'debio') return balance;
});

const onSelectBalance = (currency: Currency) => {
handleClose();
handleSelect(currency);
};

return (
<>
<Button
Expand Down Expand Up @@ -85,15 +90,8 @@ export const CurrencyOption: React.FC<CurrencyOptionProps> = ({
{filterCurrency.map(balance => (
<MenuItem
key={balance.id}
style={{filter: balance.networkId !== 'myriad' ? 'grayscale(1)' : 'grayscale(0)'}}
onClick={
balance.networkId === 'myriad'
? () => {
handleClose();
handleSelect(balance);
}
: null
}>
style={{filter: 'grayscale(0)'}}
onClick={() => onSelectBalance(balance)}>
<ListItemIcon style={{minWidth: '36px'}}>
<Avatar
name={balance.id}
Expand Down

0 comments on commit 62614ca

Please sign in to comment.