diff --git a/packages/app-desktop/gui/NoteListControls/NoteListControls.tsx b/packages/app-desktop/gui/NoteListControls/NoteListControls.tsx index dc5af87ee..f80fc9cee 100644 --- a/packages/app-desktop/gui/NoteListControls/NoteListControls.tsx +++ b/packages/app-desktop/gui/NoteListControls/NoteListControls.tsx @@ -27,7 +27,6 @@ interface Props { notesParentType: string; height: number; width: number; - onContentHeightChange: (sameRow: boolean)=> void; newNoteButtonEnabled: boolean; newTodoButtonEnabled: boolean; } @@ -41,7 +40,6 @@ interface Breakpoints { const StyledRoot = styled.div` box-sizing: border-box; - height: ${(props: any) => props.height}px; display: flex; flex-direction: column; padding: ${(props: any) => props.theme.mainPadding}px; @@ -185,12 +183,10 @@ function NoteListControls(props: Props) { if (breakpoint === dynamicBreakpoints.Xl) { noteControlsRef.current.style.flexDirection = 'row'; searchAndSortRef.current.style.flex = '2 1 50%'; - props.onContentHeightChange(true); } else { noteControlsRef.current.style.flexDirection = 'column'; - props.onContentHeightChange(false); } - }, [breakpoint, dynamicBreakpoints, props.onContentHeightChange]); + }, [breakpoint, dynamicBreakpoints]); useEffect(() => { CommandService.instance().registerRuntime('focusSearch', focusSearchRuntime(searchBarRef)); diff --git a/packages/app-desktop/gui/NoteListWrapper/NoteListWrapper.tsx b/packages/app-desktop/gui/NoteListWrapper/NoteListWrapper.tsx index f2d1471f3..65305743c 100644 --- a/packages/app-desktop/gui/NoteListWrapper/NoteListWrapper.tsx +++ b/packages/app-desktop/gui/NoteListWrapper/NoteListWrapper.tsx @@ -23,28 +23,20 @@ const StyledRoot = styled.div` export default function NoteListWrapper(props: Props) { const theme = themeStyle(props.themeId); - const [controlHeight, setControlHeight] = useState(theme.topRowHeight); - - const onContentHeightChange = (sameRow: boolean) => { - if (sameRow) { - setControlHeight(theme.topRowHeight); - } else { - setControlHeight(theme.topRowHeight * 2); - } - }; + const [controlHeight] = useState(theme.topRowHeight); const noteListSize = useMemo(() => { return { width: props.size.width, - height: props.size.height - controlHeight, + height: props.size.height, }; - }, [props.size, controlHeight]); + }, [props.size]); // return ( - + );