From 14a14436e56c86ed33383a811f22d18738d75bb4 Mon Sep 17 00:00:00 2001 From: prostarz Date: Sun, 5 Jan 2025 13:56:44 +0000 Subject: [PATCH] feat(ui): update to custom typography comps --- src/components/cards/defaultCard.tsx | 21 +++++---- src/components/cards/listCard/overlay.tsx | 6 ++- src/components/cards/pluginCard.tsx | 25 ++++++----- src/components/cards/sourcecard.tsx | 12 ++--- src/components/data-table/pagination.tsx | 21 +++++---- src/components/errorComponent/index.tsx | 10 ++--- src/components/info/media/index.tsx | 3 +- src/components/info/similar/index.tsx | 5 +-- src/components/info/sources/index.tsx | 10 ++--- src/components/info/specs/index.tsx | 5 +-- src/components/info/specs/row.tsx | 11 ++--- src/components/info/tabs/about.tsx | 44 ++++++++++--------- src/components/info/topbar/title.tsx | 6 +-- src/components/titleBar/index.tsx | 5 +-- src/components/typography/h4.tsx | 18 ++++++++ src/components/typography/h5.tsx | 18 ++++++++ src/components/typography/muted.tsx | 15 +++++++ .../components/cards/achievement.tsx | 12 ++--- .../achievements/components/container.tsx | 12 ++--- .../components/cards/download/percentBar.tsx | 9 ++-- .../components/cards/download/stat.tsx | 9 ++-- .../components/cards/download/title.tsx | 4 +- .../downloads/components/cards/loading.tsx | 8 ++-- .../ContinuePlayingCardOverlay/index.tsx | 16 ++++--- .../components/container/listContainer.tsx | 9 ++-- src/features/settings/components/section.tsx | 10 +++-- src/features/settings/components/sidebar.tsx | 13 +++--- .../settings/logDisplay/logTypes/error.tsx | 3 +- .../settings/logDisplay/logTypes/info.tsx | 3 +- .../settings/logDisplay/logTypes/warn.tsx | 3 +- src/features/settings/components/title.tsx | 3 +- src/features/updater/components/updater.tsx | 26 +++++------ src/routes/downloads.lazy.tsx | 9 ++-- 33 files changed, 231 insertions(+), 153 deletions(-) create mode 100644 src/components/typography/h4.tsx create mode 100644 src/components/typography/h5.tsx create mode 100644 src/components/typography/muted.tsx diff --git a/src/components/cards/defaultCard.tsx b/src/components/cards/defaultCard.tsx index 41505f1..d46b732 100644 --- a/src/components/cards/defaultCard.tsx +++ b/src/components/cards/defaultCard.tsx @@ -3,6 +3,8 @@ import { Link } from "@tanstack/react-router"; import { format } from "date-fns"; import { useMemo } from "react"; import IGDBImage from "../IGDBImage"; +import { H5 } from "../typography/h5"; +import { TypographyMuted } from "../typography/muted"; import { Card, CardContent } from "../ui/card"; type DefaultCardProps = (IGDBReturnDataType | SimilarGame) & { @@ -37,30 +39,33 @@ const DefaultCard = ({
-

+

{name} -
+ {!!findReleaseDate && !!findReleaseDate?.date && (
-

+ {format( new Date(findReleaseDate?.date * 1000), "MMMM d, yyyy" )} -

+
)} -
    +
    {!!genres?.length && genres.slice(0, 2).map((genre, i) => ( -
  • + {genre.name} {i !== genres.slice(0, 2).length - 1 ? "," : ""} -
  • + ))} -
+
diff --git a/src/components/cards/listCard/overlay.tsx b/src/components/cards/listCard/overlay.tsx index 157c654..da8d195 100644 --- a/src/components/cards/listCard/overlay.tsx +++ b/src/components/cards/listCard/overlay.tsx @@ -1,3 +1,5 @@ +import { H5 } from "@/components/typography/h5"; + interface ListCardOverlayProps { title: string; } @@ -6,9 +8,9 @@ const ListCardOverlay: React.FC = ({ title }) => (
-

+

{title} -
+
diff --git a/src/components/cards/pluginCard.tsx b/src/components/cards/pluginCard.tsx index 4c5daca..dd5cacb 100644 --- a/src/components/cards/pluginCard.tsx +++ b/src/components/cards/pluginCard.tsx @@ -4,6 +4,8 @@ import { useLanguageContext } from "@/contexts/I18N"; import { usePluginActions } from "@/hooks"; import { cn, openLink } from "@/lib"; import { Download, Trash2 } from "lucide-react"; +import { TypographyMuted } from "../typography/muted"; +import { TypographySmall } from "../typography/small"; interface Props { image: string; @@ -58,36 +60,35 @@ const PluginCard = ({ />
-

+ {needsUpdate && ( [Update available] )} {id} - V{version}{" "} -

+ -

{name}

+ {name} {!!author && ( -

{ if (author.url) openLink(author.url); }} > {author.name} -

+ )}
-

{description}

+ + {description} +
diff --git a/src/components/cards/sourcecard.tsx b/src/components/cards/sourcecard.tsx index f828834..95374a7 100644 --- a/src/components/cards/sourcecard.tsx +++ b/src/components/cards/sourcecard.tsx @@ -8,6 +8,8 @@ import { useAccountServices } from "@/stores/account-services"; import { CloudDownload, ShoppingCart } from "lucide-react"; import { useCallback } from "react"; import { sanitizeFilename } from "../../lib/utils"; +import { H3 } from "../typography/h3"; +import { P } from "../typography/p"; import { Button } from "../ui/button"; import { Card } from "../ui/card"; @@ -121,13 +123,13 @@ export const SourceCard = ({ source, ...props }: SourceCardProps) => { return ( -
+
{isDeal(source) ? ( <> -

{source.shop.name}

-

+

{source.shop.name}

+

{source.url} -

+

-

Rows per page

+ + Rows per page +