upd: modal konfirmasi
Deskripsi: - menerapkan semua modal baru pada semua fitur No Issues''
This commit is contained in:
@@ -9,7 +9,7 @@ import { useState } from "react"
|
||||
import { View } from "react-native"
|
||||
import Toast from "react-native-toast-message"
|
||||
import { useDispatch, useSelector } from "react-redux"
|
||||
import AlertKonfirmasi from "../alertKonfirmasi"
|
||||
import ModalConfirmation from "../ModalConfirmation"
|
||||
import ButtonMenuHeader from "../buttonMenuHeader"
|
||||
import DrawerBottom from "../drawerBottom"
|
||||
import { InputForm } from "../inputForm"
|
||||
@@ -31,6 +31,7 @@ export default function HeaderRightTaskDetail({ id, division, status, isAdminDiv
|
||||
const dispatch = useDispatch()
|
||||
const update = useSelector((state: any) => state.taskUpdate)
|
||||
const [isAddLink, setAddLink] = useState(false)
|
||||
const [showDeleteModal, setShowDeleteModal] = useState(false)
|
||||
const [link, setLink] = useState("")
|
||||
|
||||
async function handleDelete() {
|
||||
@@ -158,11 +159,9 @@ export default function HeaderRightTaskDetail({ id, division, status, isAdminDiv
|
||||
title="Hapus"
|
||||
onPress={() => {
|
||||
setVisible(false)
|
||||
AlertKonfirmasi({
|
||||
title: 'Konfirmasi',
|
||||
desc: 'Apakah Anda yakin ingin menghapus tugas ini? Tugas yang dihapus tidak dapat dikembalikan',
|
||||
onPress: () => { handleDelete() }
|
||||
})
|
||||
setTimeout(() => {
|
||||
setShowDeleteModal(true)
|
||||
}, 600)
|
||||
}}
|
||||
/>
|
||||
|
||||
@@ -180,6 +179,20 @@ export default function HeaderRightTaskDetail({ id, division, status, isAdminDiv
|
||||
}
|
||||
</DrawerBottom >
|
||||
|
||||
<ModalConfirmation
|
||||
visible={showDeleteModal}
|
||||
title="Konfirmasi"
|
||||
message="Apakah Anda yakin ingin menghapus tugas ini? Tugas yang dihapus tidak dapat dikembalikan"
|
||||
onConfirm={() => {
|
||||
setShowDeleteModal(false)
|
||||
handleDelete()
|
||||
}}
|
||||
onCancel={() => setShowDeleteModal(false)}
|
||||
confirmText="Hapus"
|
||||
cancelText="Batal"
|
||||
isDestructive
|
||||
/>
|
||||
|
||||
<ModalFloat
|
||||
title="Tambah Link"
|
||||
isVisible={isAddLink}
|
||||
|
||||
@@ -14,7 +14,8 @@ import { Alert, Platform, View } from "react-native";
|
||||
import * as mime from 'react-native-mime-types';
|
||||
import Toast from "react-native-toast-message";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import AlertKonfirmasi from "../alertKonfirmasi";
|
||||
import ModalConfirmation from "../ModalConfirmation";
|
||||
import ButtonMenuHeader from "../buttonMenuHeader";
|
||||
import BorderBottomItem from "../borderBottomItem";
|
||||
import DrawerBottom from "../drawerBottom";
|
||||
import MenuItemRow from "../menuItemRow";
|
||||
@@ -32,6 +33,9 @@ type Props = {
|
||||
export default function SectionFileTask({ refreshing, isMemberDivision }: { refreshing: boolean, isMemberDivision: boolean }) {
|
||||
const { colors } = useTheme()
|
||||
const [isModal, setModal] = useState(false)
|
||||
const [isAddLink, setAddLink] = useState(false)
|
||||
const [showDeleteModal, setShowDeleteModal] = useState(false)
|
||||
const [link, setLink] = useState("")
|
||||
const { token, decryptToken } = useAuthSession()
|
||||
const { detail } = useLocalSearchParams<{ detail: string }>()
|
||||
const [data, setData] = useState<Props[]>([])
|
||||
@@ -174,14 +178,9 @@ export default function SectionFileTask({ refreshing, isMemberDivision }: { refr
|
||||
title="Hapus"
|
||||
onPress={() => {
|
||||
setModal(false)
|
||||
AlertKonfirmasi({
|
||||
title: 'Konfirmasi',
|
||||
desc: 'Apakah Anda yakin ingin menghapus file ini? File yang dihapus tidak dapat dikembalikan',
|
||||
onPress: () => {
|
||||
handleDelete()
|
||||
}
|
||||
})
|
||||
|
||||
setTimeout(() => {
|
||||
setShowDeleteModal(true)
|
||||
}, 600)
|
||||
}}
|
||||
/>
|
||||
:
|
||||
@@ -190,6 +189,20 @@ export default function SectionFileTask({ refreshing, isMemberDivision }: { refr
|
||||
|
||||
</View>
|
||||
</DrawerBottom>
|
||||
|
||||
<ModalConfirmation
|
||||
visible={showDeleteModal}
|
||||
title="Konfirmasi"
|
||||
message="Apakah Anda yakin ingin menghapus file ini? File yang dihapus tidak dapat dikembalikan"
|
||||
onConfirm={() => {
|
||||
setShowDeleteModal(false)
|
||||
handleDelete()
|
||||
}}
|
||||
onCancel={() => setShowDeleteModal(false)}
|
||||
confirmText="Hapus"
|
||||
cancelText="Batal"
|
||||
isDestructive
|
||||
/>
|
||||
</>
|
||||
)
|
||||
}
|
||||
@@ -10,7 +10,7 @@ import { useEffect, useState } from "react";
|
||||
import { Linking, View } from "react-native";
|
||||
import Toast from "react-native-toast-message";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import AlertKonfirmasi from "../alertKonfirmasi";
|
||||
import ModalConfirmation from "../ModalConfirmation";
|
||||
import BorderBottomItem from "../borderBottomItem";
|
||||
import DrawerBottom from "../drawerBottom";
|
||||
import MenuItemRow from "../menuItemRow";
|
||||
@@ -30,6 +30,7 @@ export default function SectionLinkTask({ refreshing, isMemberDivision }: { refr
|
||||
const update = useSelector((state: any) => state.taskUpdate)
|
||||
const dispatch = useDispatch()
|
||||
const [selectLink, setSelectLink] = useState<Props | null>(null)
|
||||
const [showDeleteModal, setShowDeleteModal] = useState(false)
|
||||
const entityUser = useSelector((state: any) => state.user);
|
||||
|
||||
async function handleLoad() {
|
||||
@@ -112,11 +113,9 @@ export default function SectionLinkTask({ refreshing, isMemberDivision }: { refr
|
||||
title="Hapus"
|
||||
onPress={() => {
|
||||
setModal(false)
|
||||
AlertKonfirmasi({
|
||||
title: 'Konfirmasi',
|
||||
desc: 'Apakah Anda yakin ingin menghapus link ini? Link yang dihapus tidak dapat dikembalikan',
|
||||
onPress: () => { handleDelete() }
|
||||
})
|
||||
setTimeout(() => {
|
||||
setShowDeleteModal(true)
|
||||
}, 600)
|
||||
}}
|
||||
/>
|
||||
:
|
||||
@@ -125,6 +124,20 @@ export default function SectionLinkTask({ refreshing, isMemberDivision }: { refr
|
||||
|
||||
</View>
|
||||
</DrawerBottom>
|
||||
|
||||
<ModalConfirmation
|
||||
visible={showDeleteModal}
|
||||
title="Konfirmasi"
|
||||
message="Apakah Anda yakin ingin menghapus link ini? Link yang dihapus tidak dapat dikembalikan"
|
||||
onConfirm={() => {
|
||||
setShowDeleteModal(false)
|
||||
handleDelete()
|
||||
}}
|
||||
onCancel={() => setShowDeleteModal(false)}
|
||||
confirmText="Hapus"
|
||||
cancelText="Batal"
|
||||
isDestructive
|
||||
/>
|
||||
</>
|
||||
}
|
||||
</>
|
||||
|
||||
@@ -10,7 +10,7 @@ import { useEffect, useState } from "react";
|
||||
import { View } from "react-native";
|
||||
import Toast from "react-native-toast-message";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import AlertKonfirmasi from "../alertKonfirmasi";
|
||||
import ModalConfirmation from "../ModalConfirmation";
|
||||
import BorderBottomItem from "../borderBottomItem";
|
||||
import DrawerBottom from "../drawerBottom";
|
||||
import ImageUser from "../imageNew";
|
||||
@@ -30,6 +30,8 @@ type Props = {
|
||||
export default function SectionMemberTask({ refreshing, isAdminDivision }: { refreshing: boolean, isAdminDivision: boolean }) {
|
||||
const { colors } = useTheme()
|
||||
const [isModal, setModal] = useState(false);
|
||||
const [selectLink, setSelectLink] = useState<Props | null>(null)
|
||||
const [showDeleteModal, setShowDeleteModal] = useState(false)
|
||||
const entityUser = useSelector((state: any) => state.user);
|
||||
const { token, decryptToken } = useAuthSession();
|
||||
const { id, detail } = useLocalSearchParams<{ id: string; detail: string }>();
|
||||
@@ -132,7 +134,7 @@ export default function SectionMemberTask({ refreshing, isAdminDivision }: { ref
|
||||
);
|
||||
})
|
||||
) : (
|
||||
<Text style={[ Styles.textDefault, { textAlign: "center", color:colors.dimmed }, ]} >
|
||||
<Text style={[Styles.textDefault, { textAlign: "center", color: colors.dimmed },]} >
|
||||
Tidak ada anggota
|
||||
</Text>
|
||||
)
|
||||
@@ -177,11 +179,9 @@ export default function SectionMemberTask({ refreshing, isAdminDivision }: { ref
|
||||
title="Keluarkan"
|
||||
onPress={() => {
|
||||
setModal(false)
|
||||
AlertKonfirmasi({
|
||||
title: "Konfirmasi",
|
||||
desc: "Apakah Anda yakin ingin mengeluarkan anggota?",
|
||||
onPress: () => { handleDeleteMember() },
|
||||
});
|
||||
setTimeout(() => {
|
||||
setShowDeleteModal(true)
|
||||
}, 600)
|
||||
}}
|
||||
/>
|
||||
:
|
||||
@@ -189,6 +189,20 @@ export default function SectionMemberTask({ refreshing, isAdminDivision }: { ref
|
||||
}
|
||||
</View>
|
||||
</DrawerBottom>
|
||||
|
||||
<ModalConfirmation
|
||||
visible={showDeleteModal}
|
||||
title="Konfirmasi"
|
||||
message="Apakah Anda yakin ingin mengeluarkan anggota?"
|
||||
onConfirm={() => {
|
||||
setShowDeleteModal(false)
|
||||
handleDeleteMember()
|
||||
}}
|
||||
onCancel={() => setShowDeleteModal(false)}
|
||||
confirmText="Keluarkan"
|
||||
cancelText="Batal"
|
||||
isDestructive
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import { useEffect, useState } from "react";
|
||||
import { View } from "react-native";
|
||||
import Toast from "react-native-toast-message";
|
||||
import { useDispatch, useSelector } from "react-redux";
|
||||
import AlertKonfirmasi from "../alertKonfirmasi";
|
||||
import ModalConfirmation from "../ModalConfirmation";
|
||||
import DrawerBottom from "../drawerBottom";
|
||||
import ItemSectionTanggalTugas from "../itemSectionTanggalTugas";
|
||||
import MenuItemRow from "../menuItemRow";
|
||||
@@ -44,6 +44,7 @@ export default function SectionTanggalTugasTask({ refreshing, isMemberDivision }
|
||||
id: '',
|
||||
status: 0,
|
||||
})
|
||||
const [showDeleteModal, setShowDeleteModal] = useState(false)
|
||||
|
||||
async function handleLoad(loading: boolean) {
|
||||
try {
|
||||
@@ -211,14 +212,9 @@ export default function SectionTanggalTugasTask({ refreshing, isMemberDivision }
|
||||
title="Hapus Tugas"
|
||||
onPress={() => {
|
||||
setModal(false)
|
||||
AlertKonfirmasi({
|
||||
title: 'Konfirmasi',
|
||||
desc: 'Apakah anda yakin ingin menghapus data ini?',
|
||||
onPress: () => {
|
||||
handleDelete()
|
||||
}
|
||||
})
|
||||
|
||||
setTimeout(() => {
|
||||
setShowDeleteModal(true)
|
||||
}, 600)
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
@@ -227,6 +223,20 @@ export default function SectionTanggalTugasTask({ refreshing, isMemberDivision }
|
||||
}
|
||||
</DrawerBottom>
|
||||
|
||||
<ModalConfirmation
|
||||
visible={showDeleteModal}
|
||||
title="Konfirmasi"
|
||||
message="Apakah anda yakin ingin menghapus data ini?"
|
||||
onConfirm={() => {
|
||||
setShowDeleteModal(false)
|
||||
handleDelete()
|
||||
}}
|
||||
onCancel={() => setShowDeleteModal(false)}
|
||||
confirmText="Hapus"
|
||||
cancelText="Batal"
|
||||
isDestructive
|
||||
/>
|
||||
|
||||
<ModalSelect
|
||||
category="status-task"
|
||||
close={() => setSelect(false)}
|
||||
|
||||
Reference in New Issue
Block a user