Improve navigator message
This commit is contained in:
parent
54feb60950
commit
349c5fbdfb
3 changed files with 17 additions and 7 deletions
|
@ -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,
|
||||||
defaultMessage:
|
text: intl.formatMessage(
|
||||||
"Our new feature to help you with your daily task. Run Navigator using Ctrl+K shortcut. (Cmd+K for Mac users)",
|
{
|
||||||
description: "navigator notification"
|
defaultMessage:
|
||||||
}),
|
"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({
|
title: intl.formatMessage({
|
||||||
defaultMessage: "Navigator is here to help",
|
defaultMessage: "Navigator is here to help",
|
||||||
description: "navigator notification title"
|
description: "navigator notification title"
|
||||||
|
|
|
@ -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={{
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue