Skip to content

Commit

Permalink
chore
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrikburmester committed Aug 18, 2024
1 parent dbb7c6c commit 6a8a155
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions components/common/ColumnItem.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { useMemo } from "react";
import { StyleSheet, View, ViewProps } from "react-native";

const getItemStyle = (index: number, numColumns: number) => {
Expand All @@ -9,6 +10,7 @@ const getItemStyle = (index: number, numColumns: number) => {
})();

return {
padding: 20,
alignItems,
width: "100%",
} as const;
Expand All @@ -19,16 +21,22 @@ type ColumnItemProps = ViewProps & {
index: number;
numColumns: number;
};

export const ColumnItem = ({
children,
index,
numColumns,
...rest
}: ColumnItemProps) => (
<View
style={StyleSheet.flatten([getItemStyle(index, numColumns), rest.style])}
{...rest}
>
{children}
</View>
);
}: ColumnItemProps) => {
return (
<View className="flex flex-col mb-2 p-4" style={{ width: "33.3%" }}>
<View
className={`
`}
{...rest}
>
{children}
</View>
</View>
);
};

0 comments on commit 6a8a155

Please sign in to comment.