feat: tambah empty state dengan ikon pada section tugas, dokumen, dan diskusi divisi
This commit is contained in:
@@ -2,6 +2,7 @@ import Styles from "@/constants/Styles";
|
||||
import { apiGetDivisionOneFeature } from "@/lib/api";
|
||||
import { useAuthSession } from "@/providers/AuthProvider";
|
||||
import { useTheme } from "@/providers/ThemeProvider";
|
||||
import { MaterialCommunityIcons } from "@expo/vector-icons";
|
||||
import { router, useLocalSearchParams } from "expo-router";
|
||||
import { useEffect, useState } from "react";
|
||||
import { View } from "react-native";
|
||||
@@ -54,33 +55,31 @@ export default function DiscussionDivisionDetail({ refreshing }: { refreshing: b
|
||||
return (
|
||||
<View style={[Styles.mb15]}>
|
||||
<Text style={[Styles.textDefaultSemiBold, Styles.mv10]}>Diskusi</Text>
|
||||
<View style={[Styles.wrapPaper, { backgroundColor: colors.card, borderColor: colors.icon + '20' }, Styles.p0]}>
|
||||
{
|
||||
loading ?
|
||||
<>
|
||||
<Skeleton width={100} height={70} borderRadius={10} widthType="percent" />
|
||||
<Skeleton width={100} height={70} borderRadius={10} widthType="percent" />
|
||||
</>
|
||||
:
|
||||
data.length > 0 ? (
|
||||
data.map((item, index) => (
|
||||
<DiscussionItem
|
||||
key={index}
|
||||
title={item.desc}
|
||||
user={item.user}
|
||||
date={item.date}
|
||||
onPress={() => {
|
||||
router.push(`/division/${id}/discussion/${item.id}`);
|
||||
}}
|
||||
/>
|
||||
))
|
||||
) : (
|
||||
<Text style={[Styles.textDefault, { textAlign: "center", color: colors.dimmed }]} >
|
||||
Tidak ada diskusi
|
||||
</Text>
|
||||
)
|
||||
}
|
||||
</View>
|
||||
{loading ? (
|
||||
<View style={[Styles.wrapPaper, { backgroundColor: colors.card, borderColor: colors.icon + '20' }, Styles.p0]}>
|
||||
<Skeleton width={100} height={70} borderRadius={10} widthType="percent" />
|
||||
<Skeleton width={100} height={70} borderRadius={10} widthType="percent" />
|
||||
</View>
|
||||
) : data.length > 0 ? (
|
||||
<View style={[Styles.wrapPaper, { backgroundColor: colors.card, borderColor: colors.icon + '20' }, Styles.p0]}>
|
||||
{data.map((item, index) => (
|
||||
<DiscussionItem
|
||||
key={index}
|
||||
title={item.desc}
|
||||
user={item.user}
|
||||
date={item.date}
|
||||
onPress={() => {
|
||||
router.push(`/division/${id}/discussion/${item.id}`);
|
||||
}}
|
||||
/>
|
||||
))}
|
||||
</View>
|
||||
) : (
|
||||
<View style={{ alignItems: 'center', paddingVertical: 16, gap: 6, opacity: 0.5 }}>
|
||||
<MaterialCommunityIcons name="chat-outline" size={28} color={colors.dimmed} />
|
||||
<Text style={[Styles.textDefault, { color: colors.dimmed }]}>Belum ada diskusi aktif</Text>
|
||||
</View>
|
||||
)}
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -156,7 +156,10 @@ export default function FileDivisionDetail({ refreshing }: { refreshing: boolean
|
||||
})}
|
||||
</ScrollView>
|
||||
) : (
|
||||
<Text style={[Styles.textDefault, { textAlign: 'center', color: colors.dimmed }]}>Tidak ada file</Text>
|
||||
<View style={{ alignItems: 'center', paddingVertical: 16, gap: 6, opacity: 0.5 }}>
|
||||
<MaterialCommunityIcons name="file-document-outline" size={28} color={colors.dimmed} />
|
||||
<Text style={[Styles.textDefault, { color: colors.dimmed }]}>Belum ada dokumen</Text>
|
||||
</View>
|
||||
)}
|
||||
|
||||
<ImageViewing
|
||||
|
||||
@@ -2,7 +2,7 @@ import Styles from "@/constants/Styles";
|
||||
import { apiGetDivisionOneFeature } from "@/lib/api";
|
||||
import { useAuthSession } from "@/providers/AuthProvider";
|
||||
import { useTheme } from "@/providers/ThemeProvider";
|
||||
import { Feather } from "@expo/vector-icons";
|
||||
import { Feather, MaterialCommunityIcons } from "@expo/vector-icons";
|
||||
import { router, useLocalSearchParams } from "expo-router";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { Dimensions, Pressable, View } from "react-native";
|
||||
@@ -90,7 +90,10 @@ export default function TaskDivisionDetail({ refreshing }: { refreshing: boolean
|
||||
// )}
|
||||
// />
|
||||
:
|
||||
<Text style={[Styles.textDefault, { textAlign: 'center', color: colors.dimmed }]}>Tidak ada tugas</Text>
|
||||
<View style={{ alignItems: 'center', paddingVertical: 16, gap: 6, opacity: 0.5 }}>
|
||||
<MaterialCommunityIcons name="clipboard-check-outline" size={28} color={colors.dimmed} />
|
||||
<Text style={[Styles.textDefault, { color: colors.dimmed }]}>Tidak ada tugas hari ini</Text>
|
||||
</View>
|
||||
}
|
||||
</View>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user