Improve navigator message

This commit is contained in:
dominik-zeglen 2019-11-25 17:53:10 +01:00
parent 54feb60950
commit 349c5fbdfb
3 changed files with 17 additions and 7 deletions

View file

@ -52,11 +52,20 @@ const Navigator: React.FC = () => {
if (cmp(APP_VERSION, "2.1.0") !== 1 && !notifiedAboutNavigator) {
notify({
text: intl.formatMessage({
autohide: null,
text: intl.formatMessage(
{
defaultMessage:
"Our new feature to help you with your daily task. Run Navigator using Ctrl+K shortcut. (Cmd+K for Mac users)",
"Our new feature to help you with your daily tasks. Run Navigator using {keyboardShortcut} shortcut.",
description: "navigator notification"
}),
},
{
keyboardShortcut:
navigator.platform.toLowerCase().indexOf("mac") >= 0
? "⌘+K"
: "Ctrl+K"
}
),
title: intl.formatMessage({
defaultMessage: "Navigator is here to help",
description: "navigator notification title"

View file

@ -56,7 +56,7 @@ export class MessageManager extends React.Component<{}, MessageManagerState> {
};
render() {
const { title, text, key, onUndo } = this.state.message;
const { autohide = 3000, title, text, key, onUndo } = this.state.message;
return (
<>
<Snackbar
@ -66,7 +66,7 @@ export class MessageManager extends React.Component<{}, MessageManagerState> {
vertical: "top"
}}
open={this.state.opened}
autoHideDuration={3000}
autoHideDuration={autohide}
onClose={this.handleClose}
onExited={this.handleExited}
ContentProps={{

View file

@ -1,6 +1,7 @@
import { createContext } from "react";
export interface IMessage {
autohide?: number;
title?: string;
text: string;
onUndo?: () => void;