diff --git a/app/components/Sidebar/Right.tsx b/app/components/Sidebar/Right.tsx index 1ad0ef799..3d4c7b616 100644 --- a/app/components/Sidebar/Right.tsx +++ b/app/components/Sidebar/Right.tsx @@ -67,33 +67,36 @@ function Right({ children, border, className }: Props) { }, [isResizing, handleDrag, handleStopDrag]); const style = React.useMemo( - () => ({ - width: `${ui.sidebarRightWidth}px`, - }), - [ui.sidebarRightWidth] + () => + isMobile + ? { width: "80%" } + : { + width: `${ui.sidebarRightWidth}px`, + }, + [isMobile, ui.sidebarRightWidth] ); + const animationProps = { + initial: { + width: 0, + }, + animate: { + transition: isResizing + ? { duration: 0 } + : { + type: "spring", + bounce: 0.2, + duration: sidebarAppearDuration / 1000, + }, + width: ui.sidebarRightWidth, + }, + exit: { + width: 0, + }, + }; + return ( - + {children} {!isMobile && ( @@ -120,7 +123,7 @@ const Sidebar = styled(m.div)<{ display: flex; flex-shrink: 0; background: ${s("background")}; - max-width: 70%; + max-width: 80%; border-left: 1px solid ${s("divider")}; transition: border-left 100ms ease-in-out; z-index: 1; diff --git a/app/components/Sidebar/Sidebar.tsx b/app/components/Sidebar/Sidebar.tsx index b3ae5ce53..572ee85e5 100644 --- a/app/components/Sidebar/Sidebar.tsx +++ b/app/components/Sidebar/Sidebar.tsx @@ -248,7 +248,7 @@ const Container = styled(Flex)` ${(props) => (props.$mobileSidebarVisible ? 0 : "-100%")} ); z-index: ${depths.sidebar}; - max-width: 70%; + max-width: 80%; min-width: 280px; padding-top: ${Desktop.hasInsetTitlebar() ? 36 : 0}px; ${draggableOnDesktop()} diff --git a/app/scenes/Document/components/CommentThread.tsx b/app/scenes/Document/components/CommentThread.tsx index 4967a5dfe..8a9ef87e2 100644 --- a/app/scenes/Document/components/CommentThread.tsx +++ b/app/scenes/Document/components/CommentThread.tsx @@ -5,6 +5,7 @@ import { useTranslation } from "react-i18next"; import { useHistory } from "react-router-dom"; import scrollIntoView from "smooth-scroll-into-view-if-needed"; import styled, { css } from "styled-components"; +import breakpoint from "styled-components-breakpoint"; import { s } from "@shared/styles"; import Comment from "~/models/Comment"; import Document from "~/models/Document"; @@ -206,13 +207,16 @@ const Reply = styled.button` font-size: 14px; -webkit-appearance: none; cursor: var(--pointer); - opacity: 0; transition: opacity 100ms ease-out; position: absolute; text-align: left; width: 100%; bottom: -30px; left: 32px; + + ${breakpoint("tablet")` + opacity: 0; + `} `; const Thread = styled.div<{ diff --git a/app/scenes/Document/components/CommentThreadItem.tsx b/app/scenes/Document/components/CommentThreadItem.tsx index 986a91e5f..b86a52eb2 100644 --- a/app/scenes/Document/components/CommentThreadItem.tsx +++ b/app/scenes/Document/components/CommentThreadItem.tsx @@ -5,6 +5,7 @@ import { darken } from "polished"; import * as React from "react"; import { useTranslation } from "react-i18next"; import styled, { css } from "styled-components"; +import breakpoint from "styled-components-breakpoint"; import { s } from "@shared/styles"; import { Minute } from "@shared/utils/time"; import Comment from "~/models/Comment"; @@ -257,7 +258,7 @@ export const Bubble = styled(Flex)<{ }>` position: relative; flex-grow: 1; - font-size: 15px; + font-size: 16px; color: ${s("text")}; background: ${s("commentBackground")}; min-width: 2em; @@ -286,6 +287,10 @@ export const Bubble = styled(Flex)<{ &:hover ${Menu} { opacity: 1; } + + ${breakpoint("tablet")` + font-size: 15px; + `} `; export default observer(CommentThreadItem); diff --git a/app/scenes/Document/components/Editor.tsx b/app/scenes/Document/components/Editor.tsx index f353cc0c9..810b15dec 100644 --- a/app/scenes/Document/components/Editor.tsx +++ b/app/scenes/Document/components/Editor.tsx @@ -70,6 +70,12 @@ function DocumentEditor(props: Props, ref: React.RefObject) { } }, [ref]); + React.useEffect(() => { + if (focusedComment) { + ui.expandComments(document.id); + } + }, [focusedComment, ui, document.id]); + // Save document when blurring title, but delay so that if clicking on a // button this is allowed to execute first. const handleBlur = React.useCallback(() => { @@ -91,13 +97,12 @@ function DocumentEditor(props: Props, ref: React.RefObject) { const handleClickComment = React.useCallback( (commentId: string) => { - ui.expandComments(document.id); history.replace({ pathname: window.location.pathname.replace(/\/history$/, ""), state: { commentId }, }); }, - [ui, document.id, history] + [history] ); // Create a Comment model in local store when a comment mark is created, this @@ -119,13 +124,12 @@ function DocumentEditor(props: Props, ref: React.RefObject) { comment.id = commentId; comments.add(comment); - ui.expandComments(document.id); history.replace({ pathname: window.location.pathname.replace(/\/history$/, ""), state: { commentId }, }); }, - [comments, user?.id, props.id, ui, document.id, history] + [comments, user?.id, props.id, history] ); // Soft delete the Comment model when associated mark is totally removed.