From f555fbcaaab1203c8460e7a69c3d7723d09f45d7 Mon Sep 17 00:00:00 2001 From: Vardan Hakobyan Date: Mon, 8 Aug 2022 11:07:15 +0400 Subject: [PATCH] feat: tablet responsiveness (#1369) * feat: "Notes" column responsiveness for tablets * feat: ability to expand/collapse the navigation column, move some styles to tailwind * feat: ability to expand/collapse the navigation column, move some styles to tailwind * feat: icon for collapsing/expanding navigation column, style improvements * fix: restore vertical panels resizability on large screens * feat: tags/folders section for collapsed state * feat: notes subsection styling in navigation section * feat: hide rename & delete links of smart views when in collapsed mode * fix: show notes count in bold when in collapsed mode * fix: better padding for folders in collapsed state * fix: smaller left padding for collapsed case * fix: better view of expand/collapse control * fix: hide search bar when collapsed * fix: adjust position of "expand" control when in collapsed state * chore: remove comments * refactor: use `classNames` util when applying conditional css classes * chore: shorter class names syntax * chore: shorter syntax for conditional classes * fix: better way of setting background color with opacity * fix: use variable colors according to SN themes * chore: move "colors" from "extend" section and thus override Tailwind's colors (so only SN colors will exist) * fix: correct hover style in collapsed mode * fix: correct upper boundary for extra small screens --- .../ContentListView/ContentListView.tsx | 2 +- .../Components/Navigation/Navigation.tsx | 46 +- .../Components/Tags/SmartViewsList.tsx | 4 +- .../Components/Tags/SmartViewsListItem.tsx | 32 +- .../Components/Tags/SmartViewsSection.tsx | 5 +- .../javascripts/Components/Tags/TagsList.tsx | 4 +- .../Components/Tags/TagsListItem.tsx | 496 +++++++++--------- .../Components/Tags/TagsSection.tsx | 14 +- .../Components/Tags/TagsSectionAddButton.tsx | 5 +- .../Components/Tags/TagsSectionTitle.tsx | 7 +- packages/web/src/stylesheets/_columns.scss | 16 - packages/web/src/stylesheets/_sn.scss | 15 + packages/web/tailwind.config.js | 11 + 13 files changed, 369 insertions(+), 288 deletions(-) diff --git a/packages/web/src/javascripts/Components/ContentListView/ContentListView.tsx b/packages/web/src/javascripts/Components/ContentListView/ContentListView.tsx index febe12a7b..c66bbaad8 100644 --- a/packages/web/src/javascripts/Components/ContentListView/ContentListView.tsx +++ b/packages/web/src/javascripts/Components/ContentListView/ContentListView.tsx @@ -172,7 +172,7 @@ const ContentListView: FunctionComponent = ({ return (
diff --git a/packages/web/src/javascripts/Components/Navigation/Navigation.tsx b/packages/web/src/javascripts/Components/Navigation/Navigation.tsx index a106c2e26..766bab154 100644 --- a/packages/web/src/javascripts/Components/Navigation/Navigation.tsx +++ b/packages/web/src/javascripts/Components/Navigation/Navigation.tsx @@ -10,6 +10,7 @@ import SearchBar from '@/Components/SearchBar/SearchBar' import ResponsivePaneContent from '@/Components/ResponsivePane/ResponsivePaneContent' import { AppPaneId } from '@/Components/ResponsivePane/AppPaneMetadata' import { classNames } from '@/Utils/ConcatenateClassNames' +import Icon from '@/Components/Icon/Icon' type Props = { application: WebApplication @@ -19,6 +20,7 @@ const Navigation: FunctionComponent = ({ application }) => { const viewControllerManager = useMemo(() => application.getViewControllerManager(), [application]) const ref = useRef(null) const [panelWidth, setPanelWidth] = useState(0) + const [isPanelExpanded, setIsPanelExpanded] = useState(true) useEffect(() => { const removeObserver = application.addEventObserver(async () => { @@ -47,19 +49,39 @@ const Navigation: FunctionComponent = ({ application }) => { }, [viewControllerManager]) return ( -