diff --git a/app/components/Breadcrumb.js b/app/components/Breadcrumb.js index 421866a7..74296d14 100644 --- a/app/components/Breadcrumb.js +++ b/app/components/Breadcrumb.js @@ -12,7 +12,6 @@ import * as React from "react"; import { useTranslation } from "react-i18next"; import { Link } from "react-router-dom"; import styled from "styled-components"; -import breakpoint from "styled-components-breakpoint"; import Document from "models/Document"; import CollectionIcon from "components/CollectionIcon"; import Flex from "components/Flex"; @@ -85,7 +84,7 @@ const Breadcrumb = ({ document, children, onlyText }: Props) => { const { t } = useTranslation(); if (!collections.isLoaded) { - return ; + return; } let collection = collections.get(document.collectionId); @@ -125,7 +124,7 @@ const Breadcrumb = ({ document, children, onlyText }: Props) => { const menuPath = isNestedDocument ? path.slice(0, -1) : []; return ( - + @@ -146,7 +145,7 @@ const Breadcrumb = ({ document, children, onlyText }: Props) => { )} {children} - + ); }; @@ -155,14 +154,6 @@ export const Slash = styled(GoToIcon)` fill: ${(props) => props.theme.divider}; `; -const Wrapper = styled(Flex)` - display: none; - - ${breakpoint("tablet")` - display: flex; - `}; -`; - const SmallPadlockIcon = styled(PadlockIcon)` display: inline-block; vertical-align: sub; diff --git a/app/components/Header.js b/app/components/Header.js index 57fb7c30..6b50d4ab 100644 --- a/app/components/Header.js +++ b/app/components/Header.js @@ -36,36 +36,47 @@ function Header({ breadcrumb, title, actions }: Props) { }, []); return ( - - {breadcrumb} + + {breadcrumb ? {breadcrumb} : null} {isScrolled ? ( - - <Fade> - <Flex align="center">{title}</Flex> - </Fade> + <Title align="center" justify="flex-start" onClick={handleClickTitle}> + <Fade>{title}</Fade> ) : (
)} - {actions && {actions}} + {actions && ( + + {actions} + + )} ); } +const Breadcrumbs = styled("div")` + flex-grow: 1; + flex-basis: 0; + align-items: center; + padding-right: 8px; + + /* Don't show breadcrumbs on mobile */ + display: none; + ${breakpoint("tablet")` + display: flex; +`}; +`; + +const Actions = styled(Flex)` + flex-grow: 1; + flex-basis: 0; + min-width: auto; + padding-left: 8px; +`; + const Wrapper = styled(Flex)` position: sticky; top: 0; - right: 0; - left: 0; z-index: 2; background: ${(props) => transparentize(0.2, props.theme.background)}; padding: 12px; @@ -77,33 +88,38 @@ const Wrapper = styled(Flex)` display: none; } + justify-content: flex-start; ${breakpoint("tablet")` padding: ${(props) => (props.isCompact ? "12px" : `24px 24px 0`)}; + justify-content: "center"; `}; `; -const Title = styled(Flex)` +const Title = styled("div")` font-size: 16px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; cursor: pointer; - width: 0; + min-width: 0; + /* on mobile, there's always a floating menu button in the top left + add some padding here to offset + */ + padding-left: 40px; ${breakpoint("tablet")` - flex-grow: 1; + padding-left: 0; `}; + svg { + vertical-align: bottom; + } + @media (display-mode: standalone) { overflow: hidden; flex-grow: 0 !important; } `; -const Actions = styled(Flex)` - align-self: flex-end; - height: 32px; -`; - export default observer(Header); diff --git a/app/components/Sidebar/components/Toggle.js b/app/components/Sidebar/components/Toggle.js index 86062e31..4a563de6 100644 --- a/app/components/Sidebar/components/Toggle.js +++ b/app/components/Sidebar/components/Toggle.js @@ -28,7 +28,7 @@ export const ToggleButton = styled.button` transition: opacity 100ms ease-in-out; transform: translateY(-50%) scaleX(${(props) => (props.$direction === "left" ? 1 : -1)}); - position: absolute; + position: fixed; top: 50vh; padding: 8px; border: 0; diff --git a/app/scenes/Document/components/Header.js b/app/scenes/Document/components/Header.js index 1c1ce29f..3dae5220 100644 --- a/app/scenes/Document/components/Header.js +++ b/app/scenes/Document/components/Header.js @@ -138,12 +138,7 @@ function DocumentHeader({ } actions={ <> - {!isPublishing && ( - - {t("Saving")}… - - )} -   + {!isPublishing && isSaving && {t("Saving")}…} props.theme.slate}; - visibility: ${(props) => (props.isSaving ? "visible" : "hidden")}; `; export default observer(DocumentHeader); diff --git a/server/static/index.html b/server/static/index.html index fbf0fc14..7c4e7be4 100644 --- a/server/static/index.html +++ b/server/static/index.html @@ -44,6 +44,7 @@ #root { flex: 1; min-height: 100vh; + width: 100%; }