Skip to content

Commit c325637

Browse files
Merge pull request #835 from sudhanshutech/ui/share
fix share button UI
2 parents f2edeb6 + d1bfe20 commit c325637

File tree

2 files changed

+46
-8
lines changed

2 files changed

+46
-8
lines changed

Diff for: src/custom/CatalogDetail/SocialSharePopper.tsx

+24-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
import { Box, IconButton, Menu, MenuItem } from '@mui/material';
22
import React, { useState } from 'react';
33
import { FacebookShareButton, LinkedinShareButton, TwitterShareButton } from 'react-share';
4+
import { Typography } from '../../base';
45
import { ChainIcon, FacebookIcon, LinkedinIcon, ShareIcon, TwitterIcon } from '../../icons';
56
import { useTheme } from '../../theme';
67
import { Pattern } from '../CustomCatalog/CustomCard';
78
import { CustomTooltip } from '../CustomTooltip';
89
import { ErrorBoundary } from '../ErrorBoundary';
9-
import { ActionButton, CopyShareIconWrapper, VisibilityChip } from './style';
10+
import {
11+
CopyShareIconWrapper,
12+
ShareButton,
13+
ShareButtonGroup,
14+
ShareSideButton,
15+
VisibilityChip
16+
} from './style';
1017

1118
interface SocialSharePopperProps {
1219
details: Pattern;
@@ -55,12 +62,22 @@ const SocialSharePopper: React.FC<SocialSharePopperProps> = ({
5562
</VisibilityChip>
5663

5764
{showShareAction ? (
58-
<CustomTooltip title="Share" placement="top" arrow>
59-
<ActionButton sx={{ borderRadius: '0.2rem', padding: '0.4rem' }} onClick={handleShare}>
60-
<ChainIcon height={'24'} width={'24'} fill={theme.palette.icon.inverse} />
61-
Share
62-
</ActionButton>
63-
</CustomTooltip>
65+
<ShareButtonGroup variant="contained">
66+
<CustomTooltip title="Change access and visibility">
67+
<ShareButton variant="contained" onClick={handleShare}>
68+
<Typography>Share</Typography>
69+
</ShareButton>
70+
</CustomTooltip>
71+
<CustomTooltip title="Copy link to design">
72+
<ShareSideButton
73+
variant="contained"
74+
size="small"
75+
onClick={() => handleCopyUrl(cleanedType, details?.name, details?.id)}
76+
>
77+
<ChainIcon height={'24'} width={'24'} fill={theme.palette.icon.inverse} />
78+
</ShareSideButton>
79+
</CustomTooltip>
80+
</ShareButtonGroup>
6481
) : (
6582
<>
6683
{details?.visibility !== 'private' && (

Diff for: src/custom/CatalogDetail/style.tsx

+22-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Link, ListItemButton, Paper, Typography } from '../../base';
1+
import { Button, ButtonGroup, Link, ListItemButton, Paper, Typography } from '../../base';
22
import { styled } from '../../theme';
33
import { Theme } from './types';
44

@@ -265,3 +265,24 @@ export const RedirectLink = styled(Link)(({ theme }) => ({
265265
textDecoration: 'none',
266266
cursor: 'pointer'
267267
}));
268+
269+
export const ShareButtonGroup = styled(ButtonGroup)({
270+
boxShadow: 'none',
271+
border: 'none',
272+
outline: 'none',
273+
height: '76%'
274+
});
275+
276+
export const ShareButton = styled(Button)(({ theme }) => ({
277+
backgroundColor: theme.palette.background.brand?.default,
278+
color: 'white',
279+
border: 'none',
280+
borderRadius: '0.5rem 0px 0px 0.5rem'
281+
}));
282+
283+
export const ShareSideButton = styled(Button)(({ theme }) => ({
284+
backgroundColor: theme.palette.background.brand?.default,
285+
color: 'white',
286+
border: 'none',
287+
borderRadius: '0px 0.5rem 0.5rem 0px'
288+
}));

0 commit comments

Comments
 (0)