remove duplicate code
This commit is contained in:
parent
b9dc623170
commit
5272e13f45
|
@ -29,28 +29,14 @@ const CopyToClipboardButton: React.FC<IProps> = (props) => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<MediaQuery minWidth={MEDIA_QUERY_DESKTOP_STARTS}>
|
{show &&
|
||||||
{show &&
|
<Box p='4' mx={{ base: 0, md: 4 }}>
|
||||||
<Card backgroundColor={'transparent'} mt={{ base: 0, md: 4 }} mb={{ base: 0, md: 4 }} mx={{ base: 4, md: 4 }}>
|
<Flex justifyContent={'flex-end'} alignItems={'center'}>
|
||||||
<Box p='4'>
|
<Button bgColor={showSuccess ? 'green.400' : ''} onClick={handleClick}>
|
||||||
<Flex alignItems={'center'}>
|
{showSuccess ? t('search.copy_success') : t('search.copy_search_link')} <Icon as={IoShareSocialOutline} />
|
||||||
<Button bgColor={showSuccess ? 'green.400' : ''} onClick={handleClick}>
|
</Button>
|
||||||
{showSuccess ? t('search.copy_success'): t('search.copy_search_link')} <Icon as={IoShareSocialOutline} />
|
</Flex>
|
||||||
</Button>
|
</Box>}
|
||||||
</Flex>
|
|
||||||
</Box>
|
|
||||||
</Card>}
|
|
||||||
</MediaQuery>
|
|
||||||
<MediaQuery maxWidth={MEDIA_QUERY_MOBILE_ENDS}>
|
|
||||||
{show &&
|
|
||||||
<Box p='4'>
|
|
||||||
<Flex alignItems={'center'}>
|
|
||||||
<Button bgColor={showSuccess ? 'green.400' : ''} onClick={handleClick}>
|
|
||||||
{showSuccess ? t('search.copy_success') : t('search.copy_search_link')} <Icon as={IoShareSocialOutline} />
|
|
||||||
</Button>
|
|
||||||
</Flex>
|
|
||||||
</Box>}
|
|
||||||
</MediaQuery>
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue