Merge pull request #1785 from 0xProject/feature/instant/erc721-screen-support

Add overflow scroll to instant overlay & fix display bug
This commit is contained in:
Francesco Agosti
2019-04-22 20:39:15 -05:00
committed by GitHub
3 changed files with 11 additions and 5 deletions

View File

@@ -9,6 +9,7 @@ export interface FlexProps {
align?: 'flex-start' | 'center' | 'space-around' | 'space-between' | 'space-evenly' | 'flex-end';
width?: MediaChoice;
height?: MediaChoice;
overflow?: string;
backgroundColor?: ColorOption;
inline?: boolean;
flexGrow?: number | string;
@@ -25,6 +26,7 @@ export const Flex = styled.div<FlexProps>`
background-color: ${props => (props.backgroundColor ? props.theme[props.backgroundColor] : 'none')};
${props => (props.width ? stylesForMedia('width', props.width) : '')}
${props => (props.height ? stylesForMedia('height', props.height) : '')}
${props => (props.overflow ? `overflow: ${props.overflow}` : '')};
}
`;

View File

@@ -20,7 +20,7 @@ export const ZeroExInstantOverlay: React.StatelessComponent<ZeroExInstantOverlay
return (
<ZeroExInstantProvider {...rest}>
<Overlay zIndex={zIndex} className={OVERLAY_DIV_CLASS}>
<Flex height="100vh">
<Flex height="100vh" overflow="scroll">
<Container
className={OVERLAY_CLOSE_BUTTON_DIV_CLASS}
position="absolute"

View File

@@ -57,10 +57,14 @@ export class ZeroExInstantProvider extends React.PureComponent<ZeroExInstantProv
networkId,
);
let selectedAssetUnitAmount: BigNumber | undefined = new BigNumber(1);
if (selectedAsset !== undefined && selectedAsset.metaData.assetProxyId === AssetProxyId.ERC20) {
selectedAssetUnitAmount =
props.defaultAssetBuyAmount === undefined ? undefined : new BigNumber(props.defaultAssetBuyAmount);
let selectedAssetUnitAmount: BigNumber | undefined;
if (selectedAsset !== undefined) {
if (selectedAsset.metaData.assetProxyId === AssetProxyId.ERC20) {
selectedAssetUnitAmount =
props.defaultAssetBuyAmount === undefined ? undefined : new BigNumber(props.defaultAssetBuyAmount);
} else if (selectedAsset.metaData.assetProxyId === AssetProxyId.ERC721) {
selectedAssetUnitAmount = new BigNumber(1);
}
}
// construct the final state