upd: project
Deskripsi: - load page project - pencarian project - filter group project - update label status pada project home No Issues
This commit is contained in:
@@ -15,9 +15,20 @@ type Props = {
|
||||
open: boolean,
|
||||
close: (value: boolean) => void
|
||||
page: 'position' | 'member' | 'discussion' | 'project' | 'division'
|
||||
category?: 'filter-group' | 'filter-data'
|
||||
}
|
||||
|
||||
export default function ModalFilter({ open, close, page }: Props) {
|
||||
export default function ModalFilter({ open, close, page, category }: Props) {
|
||||
const data = [
|
||||
{
|
||||
id: "data-saya",
|
||||
name: "Kegiatan Saya",
|
||||
},
|
||||
{
|
||||
id: "semua",
|
||||
name: "Semua Kegiatan",
|
||||
},
|
||||
]
|
||||
const { token, decryptToken } = useAuthSession()
|
||||
const dispatch = useDispatch()
|
||||
const entities = useSelector((state: any) => state.filterGroup)
|
||||
@@ -44,14 +55,25 @@ export default function ModalFilter({ open, close, page }: Props) {
|
||||
<ScrollView>
|
||||
<View>
|
||||
{
|
||||
entities.map((item: any, index: any) => (
|
||||
<Pressable key={index} style={[Styles.itemSelectModal]} onPress={() => { setChooseGroup(item.id) }}>
|
||||
<Text style={[chooseGroup == item.id ? Styles.textDefaultSemiBold : Styles.textDefault]}>{item.name}</Text>
|
||||
{
|
||||
chooseGroup == item.id && <AntDesign name="check" size={20} />
|
||||
}
|
||||
</Pressable>
|
||||
))
|
||||
category == "filter-data"
|
||||
?
|
||||
data.map((item: any, index: any) => (
|
||||
<Pressable key={index} style={[Styles.itemSelectModal]} onPress={() => { setChooseGroup(item.id) }}>
|
||||
<Text style={[chooseGroup == item.id ? Styles.textDefaultSemiBold : Styles.textDefault]}>{item.name}</Text>
|
||||
{
|
||||
chooseGroup == item.id && <AntDesign name="check" size={20} />
|
||||
}
|
||||
</Pressable>
|
||||
))
|
||||
:
|
||||
entities.map((item: any, index: any) => (
|
||||
<Pressable key={index} style={[Styles.itemSelectModal]} onPress={() => { setChooseGroup(item.id) }}>
|
||||
<Text style={[chooseGroup == item.id ? Styles.textDefaultSemiBold : Styles.textDefault]}>{item.name}</Text>
|
||||
{
|
||||
chooseGroup == item.id && <AntDesign name="check" size={20} />
|
||||
}
|
||||
</Pressable>
|
||||
))
|
||||
}
|
||||
</View>
|
||||
</ScrollView>
|
||||
@@ -59,7 +81,11 @@ export default function ModalFilter({ open, close, page }: Props) {
|
||||
<ButtonForm text="Terapkan" onPress={() => {
|
||||
close(false)
|
||||
page == 'project' ?
|
||||
router.push(`/${page}?status=0`)
|
||||
category == "filter-data"
|
||||
?
|
||||
router.push(`/${page}?status=0&cat=${chooseGroup}`)
|
||||
:
|
||||
router.push(`/${page}?status=0&group=${chooseGroup}`)
|
||||
:
|
||||
router.push(`/${page}?active=true&group=${chooseGroup}`)
|
||||
}} />
|
||||
|
||||
Reference in New Issue
Block a user