mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-05-09 12:13:10 -05:00
* Clean away prisma migrations
* Way to migrate WIP
* SQLite3 seeding script initial
* Fetch tournament data in loader
* CheckinActions new loader data model
* Virtual banner text color columns
* Logged in user
* Count teams
* ownTeam
* Map pool tab fully working
* Teams tab
* Fix timestamp default
* Register page
* Manage team page
* Camel case checkedInTimestamp
* Clean slate
* Add .nvmrc
* Add favicon
* Package lock file version 2
* Update tsconfig
* Add Tailwind
* Add StrictMode
* Add background color
* Auth without DB
* Revert "Add Tailwind"
This reverts commit 204713c602.
* Auth with DB
* Switch back to tilde absolute import
* Import layout
* Camel case for database columns
* Move auth routes to folder
* User popover links working
* Import linters
* User page initial
* User edit page with country
* Script to delete db files before migration in dev
* Remove "youtubeName" column
* Correct avatar size on desktop
* Fix SubNav not spanning the whole page
* Remove duplicate files
* Update README
56 lines
1.3 KiB
TypeScript
56 lines
1.3 KiB
TypeScript
import clsx from "clsx";
|
|
import * as React from "react";
|
|
|
|
export interface ButtonProps
|
|
extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
variant?:
|
|
| "success"
|
|
| "outlined"
|
|
| "outlined-success"
|
|
| "destructive"
|
|
| "minimal"
|
|
| "minimal-success"
|
|
| "minimal-destructive";
|
|
tiny?: boolean;
|
|
loading?: boolean;
|
|
loadingText?: string;
|
|
icon?: JSX.Element;
|
|
"data-cy"?: string;
|
|
}
|
|
|
|
export function Button(props: ButtonProps) {
|
|
const {
|
|
variant,
|
|
loading,
|
|
children,
|
|
loadingText,
|
|
tiny,
|
|
className,
|
|
icon,
|
|
type = "button",
|
|
...rest
|
|
} = props;
|
|
return (
|
|
<button
|
|
className={clsx(className, {
|
|
success: variant === "success",
|
|
outlined: variant === "outlined",
|
|
"outlined-success": variant === "outlined-success",
|
|
destructive: variant === "destructive",
|
|
minimal: variant === "minimal",
|
|
"minimal-success": variant === "minimal-success",
|
|
"minimal-destructive": variant === "minimal-destructive",
|
|
"disabled-opaque": props.disabled,
|
|
loading,
|
|
tiny,
|
|
})}
|
|
disabled={props.disabled || loading}
|
|
type={type}
|
|
{...rest}
|
|
>
|
|
{icon && React.cloneElement(icon, { className: "button-icon" })}
|
|
{loading && loadingText ? loadingText : children}
|
|
</button>
|
|
);
|
|
}
|