upd: document divisi
Deskripsi: - ui list dokumen No Issues
This commit is contained in:
@@ -0,0 +1,39 @@
|
|||||||
|
import ButtonBackHeader from "@/components/buttonBackHeader"
|
||||||
|
import HeaderRightDocument from "@/components/document/headerDocument"
|
||||||
|
import ItemFile from "@/components/document/itemFile"
|
||||||
|
import Styles from "@/constants/Styles"
|
||||||
|
import { AntDesign, Ionicons, MaterialCommunityIcons } from "@expo/vector-icons"
|
||||||
|
import { router, Stack, useLocalSearchParams } from "expo-router"
|
||||||
|
import { SafeAreaView, ScrollView, Text, View } from "react-native"
|
||||||
|
|
||||||
|
export default function DocumentDivision() {
|
||||||
|
const { path } = useLocalSearchParams<{ path?: string }>()
|
||||||
|
|
||||||
|
return (
|
||||||
|
<SafeAreaView>
|
||||||
|
<Stack.Screen
|
||||||
|
options={{
|
||||||
|
headerLeft: () => <ButtonBackHeader onPress={() => { router.back() }} />,
|
||||||
|
headerTitle: 'Dokumen Divisi',
|
||||||
|
headerTitleAlign: 'center',
|
||||||
|
headerRight: () => <HeaderRightDocument id={path} />
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<ScrollView>
|
||||||
|
<View style={[Styles.p15, Styles.mb100]}>
|
||||||
|
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
|
||||||
|
<Text> home </Text>
|
||||||
|
<AntDesign name="right" style={[Styles.mh05, Styles.mt02]} />
|
||||||
|
<Text> folder 1 </Text>
|
||||||
|
</View>
|
||||||
|
<View>
|
||||||
|
<ItemFile category="folder" title="Folder Pertama" dateTime="05-02-2025 07:54" />
|
||||||
|
<ItemFile category="file" title="Images.jpg" dateTime="05-11-2024 07:54" />
|
||||||
|
<ItemFile category="folder-shared" title="Folder shared" dateTime="05-11-2024 07:54" />
|
||||||
|
<ItemFile category="file-shared" title="images-shared.pdf" dateTime="05-11-2024 07:54" />
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</ScrollView>
|
||||||
|
</SafeAreaView>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -3,9 +3,11 @@ import Styles from "@/constants/Styles"
|
|||||||
import { AntDesign, MaterialIcons, SimpleLineIcons } from "@expo/vector-icons"
|
import { AntDesign, MaterialIcons, SimpleLineIcons } from "@expo/vector-icons"
|
||||||
import { Text, View } from "react-native"
|
import { Text, View } from "react-native"
|
||||||
import BorderBottomItem from "../borderBottomItem"
|
import BorderBottomItem from "../borderBottomItem"
|
||||||
import { router } from "expo-router"
|
import { router, useLocalSearchParams } from "expo-router"
|
||||||
|
|
||||||
export default function FiturDivisionDetail() {
|
export default function FiturDivisionDetail() {
|
||||||
|
const { id } = useLocalSearchParams()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={[Styles.mb15]}>
|
<View style={[Styles.mb15]}>
|
||||||
<Text style={[Styles.textDefaultSemiBold, Styles.mv05]}>Fitur</Text>
|
<Text style={[Styles.textDefaultSemiBold, Styles.mv05]}>Fitur</Text>
|
||||||
@@ -22,7 +24,7 @@ export default function FiturDivisionDetail() {
|
|||||||
title="Tugas"
|
title="Tugas"
|
||||||
subtitle='15 Tugas'
|
subtitle='15 Tugas'
|
||||||
width={28}
|
width={28}
|
||||||
onPress={() => {router.push('/division/123/task?status=0')}}
|
onPress={() => { router.push(`/division/${id}/task?status=0`) }}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<BorderBottomItem
|
<BorderBottomItem
|
||||||
@@ -36,6 +38,7 @@ export default function FiturDivisionDetail() {
|
|||||||
title="Dokumen"
|
title="Dokumen"
|
||||||
subtitle='20 File'
|
subtitle='20 File'
|
||||||
width={28}
|
width={28}
|
||||||
|
onPress={() => { router.push(`/division/${id}/document`) }}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
@@ -51,7 +54,7 @@ export default function FiturDivisionDetail() {
|
|||||||
title="Diskusi"
|
title="Diskusi"
|
||||||
subtitle='5 Diskusi'
|
subtitle='5 Diskusi'
|
||||||
width={28}
|
width={28}
|
||||||
onPress={() => {router.push('/division/123/discussion?active=true')}}
|
onPress={() => { router.push(`/division/${id}/discussion?active=true`) }}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<BorderBottomItem
|
<BorderBottomItem
|
||||||
@@ -65,7 +68,7 @@ export default function FiturDivisionDetail() {
|
|||||||
title="Kalender"
|
title="Kalender"
|
||||||
subtitle='23 Acara'
|
subtitle='23 Acara'
|
||||||
width={28}
|
width={28}
|
||||||
onPress={() => {router.push('/division/123/calendar')}}
|
onPress={() => { router.push(`/division/${id}/calendar`) }}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
40
components/document/headerDocument.tsx
Normal file
40
components/document/headerDocument.tsx
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
import Styles from "@/constants/Styles"
|
||||||
|
import { MaterialCommunityIcons, MaterialIcons } from "@expo/vector-icons"
|
||||||
|
import { useState } from "react"
|
||||||
|
import { View } from "react-native"
|
||||||
|
import ButtonMenuHeader from "../buttonMenuHeader"
|
||||||
|
import DrawerBottom from "../drawerBottom"
|
||||||
|
import MenuItemRow from "../menuItemRow"
|
||||||
|
|
||||||
|
type Props = {
|
||||||
|
id: string | string[] | undefined | null
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function HeaderRightDocument({ id }: Props) {
|
||||||
|
const [isVisible, setVisible] = useState(false)
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<ButtonMenuHeader onPress={() => { setVisible(true) }} />
|
||||||
|
<DrawerBottom animation="slide" isVisible={isVisible} setVisible={setVisible} title="Menu">
|
||||||
|
<View style={Styles.rowItemsCenter}>
|
||||||
|
<MenuItemRow
|
||||||
|
icon={<MaterialCommunityIcons name="folder-open" color="black" size={25} />}
|
||||||
|
title="Tambah Dokumen"
|
||||||
|
onPress={() => {
|
||||||
|
setVisible(false)
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<MenuItemRow
|
||||||
|
icon={<MaterialIcons name="upload-file" color="black" size={25} />}
|
||||||
|
title="Upload File"
|
||||||
|
onPress={() => {
|
||||||
|
setVisible(false)
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
</DrawerBottom>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
|
||||||
|
}
|
||||||
69
components/document/itemFile.tsx
Normal file
69
components/document/itemFile.tsx
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
import Styles from "@/constants/Styles";
|
||||||
|
import { Ionicons, MaterialCommunityIcons } from "@expo/vector-icons";
|
||||||
|
import { Pressable, Text, View } from "react-native";
|
||||||
|
|
||||||
|
|
||||||
|
type Props = {
|
||||||
|
title: string
|
||||||
|
category: 'folder' | 'folder-shared' | 'file' | 'file-shared'
|
||||||
|
dateTime: string
|
||||||
|
checked?: boolean
|
||||||
|
onChecked?: () => void
|
||||||
|
onPress?: () => void
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function ItemFile({ category, checked, dateTime, title, onChecked, onPress }: Props) {
|
||||||
|
return (
|
||||||
|
<View style={[Styles.wrapItemBorderBottom]}>
|
||||||
|
<View style={[Styles.rowItemsCenter]}>
|
||||||
|
<Pressable onPress={onPress}>
|
||||||
|
{
|
||||||
|
category == 'folder-shared'
|
||||||
|
?
|
||||||
|
<>
|
||||||
|
<Ionicons name="folder-open-sharp" color={'#f9cc40'} size={40} />
|
||||||
|
<MaterialCommunityIcons name="share" color={'gray'} size={25} style={{
|
||||||
|
top: 18,
|
||||||
|
left: 20,
|
||||||
|
position: 'absolute'
|
||||||
|
}} />
|
||||||
|
</>
|
||||||
|
: category == 'file-shared'
|
||||||
|
?
|
||||||
|
<>
|
||||||
|
<Ionicons name="document-text-sharp" color={'#9fcff8'} size={40} />
|
||||||
|
<MaterialCommunityIcons name="share" color={'gray'} size={25} style={{
|
||||||
|
top: 18,
|
||||||
|
left: 20,
|
||||||
|
position: 'absolute'
|
||||||
|
}} />
|
||||||
|
</>
|
||||||
|
:
|
||||||
|
category == 'folder'
|
||||||
|
?
|
||||||
|
<Ionicons name="folder-open-sharp" color={'#f9cc40'} size={40} />
|
||||||
|
:
|
||||||
|
<Ionicons name="document-text-sharp" color={'#9fcff8'} size={40} />
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
</Pressable>
|
||||||
|
<View style={[Styles.rowSpaceBetween, { flex: 1, alignItems: 'center' }]}>
|
||||||
|
<Pressable style={[Styles.ml10]} onPress={onPress}>
|
||||||
|
<Text style={[Styles.textDefault]}>{title}</Text>
|
||||||
|
<Text style={[Styles.textInformation]}>{dateTime}</Text>
|
||||||
|
</Pressable>
|
||||||
|
<Pressable onPress={onChecked}>
|
||||||
|
{
|
||||||
|
checked
|
||||||
|
? <MaterialCommunityIcons name="checkbox-marked-circle" size={25} color={'black'} />
|
||||||
|
: <MaterialCommunityIcons name="checkbox-blank-circle-outline" size={25} color={'#ced4da'} />
|
||||||
|
}
|
||||||
|
|
||||||
|
</Pressable>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -83,9 +83,21 @@ const Styles = StyleSheet.create({
|
|||||||
mv15: {
|
mv15: {
|
||||||
marginVertical: 15
|
marginVertical: 15
|
||||||
},
|
},
|
||||||
|
mh05: {
|
||||||
|
marginHorizontal: 5
|
||||||
|
},
|
||||||
|
mh10: {
|
||||||
|
marginHorizontal: 10
|
||||||
|
},
|
||||||
|
mh15: {
|
||||||
|
marginHorizontal: 15
|
||||||
|
},
|
||||||
mv10: {
|
mv10: {
|
||||||
marginVertical: 10
|
marginVertical: 10
|
||||||
},
|
},
|
||||||
|
mt02: {
|
||||||
|
marginTop: 2
|
||||||
|
},
|
||||||
mt05: {
|
mt05: {
|
||||||
marginTop: 5
|
marginTop: 5
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user