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) { if (cmp(APP_VERSION, "2.1.0") !== 1 && !notifiedAboutNavigator) {
notify({ notify({
text: intl.formatMessage({ autohide: null,
text: intl.formatMessage(
{
defaultMessage: 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" description: "navigator notification"
}), },
{
keyboardShortcut:
navigator.platform.toLowerCase().indexOf("mac") >= 0
? "⌘+K"
: "Ctrl+K"
}
),
title: intl.formatMessage({ title: intl.formatMessage({
defaultMessage: "Navigator is here to help", defaultMessage: "Navigator is here to help",
description: "navigator notification title" description: "navigator notification title"

View file

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

View file

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