From 83c8aff44d3650c5afebbb437ea4c69fb7d41215 Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Wed, 7 Jun 2023 21:41:53 +0800 Subject: [PATCH] Handle selection in the header --- .../templates/homeFeed/LibraryHeader.tsx | 41 +++++++++++++++++-- 1 file changed, 38 insertions(+), 3 deletions(-) diff --git a/packages/web/components/templates/homeFeed/LibraryHeader.tsx b/packages/web/components/templates/homeFeed/LibraryHeader.tsx index b9ad73e8a..46f859400 100644 --- a/packages/web/components/templates/homeFeed/LibraryHeader.tsx +++ b/packages/web/components/templates/homeFeed/LibraryHeader.tsx @@ -1,5 +1,5 @@ -import { useEffect, useRef, useState } from 'react' -import { Box, HStack, VStack } from '../../elements/LayoutPrimitives' +import { useCallback, useEffect, useRef, useState } from 'react' +import { Box, HStack, SpanBox, VStack } from '../../elements/LayoutPrimitives' import { theme } from '../../tokens/stitches.config' import { FormInput } from '../../elements/FormElements' import { searchBarCommands } from '../../../lib/keyboardShortcuts/navigationShortcuts' @@ -7,6 +7,7 @@ import { useKeyboardShortcuts } from '../../../lib/keyboardShortcuts/useKeyboard import { Button, IconButton } from '../../elements/Button' import { ArchiveBox, + CaretDown, FunnelSimple, ListBullets, MagnifyingGlass, @@ -25,6 +26,8 @@ import { ScrollOffsetChangeset, useScrollWatcher, } from '../../../lib/hooks/useScrollWatcher' +import { CardCheckbox } from '../../patterns/LibraryCards/LibraryCardStyles' +import { Dropdown, DropdownOption } from '../../elements/DropdownElements' type LibraryHeaderProps = { layout: LayoutType @@ -358,6 +361,12 @@ type ControlButtonBoxProps = { function MultiSelectControlButtonBox( props: ControlButtonBoxProps ): JSX.Element { + const [isChecked, setIsChecked] = useState(false) + + const handleCheckChanged = useCallback(() => { + setIsChecked(!isChecked) + }, [isChecked]) + return ( + + )} {props.inMultiSelect ? ( - + <> + + + ) : ( )}