Migrate to a monorepo structure (#2909)
This commit is contained in:
@ -0,0 +1,52 @@
|
||||
import { useTheme } from '@emotion/react';
|
||||
import styled from '@emotion/styled';
|
||||
|
||||
import { IconCopy, IconLink } from '@/ui/display/icon';
|
||||
import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';
|
||||
import { Button } from '@/ui/input/button/components/Button';
|
||||
import { TextInput } from '@/ui/input/components/TextInput';
|
||||
|
||||
const StyledContainer = styled.div`
|
||||
align-items: center;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
`;
|
||||
|
||||
const StyledLinkContainer = styled.div`
|
||||
flex: 1;
|
||||
margin-right: ${({ theme }) => theme.spacing(2)};
|
||||
`;
|
||||
|
||||
type WorkspaceInviteLinkProps = {
|
||||
inviteLink: string;
|
||||
};
|
||||
|
||||
export const WorkspaceInviteLink = ({
|
||||
inviteLink,
|
||||
}: WorkspaceInviteLinkProps) => {
|
||||
const theme = useTheme();
|
||||
|
||||
const { enqueueSnackBar } = useSnackBar();
|
||||
|
||||
return (
|
||||
<StyledContainer>
|
||||
<StyledLinkContainer>
|
||||
<TextInput value={inviteLink} disabled fullWidth />
|
||||
</StyledLinkContainer>
|
||||
<Button
|
||||
Icon={IconLink}
|
||||
variant="primary"
|
||||
accent="blue"
|
||||
title="Copy link"
|
||||
onClick={() => {
|
||||
enqueueSnackBar('Link copied to clipboard', {
|
||||
variant: 'success',
|
||||
icon: <IconCopy size={theme.icon.size.md} />,
|
||||
duration: 2000,
|
||||
});
|
||||
navigator.clipboard.writeText(inviteLink);
|
||||
}}
|
||||
/>
|
||||
</StyledContainer>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user