fix : ios dan tampilan
Deskripsi: - modal crash - input keyboard over lap - detail pengumuman text color - Scroll view tinggi 100 persen - image user nb : blm selesai semua
This commit is contained in:
@@ -17,7 +17,7 @@ export default function ButtonTab({ active, value, onPress, label, n, icon }: Pr
|
||||
return (
|
||||
<TouchableOpacity style={[Styles.btnTab, (active == value) && ColorsStatus.orange, { width: n == 2 ? '50%' : 'auto' }]} onPress={() => { onPress() }}>
|
||||
{icon}
|
||||
<Text style={[Styles.textMediumSemiBold, Styles.ml10, { color: active == value ? 'white' : 'black' }]}>{label}</Text>
|
||||
<Text numberOfLines={1} style={[Styles.textMediumSemiBold, Styles.ml10, { color: active == value ? 'white' : 'black' }]}>{label}</Text>
|
||||
</TouchableOpacity>
|
||||
)
|
||||
}
|
||||
@@ -34,7 +34,9 @@ export default function HeaderDiscussionGeneral() {
|
||||
title="Filter"
|
||||
onPress={() => {
|
||||
setVisible(false)
|
||||
setFilter(true)
|
||||
setTimeout(() => {
|
||||
setFilter(true)
|
||||
}, 600)
|
||||
}}
|
||||
/>
|
||||
}
|
||||
|
||||
@@ -37,7 +37,9 @@ export default function HeaderRightDivisionList() {
|
||||
title="Filter"
|
||||
onPress={() => {
|
||||
setVisible(false)
|
||||
setFilter(true)
|
||||
setTimeout(() => {
|
||||
setFilter(true)
|
||||
}, 600);
|
||||
}}
|
||||
/>
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import Styles from "@/constants/Styles";
|
||||
import { MaterialIcons } from "@expo/vector-icons";
|
||||
import { Pressable, View } from "react-native";
|
||||
import Text from "./Text";
|
||||
import { Dimensions, KeyboardAvoidingView, Platform, Pressable, View } from "react-native";
|
||||
import Modal from 'react-native-modal';
|
||||
import Text from "./Text";
|
||||
|
||||
type Props = {
|
||||
isVisible: boolean
|
||||
@@ -12,28 +12,15 @@ type Props = {
|
||||
animation?: 'slide' | 'none' | 'fade'
|
||||
height?: number
|
||||
backdropPressable?: boolean
|
||||
keyboard?: boolean
|
||||
}
|
||||
|
||||
export default function DrawerBottom({ isVisible, setVisible, title, children, animation, height, backdropPressable = true }: Props) {
|
||||
return (
|
||||
// <Modal
|
||||
// animationType={animation}
|
||||
// transparent={true} visible={isVisible}>
|
||||
// <View style={[Styles.modalBgTransparant]}>
|
||||
// <View style={[Styles.modalContent, height != undefined && { height: `${height}%` }]}>
|
||||
// <View style={Styles.titleContainer}>
|
||||
// <Text style={Styles.textDefault}>{title}</Text>
|
||||
// <Pressable onPress={() => setVisible(false)}>
|
||||
// <MaterialIcons name="close" color="black" size={22} />
|
||||
// </Pressable>
|
||||
// </View>
|
||||
// <View style={Styles.contentContainer}>
|
||||
// {children}
|
||||
// </View>
|
||||
// </View>
|
||||
// </View>
|
||||
// </Modal>
|
||||
export default function DrawerBottom({ isVisible, setVisible, title, children, animation, height, backdropPressable = true, keyboard = false }: Props) {
|
||||
const tinggiScreen = Dimensions.get("window").height;
|
||||
const tinggiInput = height != undefined ? height : 25
|
||||
const tinggiFix = tinggiScreen * tinggiInput / 100;
|
||||
|
||||
return (
|
||||
<Modal
|
||||
animationIn={"slideInUp"}
|
||||
animationOut={"slideOutDown"}
|
||||
@@ -49,17 +36,37 @@ export default function DrawerBottom({ isVisible, setVisible, title, children, a
|
||||
backdropTransitionOutTiming={500}
|
||||
useNativeDriverForBackdrop={true}
|
||||
>
|
||||
<View style={[Styles.modalContentNew, height != undefined ? { height: `${height}%` } : { height: '25%' }]}>
|
||||
<View style={[Styles.titleContainerNew]}>
|
||||
<Text style={Styles.textDefault}>{title}</Text>
|
||||
<Pressable onPress={() => setVisible(false)}>
|
||||
<MaterialIcons name="close" color="black" size={22} />
|
||||
</Pressable>
|
||||
</View>
|
||||
<View style={Styles.contentContainer}>
|
||||
{children}
|
||||
</View>
|
||||
</View>
|
||||
{
|
||||
keyboard ?
|
||||
<KeyboardAvoidingView
|
||||
behavior={Platform.OS === 'ios' ? 'padding' : undefined}
|
||||
keyboardVerticalOffset={0}
|
||||
>
|
||||
<View style={[Styles.modalContentNew, { height: tinggiFix }]}>
|
||||
<View style={[Styles.titleContainerNew]}>
|
||||
<Text style={Styles.textDefault}>{title}</Text>
|
||||
<Pressable onPress={() => setVisible(false)}>
|
||||
<MaterialIcons name="close" color="black" size={22} />
|
||||
</Pressable>
|
||||
</View>
|
||||
<View style={Styles.contentContainer}>
|
||||
{children}
|
||||
</View>
|
||||
</View>
|
||||
</KeyboardAvoidingView>
|
||||
:
|
||||
<View style={[Styles.modalContentNew, { height: tinggiFix }]}>
|
||||
<View style={[Styles.titleContainerNew]}>
|
||||
<Text style={Styles.textDefault}>{title}</Text>
|
||||
<Pressable onPress={() => setVisible(false)}>
|
||||
<MaterialIcons name="close" color="black" size={22} />
|
||||
</Pressable>
|
||||
</View>
|
||||
<View style={Styles.contentContainer}>
|
||||
{children}
|
||||
</View>
|
||||
</View>
|
||||
}
|
||||
</Modal>
|
||||
)
|
||||
}
|
||||
@@ -78,7 +78,7 @@ export default function HeaderRightGroupList() {
|
||||
</View>
|
||||
</DrawerBottom>
|
||||
|
||||
<DrawerBottom animation="none" height={30} isVisible={isVisibleTambah} setVisible={() => setVisibleTambah(false)} title="Tambah Lembaga Desa">
|
||||
<DrawerBottom animation="none" keyboard height={30} isVisible={isVisibleTambah} setVisible={() => setVisibleTambah(false)} title="Tambah Lembaga Desa">
|
||||
<View style={{ flex: 1 }}>
|
||||
<View>
|
||||
<InputForm
|
||||
|
||||
@@ -17,7 +17,7 @@ export default function HeaderMemberList() {
|
||||
return (
|
||||
<>
|
||||
<ButtonMenuHeader onPress={() => { setVisible(true) }} />
|
||||
<DrawerBottom animation="slide" isVisible={isVisible} setVisible={setVisible} title="Menu">
|
||||
<DrawerBottom animation="slide" isVisible={isVisible} setVisible={() => setVisible(false)} title="Menu">
|
||||
<View style={Styles.rowItemsCenter}>
|
||||
<MenuItemRow
|
||||
icon={<AntDesign name="pluscircle" color="black" size={25} />}
|
||||
@@ -34,7 +34,9 @@ export default function HeaderMemberList() {
|
||||
title="Filter"
|
||||
onPress={() => {
|
||||
setVisible(false)
|
||||
setFilter(true)
|
||||
setTimeout(() => {
|
||||
setFilter(true)
|
||||
}, 600)
|
||||
}}
|
||||
/>
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ export default function ModalSelect({ open, close, title, category, idParent, on
|
||||
}
|
||||
|
||||
return (
|
||||
<DrawerBottom animation="none" isVisible={open} setVisible={close} title={title} height={(category == 'gender' || category == 'status-task') ? 25 : category == 'member' ? 100 : 75}>
|
||||
<DrawerBottom animation="none" isVisible={open} setVisible={close} title={title} height={(category == 'gender' || category == 'status-task') ? 25 : category == 'member' ? 90 : 75}>
|
||||
{
|
||||
category == 'member' &&
|
||||
<>
|
||||
|
||||
@@ -123,7 +123,7 @@ export default function HeaderRightPositionList() {
|
||||
</View>
|
||||
</DrawerBottom>
|
||||
|
||||
<DrawerBottom animation="slide" height={45} isVisible={isVisibleTambah} setVisible={() => setVisibleTambah(false)} title="Tambah Jabatan">
|
||||
<DrawerBottom animation="slide" height={45} keyboard isVisible={isVisibleTambah} setVisible={() => setVisibleTambah(false)} title="Tambah Jabatan">
|
||||
<View style={{ flex: 1, justifyContent: 'space-between' }}>
|
||||
<View>
|
||||
{
|
||||
|
||||
@@ -37,7 +37,9 @@ export default function HeaderRightProjectList() {
|
||||
title="Filter"
|
||||
onPress={() => {
|
||||
setVisible(false)
|
||||
setFilter(true)
|
||||
setTimeout(() => {
|
||||
setFilter(true)
|
||||
}, 600)
|
||||
}}
|
||||
/>
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ type Props = {
|
||||
idStorage: string
|
||||
}
|
||||
|
||||
export default function SectionFile({ status, member }: { status: number | undefined, member: boolean }) {
|
||||
export default function SectionFile({ status, member, refreshing }: { status: number | undefined, member: boolean, refreshing?: boolean }) {
|
||||
const entityUser = useSelector((state: any) => state.user)
|
||||
const [isModal, setModal] = useState(false)
|
||||
const { token, decryptToken } = useAuthSession();
|
||||
@@ -62,6 +62,11 @@ export default function SectionFile({ status, member }: { status: number | undef
|
||||
handleLoad(false);
|
||||
}, [update.file]);
|
||||
|
||||
useEffect(() => {
|
||||
if (refreshing)
|
||||
handleLoad(false);
|
||||
}, [refreshing]);
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
handleLoad(true);
|
||||
|
||||
@@ -25,7 +25,7 @@ type Props = {
|
||||
position: string;
|
||||
};
|
||||
|
||||
export default function SectionMember({ status }: { status: number | undefined }) {
|
||||
export default function SectionMember({ status, refreshing }: { status: number | undefined, refreshing?: boolean }) {
|
||||
const dispatch = useDispatch()
|
||||
const entityUser = useSelector((state: any) => state.user)
|
||||
const update = useSelector((state: any) => state.projectUpdate)
|
||||
@@ -62,6 +62,11 @@ export default function SectionMember({ status }: { status: number | undefined }
|
||||
handleLoad(false);
|
||||
}, [update.member]);
|
||||
|
||||
useEffect(() => {
|
||||
if (refreshing)
|
||||
handleLoad(false);
|
||||
}, [refreshing]);
|
||||
|
||||
useEffect(() => {
|
||||
handleLoad(true);
|
||||
}, []);
|
||||
@@ -75,7 +80,7 @@ export default function SectionMember({ status }: { status: number | undefined }
|
||||
}, id)
|
||||
if (response.success) {
|
||||
Toast.show({ type: 'small', text1: 'Berhasil menghapus anggota', })
|
||||
dispatch(setUpdateProject({ ...update, member: !update.progress }))
|
||||
dispatch(setUpdateProject({ ...update, member: !update.member }))
|
||||
setModal(false);
|
||||
}
|
||||
} catch (error) {
|
||||
|
||||
@@ -26,7 +26,7 @@ type Props = {
|
||||
createdAt: string;
|
||||
};
|
||||
|
||||
export default function SectionTanggalTugasProject({ status, member }: { status: number | undefined, member: boolean }) {
|
||||
export default function SectionTanggalTugasProject({ status, member, refreshing }: { status: number | undefined, member: boolean, refreshing?: boolean }) {
|
||||
const entityUser = useSelector((state: any) => state.user)
|
||||
const dispatch = useDispatch()
|
||||
const update = useSelector((state: any) => state.projectUpdate)
|
||||
@@ -63,6 +63,11 @@ export default function SectionTanggalTugasProject({ status, member }: { status:
|
||||
handleLoad(false);
|
||||
}, [update.task]);
|
||||
|
||||
useEffect(() => {
|
||||
if (refreshing)
|
||||
handleLoad(false);
|
||||
}, [refreshing]);
|
||||
|
||||
useEffect(() => {
|
||||
handleLoad(true);
|
||||
}, []);
|
||||
@@ -163,7 +168,9 @@ export default function SectionTanggalTugasProject({ status, member }: { status:
|
||||
title="Update Status"
|
||||
onPress={() => {
|
||||
setModal(false);
|
||||
setSelect(true);
|
||||
setTimeout(() => {
|
||||
setSelect(true);
|
||||
}, 600)
|
||||
}}
|
||||
/>
|
||||
<MenuItemRow
|
||||
@@ -198,7 +205,7 @@ export default function SectionTanggalTugasProject({ status, member }: { status:
|
||||
|
||||
<ModalSelect
|
||||
category="status-task"
|
||||
close={setSelect}
|
||||
close={() => { setSelect(false) }}
|
||||
onSelect={(value) => {
|
||||
handleUpdate(Number(value.val))
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user