Files
streamyfin/components/common/ColumnItem.tsx
Gauvain 5f39622ad6
Some checks failed
🤖 Android APK Build / 🏗️ Build Android APK (push) Has been cancelled
🤖 iOS IPA Build / 🏗️ Build iOS IPA (push) Has been cancelled
🔒 Lockfile Consistency Check / 🔍 Check bun.lock and package.json consistency (push) Has been cancelled
🛡️ CodeQL Analysis / 🔎 Analyze with CodeQL (javascript-typescript) (push) Has been cancelled
🏷️🔀Merge Conflict Labeler / 🏷️ Labeling Merge Conflicts (push) Has been cancelled
🕒 Handle Stale Issues / 🗑️ Cleanup Stale Issues (push) Has been cancelled
fix: bump biome and fix error (#864)
2025-07-21 09:44:24 +02:00

42 lines
806 B
TypeScript

import { View, type ViewProps } from "react-native";
const _getItemStyle = (index: number, numColumns: number) => {
const alignItems = (() => {
if (numColumns < 2 || index % numColumns === 0) return "flex-start";
if ((index + 1) % numColumns === 0) return "flex-end";
return "center";
})();
return {
padding: 20,
alignItems,
width: "100%",
} as const;
};
type ColumnItemProps = ViewProps & {
children: React.ReactNode;
index: number;
numColumns: number;
};
export const ColumnItem = ({
children,
index,
numColumns,
...rest
}: ColumnItemProps) => {
return (
<View className='flex flex-col mb-2 p-4' style={{ width: "33.3%" }}>
<View
className={`
`}
{...rest}
>
{children}
</View>
</View>
);
};