Fakultas Ilmu Komputer UI

Commit 4d801008 authored by Faraz's avatar Faraz
Browse files

refactor: update Ecosystem type in EcosystemListScreen.tsx

parent 6581eee6
Pipeline #86120 passed with stage
in 9 minutes and 27 seconds
......@@ -5,9 +5,7 @@ import { useNavigation } from "@react-navigation/core";
import Colors from "../constants/Colors";
import { View } from "../components/Themed";
import Spacer from "../components/Spacer/Spacer";
import { IEcosystem } from "../types/firestore/ecosystem";
import { IEcosystemList } from "../types/ecosystemList";
import PlainForm from "../components/Forms/PlainForm";
import { IEcosystem } from "../types/firestore/ecosystems";
import IconForm from "../components/Forms/IconForm";
const CategoryEcosystemListScreen = () => {
......@@ -64,20 +62,6 @@ const CategoryEcosystemListScreen = () => {
},
]);
const renderItem = ({ item }: IEcosystem) => {
return (
<View style={styles.horizontalCard}>
<HorizontalCards
image={item.image}
member={item.member}
title={item.title}
rate={item.rate}
onPress={null}
/>
</View>
);
};
return (
<SafeAreaView style={styles.container}>
<View>
......@@ -91,7 +75,19 @@ const CategoryEcosystemListScreen = () => {
<Spacer variant={"xl"} />
<FlatList
data={listData}
renderItem={renderItem}
renderItem={({ item }) => {
return (
<View style={styles.horizontalCard}>
<HorizontalCards
image={item.image}
member={item.member}
title={item.title}
rate={item.rate}
onPress={null}
/>
</View>
);
}}
keyExtractor={(item) => item.id}
ItemSeparatorComponent={() => <Spacer variant={"l"} />}
showsVerticalScrollIndicator={false}
......
......@@ -5,7 +5,7 @@ import { useNavigation } from "@react-navigation/core";
import Colors from "../constants/Colors";
import { View } from "../components/Themed";
import Spacer from "../components/Spacer/Spacer";
import { IEcosystem } from "../types/firestore/ecosystem";
import { IEcosystem } from "../types/firestore/ecosystems";
import { IEcosystemList } from "../types/ecosystemList";
const EcosystemListScreen = () => {
......@@ -61,25 +61,23 @@ const EcosystemListScreen = () => {
},
]);
const renderItem = ({ item }: IEcosystem) => {
return (
<View style={styles.horizontalCard}>
<HorizontalCards
image={item.image}
member={item.member}
title={item.title}
rate={item.rate}
onPress={null}
/>
</View>
);
};
return (
<SafeAreaView style={styles.container}>
<FlatList
data={listData}
renderItem={renderItem}
renderItem={({ item }) => {
return (
<View style={styles.horizontalCard}>
<HorizontalCards
image={item.image}
member={item.member}
title={item.title}
rate={item.rate}
onPress={null}
/>
</View>
);
}}
keyExtractor={(item) => item.id}
ItemSeparatorComponent={() => <Spacer variant={"l"} />}
showsVerticalScrollIndicator={false}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment