From f76a22c3faac526f24d131afaf044c7aa68e7eb2 Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Tue, 12 Sep 2023 15:12:34 +0800 Subject: [PATCH] Better handling of subscription type searches --- .../templates/homeFeed/LibraryFilterMenu.tsx | 29 ++++++++++++++----- .../templates/homeFeed/LibraryHeader.tsx | 2 +- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/packages/web/components/templates/homeFeed/LibraryFilterMenu.tsx b/packages/web/components/templates/homeFeed/LibraryFilterMenu.tsx index 6ab19f3eb..71a6c0c4c 100644 --- a/packages/web/components/templates/homeFeed/LibraryFilterMenu.tsx +++ b/packages/web/components/templates/homeFeed/LibraryFilterMenu.tsx @@ -5,6 +5,7 @@ import { Button } from '../../elements/Button' import { Circle } from 'phosphor-react' import { Subscription, + SubscriptionType, useGetSubscriptionsQuery, } from '../../../lib/networking/queries/useGetSubscriptionsQuery' import { useGetLabelsQuery } from '../../../lib/networking/queries/useGetLabelsQuery' @@ -200,14 +201,26 @@ function Subscriptions( {...props} /> {(props.subscriptions ?? []).map((item) => { - return ( - - ) + switch (item.type) { + case SubscriptionType.NEWSLETTER: + return ( + + ) + case SubscriptionType.RSS: + return ( + + ) + } })} { setSearchTerm(props.searchTerm ?? '')