Skip to content

Commit b20303c

Browse files
author
prostarz
committed
feat(ui): improve ui
1 parent 14a1443 commit b20303c

File tree

21 files changed

+63
-51
lines changed

21 files changed

+63
-51
lines changed

src/components/cards/bannerCard.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const BannerCard = ({
3232
return (
3333
<div className="relative w-full overflow-hidden rounded-lg h-80">
3434
<div className="absolute inset-0 z-0 w-full h-full overflow-hidden">
35-
<span className="absolute w-full h-full z-[1] from-background to-transparent bg-gradient-to-tr" />
35+
<div className="absolute w-full h-full z-[1] from-background to-transparent bg-gradient-to-tr" />
3636
<IGDBImage
3737
imageSize="720p"
3838
imageId={cover.image_id}
@@ -54,7 +54,7 @@ const BannerCard = ({
5454
imageSize="screenshot_med"
5555
key={screenshot.id}
5656
imageId={screenshot.image_id}
57-
className="object-cover rounded-md w-52 aspect-video"
57+
className="object-cover w-48 rounded-md aspect-video lg:w-56"
5858
alt={name}
5959
/>
6060
))}

src/components/cards/pluginCard.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ const PluginCard = ({
6262
<div className="flex flex-col items-start justify-end">
6363
<TypographyMuted className="flex items-center gap-1 font-medium">
6464
{needsUpdate && (
65-
<span className="font-bold text-red-500">
65+
<TypographySmall className="font-bold text-red-500">
6666
[Update available]
67-
</span>
67+
</TypographySmall>
6868
)}
6969
{id} - V{version}{" "}
7070
</TypographyMuted>

src/components/cards/sourcecard.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,9 @@ export const SourceCard = ({ source, ...props }: SourceCardProps) => {
152152
fill="currentColor"
153153
className="flex-shrink-0"
154154
/>
155-
<span className="max-w-full capitalize truncate">
155+
<P className="max-w-full capitalize truncate">
156156
{source?.uploader ?? t("download")}
157-
</span>
157+
</P>
158158
</Button>
159159
</>
160160
)}

src/components/containers/section.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { useState } from "react";
66
import DefaultCard from "../cards/defaultCard";
77
import Spinner from "../spinner";
88
import { H1 } from "../typography/h1";
9+
import { TypographyMuted } from "../typography/muted";
910
import { Button } from "../ui/button";
1011
import MainContainer from "./mainContainer";
1112

@@ -82,7 +83,7 @@ export const Section = ({ title, dataToFetch }: Props) => {
8283
<ChevronLeft />
8384
</Button>
8485

85-
<span className="text-lg text-muted-foreground">Page {page}</span>
86+
<TypographyMuted>Page {page}</TypographyMuted>
8687

8788
<Button variant={"ghost"} onClick={handleNextPage} size={"icon"}>
8889
<ChevronRight />

src/features/library/components/containers/activeLibraryGame.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { useMemo } from "react";
22
import { useGames } from "../../hooks/useGames";
33
import ContinuePlayingCard from "../cards/continuePlaying";
4+
import { H5 } from "@/components/typography/h5";
45

56
const ActiveLibraryGame = () => {
67
const { fetchGames, deleteGame, updateGame, games } = useGames(true);
@@ -21,9 +22,7 @@ const ActiveLibraryGame = () => {
2122
))}
2223
</div>
2324
) : (
24-
<p className="text-lg font-semibold">
25-
You have not added any games to continue playing.
26-
</p>
25+
<H5>You have not added any games to continue playing.</H5>
2726
);
2827
};
2928

src/features/library/components/containers/activeLibraryList.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import ListCard from "@/components/cards/listCard";
2+
import { H5 } from "@/components/typography/h5";
3+
import { P } from "@/components/typography/p";
24
import { useLists } from "@/features/lists/hooks/useLists";
35
import { useQuery } from "@tanstack/react-query";
46
import { useMemo } from "react";
@@ -22,17 +24,15 @@ const ActiveLibraryList = ({ listId }: ActiveLibraryListProps) => {
2224
if (isPending) {
2325
return (
2426
<div className="flex items-center justify-center">
25-
<p className="text-lg font-semibold">Loading...</p>
27+
<H5>Loading...</H5>
2628
</div>
2729
);
2830
}
2931

3032
if (isError) {
3133
return (
3234
<div className="flex items-center justify-center">
33-
<p className="text-lg font-semibold">
34-
Something went wrong. Please try again later.
35-
</p>
35+
<H5>Something went wrong. Please try again later.</H5>
3636
</div>
3737
);
3838
}
@@ -44,7 +44,7 @@ const ActiveLibraryList = ({ listId }: ActiveLibraryListProps) => {
4444
))}
4545
</div>
4646
) : (
47-
<p className="text-lg font-semibold">No games in this list.</p>
47+
<P>No games in this list.</P>
4848
);
4949
};
5050

