chore: Apply linting rules and add git hok (#611)

Co-authored-by: Fredrik Burmester <fredrik.burmester@gmail.com>
This commit is contained in:
lostb1t
2025-03-16 18:01:12 +01:00
committed by GitHub
parent 2688e1b981
commit 92513e234f
268 changed files with 9197 additions and 8394 deletions

View File

@@ -1,15 +1,15 @@
import {TouchableOpacity, View} from "react-native";
import {Text} from "@/components/common/Text";
import { Text } from "@/components/common/Text";
import DisabledSetting from "@/components/settings/DisabledSetting";
import { TouchableOpacity, View } from "react-native";
interface StepperProps {
value: number,
disabled?: boolean,
step: number,
min: number,
max: number,
onUpdate: (value: number) => void,
appendValue?: string,
value: number;
disabled?: boolean;
step: number;
min: number;
max: number;
onUpdate: (value: number) => void;
appendValue?: string;
}
export const Stepper: React.FC<StepperProps> = ({
@@ -19,33 +19,35 @@ export const Stepper: React.FC<StepperProps> = ({
min,
max,
onUpdate,
appendValue
appendValue,
}) => {
return (
<DisabledSetting
disabled={disabled === true}
showText={false}
className="flex flex-row items-center"
className='flex flex-row items-center'
>
<TouchableOpacity
onPress={() => onUpdate(Math.max(min, value - step))}
className="w-8 h-8 bg-neutral-800 rounded-l-lg flex items-center justify-center"
className='w-8 h-8 bg-neutral-800 rounded-l-lg flex items-center justify-center'
>
<Text>-</Text>
</TouchableOpacity>
<Text
className={
"w-auto h-8 bg-neutral-800 py-2 px-1 flex items-center justify-center" + (appendValue ? "first-letter:px-2" : "")
"w-auto h-8 bg-neutral-800 py-2 px-1 flex items-center justify-center" +
(appendValue ? "first-letter:px-2" : "")
}
>
{value}{appendValue}
{value}
{appendValue}
</Text>
<TouchableOpacity
className="w-8 h-8 bg-neutral-800 rounded-r-lg flex items-center justify-center"
className='w-8 h-8 bg-neutral-800 rounded-r-lg flex items-center justify-center'
onPress={() => onUpdate(Math.min(max, value + step))}
>
<Text>+</Text>
</TouchableOpacity>
</DisabledSetting>
)
}
);
};