upd: document divisi
Deskripsi: - ui list dokumen No Issues
This commit is contained in:
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>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user