From 3a38b2797cca631c028f47f2285c645adbdbc496 Mon Sep 17 00:00:00 2001 From: Mikkel Laursen Date: Sun, 19 Nov 2023 10:43:06 -0500 Subject: [PATCH] chore(docs): additional tweeks to material icons and symbols page --- .../AdditionalChanges.tsx | 6 +- .../FilterCategoryPanel.tsx | 6 +- .../FilterStylePanel.tsx | 11 ++-- .../FiltersSheet.tsx | 6 +- .../HowToUseSheetContent.tsx | 25 ++++---- .../IconImportAndUsage.tsx | 14 ++--- .../MaterialIconsAndSymbolsProvider.tsx | 28 +++++++-- .../material-icons-and-symbols/NoMatches.tsx | 7 +-- .../SVGIconImportAndUsage.tsx | 24 ++++++-- .../searchParams.ts | 58 +++++++++++-------- .../material-icons-and-symbols/types.ts | 16 +++-- .../material-icons-and-symbols/utils.ts | 19 +++--- 12 files changed, 132 insertions(+), 88 deletions(-) diff --git a/apps/docs/src/app/components/material-icons-and-symbols/AdditionalChanges.tsx b/apps/docs/src/app/components/material-icons-and-symbols/AdditionalChanges.tsx index 8a19566c3f..437cb736a2 100644 --- a/apps/docs/src/app/components/material-icons-and-symbols/AdditionalChanges.tsx +++ b/apps/docs/src/app/components/material-icons-and-symbols/AdditionalChanges.tsx @@ -6,6 +6,7 @@ import styles from "./AdditionalChanges.module.scss"; import { AdditionalChangesPanels } from "./AdditionalChangesPanels.js"; import { MaterialConfigChanges } from "./MaterialConfigChanges.js"; import { useMaterialIconsAndSymbols } from "./MaterialIconsAndSymbolsProvider.js"; +import { isMaterialIconType } from "./searchParams.js"; export interface AdditionalChangesProps { isSvg?: boolean; @@ -17,8 +18,9 @@ export function AdditionalChanges( const { isSvg } = props; const { iconType } = useMaterialIconsAndSymbols(); - const configDescription = - iconType === "icon" ? "icon family" : "symbol customizations"; + const configDescription = isMaterialIconType(iconType) + ? "icon family" + : "symbol customizations"; return ( <> diff --git a/apps/docs/src/app/components/material-icons-and-symbols/FilterCategoryPanel.tsx b/apps/docs/src/app/components/material-icons-and-symbols/FilterCategoryPanel.tsx index 26a6ad6fb5..43836e4d3f 100644 --- a/apps/docs/src/app/components/material-icons-and-symbols/FilterCategoryPanel.tsx +++ b/apps/docs/src/app/components/material-icons-and-symbols/FilterCategoryPanel.tsx @@ -12,6 +12,7 @@ import { MATERIAL_ICON_CATEGORIES, MATERIAL_SYMBOL_CATEGORIES, } from "./metadata.js"; +import { isMaterialIconType } from "./searchParams.js"; export function FilterCategoryPanel( props: ProvidedExpansionPanelProps @@ -19,8 +20,9 @@ export function FilterCategoryPanel( const { isDesktop } = useAppSize(); const { iconType, iconCategory, setIconCategory } = useMaterialIconsAndSymbols(); - const iconCategories = - iconType === "icon" ? MATERIAL_ICON_CATEGORIES : MATERIAL_SYMBOL_CATEGORIES; + const iconCategories = isMaterialIconType(iconType) + ? MATERIAL_ICON_CATEGORIES + : MATERIAL_SYMBOL_CATEGORIES; return ( } name="Style"> @@ -32,7 +32,8 @@ export function FilterStylePanel( onChange={(event) => setIconType(event.currentTarget.value)} > - + +