From 15dd02fe6ae193f1180a559a4597b78f20f5f476 Mon Sep 17 00:00:00 2001 From: lynn <41491154+lynnshaoyu@users.noreply.github.com> Date: Mon, 7 Nov 2022 17:13:08 -0500 Subject: [PATCH] refactor: filter panel (#5103) * init * remove unnecessary chagnes * fix comments --- .../components/profile/view/FilterSidebar.tsx | 114 +++++++----------- .../profile/view/ProfilePage.css.ts | 17 ++- 2 files changed, 50 insertions(+), 81 deletions(-) diff --git a/src/nft/components/profile/view/FilterSidebar.tsx b/src/nft/components/profile/view/FilterSidebar.tsx index ce943958b9..f28a470f22 100644 --- a/src/nft/components/profile/view/FilterSidebar.tsx +++ b/src/nft/components/profile/view/FilterSidebar.tsx @@ -2,7 +2,8 @@ import { AnimatedBox, Box } from 'nft/components/Box' import { Column, Row } from 'nft/components/Flex' import { XMarkIcon } from 'nft/components/icons' import { Checkbox } from 'nft/components/layout/Checkbox' -import { buttonTextSmall, headlineSmall } from 'nft/css/common.css' +import { Input } from 'nft/components/layout/Input' +import { subhead } from 'nft/css/common.css' import { themeVars } from 'nft/css/sprinkles.css' import { useFiltersExpanded, useIsMobile, useWalletCollections } from 'nft/hooks' import { WalletCollection } from 'nft/types' @@ -16,8 +17,6 @@ export const FilterSidebar = () => { const setCollectionFilters = useWalletCollections((state) => state.setCollectionFilters) const walletCollections = useWalletCollections((state) => state.walletCollections) - const listFilter = useWalletCollections((state) => state.listFilter) - const setListFilter = useWalletCollections((state) => state.setListFilter) const [isFiltersExpanded, setFiltersExpanded] = useFiltersExpanded() const isMobile = useIsMobile() @@ -44,9 +43,6 @@ export const FilterSidebar = () => { width={{ sm: 'full', md: 'auto' }} > - - Filters - {isMobile && ( { )} - - - - + Collections - - + + - + {displayCollections?.map((collection, index) => ( > }) => { return ( - ) => setCollectionSearchText(e.currentTarget.value)} /> @@ -181,54 +161,46 @@ const CollectionItem = ({ } return ( - - - {collection.name}{' '} - + + + + {collection.name}{' '} + + + - + {collection.count} ) } - -const statusArray = ['All', 'Unlisted', 'Listed'] - -const ListStatusFilterButtons = ({ - listFilter, - setListFilter, -}: { - listFilter: string - setListFilter: (value: string) => void -}) => { - return ( - <> - {statusArray.map((value, index) => ( - setListFilter(value)} - width="max" - padding="14" - cursor="pointer" - > - {value} - - ))} - - ) -} diff --git a/src/nft/components/profile/view/ProfilePage.css.ts b/src/nft/components/profile/view/ProfilePage.css.ts index 56b0ad23fa..cb6d79514d 100644 --- a/src/nft/components/profile/view/ProfilePage.css.ts +++ b/src/nft/components/profile/view/ProfilePage.css.ts @@ -1,6 +1,7 @@ import { style } from '@vanilla-extract/css' +import { subheadSmall } from 'nft/css/common.css' -import { sprinkles, vars } from '../../../css/sprinkles.css' +import { sprinkles, themeVars, vars } from '../../../css/sprinkles.css' export const section = style([ sprinkles({ @@ -20,16 +21,12 @@ export const ethIcon = style({ marginBottom: '-3px', }) -export const collectionName = style([ - sprinkles({ - fontWeight: 'normal', - overflow: 'hidden', - paddingRight: '14', - }), +export const subRowHover = style([ + subheadSmall, { - textOverflow: 'ellipsis', - whiteSpace: 'nowrap', - maxWidth: '180px', + ':hover': { + background: themeVars.colors.backgroundInteractive, + }, }, ])