upd: diskusi umum
- tambah diskusi umum - tambah member pada diskusi umum No Issues
This commit is contained in:
@@ -3,11 +3,13 @@ import { valueRoleUser } from "@/constants/RoleUser"
|
||||
import Styles from "@/constants/Styles"
|
||||
import { apiGetGroup, apiGetPosition, apiGetUser } from "@/lib/api"
|
||||
import { setEntityFilterGroup } from "@/lib/filterSlice"
|
||||
import { setMemberChoose } from "@/lib/memberChoose"
|
||||
import { useAuthSession } from "@/providers/AuthProvider"
|
||||
import { AntDesign } from "@expo/vector-icons"
|
||||
import { useEffect, useState } from "react"
|
||||
import { Pressable, ScrollView, Text, View } from "react-native"
|
||||
import { useDispatch, useSelector } from "react-redux"
|
||||
import { ButtonForm } from "./buttonForm"
|
||||
import DrawerBottom from "./drawerBottom"
|
||||
import ImageUser from "./imageNew"
|
||||
import ImageWithLabel from "./imageWithLabel"
|
||||
@@ -84,7 +86,7 @@ export default function ModalSelect({ open, close, title, category, idParent, on
|
||||
handleLoadMember()
|
||||
}
|
||||
setChooseValue({ ...chooseValue, val: valChoose })
|
||||
}, [dispatch, open]);
|
||||
}, [dispatch, open, search]);
|
||||
|
||||
function onChoose(val: string, label: string, img?: string) {
|
||||
if (category == "member") {
|
||||
@@ -100,29 +102,37 @@ export default function ModalSelect({ open, close, title, category, idParent, on
|
||||
}
|
||||
}
|
||||
|
||||
function handleChooseMember() {
|
||||
dispatch(setMemberChoose(selectMember))
|
||||
close(false)
|
||||
}
|
||||
|
||||
return (
|
||||
<DrawerBottom animation="none" isVisible={open} setVisible={close} title={title} height={category == 'gender' ? 25 : category == 'member' ? 100 : 75}>
|
||||
{
|
||||
category == 'member' &&
|
||||
<>
|
||||
<InputSearch onChange={setSearch} />
|
||||
<InputSearch onChange={setSearch} value={search} />
|
||||
{
|
||||
selectMember.length > 0
|
||||
?
|
||||
<ScrollView horizontal style={[Styles.mb10, Styles.pv10]}>
|
||||
{
|
||||
selectMember.map((item: any, index: any) => (
|
||||
<ImageWithLabel
|
||||
key={index}
|
||||
label={item.name}
|
||||
src={item.img}
|
||||
onClick={() => onChoose(item.idUser, item.name, item.img)}
|
||||
/>
|
||||
))
|
||||
}
|
||||
</ScrollView>
|
||||
<View>
|
||||
<ScrollView horizontal style={[Styles.mb10, Styles.pv10]}>
|
||||
{
|
||||
selectMember.map((item: any, index: any) => (
|
||||
<ImageWithLabel
|
||||
key={index}
|
||||
label={item.name}
|
||||
src={item.img}
|
||||
onClick={() => onChoose(item.idUser, item.name, item.img)}
|
||||
/>
|
||||
))
|
||||
}
|
||||
</ScrollView>
|
||||
</View>
|
||||
|
||||
:
|
||||
<Text style={[Styles.textDefault, Styles.cGray, { textAlign: 'center' }]}>Tidak ada member yang dipilih</Text>
|
||||
<Text style={[Styles.textDefault, Styles.cGray, Styles.pv05, { textAlign: 'center' }]}>Tidak ada member yang dipilih</Text>
|
||||
}
|
||||
</>
|
||||
}
|
||||
@@ -171,6 +181,14 @@ export default function ModalSelect({ open, close, title, category, idParent, on
|
||||
|
||||
</View>
|
||||
</ScrollView>
|
||||
{
|
||||
category == 'member' &&
|
||||
<ButtonForm
|
||||
onPress={() => { handleChooseMember() }}
|
||||
text="PILIH MEMBER"
|
||||
disabled={selectMember.length == 0}
|
||||
/>
|
||||
}
|
||||
</DrawerBottom >
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user