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,13 +1,13 @@
import {
PropsWithChildren,
Children,
isValidElement,
type PropsWithChildren,
type ReactElement,
cloneElement,
ReactElement,
isValidElement,
} from "react";
import { StyleSheet, View, ViewProps, ViewStyle } from "react-native";
import { ListItem } from "./ListItem";
import { StyleSheet, View, type ViewProps, type ViewStyle } from "react-native";
import { Text } from "../common/Text";
import { ListItem } from "./ListItem";
interface Props extends ViewProps {
title?: string | null | undefined;
@@ -24,12 +24,12 @@ export const ListGroup: React.FC<PropsWithChildren<Props>> = ({
return (
<View {...props}>
<Text className="ml-4 mb-1 uppercase text-[#8E8D91] text-xs">
<Text className='ml-4 mb-1 uppercase text-[#8E8D91] text-xs'>
{title}
</Text>
<View
style={[]}
className="flex flex-col rounded-xl overflow-hidden pl-0 bg-neutral-900"
className='flex flex-col rounded-xl overflow-hidden pl-0 bg-neutral-900'
>
{Children.map(childrenArray, (child, index) => {
if (isValidElement<{ style?: ViewStyle }>(child)) {
@@ -38,14 +38,14 @@ export const ListGroup: React.FC<PropsWithChildren<Props>> = ({
child.props.style,
index < childrenArray.length - 1
? styles.borderBottom
: undefined
: undefined,
),
});
}
return child;
})}
</View>
{description && <View className="pl-4 mt-1">{description}</View>}
{description && <View className='pl-4 mt-1'>{description}</View>}
</View>
);
};

View File

@@ -1,10 +1,10 @@
import { Ionicons } from "@expo/vector-icons";
import { PropsWithChildren, ReactNode } from "react";
import type { PropsWithChildren, ReactNode } from "react";
import {
TouchableOpacity,
TouchableOpacityProps,
type TouchableOpacityProps,
View,
ViewProps,
type ViewProps,
} from "react-native";
import { Text } from "../common/Text";
@@ -86,10 +86,10 @@ const ListItemContent = ({
}: Props) => {
return (
<>
<View className="flex flex-row items-center w-full">
<View className='flex flex-row items-center w-full'>
{icon && (
<View className="border border-neutral-800 rounded-md h-8 w-8 flex items-center justify-center mr-2">
<Ionicons name="person-circle-outline" size={18} color="white" />
<View className='border border-neutral-800 rounded-md h-8 w-8 flex items-center justify-center mr-2'>
<Ionicons name='person-circle-outline' size={18} color='white' />
</View>
)}
<Text
@@ -97,24 +97,24 @@ const ListItemContent = ({
textColor === "blue"
? "text-[#0584FE]"
: textColor === "red"
? "text-red-600"
: "text-white"
? "text-red-600"
: "text-white"
}
numberOfLines={1}
>
{title}
</Text>
{value && (
<View className="ml-auto items-end">
<Text selectable className=" text-[#9899A1]" numberOfLines={1}>
<View className='ml-auto items-end'>
<Text selectable className=' text-[#9899A1]' numberOfLines={1}>
{value}
</Text>
</View>
)}
{children && <View className="ml-auto">{children}</View>}
{children && <View className='ml-auto'>{children}</View>}
{showArrow && (
<View className={children ? "ml-1" : "ml-auto"}>
<Ionicons name="chevron-forward" size={18} color="#5A5960" />
<Ionicons name='chevron-forward' size={18} color='#5A5960' />
</View>
)}
</View>