Skip to content

Commit

Permalink
feat(ui): adjust more buttons to fit with new style + add icon to inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
prostarz committed Jan 3, 2025
1 parent aa6494d commit 096e103
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 44 deletions.
2 changes: 1 addition & 1 deletion src/components/cards/bannerCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const BannerCard = ({
<div className="flex flex-row gap-3">
<TrailerButton name={name} videos={videos} />
<Link
className={buttonVariants({ variant: "secondary" })}
className={buttonVariants()}
to="/info/$id"
params={{ id: id.toString() }}
>
Expand Down
2 changes: 1 addition & 1 deletion src/components/errorComponent/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const ErrorComponent = (props: ErrorComponentProps) => {
</div>
<div className="flex flex-col items-center w-full">
<div className="flex flex-row justify-between w-full gap-2">
<Link to="/" className={buttonVariants({ variant: "secondary" })}>
<Link to="/" className={buttonVariants()}>
Go to Home
</Link>
<h1 className="text-xl font-bold">
Expand Down
6 changes: 2 additions & 4 deletions src/components/trailer/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { useLanguageContext } from "@/contexts/I18N";
import { IGDBReturnDataType } from "@/lib/api/igdb/types";
import { Button } from "../ui/button";
import { Dialog, DialogTrigger } from "../ui/dialog";
import TrailerDialogContent from "./dialogContent";
import { useLanguageContext } from "@/contexts/I18N";

type Props = Pick<IGDBReturnDataType, "name" | "videos">;

Expand All @@ -12,9 +12,7 @@ const TrailerButton = (props: Props) => {
return (
<Dialog>
<DialogTrigger>
<Button variant="secondary" className="capitalize">
{t("trailer")}
</Button>
<Button className="capitalize">{t("trailer")}</Button>
</DialogTrigger>

<TrailerDialogContent {...props} />
Expand Down
7 changes: 1 addition & 6 deletions src/features/downloads/components/cards/download/actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,7 @@ const DownloadCardActions = ({
return (
<div className="flex flex-row gap-4">
{status === "paused" ? (
<Button
size="default"
variant="secondary"
className="gap-2"
onClick={start ?? undefined}
>
<Button size="default" className="gap-2" onClick={start ?? undefined}>
<Play className="fill-current" size="24" />
Start Download
</Button>
Expand Down
5 changes: 1 addition & 4 deletions src/features/library/components/containers/tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,7 @@ const LibraryTabs = ({ tabs, activeTab, setActiveTab }: LibraryTabsProps) => {
{/* New Game Button */}
<Dialog open={newGameOpen} onOpenChange={setNewGameOpen}>
<DialogTrigger>
<Button
variant="secondary"
className="text-white bg-gradient-to-tr from-blue-400 to-purple-400 gap-1.5 rounded-full"
>
<Button className="text-white bg-gradient-to-tr from-blue-400 to-purple-400 gap-1.5 rounded-full hover:opacity-90 transition-all">
<Plus strokeWidth={3} />
<span className="font-bold">New Game</span>
</Button>
Expand Down
7 changes: 4 additions & 3 deletions src/features/library/components/modals/newGame/import.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Input } from "@/components/ui/input";
import { InputWithIcon } from "@/components/inputWithIcon";
import { PopoverContent } from "@/components/ui/popover";
import useSearch from "@/features/search/hooks/useSearch";
import { cn, getSteamIdFromWebsites } from "@/lib";
import { IGDBReturnDataType } from "@/lib/api/igdb/types";
import { t } from "i18next";
import { ShipWheel } from "lucide-react";
import { SearchIcon, ShipWheel } from "lucide-react";
import { Dispatch, SetStateAction, useState } from "react";
import { UseFormReturn } from "react-hook-form";
import { NewGameFormSchema } from "./schema";
Expand Down Expand Up @@ -42,11 +42,12 @@ const NewGameImport = ({ form, setPopoverOpen }: NewGameImportProps) => {
<PopoverContent side="top" className="p-0 w-96">
<div className="grid gap-4">
<div className="w-full px-4 pt-4">
<Input
<InputWithIcon
placeholder={t("search_placeholder")}
className="w-full"
onChange={(e) => setSearchTerm(e.target.value)}
value={searchTerm}
startIcon={<SearchIcon />}
/>
</div>

Expand Down
8 changes: 2 additions & 6 deletions src/features/library/components/modals/newGame/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,12 @@ const NewGameModal = () => {
<div className="flex items-center justify-between gap-2 mt-4">
<Popover open={popoverOpen} onOpenChange={setPopoverOpen}>
<PopoverTrigger asChild>
<Button variant="secondary">{t("import_from_igdb")}</Button>
<Button>{t("import_from_igdb")}</Button>
</PopoverTrigger>
<NewGameImport form={form} setPopoverOpen={setPopoverOpen} />
</Popover>

<Button
type="submit"
variant="secondary"
onClick={form.handleSubmit(handleAddGame)}
>
<Button type="submit" onClick={form.handleSubmit(handleAddGame)}>
{t("add_game")}
</Button>
</div>
Expand Down
18 changes: 3 additions & 15 deletions src/features/library/components/updateForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,7 @@ const UpdateGameForm = ({ defaultValues, onSubmit }: UpdateGameFormProps) => {
text={t("path")}
description={t("the_path_to_the_game")}
Button={
<Button
size="icon"
variant="secondary"
onClick={handlePathButton}
>
<Button size="icon" onClick={handlePathButton}>
<FolderOpen />
</Button>
}
Expand All @@ -131,11 +127,7 @@ const UpdateGameForm = ({ defaultValues, onSubmit }: UpdateGameFormProps) => {
description={t("the_path_or_url_of_the_icon")}
required
Button={
<Button
size="icon"
variant="secondary"
onClick={handleIconButton}
>
<Button size="icon" onClick={handleIconButton}>
<FolderOpen />
</Button>
}
Expand Down Expand Up @@ -216,11 +208,7 @@ const UpdateGameForm = ({ defaultValues, onSubmit }: UpdateGameFormProps) => {
<DialogClose>
<Button variant="destructive">{t("cancel")}</Button>
</DialogClose>
<Button
variant="secondary"
onClick={form.handleSubmit(onSubmit)}
disabled={loading}
>
<Button onClick={form.handleSubmit(onSubmit)} disabled={loading}>
{loading ? `${t("updating")}...` : t("update_game")}
</Button>
</DialogFooter>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const AddAccountButton = () => {
return (
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button variant="secondary">Add Account</Button>
<Button>Add Account</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="start">
<DropdownMenuLabel>Choose an account</DropdownMenuLabel>
Expand Down
2 changes: 1 addition & 1 deletion src/features/settings/components/tabs/miscellaneous.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const MiscellaneousSettings = () => {
<SettingsContainer>
<SettingsSection title="reset-igdb-cache">
<SettingsItem title="reset-igdb-cache">
<Button variant="secondary" onClick={handleResetCache}>
<Button onClick={handleResetCache}>
{t("settings.settings.reset-igdb-cache")}
</Button>
</SettingsItem>
Expand Down
2 changes: 1 addition & 1 deletion src/features/settings/components/tabs/plugins/sort.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const PluginsSort = ({
<Tooltip>
<TooltipTrigger>
<Button
variant={showEnabledOnly ? "secondary" : "ghost"}
variant={showEnabledOnly ? "default" : "ghost"}
size={"icon"}
onClick={() => {
localStorage.setItem("showEnabledOnly", String(!showEnabledOnly));
Expand Down
1 change: 0 additions & 1 deletion src/features/updater/components/updater.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ const Updater = () => {
<Button variant="destructive">{t("later")}</Button>
</DialogClose>
<Button
variant="secondary"
onClick={installUpdate}
disabled={progress !== undefined && progress > 0}
>
Expand Down

0 comments on commit 096e103

Please sign in to comment.