diff --git a/app/components/Sidebar/Main.tsx b/app/components/Sidebar/Main.tsx index 9b2de6a652..101457ed9b 100644 --- a/app/components/Sidebar/Main.tsx +++ b/app/components/Sidebar/Main.tsx @@ -104,7 +104,9 @@ function MainSidebar() { /> )} - +
+ +
diff --git a/app/components/Sidebar/components/CollectionLink.tsx b/app/components/Sidebar/components/CollectionLink.tsx index 965acdbb3f..cf8879b29c 100644 --- a/app/components/Sidebar/components/CollectionLink.tsx +++ b/app/components/Sidebar/components/CollectionLink.tsx @@ -253,7 +253,7 @@ function CollectionLink({ /> } exact={false} - depth={0.5} + depth={0} menu={ !isEditing && ( <> @@ -325,7 +325,7 @@ const Draggable = styled("div")<{ $isDragging: boolean; $isMoving: boolean }>` const Disclosure = styled(CollapsedIcon)<{ expanded?: boolean }>` transition: transform 100ms ease, fill 50ms !important; position: absolute; - left: 0px; + left: -6px; ${({ expanded }) => !expanded && "transform: rotate(-90deg);"}; display: none; `; diff --git a/app/components/Sidebar/components/Collections.tsx b/app/components/Sidebar/components/Collections.tsx index b9cc9e9371..127a4dac54 100644 --- a/app/components/Sidebar/components/Collections.tsx +++ b/app/components/Sidebar/components/Collections.tsx @@ -13,6 +13,7 @@ import useStores from "~/hooks/useStores"; import useToasts from "~/hooks/useToasts"; import CollectionLink from "./CollectionLink"; import DropCursor from "./DropCursor"; +import Header from "./Header"; import PlaceholderCollections from "./PlaceholderCollections"; import SidebarAction from "./SidebarAction"; import SidebarLink, { DragObject } from "./SidebarLink"; @@ -85,17 +86,14 @@ function Collections() { belowCollection={orderedCollections[index + 1]} /> ))} - + ); if (!collections.isLoaded || fetchError) { return ( - } - /> +
{t("Collections")}
); @@ -103,19 +101,13 @@ function Collections() { return ( - setExpanded((prev) => !prev)} - label={t("Collections")} - icon={} - /> +
setExpanded((prev) => !prev)} expanded={expanded}> + {t("Collections")} +
+ {expanded && (isPreloaded ? content : {content})}
); } -const Disclosure = styled(CollapsedIcon)<{ expanded?: boolean }>` - transition: transform 100ms ease, fill 50ms !important; - ${({ expanded }) => !expanded && "transform: rotate(-90deg);"}; -`; - export default observer(Collections); diff --git a/app/components/Sidebar/components/Header.ts b/app/components/Sidebar/components/Header.ts index 77b0b1f7ca..005e0193c8 100644 --- a/app/components/Sidebar/components/Header.ts +++ b/app/components/Sidebar/components/Header.ts @@ -1,14 +1,19 @@ +import { CollapsedIcon } from "outline-icons"; import styled from "styled-components"; import Flex from "~/components/Flex"; const Header = styled(Flex)` - font-size: 11px; + font-size: 13px; font-weight: 600; user-select: none; - text-transform: uppercase; - color: ${(props) => props.theme.sidebarText}; - letter-spacing: 0.04em; + color: ${(props) => props.theme.textTertiary}; + letter-spacing: 0.03em; margin: 4px 12px; `; +const Disclosure = styled(CollapsedIcon)<{ expanded?: boolean }>` + transition: transform 100ms ease, fill 50ms !important; + ${({ expanded }) => !expanded && "transform: rotate(-90deg);"}; +`; + export default Header; diff --git a/app/components/Sidebar/components/Starred.tsx b/app/components/Sidebar/components/Starred.tsx index 96b66a41ab..b43b90a280 100644 --- a/app/components/Sidebar/components/Starred.tsx +++ b/app/components/Sidebar/components/Starred.tsx @@ -10,8 +10,8 @@ import Flex from "~/components/Flex"; import useStores from "~/hooks/useStores"; import useToasts from "~/hooks/useToasts"; import DropCursor from "./DropCursor"; +import Header from "./Header"; import PlaceholderCollections from "./PlaceholderCollections"; -import Section from "./Section"; import SidebarLink from "./SidebarLink"; import StarredLink from "./StarredLink"; @@ -119,71 +119,60 @@ function Starred() { }), }); - const content = stars.orderedData.slice(0, upperBound).map((star) => { - const document = documents.get(star.documentId); - - return document ? ( - - ) : null; - }); - if (!stars.orderedData.length) { return null; } return ( -
- - } - /> - {expanded && ( - <> - +
+ {t("Starred")} +
+ {expanded && ( + <> + + {stars.orderedData.slice(0, upperBound).map((star) => { + const document = documents.get(star.documentId); + + return document ? ( + + ) : null; + })} + {show === "More" && !isFetching && ( + - {content} - {show === "More" && !isFetching && ( - - )} - {show === "Less" && !isFetching && ( - - )} - {(isFetching || fetchError) && !stars.orderedData.length && ( - - - - )} - - )} -
-
+ )} + {show === "Less" && !isFetching && ( + + )} + {(isFetching || fetchError) && !stars.orderedData.length && ( + + + + )} + + )} + ); } -const Disclosure = styled(CollapsedIcon)<{ expanded?: boolean }>` - transition: transform 100ms ease, fill 50ms !important; - ${({ expanded }) => !expanded && "transform: rotate(-90deg);"}; -`; - export default observer(Starred); diff --git a/app/components/Sidebar/components/StarredLink.tsx b/app/components/Sidebar/components/StarredLink.tsx index 8ce6bb9bbd..c842bcc3f4 100644 --- a/app/components/Sidebar/components/StarredLink.tsx +++ b/app/components/Sidebar/components/StarredLink.tsx @@ -1,10 +1,11 @@ import fractionalIndex from "fractional-index"; import { observer } from "mobx-react"; +import { StarredIcon } from "outline-icons"; import * as React from "react"; import { useEffect, useState } from "react"; import { useDrag, useDrop } from "react-dnd"; import { useTranslation } from "react-i18next"; -import styled from "styled-components"; +import styled, { useTheme } from "styled-components"; import { MAX_TITLE_LENGTH } from "@shared/constants"; import Star from "~/models/Star"; import Fade from "~/components/Fade"; @@ -33,6 +34,7 @@ function StarredLink({ collectionId, star, }: Props) { + const theme = useTheme(); const { t } = useTranslation(); const { collections, documents, policies } = useStores(); const collection = collections.get(collectionId); @@ -122,6 +124,7 @@ function StarredLink({ : undefined} isActive={(match, location) => !!match && location.search === "?starred" }