-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
304a9e5
commit 79bcfd5
Showing
9 changed files
with
161 additions
and
113 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,35 @@ | ||
import { ButtonContainer } from "./ButtonContainer"; | ||
import { ButtonContent } from "./ButtonContent"; | ||
import { twMerge } from "tailwind-merge"; | ||
|
||
interface Button { | ||
interface Button extends React.HTMLAttributes<HTMLButtonElement> { | ||
className?: string; | ||
icon?: React.ReactNode; | ||
label: string; | ||
onClick: () => void; | ||
minimalistic?: boolean; | ||
isDisabled?: boolean; | ||
disabled?: boolean; | ||
} | ||
|
||
export default function Button({ | ||
className, | ||
icon, | ||
label, | ||
onClick, | ||
disabled = false, | ||
minimalistic = true, | ||
isDisabled = false | ||
...props | ||
}: Button) { | ||
return ( | ||
<> | ||
<ButtonContainer className={className} handleClick={onClick} isDisabled={isDisabled}> | ||
<ButtonContent icon={icon} label={label} minimalistic={minimalistic} /> | ||
</ButtonContainer> | ||
</> | ||
<button | ||
{...props} | ||
type="button" | ||
className={twMerge( | ||
`min-h-9 px-3 transition duration-200 rounded-md border font-medium justify-center align-middle light:hover:bg-neutral-200 light:hover:border-neutral-400 light:text-neutral-950 light:border-neutral-200 dark:hover:bg-zinc-700 dark:hover:border-zinc-500 dark:border-zinc-800 text-md disabled:bg-zinc-900 dark:disabled:border-zinc-500 dark:disabled:bg-zinc-700 light:disabled:bg-neutral-200 light:disabled:border-neutral-300 disabled:cursor-normal`, | ||
className | ||
)} | ||
disabled={disabled} | ||
> | ||
<div className="flex items-center justify-between gap-1"> | ||
{icon} | ||
<div className={`${minimalistic ? "hidden" : "inline"}`}>{label}</div> | ||
</div> | ||
</button> | ||
); | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import { locales } from "@/navigation"; | ||
import { | ||
US, | ||
ES, | ||
FR, | ||
DE, | ||
JP, | ||
CN, | ||
RU, | ||
IN, | ||
PT, | ||
IT, | ||
KR, | ||
NL, | ||
SE, | ||
TR, | ||
PL, | ||
VN, | ||
FI, | ||
UA, | ||
CZ, | ||
RO, | ||
NO, | ||
MY, | ||
HU, | ||
ID, | ||
BD, | ||
SK, | ||
EE, | ||
} from "country-flag-icons/react/3x2"; | ||
|
||
interface LanguageProp { | ||
code: (typeof locales)[number]; | ||
name: string; | ||
flag: React.ReactNode; | ||
} | ||
|
||
export const languages: LanguageProp[] = [ | ||
{ code: "en", name: "English", flag: <US className="w-4 h-4" /> }, | ||
{ code: "es", name: "Español", flag: <ES className="w-4 h-4" /> }, | ||
{ code: "fr", name: "Français", flag: <FR className="w-4 h-4" /> }, | ||
{ code: "de", name: "Deutsch", flag: <DE className="w-4 h-4" /> }, | ||
{ code: "ja", name: "日本語", flag: <JP className="w-4 h-4" /> }, | ||
{ code: "zh", name: "中文", flag: <CN className="w-4 h-4" /> }, | ||
{ code: "ru", name: "Русский", flag: <RU className="w-4 h-4" /> }, | ||
{ code: "hi", name: "हिन्दी", flag: <IN className="w-4 h-4" /> }, | ||
{ code: "pt", name: "Português", flag: <PT className="w-4 h-4" /> }, | ||
{ code: "it", name: "Italiano", flag: <IT className="w-4 h-4" /> }, | ||
{ code: "ko", name: "한국어", flag: <KR className="w-4 h-4" /> }, | ||
{ code: "nl", name: "Nederlands", flag: <NL className="w-4 h-4" /> }, | ||
{ code: "sv", name: "Svenska", flag: <SE className="w-4 h-4" /> }, | ||
{ code: "tr", name: "Türkçe", flag: <TR className="w-4 h-4" /> }, | ||
{ code: "pl", name: "Polski", flag: <PL className="w-4 h-4" /> }, | ||
{ code: "vi", name: "Tiếng Việt", flag: <VN className="w-4 h-4" /> }, | ||
{ code: "fi", name: "Suomi", flag: <FI className="w-4 h-4" /> }, | ||
{ code: "uk", name: "Українська", flag: <UA className="w-4 h-4" /> }, | ||
{ code: "cs", name: "Čeština", flag: <CZ className="w-4 h-4" /> }, | ||
{ code: "ro", name: "Română", flag: <RO className="w-4 h-4" /> }, | ||
{ code: "no", name: "Norsk", flag: <NO className="w-4 h-4" /> }, | ||
{ code: "ms", name: "Bahasa Melayu", flag: <MY className="w-4 h-4" /> }, | ||
{ code: "hu", name: "Magyar", flag: <HU className="w-4 h-4" /> }, | ||
{ code: "id", name: "Bahasa Indonesia", flag: <ID className="w-4 h-4" /> }, | ||
{ code: "bn", name: "বাংলা", flag: <BD className="w-4 h-4" /> }, | ||
{ code: "sk", name: "Slovenčina", flag: <SK className="w-4 h-4" /> }, | ||
{ code: "et", name: "Eesti", flag: <EE className="w-4 h-4" /> }, | ||
]; |