front: wrapper notifikasi ga full

This commit is contained in:
2025-07-10 15:15:57 +08:00
parent 3613b7d869
commit 0df97a3a4b

View File

@@ -118,49 +118,47 @@ export default function Notification() {
return ( return (
<SafeAreaView> <SafeAreaView>
<View style={[Styles.p15]}> <View style={[Styles.p15]}>
<View style={[Styles.wrapPaper, Styles.mb100]}> {
{ loading ?
loading ? arrSkeleton.map((item, index) => {
arrSkeleton.map((item, index) => { return (
return ( <SkeletonTwoItem key={index} />
<SkeletonTwoItem key={index} /> )
) })
}) :
: data.length > 0 ?
data.length > 0 ? <VirtualizedList
<VirtualizedList data={data}
data={data} getItemCount={() => data.length}
getItemCount={() => data.length} getItem={getItem}
getItem={getItem} renderItem={({ item, index }: { item: Props, index: number }) => {
renderItem={({ item, index }: { item: Props, index: number }) => { return (
return ( <BorderBottomItem
<BorderBottomItem borderType="bottom"
borderType="bottom" icon={
icon={ <View style={[Styles.iconContent, item.isRead ? ColorsStatus.secondary : ColorsStatus.primary]}>
<View style={[Styles.iconContent, item.isRead ? ColorsStatus.secondary : ColorsStatus.primary]}> <Feather name="bell" size={25} color="white" />
<Feather name="bell" size={25} color="white" /> </View>
</View> }
} title={item.title}
title={item.title} rightTopInfo={item.createdAt}
rightTopInfo={item.createdAt} desc={item.desc}
desc={item.desc} textColor={item.isRead ? 'gray' : 'black'}
textColor={item.isRead ? 'gray' : 'black'} onPress={() => {
onPress={() => { handleReadNotification(item.id, item.category, item.idContent)
handleReadNotification(item.id, item.category, item.idContent)
}} }}
/> />
) )
}} }}
keyExtractor={(item, index) => String(index)} keyExtractor={(item, index) => String(index)}
onEndReached={loadMoreData} onEndReached={loadMoreData}
onEndReachedThreshold={0.5} onEndReachedThreshold={0.5}
showsVerticalScrollIndicator={false} showsVerticalScrollIndicator={false}
/> />
: :
<Text style={[Styles.textDefault, Styles.cGray, { textAlign: 'center' }]}>Tidak ada data</Text> <Text style={[Styles.textDefault, Styles.cGray, { textAlign: 'center' }]}>Tidak ada data</Text>
} }
</View>
</View> </View>
</SafeAreaView> </SafeAreaView>
) )