Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix uniswap modal ui overlap #1277

Merged
merged 1 commit into from
Oct 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 52 additions & 52 deletions src/components/FaucetInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { appConfig } from 'config';
import { device } from 'config/Globals';
import { useEffect, useState } from 'react';
import { getHasEnoughPushToken } from 'helpers';
import useModalBlur, {MODAL_POSITION} from 'hooks/useModalBlur';
import useModalBlur, { MODAL_POSITION } from 'hooks/useModalBlur';
import { UniswapWidgetModal } from './UniswapWidget';

type FaucetInfoType = {
Expand Down Expand Up @@ -49,70 +49,70 @@ const FaucetInfo = ({ onMintPushToken, noOfPushTokensToCheck, containerProps }:
useEffect(() => {
(async () => {
await checkSetFaucetVisibility();
})()
})();
}, [noOfPushTokensToCheck]);

return (
<Container>
{isFaucetVisible ? (
<TextSpace style={containerProps}>
<InfoText>
{isProd
? 'You do not have sufficient PUSH Tokens. Swap to add more PUSH.'
: 'Follow these steps to ensure you have enough Testnet Push to proceed.'}
</InfoText>
{isProd ? (
<SwapTokensButton onClick={showUniswapWidgetModal}>
<ImageV2
width="12px"
height="12px"
margin="0 0.5rem 0 0"
src={swapIcon}
/>
<ButtonLabel>Swap Tokens for PUSH</ButtonLabel>
</SwapTokensButton>
) : (
<ItemBody>
<AnchorLink
href="https://chaindrop.org/?chainid=5&token=0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
target="_blank"
>
<NumberIcon>1</NumberIcon>
<PoolShare>Goerli ETH Faucet</PoolShare>
</AnchorLink>
<Minter
onClick={async () => {
await onMintPushToken(1000);
await checkSetFaucetVisibility();
}}
>
<NumberIcon>2</NumberIcon>
<PoolShare>Get Testnet PUSH</PoolShare>
</Minter>
</ItemBody>
)}
</TextSpace>
) : (
''
)}
{isUniswapWidgetModalOpen &&
<>
<Container>
{isFaucetVisible ? (
<TextSpace style={containerProps}>
<InfoText>
{isProd
? 'You do not have sufficient PUSH Tokens. Swap to add more PUSH.'
: 'Follow these steps to ensure you have enough Testnet Push to proceed.'}
</InfoText>
{isProd ? (
<SwapTokensButton onClick={showUniswapWidgetModal}>
<ImageV2
width="12px"
height="12px"
margin="0 0.5rem 0 0"
src={swapIcon}
/>
<ButtonLabel>Swap Tokens for PUSH</ButtonLabel>
</SwapTokensButton>
) : (
<ItemBody>
<AnchorLink
href="https://chaindrop.org/?chainid=5&token=0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee"
target="_blank"
>
<NumberIcon>1</NumberIcon>
<PoolShare>Goerli ETH Faucet</PoolShare>
</AnchorLink>
<Minter
onClick={async () => {
await onMintPushToken(1000);
await checkSetFaucetVisibility();
}}
>
<NumberIcon>2</NumberIcon>
<PoolShare>Get Testnet PUSH</PoolShare>
</Minter>
</ItemBody>
)}
</TextSpace>
) : (
''
)}
</Container>
{isUniswapWidgetModalOpen && (
<UniswapWidgetModalComponent
InnerComponent={UniswapWidgetModal}
InnerComponentProps={{ defaultPushTokenAmount: noOfPushTokensToCheck }}
modalPadding="0px"
modalPosition={MODAL_POSITION.ON_ROOT}
/>
}
</Container>


)}
</>
);
};

const Container = styled.div`
width:100%;
width: 100%;
transform: translateY(-40px);
`
`;

const TextSpace = styled.div`
box-sizing: border-box;
Expand All @@ -125,7 +125,7 @@ const TextSpace = styled.div`
background: #f4dcea;
border-radius: 0px 0px 28px 28px;
padding: 32px 32px 20px 32px;
margin-top:24px;
margin-top: 24px;
margin-bottom: -40px;

@media ${device.tablet} {
Expand Down
Loading