diff --git a/app/components/AddNewButton.tsx b/app/components/AddNewButton.tsx index 7b554ea44..32cd0025f 100644 --- a/app/components/AddNewButton.tsx +++ b/app/components/AddNewButton.tsx @@ -1,5 +1,5 @@ -import { LinkButton } from "~/components/Button"; import { Image } from "~/components/Image"; +import { LinkButton } from "~/components/elements/Button"; import { PlusIcon } from "~/components/icons/Plus"; import { navIconUrl } from "~/utils/urls"; @@ -12,7 +12,7 @@ interface AddNewButtonProps { export function AddNewButton({ to, navIcon }: AddNewButtonProps) { return ( - + diff --git a/app/components/BuildCard.tsx b/app/components/BuildCard.tsx index 678257daf..0fa209458 100644 --- a/app/components/BuildCard.tsx +++ b/app/components/BuildCard.tsx @@ -24,10 +24,9 @@ import { weaponBuildPage, } from "~/utils/urls"; import { Ability } from "./Ability"; -import { LinkButton } from "./Button"; import { FormWithConfirm } from "./FormWithConfirm"; import { Image } from "./Image"; -import { SendouButton } from "./elements/Button"; +import { LinkButton, SendouButton } from "./elements/Button"; import { SendouPopover } from "./elements/Popover"; import { EditIcon } from "./icons/Edit"; import { LockIcon } from "./icons/Lock"; @@ -221,7 +220,7 @@ export function BuildCard({ diff --git a/app/components/Button.tsx b/app/components/Button.tsx deleted file mode 100644 index c1cf76659..000000000 --- a/app/components/Button.tsx +++ /dev/null @@ -1,93 +0,0 @@ -import { Link } from "@remix-run/react"; -import type { LinkProps } from "@remix-run/react"; -import clsx from "clsx"; -import * as React from "react"; - -interface ButtonProps extends React.ButtonHTMLAttributes { - variant?: - | "primary" - | "success" - | "outlined" - | "outlined-success" - | "destructive" - | "minimal" - | "minimal-success" - | "minimal-destructive"; - size?: "miniscule" | "tiny" | "big"; - loading?: boolean; - loadingText?: string; - icon?: JSX.Element; - testId?: string; - _ref?: React.LegacyRef | React.ForwardedRef; -} - -type LinkButtonProps = Pick< - ButtonProps, - "variant" | "children" | "className" | "size" | "testId" | "icon" -> & - Pick & { - "data-cy"?: string; - isExternal?: boolean; - onClick?: () => void; - }; - -export function LinkButton({ - variant, - children, - size, - className, - to, - prefetch, - isExternal, - testId, - icon, - preventScrollReset, - onClick, -}: LinkButtonProps) { - if (isExternal) { - return ( - - {icon && - React.cloneElement(icon, { - className: clsx("button-icon", { - lonely: !children, - }), - })} - {children} - - ); - } - - return ( - - {icon && - React.cloneElement(icon, { - className: clsx("button-icon", { lonely: !children }), - })} - {children} - - ); -} diff --git a/app/components/elements/Button.module.css b/app/components/elements/Button.module.css index 049e554a7..830103143 100644 --- a/app/components/elements/Button.module.css +++ b/app/components/elements/Button.module.css @@ -18,15 +18,18 @@ user-select: none; } -.button[data-focus-visible] { +.button[data-focus-visible], +.button:focus-visible { outline: 2px solid var(--theme); } -.button[data-pressed] { +.button[data-pressed], +.button:active { transform: translateY(1px); } -.button[data-disabled] { +.button[data-disabled], +.button:disabled { cursor: not-allowed; opacity: 0.5; transform: initial; diff --git a/app/components/elements/Button.tsx b/app/components/elements/Button.tsx index dfe78020f..48c8da937 100644 --- a/app/components/elements/Button.tsx +++ b/app/components/elements/Button.tsx @@ -1,3 +1,4 @@ +import { Link, type LinkProps } from "@remix-run/react"; import clsx from "clsx"; import * as React from "react"; import { @@ -18,7 +19,8 @@ type ButtonVariant = | "minimal-destructive"; export interface SendouButtonProps - extends Omit { + extends Omit { + className?: string; variant?: ButtonVariant; size?: "miniscule" | "small" | "medium" | "big"; icon?: JSX.Element; @@ -33,47 +35,128 @@ export function SendouButton({ icon, ...rest }: SendouButtonProps) { - const variantClassname = variant ? variantToClassname(variant) : null; - return ( {icon && React.cloneElement(icon, { - className: clsx(icon.props.className, styles.buttonIcon, { - [styles.lonely]: !children, - }), + className: iconClassName(icon.props.className, children), })} {children} ); } -function variantToClassname(variant: ButtonVariant) { - switch (variant) { - case "primary": - return styles.primary; - case "success": - return styles.success; - case "outlined": - return styles.outlined; - case "outlined-success": - return styles.outlinedSuccess; - case "destructive": - return styles.destructive; - case "minimal": - return styles.minimal; - case "minimal-success": - return styles.minimalSuccess; - case "minimal-destructive": - return styles.minimalDestructive; - default: - return assertUnreachable(variant); - } +export interface LinkButtonProps { + to: LinkProps["to"]; + prefetch?: LinkProps["prefetch"]; + preventScrollReset?: LinkProps["preventScrollReset"]; + isExternal?: boolean; + className?: string; + variant?: SendouButtonProps["variant"]; + size?: SendouButtonProps["size"]; + icon?: JSX.Element; + children?: React.ReactNode; + onClick?: React.MouseEventHandler; + testId?: string; +} + +export function LinkButton({ + to, + prefetch, + preventScrollReset, + isExternal, + className, + variant, + size, + icon, + children, + onClick, + testId, +}: LinkButtonProps) { + if (isExternal) { + return ( + + {icon && + React.cloneElement(icon, { + className: iconClassName(icon.props.className, children), + })} + {children} + + ); + } + + return ( + + {icon && + React.cloneElement(icon, { + className: iconClassName(icon.props.className, children), + })} + {children} + + ); +} + +function buttonClassName({ + className, + variant, + size, +}: Pick) { + const variantToClassname = (variant: ButtonVariant) => { + switch (variant) { + case "primary": + return styles.primary; + case "success": + return styles.success; + case "outlined": + return styles.outlined; + case "outlined-success": + return styles.outlinedSuccess; + case "destructive": + return styles.destructive; + case "minimal": + return styles.minimal; + case "minimal-success": + return styles.minimalSuccess; + case "minimal-destructive": + return styles.minimalDestructive; + default: + return assertUnreachable(variant); + } + }; + + return clsx( + className, + variant ? variantToClassname(variant) : null, + styles.button, + { + [styles.small]: size === "small", + [styles.big]: size === "big", + [styles.miniscule]: size === "miniscule", + }, + ); +} + +function iconClassName( + baseClassName: string | undefined, + children: React.ReactNode, +) { + return clsx(baseClassName, styles.buttonIcon, { + [styles.lonely]: !children, + }); } diff --git a/app/components/form/SendouForm.tsx b/app/components/form/SendouForm.tsx index ec2dbd446..aa8c4c1aa 100644 --- a/app/components/form/SendouForm.tsx +++ b/app/components/form/SendouForm.tsx @@ -6,8 +6,8 @@ import { useTranslation } from "react-i18next"; import type { z } from "zod"; import { logger } from "~/utils/logger"; import type { ActionError } from "~/utils/remix.server"; -import { LinkButton } from "../Button"; import { SubmitButton } from "../SubmitButton"; +import { LinkButton } from "../elements/Button"; export function SendouForm({ schema, @@ -65,7 +65,7 @@ export function SendouForm({ {t("common:actions.cancel")} diff --git a/app/components/layout/NotificationPopover.tsx b/app/components/layout/NotificationPopover.tsx index b94168b24..768ccf402 100644 --- a/app/components/layout/NotificationPopover.tsx +++ b/app/components/layout/NotificationPopover.tsx @@ -12,7 +12,7 @@ import { NOTIFICATIONS } from "~/features/notifications/notifications-contants"; import type { RootLoaderData } from "~/root"; import { NOTIFICATIONS_URL } from "~/utils/urls"; import { useMarkNotificationsAsSeen } from "../../features/notifications/notifications-hooks"; -import { LinkButton } from "../Button"; +import { LinkButton } from "../elements/Button"; import { SendouButton } from "../elements/Button"; import { SendouPopover } from "../elements/Popover"; import { BellIcon } from "../icons/Bell"; @@ -129,7 +129,7 @@ function NotificationsFooter() {
} variant="outlined" > diff --git a/app/features/art/components/ArtGrid.tsx b/app/features/art/components/ArtGrid.tsx index 48fdb1c6f..e5bd48947 100644 --- a/app/features/art/components/ArtGrid.tsx +++ b/app/features/art/components/ArtGrid.tsx @@ -3,9 +3,9 @@ import clsx from "clsx"; import * as React from "react"; import { useTranslation } from "react-i18next"; import { Avatar } from "~/components/Avatar"; -import { LinkButton } from "~/components/Button"; import { FormWithConfirm } from "~/components/FormWithConfirm"; import { Pagination } from "~/components/Pagination"; +import { LinkButton } from "~/components/elements/Button"; import { SendouButton } from "~/components/elements/Button"; import { SendouDialog } from "~/components/elements/Dialog"; import { CrossIcon } from "~/components/icons/Cross"; @@ -191,7 +191,7 @@ function ImagePreview({ > } > diff --git a/app/features/badges/routes/badges.$id.tsx b/app/features/badges/routes/badges.$id.tsx index b260e06a0..29231231b 100644 --- a/app/features/badges/routes/badges.$id.tsx +++ b/app/features/badges/routes/badges.$id.tsx @@ -2,7 +2,7 @@ import { Outlet, useLoaderData } from "@remix-run/react"; import clsx from "clsx"; import { useTranslation } from "react-i18next"; import { Badge } from "~/components/Badge"; -import { LinkButton } from "~/components/Button"; +import { LinkButton } from "~/components/elements/Button"; import { useHasPermission, useHasRole } from "~/modules/permissions/hooks"; import type { SerializeFrom } from "~/utils/remix"; import { badgeExplanationText } from "../badges-utils"; @@ -60,7 +60,7 @@ export default function BadgeDetailsPage() { {isStaff || canManageBadge ? ( - + Edit ) : null} diff --git a/app/features/builds/routes/builds.$slug.tsx b/app/features/builds/routes/builds.$slug.tsx index abfb60394..52284db42 100644 --- a/app/features/builds/routes/builds.$slug.tsx +++ b/app/features/builds/routes/builds.$slug.tsx @@ -8,8 +8,8 @@ import { nanoid } from "nanoid"; import * as React from "react"; import { useTranslation } from "react-i18next"; import { BuildCard } from "~/components/BuildCard"; -import { LinkButton } from "~/components/Button"; import { Main } from "~/components/Main"; +import { LinkButton } from "~/components/elements/Button"; import { SendouButton } from "~/components/elements/Button"; import { SendouMenu, SendouMenuItem } from "~/components/elements/Menu"; import { BeakerFilledIcon } from "~/components/icons/BeakerFilled"; @@ -320,7 +320,7 @@ export default function WeaponsBuildsPage() { to={weaponBuildStatsPage(data.slug)} variant="outlined" icon={} - size="tiny" + size="small" > {t("builds:linkButton.abilityStats")} @@ -328,7 +328,7 @@ export default function WeaponsBuildsPage() { to={weaponBuildPopularPage(data.slug)} variant="outlined" icon={} - size="tiny" + size="small" > {t("builds:linkButton.popularBuilds")} @@ -355,7 +355,7 @@ export default function WeaponsBuildsPage() { data.builds.length === data.limit && ( diff --git a/app/features/calendar/routes/calendar.$id.tsx b/app/features/calendar/routes/calendar.$id.tsx index 9989f0acd..782f4a71c 100644 --- a/app/features/calendar/routes/calendar.$id.tsx +++ b/app/features/calendar/routes/calendar.$id.tsx @@ -5,7 +5,6 @@ import clsx from "clsx"; import * as React from "react"; import { useTranslation } from "react-i18next"; import { Avatar } from "~/components/Avatar"; -import { LinkButton } from "~/components/Button"; import { FormWithConfirm } from "~/components/FormWithConfirm"; import { Image } from "~/components/Image"; import { Main } from "~/components/Main"; @@ -13,6 +12,7 @@ import { MapPoolStages } from "~/components/MapPoolSelector"; import { Placement } from "~/components/Placement"; import { Section } from "~/components/Section"; import { Table } from "~/components/Table"; +import { LinkButton } from "~/components/elements/Button"; import { SendouButton } from "~/components/elements/Button"; import { useUser } from "~/features/auth/core/user"; import { MapPool } from "~/features/map-list-generator/core/map-pool"; @@ -128,7 +128,7 @@ export default function CalendarEventPage() { Discord @@ -137,13 +137,16 @@ export default function CalendarEventPage() { {resolveBaseUrl(data.event.bracketUrl)} {canEditCalendarEvent({ user, event: data.event }) && ( - + {t("common:actions.edit")} )} @@ -153,7 +156,7 @@ export default function CalendarEventPage() { startTimes: data.event.startTimes, }) && ( {t("calendar:actions.reportWinners")} @@ -276,7 +279,7 @@ function MapPoolInfo() { className="event__create-map-list-link" to={readonlyMapsPage(data.event.eventId)} variant="outlined" - size="tiny" + size="small" > {t("calendar:createMapList")} diff --git a/app/features/info/routes/support.tsx b/app/features/info/routes/support.tsx index 03244b0c3..ce53322dd 100644 --- a/app/features/info/routes/support.tsx +++ b/app/features/info/routes/support.tsx @@ -2,8 +2,8 @@ import type { MetaFunction } from "@remix-run/node"; import * as React from "react"; import { Trans, useTranslation } from "react-i18next"; import { Badge } from "~/components/Badge"; -import { LinkButton } from "~/components/Button"; import { Main } from "~/components/Main"; +import { LinkButton } from "~/components/elements/Button"; import { CheckmarkIcon } from "~/components/icons/Checkmark"; import { FF_SCRIMS_ENABLED } from "~/features/scrims/scrims-constants"; import { metaTags } from "~/utils/remix"; diff --git a/app/features/lfg/routes/lfg.new.tsx b/app/features/lfg/routes/lfg.new.tsx index 3011efd90..2ca211c72 100644 --- a/app/features/lfg/routes/lfg.new.tsx +++ b/app/features/lfg/routes/lfg.new.tsx @@ -1,12 +1,12 @@ import { Link, useFetcher, useLoaderData } from "@remix-run/react"; import * as React from "react"; import { useTranslation } from "react-i18next"; -import { LinkButton } from "~/components/Button"; import { FormMessage } from "~/components/FormMessage"; import { WeaponImage } from "~/components/Image"; import { Label } from "~/components/Label"; import { Main } from "~/components/Main"; import { SubmitButton } from "~/components/SubmitButton"; +import { LinkButton } from "~/components/elements/Button"; import { ArrowLeftIcon } from "~/components/icons/ArrowLeft"; import type { Tables } from "~/db/tables"; import { useUser } from "~/features/auth/core/user"; diff --git a/app/features/plus-suggestions/routes/plus.suggestions.tsx b/app/features/plus-suggestions/routes/plus.suggestions.tsx index 6f9aefe6f..0bfc02821 100644 --- a/app/features/plus-suggestions/routes/plus.suggestions.tsx +++ b/app/features/plus-suggestions/routes/plus.suggestions.tsx @@ -4,10 +4,10 @@ import { Link, Outlet, useLoaderData, useSearchParams } from "@remix-run/react"; import clsx from "clsx"; import { Alert } from "~/components/Alert"; import { Avatar } from "~/components/Avatar"; -import { LinkButton } from "~/components/Button"; import { Catcher } from "~/components/Catcher"; import { FormWithConfirm } from "~/components/FormWithConfirm"; import { RelativeTime } from "~/components/RelativeTime"; +import { LinkButton } from "~/components/elements/Button"; import { TrashIcon } from "~/components/icons/Trash"; import type { Tables } from "~/db/tables"; import { useUser } from "~/features/auth/core/user"; @@ -221,7 +221,7 @@ function SuggestedUser({ }) ? (
} > diff --git a/app/features/sendouq-match/routes/q.match.$id.tsx b/app/features/sendouq-match/routes/q.match.$id.tsx index 844b1b88c..8e8ec0615 100644 --- a/app/features/sendouq-match/routes/q.match.$id.tsx +++ b/app/features/sendouq-match/routes/q.match.$id.tsx @@ -13,7 +13,6 @@ import { Flipped, Flipper } from "react-flip-toolkit"; import { useTranslation } from "react-i18next"; import { Alert } from "~/components/Alert"; import { Avatar } from "~/components/Avatar"; -import { LinkButton } from "~/components/Button"; import { WeaponCombobox } from "~/components/Combobox"; import { Divider } from "~/components/Divider"; import { FormWithConfirm } from "~/components/FormWithConfirm"; @@ -21,6 +20,7 @@ import { Image, ModeImage, StageImage, WeaponImage } from "~/components/Image"; import { Main } from "~/components/Main"; import { NewTabs } from "~/components/NewTabs"; import { SubmitButton } from "~/components/SubmitButton"; +import { LinkButton } from "~/components/elements/Button"; import { SendouButton } from "~/components/elements/Button"; import { SendouPopover } from "~/components/elements/Popover"; import { SendouSwitch } from "~/components/elements/Switch"; @@ -748,7 +748,7 @@ function BottomSection({ } > {t("q:front.nav.rules.title")} @@ -760,7 +760,7 @@ function BottomSection({ isExternal to={SENDOU_INK_DISCORD_URL} variant="outlined" - size="tiny" + size="small" icon={} > {t("q:match.helpdesk")} diff --git a/app/features/sendouq/components/GroupCard.tsx b/app/features/sendouq/components/GroupCard.tsx index e271f1ab2..ea2dd6d28 100644 --- a/app/features/sendouq/components/GroupCard.tsx +++ b/app/features/sendouq/components/GroupCard.tsx @@ -5,10 +5,10 @@ import * as React from "react"; import { Flipped } from "react-flip-toolkit"; import { useTranslation } from "react-i18next"; import { Avatar } from "~/components/Avatar"; -import { LinkButton } from "~/components/Button"; import { FormWithConfirm } from "~/components/FormWithConfirm"; import { Image, ModeImage, TierImage, WeaponImage } from "~/components/Image"; import { SubmitButton } from "~/components/SubmitButton"; +import { LinkButton } from "~/components/elements/Button"; import { SendouButton } from "~/components/elements/Button"; import { SendouPopover } from "~/components/elements/Popover"; import { EditIcon } from "~/components/icons/Edit"; diff --git a/app/features/sendouq/routes/q.looking.tsx b/app/features/sendouq/routes/q.looking.tsx index 9aeb7f122..c1cc4420b 100644 --- a/app/features/sendouq/routes/q.looking.tsx +++ b/app/features/sendouq/routes/q.looking.tsx @@ -5,11 +5,11 @@ import * as React from "react"; import { Flipper } from "react-flip-toolkit"; import { useTranslation } from "react-i18next"; import { Alert } from "~/components/Alert"; -import { LinkButton } from "~/components/Button"; import { Image } from "~/components/Image"; import { Main } from "~/components/Main"; import { NewTabs } from "~/components/NewTabs"; import { SubmitButton } from "~/components/SubmitButton"; +import { LinkButton } from "~/components/elements/Button"; import { useUser } from "~/features/auth/core/user"; import { Chat, useChat } from "~/features/chat/components/Chat"; import { useAutoRefresh } from "~/hooks/useAutoRefresh"; @@ -144,7 +144,7 @@ function InfoText() {
@@ -177,7 +177,7 @@ function StreamsLinkButton() { return ( @@ -493,7 +493,7 @@ function JoinQueuePrompt() { const { t } = useTranslation(["q"]); return ( - + {t("q:looking.joinQPrompt")} ); diff --git a/app/features/sendouq/routes/q.tsx b/app/features/sendouq/routes/q.tsx index 8ce898ccc..21cc9597f 100644 --- a/app/features/sendouq/routes/q.tsx +++ b/app/features/sendouq/routes/q.tsx @@ -4,13 +4,13 @@ import clsx from "clsx"; import * as React from "react"; import { useTranslation } from "react-i18next"; import { Alert } from "~/components/Alert"; -import { LinkButton } from "~/components/Button"; import { Flag } from "~/components/Flag"; import { FormMessage } from "~/components/FormMessage"; import { FriendCodeInput } from "~/components/FriendCodeInput"; import { Image } from "~/components/Image"; import { Main } from "~/components/Main"; import { SubmitButton } from "~/components/SubmitButton"; +import { LinkButton } from "~/components/elements/Button"; import { SendouDialog } from "~/components/elements/Dialog"; import { UserIcon } from "~/components/icons/User"; import { UsersIcon } from "~/components/icons/Users"; @@ -465,7 +465,11 @@ function PreviewQueueButton() { } return ( - + {t("q:front.preview")} ); diff --git a/app/features/team/routes/t.$customUrl.tsx b/app/features/team/routes/t.$customUrl.tsx index f97181b6d..6b8f30abd 100644 --- a/app/features/team/routes/t.$customUrl.tsx +++ b/app/features/team/routes/t.$customUrl.tsx @@ -5,12 +5,12 @@ import React from "react"; import { useTranslation } from "react-i18next"; import * as R from "remeda"; import { Avatar } from "~/components/Avatar"; -import { LinkButton } from "~/components/Button"; import { Flag } from "~/components/Flag"; import { FormWithConfirm } from "~/components/FormWithConfirm"; import { WeaponImage } from "~/components/Image"; import { Main } from "~/components/Main"; import { SubmitButton } from "~/components/SubmitButton"; +import { LinkButton } from "~/components/elements/Button"; import { SendouButton } from "~/components/elements/Button"; import { BskyIcon } from "~/components/icons/Bsky"; import { EditIcon } from "~/components/icons/Edit"; @@ -233,7 +233,7 @@ function ActionButtons() { ) : null} {isTeamManager({ user, team }) || isAdmin ? ( Go to match diff --git a/app/features/tournament-bracket/routes/to.$id.matches.$mid.tsx b/app/features/tournament-bracket/routes/to.$id.matches.$mid.tsx index a5d21f9cf..2ce910ee5 100644 --- a/app/features/tournament-bracket/routes/to.$id.matches.$mid.tsx +++ b/app/features/tournament-bracket/routes/to.$id.matches.$mid.tsx @@ -2,8 +2,8 @@ import { useLoaderData, useRevalidator } from "@remix-run/react"; import clsx from "clsx"; import * as React from "react"; import { useEventSource } from "remix-utils/sse/react"; -import { LinkButton } from "~/components/Button"; import { containerClassName } from "~/components/Main"; +import { LinkButton } from "~/components/elements/Button"; import { ArrowLongLeftIcon } from "~/components/icons/ArrowLongLeft"; import { useUser } from "~/features/auth/core/user"; import { ConnectedChat } from "~/features/chat/components/Chat"; @@ -90,7 +90,7 @@ export default function TournamentMatchPage() { groupId: data.match.groupId, })} variant="outlined" - size="tiny" + size="small" className="w-max" icon={} testId="back-to-bracket-button" diff --git a/app/features/tournament-organization/components/EventCalendar.tsx b/app/features/tournament-organization/components/EventCalendar.tsx index b6237c163..7e4914546 100644 --- a/app/features/tournament-organization/components/EventCalendar.tsx +++ b/app/features/tournament-organization/components/EventCalendar.tsx @@ -1,6 +1,6 @@ import type { SerializeFrom } from "@remix-run/node"; import clsx from "clsx"; -import { LinkButton } from "~/components/Button"; +import { LinkButton } from "~/components/elements/Button"; import type { MonthYear } from "~/features/plus-voting/core"; import { useIsMounted } from "~/hooks/useIsMounted"; import { databaseTimestampToDate, nullPaddedDatesOfMonth } from "~/utils/dates"; diff --git a/app/features/tournament-organization/routes/org.$slug.tsx b/app/features/tournament-organization/routes/org.$slug.tsx index c7df45db4..b94f46a15 100644 --- a/app/features/tournament-organization/routes/org.$slug.tsx +++ b/app/features/tournament-organization/routes/org.$slug.tsx @@ -2,12 +2,12 @@ import type { MetaFunction, SerializeFrom } from "@remix-run/node"; import { Link, useLoaderData, useSearchParams } from "@remix-run/react"; import { useTranslation } from "react-i18next"; import { Avatar } from "~/components/Avatar"; -import { LinkButton } from "~/components/Button"; import { Divider } from "~/components/Divider"; import { Main } from "~/components/Main"; import { NewTabs } from "~/components/NewTabs"; import { Pagination } from "~/components/Pagination"; import { Placement } from "~/components/Placement"; +import { LinkButton } from "~/components/elements/Button"; import { EditIcon } from "~/components/icons/Edit"; import { BadgeDisplay } from "~/features/badges/components/BadgeDisplay"; import { useIsMounted } from "~/hooks/useIsMounted"; @@ -119,7 +119,7 @@ function LogoHeader() { } - size="tiny" + size="small" variant="outlined" testId="edit-org-button" > @@ -343,7 +343,7 @@ function SeriesButton({ return ( {children} diff --git a/app/features/tournament-subs/routes/to.$id.subs.tsx b/app/features/tournament-subs/routes/to.$id.subs.tsx index 9500b3d0d..80b12a5c6 100644 --- a/app/features/tournament-subs/routes/to.$id.subs.tsx +++ b/app/features/tournament-subs/routes/to.$id.subs.tsx @@ -2,11 +2,11 @@ import { Link, useLoaderData } from "@remix-run/react"; import React from "react"; import { useTranslation } from "react-i18next"; import { Avatar } from "~/components/Avatar"; -import { LinkButton } from "~/components/Button"; import { Flag } from "~/components/Flag"; import { FormWithConfirm } from "~/components/FormWithConfirm"; import { WeaponImage } from "~/components/Image"; import { Redirect } from "~/components/Redirect"; +import { LinkButton } from "~/components/elements/Button"; import { SendouButton } from "~/components/elements/Button"; import { SendouPopover } from "~/components/elements/Popover"; import { MicrophoneIcon } from "~/components/icons/Microphone"; @@ -67,7 +67,7 @@ function AddOrEditSubButton() { } return ( - + {buttonText} ); diff --git a/app/features/tournament/routes/to.$id.admin.tsx b/app/features/tournament/routes/to.$id.admin.tsx index 4cac4c401..e28c1fa1e 100644 --- a/app/features/tournament/routes/to.$id.admin.tsx +++ b/app/features/tournament/routes/to.$id.admin.tsx @@ -3,7 +3,6 @@ import clsx from "clsx"; import * as React from "react"; import { useTranslation } from "react-i18next"; import { Avatar } from "~/components/Avatar"; -import { LinkButton } from "~/components/Button"; import { Divider } from "~/components/Divider"; import { FormMessage } from "~/components/FormMessage"; import { FormWithConfirm } from "~/components/FormWithConfirm"; @@ -12,6 +11,7 @@ import { Label } from "~/components/Label"; import { containerClassName } from "~/components/Main"; import { Redirect } from "~/components/Redirect"; import { SubmitButton } from "~/components/SubmitButton"; +import { LinkButton } from "~/components/elements/Button"; import { SendouButton } from "~/components/elements/Button"; import { SendouDialog } from "~/components/elements/Dialog"; import { UserSearch } from "~/components/elements/UserSearch"; @@ -56,7 +56,7 @@ export default function TournamentAdminPage() {
diff --git a/app/features/tournament/routes/to.$id.join.tsx b/app/features/tournament/routes/to.$id.join.tsx index 1a37bcd0d..ae613f903 100644 --- a/app/features/tournament/routes/to.$id.join.tsx +++ b/app/features/tournament/routes/to.$id.join.tsx @@ -2,9 +2,9 @@ import { Form, useLoaderData } from "@remix-run/react"; import React from "react"; import { useTranslation } from "react-i18next"; import { Alert } from "~/components/Alert"; -import { LinkButton } from "~/components/Button"; import { FriendCodeInput } from "~/components/FriendCodeInput"; import { SubmitButton } from "~/components/SubmitButton"; +import { LinkButton } from "~/components/elements/Button"; import { useUser } from "~/features/auth/core/user"; import invariant from "~/utils/invariant"; import { assertUnreachable } from "~/utils/types"; @@ -60,7 +60,7 @@ export default function JoinTeamPage() {
This tournament requires you to have an in-game name set{" "} - + Edit profile
diff --git a/app/features/tournament/routes/to.$id.register.tsx b/app/features/tournament/routes/to.$id.register.tsx index 90de9b92b..8556ad9dd 100644 --- a/app/features/tournament/routes/to.$id.register.tsx +++ b/app/features/tournament/routes/to.$id.register.tsx @@ -7,7 +7,6 @@ import { useTranslation } from "react-i18next"; import { useCopyToClipboard } from "react-use"; import { Alert } from "~/components/Alert"; import { Avatar } from "~/components/Avatar"; -import { LinkButton } from "~/components/Button"; import { Divider } from "~/components/Divider"; import { FormWithConfirm } from "~/components/FormWithConfirm"; import { FriendCodeInput } from "~/components/FriendCodeInput"; @@ -19,6 +18,7 @@ import { MapPoolStages } from "~/components/MapPoolSelector"; import { NewTabs } from "~/components/NewTabs"; import { Section } from "~/components/Section"; import { SubmitButton } from "~/components/SubmitButton"; +import { LinkButton } from "~/components/elements/Button"; import { SendouButton } from "~/components/elements/Button"; import { SendouPopover } from "~/components/elements/Popover"; import { CheckmarkIcon } from "~/components/icons/Checkmark"; @@ -223,7 +223,7 @@ function TournamentRegisterInfoTabs() { } > @@ -282,7 +282,7 @@ function TournamentRegisterInfoTabs() {
This tournament requires you to have an in-game name set{" "} - + Edit profile
@@ -1328,7 +1328,7 @@ function TOPickedMapPoolInfo() { className="event__create-map-list-link" to={readonlyMapsPage(tournament.ctx.eventId)} variant="outlined" - size="tiny" + size="small" > {t("calendar:createMapList")} diff --git a/app/features/user-page/routes/u.$identifier.results.tsx b/app/features/user-page/routes/u.$identifier.results.tsx index b532ac961..6a2f547b8 100644 --- a/app/features/user-page/routes/u.$identifier.results.tsx +++ b/app/features/user-page/routes/u.$identifier.results.tsx @@ -1,6 +1,6 @@ import { useLoaderData, useMatches } from "@remix-run/react"; import { useTranslation } from "react-i18next"; -import { LinkButton } from "~/components/Button"; +import { LinkButton } from "~/components/elements/Button"; import { useUser } from "~/features/auth/core/user"; import { UserResultsTable } from "~/features/user-page/components/UserResultsTable"; import { useSearchParamState } from "~/hooks/useSearchParamState"; @@ -44,7 +44,7 @@ export default function UserResultsPage() { {t("results.highlights.choose")} diff --git a/app/features/vods/routes/vods.$id.tsx b/app/features/vods/routes/vods.$id.tsx index 41f70999a..dda8d9fed 100644 --- a/app/features/vods/routes/vods.$id.tsx +++ b/app/features/vods/routes/vods.$id.tsx @@ -3,11 +3,11 @@ import { useLoaderData } from "@remix-run/react"; import clsx from "clsx"; import * as React from "react"; import { useTranslation } from "react-i18next"; -import { LinkButton } from "~/components/Button"; import { FormWithConfirm } from "~/components/FormWithConfirm"; import { Image, WeaponImage } from "~/components/Image"; import { Main } from "~/components/Main"; import { YouTubeEmbed } from "~/components/YouTubeEmbed"; +import { LinkButton } from "~/components/elements/Button"; import { EditIcon } from "~/components/icons/Edit"; import { TrashIcon } from "~/components/icons/Trash"; import { useUser } from "~/features/auth/core/user"; @@ -120,7 +120,7 @@ export default function VodPage() {
} > diff --git a/app/styles/common.css b/app/styles/common.css index e990ba45a..66bedbcdc 100644 --- a/app/styles/common.css +++ b/app/styles/common.css @@ -26,128 +26,6 @@ a { text-decoration: none; } -.button { - display: flex; - width: auto; - align-items: center; - justify-content: center; - border: 2px solid var(--theme); - border-radius: var(--rounded-sm); - appearance: none; - background: var(--theme); - color: var(--button-text); - cursor: pointer; - font-size: var(--fonts-sm); - font-weight: var(--bold); - line-height: 1.2; - outline-offset: 2px; - padding-block: var(--s-1-5); - padding-inline: var(--s-2-5); - user-select: none; -} - -.button:focus-visible { - outline: 2px solid var(--theme); -} - -.button:active { - transform: translateY(1px); -} - -.button:disabled { - cursor: not-allowed; - opacity: 0.5; - transform: initial; -} - -.button.outlined { - background-color: var(--theme-very-transparent); - color: var(--theme); -} - -.button.outlined-success { - border-color: var(--theme-success); - background-color: transparent; - color: var(--theme-success); -} - -.button.tiny { - font-size: var(--fonts-xs); - padding-block: var(--s-1); - padding-inline: var(--s-2); -} - -.button.miniscule { - font-size: var(--fonts-xxs); - padding-block: var(--s-1); - padding-inline: var(--s-2); -} - -.button.big { - font-size: var(--fonts-md); - padding-block: var(--s-2-5); - padding-inline: var(--s-6); -} - -.button.minimal { - padding: 0; - border: none; - background-color: transparent; - color: var(--theme); - outline: initial; -} - -.button.minimal:focus-visible { - outline: 2px solid var(--theme); -} - -.button.minimal-success { - padding: 0; - border: none; - background-color: transparent; - color: var(--theme-success); -} - -.button.success { - border-color: var(--theme-success); - background-color: var(--theme-success); - outline-color: var(--theme-success); -} - -.button.destructive { - border-color: var(--theme-error); - background-color: transparent; - color: var(--theme-error); - outline-color: var(--theme-error); -} - -.button.minimal-destructive { - padding: 0; - border: none; - background-color: transparent; - color: var(--theme-error); - outline-color: var(--theme-error); -} - -.button.loading { - cursor: not-allowed; - opacity: 0.6; -} - -.button-icon { - width: 1.25rem; - margin-inline-end: var(--s-1-5); -} - -.button-icon.lonely { - margin-inline-end: 0 !important; -} - -.button.tiny > .button-icon { - width: 1rem; - margin-inline-end: var(--s-1); -} - /* :not([name="text"]) workaround not to select textarea on map planner */ textarea:not(.plain, [name="text"]) { width: 18rem;