upd: discussion
Deskripsi: - ui list diskusi No Issues
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import ButtonBackHeader from "@/components/buttonBackHeader";
|
||||
import HeaderDiscussionGeneral from "@/components/discussion_general/headerDiscussionGeneral";
|
||||
import HeaderMemberList from "@/components/member/headerMemberList";
|
||||
import { Headers } from "@/constants/Headers";
|
||||
import { router, Stack } from "expo-router";
|
||||
@@ -21,7 +22,12 @@ export default function RootLayout() {
|
||||
headerTitleAlign: 'center',
|
||||
headerRight: () => <HeaderMemberList />
|
||||
}} />
|
||||
<Stack.Screen name="member/create" options={{ title: 'Tambah Anggota' }} />
|
||||
<Stack.Screen name="discussion/index" options={{
|
||||
headerLeft: () => <ButtonBackHeader onPress={() => { router.back() }} />,
|
||||
title: 'Diskusi Umum',
|
||||
headerTitleAlign: 'center',
|
||||
headerRight: () => <HeaderDiscussionGeneral />
|
||||
}} />
|
||||
</Stack>
|
||||
<StatusBar style="light" />
|
||||
</>
|
||||
|
||||
7
app/(application)/discussion/[id].tsx
Normal file
7
app/(application)/discussion/[id].tsx
Normal file
@@ -0,0 +1,7 @@
|
||||
import { Text } from "react-native";
|
||||
|
||||
export default function DetailDiscussionGeneral() {
|
||||
return (
|
||||
<Text>Detail diskusi general</Text>
|
||||
)
|
||||
}
|
||||
7
app/(application)/discussion/create.tsx
Normal file
7
app/(application)/discussion/create.tsx
Normal file
@@ -0,0 +1,7 @@
|
||||
import { Text } from "react-native";
|
||||
|
||||
export default function CreateDiscussionGeneral(){
|
||||
return(
|
||||
<Text>Tambah diskusi general</Text>
|
||||
)
|
||||
}
|
||||
66
app/(application)/discussion/index.tsx
Normal file
66
app/(application)/discussion/index.tsx
Normal file
@@ -0,0 +1,66 @@
|
||||
import BorderBottomItem from "@/components/borderBottomItem";
|
||||
import ButtonTab from "@/components/buttonTab";
|
||||
import InputSearch from "@/components/inputSearch";
|
||||
import LabelStatus from "@/components/labelStatus";
|
||||
import { ColorsStatus } from "@/constants/ColorsStatus";
|
||||
import Styles from "@/constants/Styles";
|
||||
import { AntDesign, Feather, Ionicons, MaterialCommunityIcons, MaterialIcons } from "@expo/vector-icons";
|
||||
import { router, useLocalSearchParams } from "expo-router";
|
||||
import { SafeAreaView, ScrollView, Text, View } from "react-native";
|
||||
|
||||
export default function Discussion() {
|
||||
const { active } = useLocalSearchParams<{ active?: string }>()
|
||||
|
||||
return (
|
||||
<SafeAreaView>
|
||||
<ScrollView>
|
||||
<View style={[Styles.p15]}>
|
||||
<View style={[Styles.wrapBtnTab]}>
|
||||
<ButtonTab
|
||||
active={active == "false" ? "false" : "true"}
|
||||
value="true"
|
||||
onPress={() => { router.push('/discussion?active=true') }}
|
||||
label="Aktif"
|
||||
icon={<Feather name="check-circle" color={active == "false" ? 'black' : 'white'} size={20} />}
|
||||
n={2} />
|
||||
<ButtonTab
|
||||
active={active == "false" ? "false" : "true"}
|
||||
value="false"
|
||||
onPress={() => { router.push('/discussion?active=false') }}
|
||||
label="Arsip"
|
||||
icon={<AntDesign name="closecircleo" color={active == "true" ? 'black' : 'white'} size={20} />}
|
||||
n={2} />
|
||||
</View>
|
||||
<InputSearch />
|
||||
<View style={[Styles.mv05]}>
|
||||
<Text>Filter : Dinas</Text>
|
||||
</View>
|
||||
<View>
|
||||
<BorderBottomItem
|
||||
onPress={() => { router.push('/discussion/1') }}
|
||||
borderType="bottom"
|
||||
icon={
|
||||
<View style={[Styles.iconContent, ColorsStatus.lightGreen]}>
|
||||
<MaterialIcons name="chat" size={25} color={'#384288'} />
|
||||
</View>
|
||||
}
|
||||
title="Danantara"
|
||||
subtitle={
|
||||
<LabelStatus category='success' text='BUKA' size="small" />
|
||||
}
|
||||
rightTopInfo="3 Jan 2025"
|
||||
desc="Bagaimana dampak yg dirasakan akibat efisiensi?"
|
||||
leftBottomInfo={
|
||||
<View style={[Styles.rowItemsCenter]}>
|
||||
<Ionicons name="chatbox-ellipses-outline" size={18} color="grey" style={Styles.mr05} />
|
||||
<Text style={[Styles.textInformation, Styles.cGray, Styles.mb05]}>Diskusikan</Text>
|
||||
</View>
|
||||
}
|
||||
rightBottomInfo='15 Komentar'
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
</ScrollView>
|
||||
</SafeAreaView>
|
||||
);
|
||||
}
|
||||
@@ -20,7 +20,7 @@ export default function Feature() {
|
||||
<ButtonFiturMenu icon={<MaterialIcons name="group" size={35} color="black" />} text="Divisi" />
|
||||
<ButtonFiturMenu icon={<AntDesign name="areachart" size={35} color="black" />} text="Kegiatan" />
|
||||
<ButtonFiturMenu icon={<MaterialIcons name="campaign" size={35} color="black" />} text="Pengumuman" />
|
||||
<ButtonFiturMenu icon={<Ionicons name="chatbubbles-sharp" size={35} color="black" />} text="Diskusi" />
|
||||
<ButtonFiturMenu icon={<Ionicons name="chatbubbles-sharp" size={35} color="black" />} text="Diskusi" onPress={() => { router.push('/discussion?active=true') }}/>
|
||||
</View>
|
||||
<View style={[Styles.rowSpaceBetween, Styles.mb15]}>
|
||||
<ButtonFiturMenu icon={<MaterialIcons name="groups" size={35} color="black" />} text="Anggota" onPress={() => { router.push('/member?active=true') }}/>
|
||||
|
||||
@@ -1,17 +1,24 @@
|
||||
import Styles from "@/constants/Styles";
|
||||
import React from "react";
|
||||
import { Pressable, Text, View } from "react-native";
|
||||
import LabelStatus from "./labelStatus";
|
||||
import { Feather } from "@expo/vector-icons";
|
||||
|
||||
type Props = {
|
||||
title: string
|
||||
subtitle?: string
|
||||
subtitle?: string | React.ReactNode
|
||||
icon: React.ReactNode
|
||||
desc?: string
|
||||
rightTopInfo?: string
|
||||
onPress?: () => void
|
||||
borderType: 'all' | 'bottom'
|
||||
leftBottomInfo?: React.ReactNode | string
|
||||
rightBottomInfo?: React.ReactNode | string
|
||||
}
|
||||
|
||||
export default function BorderBottomItem({ title, subtitle, icon, desc, onPress, rightTopInfo, borderType }: Props) {
|
||||
export default function BorderBottomItem({ title, subtitle, icon, desc, onPress, rightTopInfo, borderType, leftBottomInfo, rightBottomInfo }: Props) {
|
||||
|
||||
console.log(typeof rightBottomInfo)
|
||||
return (
|
||||
<Pressable style={[borderType == 'bottom' ? Styles.wrapItemBorderBottom : Styles.wrapItemBorderAll]} onPressOut={onPress}>
|
||||
<View style={[Styles.rowItemsCenter]}>
|
||||
@@ -19,7 +26,14 @@ export default function BorderBottomItem({ title, subtitle, icon, desc, onPress,
|
||||
<View style={[Styles.rowSpaceBetween, { width: '85%' }]}>
|
||||
<View style={[Styles.ml10]}>
|
||||
<Text style={[Styles.textDefaultSemiBold]}>{title}</Text>
|
||||
{subtitle && <Text style={[Styles.textMediumNormal, {lineHeight:15}]}>{subtitle}</Text>}
|
||||
{
|
||||
subtitle &&
|
||||
typeof subtitle == "string"
|
||||
? <Text style={[Styles.textMediumNormal, { lineHeight: 15 }]}>{subtitle}</Text>
|
||||
: <View style={{ alignItems: 'flex-start' }}>
|
||||
{subtitle}
|
||||
</View>
|
||||
}
|
||||
</View>
|
||||
{
|
||||
rightTopInfo && <Text style={[Styles.textInformation]}>{rightTopInfo}</Text>
|
||||
@@ -28,6 +42,25 @@ export default function BorderBottomItem({ title, subtitle, icon, desc, onPress,
|
||||
|
||||
</View>
|
||||
{desc && <Text style={[Styles.textDefault, Styles.mt05, { textAlign: 'justify' }]}>{desc}</Text>}
|
||||
{
|
||||
leftBottomInfo && rightBottomInfo &&
|
||||
(
|
||||
<View style={[Styles.rowSpaceBetween, Styles.mt10]}>
|
||||
{
|
||||
typeof leftBottomInfo == 'string' ?
|
||||
<Text style={[Styles.textInformation, Styles.cGray, { textAlign: 'left' }]}>{leftBottomInfo}</Text>
|
||||
:
|
||||
leftBottomInfo
|
||||
}
|
||||
{
|
||||
typeof rightBottomInfo == 'string' ?
|
||||
<Text style={[Styles.textInformation, Styles.cGray, { textAlign: 'right' }]}>{rightBottomInfo}</Text>
|
||||
:
|
||||
rightBottomInfo
|
||||
}
|
||||
</View>
|
||||
)
|
||||
}
|
||||
</Pressable>
|
||||
)
|
||||
}
|
||||
40
components/discussion_general/headerDiscussionGeneral.tsx
Normal file
40
components/discussion_general/headerDiscussionGeneral.tsx
Normal file
@@ -0,0 +1,40 @@
|
||||
import Styles from "@/constants/Styles"
|
||||
import { AntDesign } from "@expo/vector-icons"
|
||||
import { router } from "expo-router"
|
||||
import { useState } from "react"
|
||||
import { View } from "react-native"
|
||||
import ButtonMenuHeader from "../buttonMenuHeader"
|
||||
import DrawerBottom from "../drawerBottom"
|
||||
import MenuItemRow from "../menuItemRow"
|
||||
import ModalFilter from "../modalFilter"
|
||||
|
||||
export default function HeaderDiscussionGeneral() {
|
||||
const [isVisible, setVisible] = useState(false)
|
||||
const [isFilter, setFilter] = useState(false)
|
||||
return (
|
||||
<>
|
||||
<ButtonMenuHeader onPress={() => { setVisible(true) }} />
|
||||
<DrawerBottom animation="slide" isVisible={isVisible} setVisible={setVisible} title="Menu">
|
||||
<View style={Styles.rowItemsCenter}>
|
||||
<MenuItemRow
|
||||
icon={<AntDesign name="pluscircle" color="black" size={25} />}
|
||||
title="Tambah Diskusi"
|
||||
onPress={() => {
|
||||
setVisible(false)
|
||||
router.push('/discussion/create')
|
||||
}}
|
||||
/>
|
||||
<MenuItemRow
|
||||
icon={<AntDesign name="filter" color="black" size={25} />}
|
||||
title="Filter"
|
||||
onPress={() => {
|
||||
setVisible(false)
|
||||
setFilter(true)
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
</DrawerBottom>
|
||||
<ModalFilter close={() => { setFilter(false) }} open={isFilter} page="discussion" />
|
||||
</>
|
||||
)
|
||||
}
|
||||
17
components/labelStatus.tsx
Normal file
17
components/labelStatus.tsx
Normal file
@@ -0,0 +1,17 @@
|
||||
import { ColorsStatus } from "@/constants/ColorsStatus";
|
||||
import Styles from "@/constants/Styles";
|
||||
import { Text, View } from "react-native";
|
||||
|
||||
|
||||
type Props = {
|
||||
category: 'error' | 'success' | 'warning' | 'primary'
|
||||
text: string
|
||||
size: 'small' | 'default'
|
||||
}
|
||||
export default function LabelStatus({ category, text, size }: Props) {
|
||||
return (
|
||||
<View style={[size == "small" ? Styles.labelStatusSmall : Styles.labelStatus, ColorsStatus[category]]}>
|
||||
<Text style={[size == "small" ? Styles.textSmallSemiBold : Styles.textMediumSemiBold, Styles.cWhite, { textAlign: 'center' }]}>{text}</Text>
|
||||
</View>
|
||||
)
|
||||
}
|
||||
@@ -9,7 +9,7 @@ import { router } from "expo-router"
|
||||
type Props = {
|
||||
open: boolean,
|
||||
close: (value: boolean) => void
|
||||
page: 'position' | 'member'
|
||||
page: 'position' | 'member' | 'discussion'
|
||||
}
|
||||
|
||||
export default function ModalFilter({ open, close, page }: Props) {
|
||||
|
||||
@@ -3,7 +3,7 @@ export const ColorsStatus = {
|
||||
backgroundColor: '#19345E'
|
||||
},
|
||||
success: {
|
||||
backgroundColor: 'green'
|
||||
backgroundColor: '#40c057'
|
||||
},
|
||||
info: {
|
||||
backgroundColor: 'blue'
|
||||
|
||||
@@ -25,6 +25,10 @@ const Styles = StyleSheet.create({
|
||||
lineHeight: 24,
|
||||
fontWeight: '600',
|
||||
},
|
||||
textSmallSemiBold: {
|
||||
fontSize: 10,
|
||||
fontWeight: '600',
|
||||
},
|
||||
textTitle: {
|
||||
fontSize: 32,
|
||||
fontWeight: 'bold',
|
||||
@@ -120,6 +124,10 @@ const Styles = StyleSheet.create({
|
||||
paddingHorizontal: 15,
|
||||
borderRadius: 10
|
||||
},
|
||||
labelStatusSmall: {
|
||||
paddingHorizontal: 10,
|
||||
borderRadius: 10
|
||||
},
|
||||
rowSpaceBetween: {
|
||||
justifyContent: 'space-between',
|
||||
flexDirection: 'row'
|
||||
|
||||
Reference in New Issue
Block a user