src/features/library/components/containers/tabs.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Tab } from "@/@types";
2+
import { H5 } from "@/components/typography/h5";
23
import { Button } from "@/components/ui/button";
34
import {
45
Carousel,
@@ -88,7 +89,7 @@ const LibraryTabs = ({ tabs, activeTab, setActiveTab }: LibraryTabsProps) => {
8889
<DialogTrigger>
8990
<Button className="text-white bg-gradient-to-tr from-blue-400 to-purple-400 gap-1.5 rounded-full hover:opacity-90 transition-all">
9091
<Plus strokeWidth={3} />
91-
<span className="font-bold">New Game</span>
92+
<H5>New Game</H5>
9293
</Button>
9394
</DialogTrigger>
9495
<NewGameModal />
@@ -126,7 +127,7 @@ const LibraryTabs = ({ tabs, activeTab, setActiveTab }: LibraryTabsProps) => {
126127
<DialogTrigger>
127128
<Button className="rounded-full gap-1.5 ml-1">
128129
<Plus strokeWidth={3} />
129-
<span className="font-bold">New List</span>
130+
<H5>New List</H5>
130131
</Button>
131132
</DialogTrigger>
132133
<NewListDialogContent open={newListOpen} setOpen={setNewListOpen} />

src/features/library/components/modals/newGame/import.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import { InputWithIcon } from "@/components/inputWithIcon";
2+
import { TypographyMuted } from "@/components/typography/muted";
3+
import { TypographySmall } from "@/components/typography/small";
24
import { PopoverContent } from "@/components/ui/popover";
35
import useSearch from "@/features/search/hooks/useSearch";
46
import { cn, getSteamIdFromWebsites } from "@/lib";
@@ -69,10 +71,12 @@ const NewGameImport = ({ form, setPopoverOpen }: NewGameImportProps) => {
6971
onClick={() => handleClick(game)}
7072
>
7173
<div className="flex gap-1.5">
72-
<p className="flex-1 text-sm line-clamp-2">{game?.name}</p>
73-
<span className="text-xs text-muted-foreground">
74+
<TypographySmall className="flex-1 line-clamp-2">
75+
{game?.name}
76+
</TypographySmall>
77+
<TypographyMuted>
7478
({game?.release_dates?.[0]?.human})
75-
</span>
79+
</TypographyMuted>
7680
</div>
7781
</div>
7882
))

src/features/library/components/playtime.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { P } from "@/components/typography/p";
12
import { Badge } from "@/components/ui/badge";
23
import { Clock } from "lucide-react";
34
import ms from "ms";
@@ -12,11 +13,11 @@ const Playtime = ({ playtime }: PlaytimeProps) => {
1213
return (
1314
<Badge className="flex items-center gap-1.5 px-2.5 py-1.5 h-full rounded-lg text-foreground backdrop-blur-md">
1415
<Clock size={16} className="text-foreground" />
15-
<span className="font-semibold uppercase">
16+
<P className="uppercase">
1617
{ms(playtime, {
1718
long: true,
1819
})}
19-
</span>
20+
</P>
2021
</Badge>
2122
);
2223
};

src/features/library/components/updateForm.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { P } from "@/components/typography/p";
12
import { Button } from "@/components/ui/button";
23
import { DialogClose, DialogFooter } from "@/components/ui/dialog";
34
import { Form, FormField } from "@/components/ui/form";
@@ -147,9 +148,9 @@ const UpdateGameForm = ({ defaultValues, onSubmit }: UpdateGameFormProps) => {
147148
field={field}
148149
/>
149150
{form.formState.errors.gameArgs && (
150-
<p className="w-full text-right text-red-500">
151+
<P className="w-full text-right text-red-500">
151152
{form.formState.errors.gameArgs.message}
152-
</p>
153+
</P>
153154
)}
154155
</>
155156
)}
@@ -212,7 +213,7 @@ const UpdateGameForm = ({ defaultValues, onSubmit }: UpdateGameFormProps) => {
212213
{loading ? `${t("updating")}...` : t("update_game")}
213214
</Button>
214215
</DialogFooter>
215-
{error && <p className="w-full text-right text-red-500">{error}</p>}
216+
{error && <P className="w-full text-right text-red-500">{error}</P>}
216217
</Form>
217218
);
218219
};

