From 7efcf7f300fff63f8f03e4820d3bbeead9bcded0 Mon Sep 17 00:00:00 2001 From: "Jeff." Date: Sun, 19 Jan 2025 21:08:51 -0400 Subject: [PATCH] Update .gitignore, refactor Header component for type safety, and adjust API URLs in context files --- .gitignore | 3 + src/components/Header/Header.tsx | 2 +- src/components/ItemList/ItemList.tsx | 6 +- .../ProfilesDetails/ProfilesDetails.tsx | 39 ++---- src/components/Searcher/Searcher.tsx | 8 +- src/context/AddonsContext.tsx | 63 +++++---- src/context/ElvUIContext.tsx | 12 +- src/context/WeakAurasContext.tsx | 9 +- src/hook/useFilterAddons.ts | 42 +++--- src/pages/Addons/Addons.tsx | 24 ++-- src/pages/Addons/AddonsDetails.tsx | 120 ++++++++++++++---- src/pages/ElvUI/ElvUI.tsx | 6 +- src/types/index.ts | 48 ++++--- 13 files changed, 219 insertions(+), 163 deletions(-) diff --git a/.gitignore b/.gitignore index 3fc984c..0354146 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,9 @@ lerna-debug.log* MaddonsManager.github.io.code-workspace .react-router/ +.env +.env.production +.env.development node_modules dist dist-ssr diff --git a/src/components/Header/Header.tsx b/src/components/Header/Header.tsx index d9b705f..c86479b 100644 --- a/src/components/Header/Header.tsx +++ b/src/components/Header/Header.tsx @@ -9,7 +9,7 @@ interface HeaderProps { const Header = ({ data }: HeaderProps) => { const { pathname } = useLocation() - const getPageLabel = () => { + const getPageLabel = (): string | undefined => { const allNavItems = [...siteConfig.navItems, ...siteConfig.navItemsAccord] return allNavItems.find((item) => item.href.toLowerCase() === pathname.toLowerCase())?.label } diff --git a/src/components/ItemList/ItemList.tsx b/src/components/ItemList/ItemList.tsx index dccd483..d66609e 100644 --- a/src/components/ItemList/ItemList.tsx +++ b/src/components/ItemList/ItemList.tsx @@ -1,4 +1,4 @@ -import { Card, CardBody, Image, Button, Tooltip, Chip, Avatar, Divider } from "@heroui/react" +import { Card, CardBody, Image, Button, Tooltip, Chip, Avatar, Divider } from '@heroui/react' import { AnimatePresence } from 'framer-motion' import { classIcon } from '@/utils/classIcon' import { FlameIcon, GroupIcon } from '@/assets/Icons' @@ -16,7 +16,7 @@ const ItemList = ({ data, onOpenDetails, handleCopyToClipboard, itemToShow }: It {data.slice(0, itemToShow).map((item: StringItems) => (
( ) : ( ( + className === 'All' ? ( + + ) : ( + + ) } key={index} color="warning" @@ -107,10 +112,8 @@ const ProfilesDetails = ({ data, isOpen, onOpenChange }: ProfilesDetailsProps) =

95.1k Downloads - 141.9k views

-

- Last updated: {data.lastUpdate} -

-

version: {data.version}

+

Last updated:

+

version:

Description

@@ -118,27 +121,11 @@ const ProfilesDetails = ({ data, isOpen, onOpenChange }: ProfilesDetailsProps) = {data.md} -
- {data.title} -
-
-

Changelogs

- {data.changelog.map((changelog: string, index: number) => ( -

- {changelog} -

- ))} -