Skip to content

Commit

Permalink
fix: use ternary expression
Browse files Browse the repository at this point in the history
  • Loading branch information
salimtb committed Dec 5, 2024
1 parent a936f0f commit 83fe992
Showing 1 changed file with 27 additions and 29 deletions.
56 changes: 27 additions & 29 deletions ui/components/app/toast-master/toast-master.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,35 +283,33 @@ function BaseNetworkToast() {
showBaseNetworkToastPreference &&
(!isCurrentNetworkFilerSelected ||
currentNetwork?.chainId === CHAIN_IDS.BASE);
return (
showBaseNetworkToast && (
<Toast
key="switched-network-toast"
startAdornment={
<AvatarNetwork
size={AvatarAccountSize.Md}
borderColor={BorderColor.transparent}
src={BASE_TOKEN_IMAGE_URL}
name={BASE_DISPLAY_NAME}
/>
}
text={t('baseNetworkToastMessage')}
actionText={t('seeDetails')}
onActionClick={() => {
dispatch(setShowBaseNetworkToast(false));
dispatch(toggleNetworkMenu());
dispatch(
setEditedNetwork({
chainId: CHAIN_IDS.BASE,
nickname: BASE_DISPLAY_NAME,
}),
);
}}
hasLink={false}
onClose={() => dispatch(setShowBaseNetworkToast(false))}
/>
)
);
return showBaseNetworkToast ? (
<Toast
key="switched-network-toast"
startAdornment={
<AvatarNetwork
size={AvatarAccountSize.Md}
borderColor={BorderColor.transparent}
src={BASE_TOKEN_IMAGE_URL}
name={BASE_DISPLAY_NAME}
/>
}
text={t('baseNetworkToastMessage')}
actionText={t('seeDetails')}
onActionClick={() => {
dispatch(setShowBaseNetworkToast(false));
dispatch(toggleNetworkMenu());
dispatch(
setEditedNetwork({
chainId: CHAIN_IDS.BASE,
nickname: BASE_DISPLAY_NAME,
}),
);
}}
hasLink={false}
onClose={() => dispatch(setShowBaseNetworkToast(false))}
/>
) : null;
}

function NftEnablementToast() {
Expand Down

0 comments on commit 83fe992

Please sign in to comment.