-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into user-guide-images
- Loading branch information
Showing
17 changed files
with
189 additions
and
54 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
...es/twenty-front/src/modules/object-record/record-field/components/LightCopyIconButton.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { useTheme } from '@emotion/react'; | ||
import styled from '@emotion/styled'; | ||
import { IconCopy } from 'twenty-ui'; | ||
|
||
import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar'; | ||
import { LightIconButton } from '@/ui/input/button/components/LightIconButton'; | ||
|
||
const StyledButtonContainer = styled.div` | ||
padding: 0 ${({ theme }) => theme.spacing(1)}; | ||
`; | ||
|
||
export type LightCopyIconButtonProps = { | ||
copyText: string; | ||
}; | ||
|
||
export const LightCopyIconButton = ({ copyText }: LightCopyIconButtonProps) => { | ||
const { enqueueSnackBar } = useSnackBar(); | ||
const theme = useTheme(); | ||
|
||
return ( | ||
<StyledButtonContainer> | ||
<LightIconButton | ||
className="copy-button" | ||
Icon={IconCopy} | ||
onClick={() => { | ||
enqueueSnackBar('Text copied to clipboard', { | ||
variant: 'success', | ||
icon: <IconCopy size={theme.icon.size.md} />, | ||
duration: 2000, | ||
}); | ||
navigator.clipboard.writeText(copyText); | ||
}} | ||
aria-label="Copy to Clipboard" | ||
/> | ||
</StyledButtonContainer> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
packages/twenty-front/src/modules/ui/field/input/components/FieldTextAreaOverlay.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.