Skip to content

Commit

Permalink
Merge pull request #118 from VampireChicken12/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
VampireChicken12 authored Nov 26, 2023
2 parents a312ef9 + 38a8565 commit cc630ad
Show file tree
Hide file tree
Showing 46 changed files with 1,054 additions and 864 deletions.
24 changes: 19 additions & 5 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,24 @@
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-type-checked",
"plugin:import/recommended",
"plugin:import/typescript",
"plugin:tailwindcss/recommended",
"plugin:prettier/recommended",
"plugin:promise/recommended",
"plugin:perfectionist/recommended-natural"
],
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": "latest",
"sourceType": "module"
"sourceType": "module",
"project": "./tsconfig.json",
"tsconfigRootDir": "."
},
"plugins": ["react", "@typescript-eslint", "no-secrets"],
"rules": {
Expand Down Expand Up @@ -67,16 +70,27 @@
}
],
"import/no-unresolved": "off",
"tailwindcss/no-custom-classname": "off"
"tailwindcss/no-custom-classname": "off",
"tailwindcss/classnames-order": "error",
"@typescript-eslint/no-floating-promises": "error"
},
"globals": {
"chrome": "readonly"
},
"ignorePatterns": ["watch.js", "dist/**"],
"ignorePatterns": ["watch.js", "dist/**", "releases/**"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js"],
"parser": "@typescript-eslint/parser"
}
]
],
"settings": {
"tailwindcss": {
"callees": ["cn"],
"config": "./tailwind.config.ts"
},
"react": {
"version": "detect"
}
}
}
16 changes: 16 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "eslint",
"problemMatcher": ["$eslint-stylish"],
"label": "eslint: lint whole folder",
"options": {
"shell": {
"executable": "cmd.exe",
"args": ["/d", "/c"]
}
}
}
]
}
3 changes: 0 additions & 3 deletions public/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@
"success": {
"saved": "Options saved."
},
"error": {
"playerQuality": "You must select a player quality if you want to enable the automatic quality feature."
},
"info": {
"reset": "All options have been reset to their default values.\nYou can now save the changes by clicking the \"Confirm\" button or discard them by closing this page or ignore this notification."
}
Expand Down
3 changes: 0 additions & 3 deletions public/locales/en-US.json.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ interface EnUS {
};
options: {
notifications: {
error: {
playerQuality: "You must select a player quality if you want to enable the automatic quality feature.";
};
info: {
reset: 'All options have been reset to their default values.\nYou can now save the changes by clicking the "Confirm" button or discard them by closing this page or ignore this notification.';
};
Expand Down
2 changes: 1 addition & 1 deletion src/components/Inputs/Number/Arrow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ type RotationDirection = "down" | "left" | "right" | "up";
export default function Arrow({ rotation }: { rotation: RotationDirection }) {
return (
<svg
className={cn("h-4 w-4 transition-transform duration-300 transform", {
className={cn("h-4 w-4 transition-transform duration-300", {
"rotate-0": rotation === "down",
"rotate-90": rotation === "left",
"rotate-180": rotation === "up",
Expand Down
9 changes: 5 additions & 4 deletions src/components/Inputs/Number/Number.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,19 @@ const NumberInput: React.FC<NumberInputProps> = ({ className, disabled, id, labe
"text-[#4b5563]": disabled
} satisfies ClassValue;
return (
<div className={cn("relative flex gap-4 items-baseline justify-between flex-row", className)} ref={inputDiv}>
<div className={cn("relative flex flex-row items-baseline justify-between gap-4", className)} ref={inputDiv}>
<label className="mb-1" htmlFor={id}>
{label}
</label>
<div className="relative flex flex-row">
<input
aria-hidden={true}
className={cn(
"number border border-gray-300 bg-white text-black px-2 py-2 rounded-md flex items-center justify-between w-40 h-10 focus:outline-none dark:bg-[#23272a] dark:text-white dark:border-gray-700",
"number flex h-10 w-40 items-center justify-between rounded-md border border-gray-300 bg-white p-2 text-black focus:outline-none dark:border-gray-700 dark:bg-[#23272a] dark:text-white",
{ "dark:text-[#4b5563]": disabled, "text-[#4b5563]": disabled }
)}
disabled={disabled}
id={id}
max={max}
min={min}
onChange={(e) => handleChange(e.currentTarget.value)}
Expand All @@ -83,7 +84,7 @@ const NumberInput: React.FC<NumberInputProps> = ({ className, disabled, id, labe
aria-hidden={true}
aria-label="Add one"
className={cn(
"flex text-black dark:text-white round-r dark:bg-[#23272a] dark:hover:bg-[rgba(24,26,27,0.5)] w-full h-1/2 p-1 justify-center cursor-default",
"round-r flex h-1/2 w-full cursor-default justify-center p-1 text-black dark:bg-[#23272a] dark:text-white dark:hover:bg-[rgba(24,26,27,0.5)]",
disabledButtonClasses
)}
disabled={disabled}
Expand All @@ -100,7 +101,7 @@ const NumberInput: React.FC<NumberInputProps> = ({ className, disabled, id, labe
aria-hidden={true}
aria-label="Subtract one"
className={cn(
"flex text-black dark:text-white round-r dark:bg-[#23272a] dark:hover:bg-[rgba(24,26,27,0.5)] w-full h-1/2 p-1 justify-center cursor-default",
"round-r flex h-1/2 w-full cursor-default justify-center p-1 text-black dark:bg-[#23272a] dark:text-white dark:hover:bg-[rgba(24,26,27,0.5)]",
disabledButtonClasses
)}
disabled={disabled}
Expand Down
12 changes: 9 additions & 3 deletions src/components/Inputs/Select/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,17 @@ const Select: React.FC<SelectProps> = ({ className, disabled, id, label, onChang

const disabledButtonClasses = { "dark:text-[#4b5563]": disabled, "text-[#4b5563]": disabled } satisfies ClassValue;
return (
<div className={cn("relative flex gap-4 flex-row items-baseline justify-between", className)} id={id} ref={selectRef}>
<div
aria-valuetext={selectedOption}
className={cn("relative flex flex-row items-baseline justify-between gap-4", className)}
id={id}
ref={selectRef}
>
<label htmlFor={id}>{label}</label>
<div className="relative inline-block">
<button
className={cn(
"border border-gray-300 bg-white text-black px-2 py-2 rounded-md flex items-center justify-between w-40 h-10 focus:outline-none dark:bg-[#23272a] dark:text-white dark:border-gray-700",
"flex h-10 w-40 items-center justify-between rounded-md border border-gray-300 bg-white p-2 text-black focus:outline-none dark:border-gray-700 dark:bg-[#23272a] dark:text-white",
disabledButtonClasses
)}
disabled={disabled}
Expand Down Expand Up @@ -88,8 +93,9 @@ const Select: React.FC<SelectProps> = ({ className, disabled, id, label, onChang
<div className="absolute z-10 mt-2 w-40 rounded-md border border-gray-300 bg-white shadow-lg dark:border-gray-700 dark:bg-[#23272a]">
{options.map((option, index) => (
<div
aria-valuetext={option.value}
className={cn(
"px-2 py-2 hover:bg-gray-100 dark:hover:bg-[rgba(24,26,27,0.5)] cursor-pointer flex items-center justify-between w-40 focus:outline-none",
"flex w-40 cursor-pointer items-center justify-between p-2 hover:bg-gray-100 focus:outline-none dark:hover:bg-[rgba(24,26,27,0.5)]",
{
"bg-gray-100 dark:bg-[#2c2f33]": selectedOption === option.value,
"rounded-b-md": index === options.length - 1,
Expand Down
Loading

0 comments on commit cc630ad

Please sign in to comment.