Skip to content

Commit 2c90a29

Browse files
committed
feat(components): add toastMessage prop
1 parent 76b36f1 commit 2c90a29

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

.changeset/chilly-beans-join.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@launchpad-ui/components": patch
3+
---
4+
5+
Add `toastMessage` prop to `CopyToClipboard` to allow a customizeable toast message

packages/components/src/CopyToClipboard.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ type CopyToClipboardProps = {
1111
text: string;
1212
tooltip?: string;
1313
showTooltip?: boolean;
14+
toastMessage?: string;
1415
};
1516

1617
export const CopyToClipboard = ({
@@ -19,9 +20,10 @@ export const CopyToClipboard = ({
1920
text,
2021
tooltip = 'Copy to clipboard',
2122
showTooltip = true,
23+
toastMessage = 'Copied!',
2224
}: CopyToClipboardProps) => {
2325
const handlePress = async () => {
24-
await copyToClipboard(text, 'Copied!');
26+
await copyToClipboard(text, toastMessage);
2527
if (onCopy) {
2628
onCopy();
2729
}

0 commit comments

Comments
 (0)