From 78f15c54c2e0d1f61abc9eec4d88ee020b191e95 Mon Sep 17 00:00:00 2001 From: "Thomas F. K. Jorna" Date: Tue, 2 Nov 2021 23:24:07 +0100 Subject: Feat/collapse: add collapsible/toggleable headers and outline layout in the preview panel (#139) * feat(preview): collapsible headings * feat(preview): collapsible headings * feat(collapse): change icons for headings * feat(collapse): * feat(collapse): use new uniorg and better looks * feat(collapse): fix typescript errors * fix(ci): better filter * feat(collapse): more small adjustments * feat(collapse): collapse all button * fix(collapse): fix global css * fix(cd): remove yarn and add export * fix(collapse): type-errors * fix(cd): fix format-all fucking up yml --- components/Sidebar/Note.tsx | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'components/Sidebar/Note.tsx') diff --git a/components/Sidebar/Note.tsx b/components/Sidebar/Note.tsx index ec267a3..197fa76 100644 --- a/components/Sidebar/Note.tsx +++ b/components/Sidebar/Note.tsx @@ -5,7 +5,7 @@ import { NodeById, NodeByCite, LinksByNodeId } from '../../pages' import { Box, Flex } from '@chakra-ui/react' import { UniOrg } from '../../util/uniorg' import { Backlinks } from '../../components/Sidebar/Backlinks' -import { noteStyle } from './noteStyle' +import { defaultNoteStyle, viewerNoteStyle, outlineNoteStyle } from './noteStyle' export interface NoteProps { setPreviewNode: any @@ -17,6 +17,8 @@ export interface NoteProps { justificationList: string[] linksByNodeId: LinksByNodeId openContextMenu: any + outline: boolean + collapse: boolean } export const Note = (props: NoteProps) => { @@ -30,20 +32,29 @@ export const Note = (props: NoteProps) => { setSidebarHighlightedNode, linksByNodeId, openContextMenu, + outline, + collapse, } = props + const extraStyle = outline ? outlineNoteStyle : viewerNoteStyle return ( {previewNode?.id && ( - + { nodeByCite, setSidebarHighlightedNode, openContextMenu, + outline, + collapse, }} /> { nodeByCite, setSidebarHighlightedNode, openContextMenu, + outline, }} /> -- cgit v1.2.3