src/features/lists/components/container/listContainer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const ListContainer = ({ list_id, list_name }: ListContainerProps) => {
4545
</Button>
4646
</TooltipTrigger>
4747
<TooltipContent>
48-
<p>Edit List</p>
48+
<P>Edit List</P>
4949
</TooltipContent>
5050
</Tooltip>
5151

@@ -56,7 +56,7 @@ const ListContainer = ({ list_id, list_name }: ListContainerProps) => {
5656
</Button>
5757
</TooltipTrigger>
5858
<TooltipContent>
59-
<p>Delete List</p>
59+
<P>Delete List</P>
6060
</TooltipContent>
6161
</Tooltip>
6262
</div>

src/features/lists/components/dropdownContent.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { P } from "@/components/typography/p";
12
import { DialogTrigger } from "@/components/ui/dialog";
23
import {
34
DropdownMenuContent,
@@ -39,7 +40,7 @@ const ListsDropdownContent = (props: Props) => {
3940
<div className="overflow-y-auto max-h-24">
4041
{!lists?.length ? (
4142
<div className="flex items-center justify-center gap-2 p-2">
42-
<p className="text-center">{t("create_new_list")}</p>
43+
<P className="text-center">{t("create_new_list")}</P>
4344
</div>
4445
) : (
4546
lists.map((list) => (
@@ -56,7 +57,7 @@ const ListsDropdownContent = (props: Props) => {
5657
<DialogTrigger>
5758
<div className="flex items-center gap-1.5">
5859
<PlusIcon className="size-5 " />
59-
<p className="text-sm">Create a new collection</p>
60+
<P>Create a new list</P>
6061
</div>
6162
</DialogTrigger>
6263
</DropdownMenuItem>

src/features/lists/components/dropdownItem.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import Confirmation from "@/components/confirmation";
2+
import { P } from "@/components/typography/p";
23
import { Button } from "@/components/ui/button";
34
import { DropdownMenuCheckboxItem } from "@/components/ui/dropdown-menu";
45
import { IGDBReturnDataType } from "@/lib/api/igdb/types";
@@ -73,7 +74,7 @@ const ListsDropdownItem = ({
7374
onSelect={handleSelect}
7475
disabled={loading}
7576
>
76-
<span className="truncate">{children || game.name}</span>
77+
<P className="truncate">{children || game.name}</P>
7778
</DropdownMenuCheckboxItem>
7879
</div>
7980

src/features/realDebrid/components/realDebridDialogContent.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import { ExternalNewAccountInput } from "@/@types/accounts";
2+
import { TypographyMuted } from "@/components/typography/muted";
3+
import { P } from "@/components/typography/p";
24
import { DialogContent, DialogTitle } from "@/components/ui/dialog";
35
import { invoke } from "@/lib";
46
import { User } from "@/lib/api/realdebrid/user";
@@ -112,12 +114,12 @@ const RealDebridDialogContent = ({
112114
"loading..."
113115
) : (
114116
<div className="flex flex-col gap-3">
115-
<p>Please go to the following URL and enter the code:</p>
116-
<p className="text-sm text-muted-foreground">
117-
{deviceCodeInfo.verification_url}
118-
</p>
119-
<p>Enter the code: {deviceCodeInfo.user_code}</p>
120-
<p>Expires in: {deviceCodeInfo.expires_in} seconds</p>
117+
<P>Please go to the following URL and enter the code:</P>
118+
<TypographyMuted>{deviceCodeInfo.verification_url}</TypographyMuted>
119+
<P>Enter the code: {deviceCodeInfo.user_code}</P>
120+
<TypographyMuted>
121+
Expires in: {deviceCodeInfo.expires_in} seconds
122+
</TypographyMuted>
121123
</div>
122124
)}
123125
</div>

src/features/search/components/card.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { TypographyMuted } from "@/components/typography/muted";
2+
import { P } from "@/components/typography/p";
13
import { IGDBReturnDataType } from "@/lib/api/igdb/types";
24
import { Link } from "@tanstack/react-router";
35

@@ -20,8 +22,8 @@ const SearchCard = ({
2022
onClick={() => setOpen(false)}
2123
>
2224
<div className="flex gap-1.5">
23-
<p className="flex-1 text-sm line-clamp-2">{name}</p>
24-
<span className="text-xs text-muted-foreground">({year})</span>
25+
<P className="flex-1 line-clamp-2">{name}</P>
26+
<TypographyMuted>{year}</TypographyMuted>
2527
</div>
2628
</Link>
2729
);

src/features/settings/components/section.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,7 @@ export const SettingsSection = ({
2020
<div className="p-4 space-y-4 shadow-md rounded-xl bg-card/40">
2121
{(title || description) && (
2222
<div className={cn("flex flex-col mb-4")}>
23-
{title && (
24-
<H3>
25-
<span>{t("settings.settings." + title)}</span>
26-
</H3>
27-
)}
23+
{title && <H3>{t("settings.settings." + title)}</H3>}
2824
{description && (
2925
<TypographyMuted>
3026
{t("settings.settings." + description)}

src/features/settings/components/tab.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { P } from "@/components/typography/p";
12
import { cn } from "@/lib/utils";
23
import { JSX } from "react";
34

@@ -22,7 +23,7 @@ const SettingTab = ({ icon, title, isActive, onClick }: SettingTabProps) => {
2223
onClick={onClick}
2324
>
2425
{icon}
25-
<span className="truncate">{title}</span>
26+
<P className="truncate">{title}</P>
2627
</button>
2728
);
2829
};

src/features/settings/components/tabs/developer/settings/logDisplay/logWindow.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { H5 } from "@/components/typography/h5";
12
import { ScrollArea } from "@/components/ui/scroll-area";
23
import { useLogger } from "@/hooks";
34
import { cn } from "@/lib";
@@ -32,7 +33,7 @@ const LogWindow = ({ enabled }: LogWindowProps) => {
3233
})
3334
) : (
3435
<div className="flex items-center justify-center size-full">
35-
<p className="text-lg font-bold">No logs</p>
36+
<H5>No logs</H5>
3637
</div>
3738
)}
3839
</div>

src/features/settings/components/tabs/plugins/display.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { PluginSetupJSONDisabled } from "@/@types";
22
import PluginCard from "@/components/cards/pluginCard";
3+
import { H5 } from "@/components/typography/h5";
34
import { ScrollArea } from "@/components/ui/scroll-area";
45
import UsePlugins from "@/hooks/usePlugins";
56
import { cn } from "@/lib";
@@ -97,10 +98,10 @@ const PluginDisplay = ({
9798
/>
9899
))
99100
) : (
100-
<div className="w-full flex items-center justify-start py-2">
101-
<p className="text-left text-lg w-full font-bold">
101+
<div className="flex items-center justify-start w-full py-2">
102+
<H5 className="w-full text-left">
102103
{search?.length ? `No results for "${search}"` : "No plugins"}
103-
</p>
104+
</H5>
104105
</div>
105106
)}
106107
</div>

src/features/splashscreen/components/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const SplashScreen = () => {
66
return (
77
<div className="relative w-screen h-screen overflow-hidden bg-background z-[9999]">
88
<div className="splash-bg">
9-
<span></span>
9+
<span />
1010
<img src={bgImage} alt="icon" />
1111
</div>
1212

src/features/torBox/components/torBoxDialogContent.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { ExternalNewAccountInput } from "@/@types/accounts";
2+
import { H3 } from "@/components/typography/h3";
23
import { Button } from "@/components/ui/button";
34
import { DialogContent, DialogTitle } from "@/components/ui/dialog";
45
import { Input } from "@/components/ui/input";
@@ -67,13 +68,12 @@ const TorBoxDialogContent = ({ open, setOpen }: TorBoxDialogContentProps) => {
6768
<DialogContent>
6869
<DialogTitle>TorBox</DialogTitle>
6970
<div className="flex flex-col gap-3">
70-
<p>Please enter your TorBox API key below:</p>
71+
<H3>Please enter your TorBox API key below:</H3>
7172
<Input
7273
type="text"
7374
value={apiKey}
7475
onChange={(e) => setApiKey(e.target.value)}
7576
placeholder="Enter API key"
76-
className="p-2 border rounded"
7777
/>
7878
<div className="flex justify-end gap-3 mt-3">
7979
<Button onClick={handleClose} variant={"destructive"}>

0 commit comments

Comments
 (0)