Skip to content

Virtual whiteboard for sketching hand-drawn like diagrams

feat: Add export info on copy PNG to clipboard toast message (#3159)

Arunf295ba98c55d
diff --git a/src/actions/actionClipboard.tsx b/src/actions/actionClipboard.tsx
index 70e4af17d5..fdbe41dc7a 100644
--- a/src/actions/actionClipboard.tsx
+++ b/src/actions/actionClipboard.tsx
@@ -94,7 +94,14 @@ export const actionCopyAsPng = register({
return {
appState: {
...appState,
- toastMessage: t("toast.copyToClipboardAsPng"),
+ toastMessage: t("toast.copyToClipboardAsPng", {
+ exportSelection: selectedElements.length
+ ? t("toast.selection")
+ : t("toast.canvas"),
+ exportColorScheme: appState.exportWithDarkMode
+ ? t("buttons.darkMode")
+ : t("buttons.lightMode"),
+ }),
},
commitToHistory: false,
};
diff --git a/src/components/Toast.scss b/src/components/Toast.scss
index 4cf24115c2..63d949a6b7 100644
--- a/src/components/Toast.scss
+++ b/src/components/Toast.scss
@@ -19,6 +19,7 @@
.Toast__message {
color: var(--popup-text-color);
+ white-space: pre-wrap;
}
@keyframes fade-in {
diff --git a/src/locales/en.json b/src/locales/en.json
index 32687080b2..3bd0c85279 100644
--- a/src/locales/en.json
+++ b/src/locales/en.json
@@ -245,8 +245,10 @@
"toast": {
"copyStyles": "Copied styles.",
"copyToClipboard": "Copied to clipboard.",
- "copyToClipboardAsPng": "Copied to clipboard as PNG.",
+ "copyToClipboardAsPng": "Copied {{exportSelection}} to clipboard as PNG\n({{exportColorScheme}})",
"fileSaved": "File saved.",
- "fileSavedToFilename": "Saved to {filename}"
+ "fileSavedToFilename": "Saved to {filename}",
+ "canvas": "canvas",
+ "selection": "selection"
}
}