Skip to content

Commit 54994bf

Browse files
committed
Fix lint errors and cleanup
1 parent ae5525f commit 54994bf

14 files changed

+618
-267
lines changed

fixture/react-native/src/Grid.tsx

Lines changed: 31 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -8,43 +8,42 @@ interface GridItem {
88
color: string;
99
span?: number;
1010
}
11+
const colors = [
12+
"#FF5252",
13+
"#FF4081",
14+
"#E040FB",
15+
"#7C4DFF",
16+
"#536DFE",
17+
"#448AFF",
18+
"#40C4FF",
19+
"#18FFFF",
20+
"#64FFDA",
21+
"#69F0AE",
22+
"#B2FF59",
23+
"#EEFF41",
24+
"#FFFF00",
25+
"#FFD740",
26+
"#FFAB40",
27+
"#FF6E40",
28+
];
29+
// Generate data using a loop
30+
const generateData = (count: number): GridItem[] => {
31+
const items: GridItem[] = [];
32+
for (let i = 0; i < count; i++) {
33+
items.push({
34+
id: i,
35+
title: `Item ${i}`,
36+
span: i % 9 === 0 ? 2 : 1,
37+
color: colors[i % colors.length], // Cycle through colors
38+
});
39+
}
40+
return items;
41+
};
1142

1243
export function Grid() {
1344
const [numItems] = useState(1000); // Default to 100 items
1445

1546
// Generate colors for the grid items
16-
const colors = [
17-
"#FF5252",
18-
"#FF4081",
19-
"#E040FB",
20-
"#7C4DFF",
21-
"#536DFE",
22-
"#448AFF",
23-
"#40C4FF",
24-
"#18FFFF",
25-
"#64FFDA",
26-
"#69F0AE",
27-
"#B2FF59",
28-
"#EEFF41",
29-
"#FFFF00",
30-
"#FFD740",
31-
"#FFAB40",
32-
"#FF6E40",
33-
];
34-
35-
// Generate data using a loop
36-
const generateData = (count: number): GridItem[] => {
37-
const items: GridItem[] = [];
38-
for (let i = 0; i < count; i++) {
39-
items.push({
40-
id: i,
41-
title: `Item ${i}`,
42-
span: i % 9 === 0 ? 2 : 1,
43-
color: colors[i % colors.length], // Cycle through colors
44-
});
45-
}
46-
return items;
47-
};
4847

4948
const data = useMemo(() => generateData(numItems), [numItems]);
5049

fixture/react-native/src/LayoutOptions.tsx

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,33 +17,33 @@ interface ListItem {
1717
height: number;
1818
}
1919

20+
// Generate colors for the items
21+
const colors = [
22+
"#FF5252", // Red
23+
"#FF4081", // Pink
24+
"#E040FB", // Purple
25+
"#7C4DFF", // Deep Purple
26+
"#536DFE", // Indigo
27+
"#448AFF", // Blue
28+
"#40C4FF", // Light Blue
29+
"#18FFFF", // Cyan
30+
"#64FFDA", // Teal
31+
"#69F0AE", // Green
32+
"#B2FF59", // Light Green
33+
"#EEFF41", // Lime
34+
"#FFFF00", // Yellow
35+
"#FFD740", // Amber
36+
"#FFAB40", // Orange
37+
"#FF6E40", // Deep Orange
38+
];
39+
2040
export function LayoutOptions() {
2141
// Configuration states
2242
const [numColumns, setNumColumns] = useState(1);
2343
const [isHorizontal, setIsHorizontal] = useState(false);
2444
const [isMasonry, setIsMasonry] = useState(false);
2545
const [optimizeItemArrangement, setOptimizeItemArrangement] = useState(false);
2646

27-
// Generate colors for the items
28-
const colors = [
29-
"#FF5252", // Red
30-
"#FF4081", // Pink
31-
"#E040FB", // Purple
32-
"#7C4DFF", // Deep Purple
33-
"#536DFE", // Indigo
34-
"#448AFF", // Blue
35-
"#40C4FF", // Light Blue
36-
"#18FFFF", // Cyan
37-
"#64FFDA", // Teal
38-
"#69F0AE", // Green
39-
"#B2FF59", // Light Green
40-
"#EEFF41", // Lime
41-
"#FFFF00", // Yellow
42-
"#FFD740", // Amber
43-
"#FFAB40", // Orange
44-
"#FF6E40", // Deep Orange
45-
];
46-
4747
// Generate data
4848
const data: ListItem[] = useMemo(() => {
4949
return Array.from({ length: 100 }, (_, i) => ({

fixture/react-native/src/MovieList.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,10 +219,6 @@ const MoviePoster = ({ item }: { item: Movie }) => {
219219

220220
// Category row component
221221
const CategoryRow = ({ category }: { category: Category }) => {
222-
useEffect(() => {
223-
console.log("Moview row mount", category.title);
224-
}, []);
225-
226222
const renderMoviePoster = useCallback(
227223
({ item }: { item: Movie }) => <MoviePoster item={item} />,
228224
[]

0 commit comments

Comments
 (0)