diff --git a/public/locales/en.json b/public/locales/en.json index c7a726851..c575a7443 100644 --- a/public/locales/en.json +++ b/public/locales/en.json @@ -306,6 +306,7 @@ "export": "Export", "extra": "Extra", "slideMode": "Slide Mode", + "readOnlyMode": "Read-only mode", "download": "Download", "help": "Help", "deleteNote": "Delete note", diff --git a/src/components/editor-page/app-bar/app-bar.tsx b/src/components/editor-page/app-bar/app-bar.tsx index 32045a8e0..5f0fd11d5 100644 --- a/src/components/editor-page/app-bar/app-bar.tsx +++ b/src/components/editor-page/app-bar/app-bar.tsx @@ -5,22 +5,22 @@ */ import React from 'react' -import { Button, Nav, Navbar } from 'react-bootstrap' -import { Trans, useTranslation } from 'react-i18next' +import equal from 'fast-deep-equal' +import { Nav, Navbar } from 'react-bootstrap' import { useSelector } from 'react-redux' -import { useParams } from 'react-router' -import { Link } from 'react-router-dom' import { ApplicationState } from '../../../redux' -import { ForkAwesomeIcon } from '../../common/fork-awesome/fork-awesome-icon' import { ShowIf } from '../../common/show-if/show-if' import { SignInButton } from '../../landing-layout/navigation/sign-in-button' import { UserDropdown } from '../../landing-layout/navigation/user-dropdown' -import { EditorPagePathParams } from '../editor-page' import { DarkModeButton } from './dark-mode-button' import { EditorViewMode } from './editor-view-mode' import { HelpButton } from './help-button/help-button' import { NavbarBranding } from './navbar-branding' import { SyncScrollButtons } from './sync-scroll-buttons/sync-scroll-buttons' +import { NoteType } from '../note-frontmatter/note-frontmatter' +import { SlideModeButton } from './slide-mode-button' +import { ReadOnlyModeButton } from './read-only-mode-button' +import { NewNoteButton } from './new-note-button' export enum AppBarMode { BASIC, @@ -32,9 +32,8 @@ export interface AppBarProps { } export const AppBar: React.FC = ({ mode }) => { - const { t } = useTranslation() - const { id } = useParams() const userExists = useSelector((state: ApplicationState) => !!state.user) + const noteFrontmatter = useSelector((state: ApplicationState) => state.noteDetails.frontmatter, equal) return ( @@ -45,20 +44,18 @@ export const AppBar: React.FC = ({ mode }) => { - - - + + + + + +