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

Co-authored-by: dwelle <luzar.david@gmail.com>
This commit is contained in:
Arun 2021-03-03 17:45:10 +05:30 committed by GitHub
parent 91eb8834e8
commit f295ba98c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 3 deletions

View File

@ -94,7 +94,14 @@ export const actionCopyAsPng = register({
return { return {
appState: { appState: {
...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, commitToHistory: false,
}; };

View File

@ -19,6 +19,7 @@
.Toast__message { .Toast__message {
color: var(--popup-text-color); color: var(--popup-text-color);
white-space: pre-wrap;
} }
@keyframes fade-in { @keyframes fade-in {

View File

@ -245,8 +245,10 @@
"toast": { "toast": {
"copyStyles": "Copied styles.", "copyStyles": "Copied styles.",
"copyToClipboard": "Copied to clipboard.", "copyToClipboard": "Copied to clipboard.",
"copyToClipboardAsPng": "Copied to clipboard as PNG.", "copyToClipboardAsPng": "Copied {{exportSelection}} to clipboard as PNG\n({{exportColorScheme}})",
"fileSaved": "File saved.", "fileSaved": "File saved.",
"fileSavedToFilename": "Saved to {filename}" "fileSavedToFilename": "Saved to {filename}",
"canvas": "canvas",
"selection": "selection"
} }
} }