Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve navigator message
Browse files Browse the repository at this point in the history
dominik-zeglen committed Nov 25, 2019
1 parent 54feb60 commit ff7c721
Showing 3 changed files with 17 additions and 7 deletions.
19 changes: 14 additions & 5 deletions src/components/Navigator/Navigator.tsx
Original file line number Diff line number Diff line change
@@ -52,11 +52,20 @@ const Navigator: React.FC = () => {

if (cmp(APP_VERSION, "2.1.0") !== 1 && !notifiedAboutNavigator) {
notify({
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)",
description: "navigator notification"
}),
autohide: null,
text: intl.formatMessage(
{
defaultMessage:
"Our new feature to help you with your daily task. 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"
4 changes: 2 additions & 2 deletions src/components/messages/MessageManager.tsx
Original file line number Diff line number Diff line change
@@ -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={{
1 change: 1 addition & 0 deletions src/components/messages/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { createContext } from "react";

export interface IMessage {
autohide?: number;
title?: string;
text: string;
onUndo?: () => void;

0 comments on commit ff7c721

Please sign in to comment.