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:
		@@ -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}` : '')};
 | 
			
		||||
    }
 | 
			
		||||
`;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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"
 | 
			
		||||
 
 | 
			
		||||
@@ -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) {
 | 
			
		||||
        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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user