Deskripsi :
- load refresh pada project
- load refresh pada task divisi
- text pada modal salin atau pindah
- crash modal pada modal more dokumen divisi
- memberi loadin pada modal info dokumen divisi
- crash modal pada header dokumen divisi
- kyboard avoiding pada project
- keyboard avoiding pada tugas divisi
- image pada user yg diselect pada tambah anggota divisi

nb : qc blm selesai

No Issues
This commit is contained in:
2025-07-31 15:10:51 +08:00
parent 5898655fac
commit e7ef09e9aa
21 changed files with 584 additions and 456 deletions

View File

@@ -18,7 +18,7 @@ import { Ionicons, MaterialIcons } from "@expo/vector-icons";
import { firebase } from "@react-native-firebase/database";
import { router, Stack, useLocalSearchParams } from "expo-router";
import { useEffect, useState } from "react";
import { Pressable, ScrollView, View } from "react-native";
import { KeyboardAvoidingView, Platform, Pressable, RefreshControl, ScrollView, View } from "react-native";
import { useSelector } from "react-redux";
type Props = {
@@ -58,6 +58,7 @@ export default function DiscussionDetail() {
const [loadingKomentar, setLoadingKomentar] = useState(true)
const arrSkeleton = Array.from({ length: 3 })
const reference = firebase.app().database('https://mobile-darmasaba-default-rtdb.asia-southeast1.firebasedatabase.app').ref(`/discussion-division/${detail}`);
const [refreshing, setRefreshing] = useState(false)
useEffect(() => {
@@ -165,6 +166,15 @@ export default function DiscussionDetail() {
}
}
const handleRefresh = async () => {
setRefreshing(true)
handleLoad(false)
handleLoadComment(false)
await new Promise(resolve => setTimeout(resolve, 2000));
setRefreshing(false)
};
return (
<>
<Stack.Screen
@@ -189,7 +199,14 @@ export default function DiscussionDetail() {
}}
/>
<View style={{ flex: 1 }}>
<ScrollView>
<ScrollView
refreshControl={
<RefreshControl
refreshing={refreshing}
onRefresh={handleRefresh}
/>
}
>
<View style={[Styles.p15, Styles.mb100]}>
{
loading ?
@@ -264,63 +281,68 @@ export default function DiscussionDetail() {
</View>
</View>
</ScrollView>
<View
style={[
Styles.contentItemCenter,
Styles.absolute0,
Styles.w100,
{ backgroundColor: "#f4f4f4" },
]}
<KeyboardAvoidingView
behavior={Platform.OS === 'ios' ? 'padding' : undefined}
keyboardVerticalOffset={110}
>
<InputForm
disable={
data?.status == 2 ||
data?.isActive == false ||
((entityUser.role == "user" || entityUser.role == "coadmin") &&
!isMemberDivision)
}
bg="white"
type="default"
round
placeholder="Kirim Komentar"
onChange={setKomentar}
value={komentar}
itemRight={
<Pressable
onPress={() => {
komentar != "" &&
!loadingSend &&
data?.status != 2 &&
data?.isActive &&
(((entityUser.role == "user" ||
entityUser.role == "coadmin") &&
isMemberDivision) ||
entityUser.role == "admin" ||
entityUser.role == "supadmin" ||
entityUser.role == "developer" ||
entityUser.role == "cosupadmin") &&
handleKomentar();
}}
>
<MaterialIcons
name="send"
size={25}
style={
komentar == "" ||
loadingSend ||
data?.status == 2 ||
data?.isActive == false ||
((entityUser.role == "user" ||
<View
style={[
Styles.contentItemCenter,
Styles.w100,
{ backgroundColor: "#f4f4f4" },
]}
>
<InputForm
disable={
data?.status == 2 ||
data?.isActive == false ||
((entityUser.role == "user" || entityUser.role == "coadmin") &&
!isMemberDivision)
}
bg="white"
type="default"
round
placeholder="Kirim Komentar"
onChange={setKomentar}
value={komentar}
itemRight={
<Pressable
onPress={() => {
komentar != "" &&
!loadingSend &&
data?.status != 2 &&
data?.isActive &&
(((entityUser.role == "user" ||
entityUser.role == "coadmin") &&
!isMemberDivision)
? Styles.cGray
: Styles.cDefault
}
/>
</Pressable>
}
/>
</View>
isMemberDivision) ||
entityUser.role == "admin" ||
entityUser.role == "supadmin" ||
entityUser.role == "developer" ||
entityUser.role == "cosupadmin") &&
handleKomentar();
}}
>
<MaterialIcons
name="send"
size={25}
style={
komentar == "" ||
loadingSend ||
data?.status == 2 ||
data?.isActive == false ||
((entityUser.role == "user" ||
entityUser.role == "coadmin") &&
!isMemberDivision)
? Styles.cGray
: Styles.cDefault
}
/>
</Pressable>
}
/>
</View>
</KeyboardAvoidingView>
</View>
</>
);