diff --git a/app/components/ContextMenu/MenuItem.js b/app/components/ContextMenu/MenuItem.js index a5fc1d59..5fd3a4b0 100644 --- a/app/components/ContextMenu/MenuItem.js +++ b/app/components/ContextMenu/MenuItem.js @@ -3,6 +3,7 @@ import { CheckmarkIcon } from "outline-icons"; import * as React from "react"; import { MenuItem as BaseMenuItem } from "reakit/Menu"; import styled from "styled-components"; +import breakpoint from "styled-components-breakpoint"; type Props = {| onClick?: (SyntheticEvent<>) => void | Promise, @@ -72,7 +73,7 @@ export const MenuAnchor = styled.a` display: flex; margin: 0; border: 0; - padding: 6px 12px; + padding: 12px; width: 100%; min-height: 32px; background: none; @@ -80,7 +81,7 @@ export const MenuAnchor = styled.a` props.disabled ? props.theme.textTertiary : props.theme.textSecondary}; justify-content: left; align-items: center; - font-size: 15px; + font-size: 16px; cursor: default; user-select: none; @@ -115,6 +116,11 @@ export const MenuAnchor = styled.a` background: ${props.theme.primary}; } `}; + + ${breakpoint("tablet")` + padding: 6px 12px; + font-size: 15px; + `}; `; export default MenuItem; diff --git a/app/components/ContextMenu/index.js b/app/components/ContextMenu/index.js index aa715310..c883d6cd 100644 --- a/app/components/ContextMenu/index.js +++ b/app/components/ContextMenu/index.js @@ -1,9 +1,12 @@ // @flow import { rgba } from "polished"; import * as React from "react"; +import { Portal } from "react-portal"; import { Menu } from "reakit/Menu"; import styled from "styled-components"; -import { fadeAndScaleIn } from "shared/styles/animations"; +import breakpoint from "styled-components-breakpoint"; +import { fadeAndScaleIn, fadeAndSlideIn } from "shared/styles/animations"; +import Fade from "components/Fade"; import usePrevious from "hooks/usePrevious"; type Props = {| @@ -37,27 +40,60 @@ export default function ContextMenu({ }, [onOpen, onClose, previousVisible, rest.visible]); return ( - - {(props) => ( - - - {rest.visible || rest.animating ? children : null} - - + <> + + {(props) => ( + + + {rest.visible || rest.animating ? children : null} + + + )} + + {(rest.visible || rest.animating) && ( + + + + + )} - + ); } +const Backdrop = styled.div` + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + background: ${(props) => props.theme.shadow}; + z-index: ${(props) => props.theme.depths.menu - 1}; + + ${breakpoint("tablet")` + display: none; + `}; +`; + const Position = styled.div` position: absolute; z-index: ${(props) => props.theme.depths.menu}; + + ${breakpoint("mobile", "tablet")` + position: fixed !important; + transform: none !important; + top: auto !important; + right: 8px !important; + bottom: 8px !important; + left: 8px !important; + `}; `; const Background = styled.div` - animation: ${fadeAndScaleIn} 200ms ease; - transform-origin: ${(props) => (props.left !== undefined ? "25%" : "75%")} 0; - background: ${(props) => rgba(props.theme.menuBackground, 0.95)}; + animation: ${fadeAndSlideIn} 200ms ease; + transform-origin: 50% 100%; + max-width: 100%; + background: ${(props) => props.theme.menuBackground}; border: ${(props) => props.theme.menuBorder ? `1px solid ${props.theme.menuBorder}` : "none"}; border-radius: 6px; @@ -66,7 +102,6 @@ const Background = styled.div` overflow: hidden; overflow-y: auto; max-height: 75vh; - max-width: 276px; box-shadow: ${(props) => props.theme.menuShadow}; pointer-events: all; font-weight: normal; @@ -74,4 +109,12 @@ const Background = styled.div` @media print { display: none; } + + ${breakpoint("tablet")` + animation: ${fadeAndScaleIn} 200ms ease; + transform-origin: ${(props) => + props.left !== undefined ? "25%" : "75%"} 0; + max-width: 276px; + background: ${(props) => rgba(props.theme.menuBackground, 0.95)}; + `}; `; diff --git a/app/components/Header.js b/app/components/Header.js index 57f557b7..a5913338 100644 --- a/app/components/Header.js +++ b/app/components/Header.js @@ -77,7 +77,7 @@ const Actions = styled(Flex)` const Wrapper = styled(Flex)` position: sticky; top: 0; - z-index: 2; + z-index: ${(props) => props.theme.depths.header}; background: ${(props) => transparentize(0.2, props.theme.background)}; padding: 12px; transition: all 100ms ease-out; diff --git a/app/components/Sidebar/Sidebar.js b/app/components/Sidebar/Sidebar.js index a123cc7a..02e57120 100644 --- a/app/components/Sidebar/Sidebar.js +++ b/app/components/Sidebar/Sidebar.js @@ -211,7 +211,7 @@ const Background = styled.a` right: 0; cursor: default; z-index: ${(props) => props.theme.depths.sidebar - 1}; - background: rgba(0, 0, 0, 0.5); + background: ${(props) => props.theme.sidebarShadow}; `; const Container = styled(Flex)` diff --git a/app/components/Sidebar/components/SidebarLink.js b/app/components/Sidebar/components/SidebarLink.js index 29ca5c9d..d9628507 100644 --- a/app/components/Sidebar/components/SidebarLink.js +++ b/app/components/Sidebar/components/SidebarLink.js @@ -126,7 +126,7 @@ const Link = styled(NavLink)` props.$isActiveDrop ? props.theme.slateDark : "inherit"}; color: ${(props) => props.$isActiveDrop ? props.theme.white : props.theme.sidebarText}; - font-size: 15px; + font-size: 16px; cursor: pointer; overflow: hidden; @@ -158,6 +158,7 @@ const Link = styled(NavLink)` ${breakpoint("tablet")` padding: 4px 16px; + font-size: 15px; `} `; diff --git a/app/scenes/Collection.js b/app/scenes/Collection.js index 97f7b3ad..321bd2dc 100644 --- a/app/scenes/Collection.js +++ b/app/scenes/Collection.js @@ -152,7 +152,6 @@ function CollectionScene() { (