Compare commits
5 Commits
amalia/01-
...
amalia/04-
| Author | SHA1 | Date | |
|---|---|---|---|
| 6c84881186 | |||
| 2d24050b64 | |||
| fafb52d87c | |||
| b7c44109a1 | |||
| c54f4c9fda |
@@ -21,7 +21,8 @@ export default function CreateAnnouncement() {
|
|||||||
const { token, decryptToken } = useAuthSession()
|
const { token, decryptToken } = useAuthSession()
|
||||||
const [disableBtn, setDisableBtn] = useState(true);
|
const [disableBtn, setDisableBtn] = useState(true);
|
||||||
const [modalDivisi, setModalDivisi] = useState(false);
|
const [modalDivisi, setModalDivisi] = useState(false);
|
||||||
const [divisionMember, setDivisionMember] = useState<any>([]);
|
const [divisionMember, setDivisionMember] = useState<any>([])
|
||||||
|
const [loading, setLoading] = useState(false)
|
||||||
const [dataForm, setDataForm] = useState({
|
const [dataForm, setDataForm] = useState({
|
||||||
title: "",
|
title: "",
|
||||||
desc: "",
|
desc: "",
|
||||||
@@ -66,6 +67,7 @@ export default function CreateAnnouncement() {
|
|||||||
|
|
||||||
async function handleCreate() {
|
async function handleCreate() {
|
||||||
try {
|
try {
|
||||||
|
setLoading(true)
|
||||||
const hasil = await decryptToken(String(token?.current))
|
const hasil = await decryptToken(String(token?.current))
|
||||||
const response = await apiCreateAnnouncement({
|
const response = await apiCreateAnnouncement({
|
||||||
data: { ...dataForm, user: hasil, groups: divisionMember },
|
data: { ...dataForm, user: hasil, groups: divisionMember },
|
||||||
@@ -77,6 +79,8 @@ export default function CreateAnnouncement() {
|
|||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
|
} finally {
|
||||||
|
setLoading(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -95,7 +99,7 @@ export default function CreateAnnouncement() {
|
|||||||
headerTitleAlign: "center",
|
headerTitleAlign: "center",
|
||||||
headerRight: () => (
|
headerRight: () => (
|
||||||
<ButtonSaveHeader
|
<ButtonSaveHeader
|
||||||
disable={disableBtn}
|
disable={disableBtn || loading ? true : false}
|
||||||
category="create"
|
category="create"
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
divisionMember.length == 0
|
divisionMember.length == 0
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ export default function EditAnnouncement() {
|
|||||||
const [modalDivisi, setModalDivisi] = useState(false);
|
const [modalDivisi, setModalDivisi] = useState(false);
|
||||||
const [disableBtn, setDisableBtn] = useState(true);
|
const [disableBtn, setDisableBtn] = useState(true);
|
||||||
const [dataMember, setDataMember] = useState<any>([]);
|
const [dataMember, setDataMember] = useState<any>([]);
|
||||||
|
const [loading, setLoading] = useState(false)
|
||||||
const [dataForm, setDataForm] = useState({
|
const [dataForm, setDataForm] = useState({
|
||||||
title: "",
|
title: "",
|
||||||
desc: "",
|
desc: "",
|
||||||
@@ -109,6 +110,7 @@ export default function EditAnnouncement() {
|
|||||||
|
|
||||||
async function handleEdit() {
|
async function handleEdit() {
|
||||||
try {
|
try {
|
||||||
|
setLoading(true)
|
||||||
const hasil = await decryptToken(String(token?.current))
|
const hasil = await decryptToken(String(token?.current))
|
||||||
const response = await apiEditAnnouncement({
|
const response = await apiEditAnnouncement({
|
||||||
...dataForm, user: hasil, groups: dataMember,
|
...dataForm, user: hasil, groups: dataMember,
|
||||||
@@ -120,6 +122,8 @@ export default function EditAnnouncement() {
|
|||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
|
} finally {
|
||||||
|
setLoading(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -138,7 +142,7 @@ export default function EditAnnouncement() {
|
|||||||
headerTitleAlign: "center",
|
headerTitleAlign: "center",
|
||||||
headerRight: () => (
|
headerRight: () => (
|
||||||
<ButtonSaveHeader
|
<ButtonSaveHeader
|
||||||
disable={disableBtn}
|
disable={disableBtn || loading ? true : false}
|
||||||
category="update"
|
category="update"
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
dataMember.length == 0
|
dataMember.length == 0
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ export default function EditBanner() {
|
|||||||
const [title, setTitle] = useState("");
|
const [title, setTitle] = useState("");
|
||||||
const [error, setError] = useState(false);
|
const [error, setError] = useState(false);
|
||||||
const [imgForm, setImgForm] = useState<any>();
|
const [imgForm, setImgForm] = useState<any>();
|
||||||
|
const [loading, setLoading] = useState(false)
|
||||||
|
|
||||||
const pickImageAsync = async () => {
|
const pickImageAsync = async () => {
|
||||||
let result = await ImagePicker.launchImageLibraryAsync({
|
let result = await ImagePicker.launchImageLibraryAsync({
|
||||||
@@ -71,6 +72,7 @@ export default function EditBanner() {
|
|||||||
|
|
||||||
const handleUpdateEntity = async () => {
|
const handleUpdateEntity = async () => {
|
||||||
try {
|
try {
|
||||||
|
setLoading(true)
|
||||||
const hasil = await decryptToken(String(token?.current));
|
const hasil = await decryptToken(String(token?.current));
|
||||||
const fd = new FormData();
|
const fd = new FormData();
|
||||||
|
|
||||||
@@ -105,6 +107,8 @@ export default function EditBanner() {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
Toast.show({ type: 'small', text1: 'Gagal mengupdate data', })
|
Toast.show({ type: 'small', text1: 'Gagal mengupdate data', })
|
||||||
|
} finally {
|
||||||
|
setLoading(false)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -122,7 +126,7 @@ export default function EditBanner() {
|
|||||||
headerTitle: "Edit Banner",
|
headerTitle: "Edit Banner",
|
||||||
headerTitleAlign: "center",
|
headerTitleAlign: "center",
|
||||||
headerRight: () => <ButtonSaveHeader
|
headerRight: () => <ButtonSaveHeader
|
||||||
disable={title == "" || error ? true : false}
|
disable={title == "" || error || loading ? true : false}
|
||||||
onPress={() => { handleUpdateEntity() }}
|
onPress={() => { handleUpdateEntity() }}
|
||||||
category="update" />,
|
category="update" />,
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ export default function CreateBanner() {
|
|||||||
const [imgForm, setImgForm] = useState<any>();
|
const [imgForm, setImgForm] = useState<any>();
|
||||||
const [title, setTitle] = useState("");
|
const [title, setTitle] = useState("");
|
||||||
const [error, setError] = useState(false);
|
const [error, setError] = useState(false);
|
||||||
|
const [loading, setLoading] = useState(false)
|
||||||
|
|
||||||
const pickImageAsync = async () => {
|
const pickImageAsync = async () => {
|
||||||
let result = await ImagePicker.launchImageLibraryAsync({
|
let result = await ImagePicker.launchImageLibraryAsync({
|
||||||
@@ -57,32 +58,40 @@ export default function CreateBanner() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handleCreateEntity = async () => {
|
const handleCreateEntity = async () => {
|
||||||
const hasil = await decryptToken(String(token?.current));
|
try {
|
||||||
const fd = new FormData();
|
setLoading(true)
|
||||||
|
const hasil = await decryptToken(String(token?.current));
|
||||||
|
const fd = new FormData();
|
||||||
|
|
||||||
fd.append("file", {
|
fd.append("file", {
|
||||||
uri: imgForm.uri,
|
uri: imgForm.uri,
|
||||||
type: imgForm.mimeType,
|
type: imgForm.mimeType,
|
||||||
name: imgForm.fileName,
|
name: imgForm.fileName,
|
||||||
} as any);
|
} as any);
|
||||||
|
|
||||||
fd.append(
|
fd.append(
|
||||||
"data",
|
"data",
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
title,
|
title,
|
||||||
user: hasil,
|
user: hasil,
|
||||||
})
|
})
|
||||||
);
|
|
||||||
|
|
||||||
const createdEntity = await apiCreateBanner(fd);
|
|
||||||
if (createdEntity.success) {
|
|
||||||
Toast.show({ type: 'small', text1: 'Berhasil menambahkan data', })
|
|
||||||
apiGetBanner({ user: hasil }).then((data) =>
|
|
||||||
dispatch(setEntities(data.data))
|
|
||||||
);
|
);
|
||||||
router.back();
|
|
||||||
} else {
|
const createdEntity = await apiCreateBanner(fd);
|
||||||
|
if (createdEntity.success) {
|
||||||
|
Toast.show({ type: 'small', text1: 'Berhasil menambahkan data', })
|
||||||
|
apiGetBanner({ user: hasil }).then((data) =>
|
||||||
|
dispatch(setEntities(data.data))
|
||||||
|
);
|
||||||
|
router.back();
|
||||||
|
} else {
|
||||||
|
Toast.show({ type: 'small', text1: 'Gagal menambahkan data', })
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
Toast.show({ type: 'small', text1: 'Gagal menambahkan data', })
|
Toast.show({ type: 'small', text1: 'Gagal menambahkan data', })
|
||||||
|
} finally {
|
||||||
|
setLoading(false)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -101,7 +110,7 @@ export default function CreateBanner() {
|
|||||||
headerTitleAlign: "center",
|
headerTitleAlign: "center",
|
||||||
headerRight: () => (
|
headerRight: () => (
|
||||||
<ButtonSaveHeader
|
<ButtonSaveHeader
|
||||||
disable={title == "" || selectedImage == undefined || error ? true : false}
|
disable={title == "" || selectedImage == undefined || error || loading ? true : false}
|
||||||
category="create"
|
category="create"
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
handleCreateEntity();
|
handleCreateEntity();
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ export default function AddMemberDiscussionDetail() {
|
|||||||
const [idGroup, setIdGroup] = useState('')
|
const [idGroup, setIdGroup] = useState('')
|
||||||
const [selectMember, setSelectMember] = useState<any[]>([])
|
const [selectMember, setSelectMember] = useState<any[]>([])
|
||||||
const [search, setSearch] = useState('')
|
const [search, setSearch] = useState('')
|
||||||
|
const [loading, setLoading] = useState(false)
|
||||||
|
|
||||||
async function handleLoad() {
|
async function handleLoad() {
|
||||||
try {
|
try {
|
||||||
@@ -70,15 +71,21 @@ export default function AddMemberDiscussionDetail() {
|
|||||||
|
|
||||||
async function handleAddMember() {
|
async function handleAddMember() {
|
||||||
try {
|
try {
|
||||||
|
setLoading(true)
|
||||||
const hasil = await decryptToken(String(token?.current))
|
const hasil = await decryptToken(String(token?.current))
|
||||||
const response = await apiAddMemberDiscussionGeneral({ id: id, data: { user: hasil, member: selectMember } })
|
const response = await apiAddMemberDiscussionGeneral({ id: id, data: { user: hasil, member: selectMember } })
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
Toast.show({ type: 'small', text1: 'Berhasil menambahkan anggota', })
|
Toast.show({ type: 'small', text1: 'Berhasil menambahkan anggota', })
|
||||||
dispatch(setUpdateDiscussionGeneralDetail(!update))
|
dispatch(setUpdateDiscussionGeneralDetail(!update))
|
||||||
router.back()
|
router.back()
|
||||||
|
} else {
|
||||||
|
Toast.show({ type: 'small', text1: response.message, })
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
|
Toast.show({ type: 'small', text1: 'Gagal menambahkan anggota', })
|
||||||
|
} finally {
|
||||||
|
setLoading(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -93,7 +100,7 @@ export default function AddMemberDiscussionDetail() {
|
|||||||
headerRight: () => (
|
headerRight: () => (
|
||||||
<ButtonSaveHeader
|
<ButtonSaveHeader
|
||||||
category="update"
|
category="update"
|
||||||
disable={selectMember.length > 0 ? false : true}
|
disable={selectMember.length == 0 || loading ? true : false}
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
handleAddMember()
|
handleAddMember()
|
||||||
}}
|
}}
|
||||||
@@ -149,7 +156,7 @@ export default function AddMemberDiscussionDetail() {
|
|||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
{
|
{
|
||||||
selectMember.some((i: any) => i.idUser == item.id) && <AntDesign name="check" size={20} />
|
selectMember.some((i: any) => i.idUser == item.id) && <AntDesign name="check" size={20} color={'black'}/>
|
||||||
}
|
}
|
||||||
</Pressable>
|
</Pressable>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ export default function CreateDiscussionGeneral() {
|
|||||||
const [isSelect, setSelect] = useState(false);
|
const [isSelect, setSelect] = useState(false);
|
||||||
const entitiesMember = useSelector((state: any) => state.memberChoose)
|
const entitiesMember = useSelector((state: any) => state.memberChoose)
|
||||||
const update = useSelector((state: any) => state.discussionGeneralDetailUpdate)
|
const update = useSelector((state: any) => state.discussionGeneralDetailUpdate)
|
||||||
|
const [loading, setLoading] = useState(false)
|
||||||
const [dataForm, setDataForm] = useState({
|
const [dataForm, setDataForm] = useState({
|
||||||
idGroup: "",
|
idGroup: "",
|
||||||
title: "",
|
title: "",
|
||||||
@@ -95,6 +96,7 @@ export default function CreateDiscussionGeneral() {
|
|||||||
|
|
||||||
async function handleCreate() {
|
async function handleCreate() {
|
||||||
try {
|
try {
|
||||||
|
setLoading(true)
|
||||||
const hasil = await decryptToken(String(token?.current))
|
const hasil = await decryptToken(String(token?.current))
|
||||||
const response = await apiCreateDiscussionGeneral({
|
const response = await apiCreateDiscussionGeneral({
|
||||||
data: { ...dataForm, user: hasil, member: entitiesMember },
|
data: { ...dataForm, user: hasil, member: entitiesMember },
|
||||||
@@ -110,6 +112,8 @@ export default function CreateDiscussionGeneral() {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
|
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
|
||||||
|
} finally {
|
||||||
|
setLoading(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -127,7 +131,7 @@ export default function CreateDiscussionGeneral() {
|
|||||||
headerRight: () => (
|
headerRight: () => (
|
||||||
<ButtonSaveHeader
|
<ButtonSaveHeader
|
||||||
category="create"
|
category="create"
|
||||||
disable={disableBtn}
|
disable={disableBtn || loading ? true : false}
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
entitiesMember.length == 0
|
entitiesMember.length == 0
|
||||||
? Toast.show({ type: 'small', text1: 'Anda belum memilih anggota', })
|
? Toast.show({ type: 'small', text1: 'Anda belum memilih anggota', })
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ export default function EditDiscussionGeneral() {
|
|||||||
const { id } = useLocalSearchParams<{ id: string }>();
|
const { id } = useLocalSearchParams<{ id: string }>();
|
||||||
const [disableBtn, setDisableBtn] = useState(false)
|
const [disableBtn, setDisableBtn] = useState(false)
|
||||||
const dispatch = useDispatch()
|
const dispatch = useDispatch()
|
||||||
|
const [loading, setLoading] = useState(false)
|
||||||
const update = useSelector((state: any) => state.discussionGeneralDetailUpdate)
|
const update = useSelector((state: any) => state.discussionGeneralDetailUpdate)
|
||||||
const [dataForm, setDataForm] = useState({
|
const [dataForm, setDataForm] = useState({
|
||||||
title: "",
|
title: "",
|
||||||
@@ -80,6 +81,7 @@ export default function EditDiscussionGeneral() {
|
|||||||
|
|
||||||
async function handleEdit() {
|
async function handleEdit() {
|
||||||
try {
|
try {
|
||||||
|
setLoading(true)
|
||||||
const hasil = await decryptToken(String(token?.current));
|
const hasil = await decryptToken(String(token?.current));
|
||||||
const response = await apiEditDiscussionGeneral({ user: hasil, title: dataForm.title, desc: dataForm.desc }, id);
|
const response = await apiEditDiscussionGeneral({ user: hasil, title: dataForm.title, desc: dataForm.desc }, id);
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
@@ -89,6 +91,9 @@ export default function EditDiscussionGeneral() {
|
|||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
|
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
|
||||||
|
} finally {
|
||||||
|
setLoading(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,7 +112,7 @@ export default function EditDiscussionGeneral() {
|
|||||||
headerTitleAlign: "center",
|
headerTitleAlign: "center",
|
||||||
headerRight: () => (
|
headerRight: () => (
|
||||||
<ButtonSaveHeader
|
<ButtonSaveHeader
|
||||||
disable={disableBtn}
|
disable={disableBtn || loading ? true : false}
|
||||||
category="update"
|
category="update"
|
||||||
onPress={() => { handleEdit() }}
|
onPress={() => { handleEdit() }}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ export default function AddMemberCalendarEvent() {
|
|||||||
const [selectMember, setSelectMember] = useState<any[]>([])
|
const [selectMember, setSelectMember] = useState<any[]>([])
|
||||||
const [search, setSearch] = useState('')
|
const [search, setSearch] = useState('')
|
||||||
const [idCalendar, setIdCalendar] = useState('')
|
const [idCalendar, setIdCalendar] = useState('')
|
||||||
|
const [loading, setLoading] = useState(false)
|
||||||
|
|
||||||
async function handleLoadOldMember() {
|
async function handleLoadOldMember() {
|
||||||
try {
|
try {
|
||||||
@@ -78,6 +79,7 @@ export default function AddMemberCalendarEvent() {
|
|||||||
|
|
||||||
async function handleAddMember() {
|
async function handleAddMember() {
|
||||||
try {
|
try {
|
||||||
|
setLoading(true)
|
||||||
const hasil = await decryptToken(String(token?.current))
|
const hasil = await decryptToken(String(token?.current))
|
||||||
const response = await apiAddMemberCalendar({ id: idCalendar, data: { user: hasil, member: selectMember } })
|
const response = await apiAddMemberCalendar({ id: idCalendar, data: { user: hasil, member: selectMember } })
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
@@ -90,6 +92,8 @@ export default function AddMemberCalendarEvent() {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
|
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
|
||||||
|
} finally {
|
||||||
|
setLoading(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -104,7 +108,7 @@ export default function AddMemberCalendarEvent() {
|
|||||||
headerRight: () => (
|
headerRight: () => (
|
||||||
<ButtonSaveHeader
|
<ButtonSaveHeader
|
||||||
category="update"
|
category="update"
|
||||||
disable={selectMember.length > 0 ? false : true}
|
disable={selectMember.length == 0 || loading ? true : false}
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
handleAddMember()
|
handleAddMember()
|
||||||
}}
|
}}
|
||||||
@@ -159,7 +163,7 @@ export default function AddMemberCalendarEvent() {
|
|||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
{
|
{
|
||||||
selectMember.some((i: any) => i.idUser == item.id) && <AntDesign name="check" size={20} />
|
selectMember.some((i: any) => i.idUser == item.id) && <AntDesign name="check" size={20} color={'black'}/>
|
||||||
}
|
}
|
||||||
</Pressable>
|
</Pressable>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ export default function EditEventCalendar() {
|
|||||||
const [isSelect, setSelect] = useState(false)
|
const [isSelect, setSelect] = useState(false)
|
||||||
const { id, detail } = useLocalSearchParams<{ id: string, detail: string }>()
|
const { id, detail } = useLocalSearchParams<{ id: string, detail: string }>()
|
||||||
const [idCalendar, setIdCalendar] = useState('')
|
const [idCalendar, setIdCalendar] = useState('')
|
||||||
|
const [loading, setLoading] = useState(false)
|
||||||
|
|
||||||
const [error, setError] = useState({
|
const [error, setError] = useState({
|
||||||
title: false,
|
title: false,
|
||||||
@@ -140,6 +141,7 @@ export default function EditEventCalendar() {
|
|||||||
|
|
||||||
async function handleUpdate() {
|
async function handleUpdate() {
|
||||||
try {
|
try {
|
||||||
|
setLoading(true)
|
||||||
const hasil = await decryptToken(String(token?.current))
|
const hasil = await decryptToken(String(token?.current))
|
||||||
const response = await apiUpdateCalendar({ data: { ...data, user: hasil }, id: idCalendar })
|
const response = await apiUpdateCalendar({ data: { ...data, user: hasil }, id: idCalendar })
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
@@ -150,7 +152,9 @@ export default function EditEventCalendar() {
|
|||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
Toast.show({ type: 'small', text1: 'Gagal mengubah acara', })
|
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
|
||||||
|
} finally {
|
||||||
|
setLoading(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -164,7 +168,7 @@ export default function EditEventCalendar() {
|
|||||||
headerTitleAlign: 'center',
|
headerTitleAlign: 'center',
|
||||||
headerRight: () =>
|
headerRight: () =>
|
||||||
<ButtonSaveHeader
|
<ButtonSaveHeader
|
||||||
disable={Object.values(error).some((val) => val == true) || data.title == "" || data.dateStart == "" || data.timeStart == "" || data.timeEnd == "" || data.repeatEventTyper == ""}
|
disable={Object.values(error).some((val) => val == true) || data.title == "" || data.dateStart == "" || data.timeStart == "" || data.timeEnd == "" || data.repeatEventTyper == "" || loading}
|
||||||
category="update-calendar"
|
category="update-calendar"
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
handleUpdate()
|
handleUpdate()
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ export default function CreateCalendarAddMember() {
|
|||||||
const update = useSelector((state: any) => state.calendarCreate)
|
const update = useSelector((state: any) => state.calendarCreate)
|
||||||
const dispatch = useDispatch()
|
const dispatch = useDispatch()
|
||||||
const updateRefresh = useSelector((state: any) => state.calendarUpdate)
|
const updateRefresh = useSelector((state: any) => state.calendarUpdate)
|
||||||
|
const [loading, setLoading] = useState(false)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -58,6 +59,7 @@ export default function CreateCalendarAddMember() {
|
|||||||
|
|
||||||
async function handleAddMember() {
|
async function handleAddMember() {
|
||||||
try {
|
try {
|
||||||
|
setLoading(true)
|
||||||
const hasil = await decryptToken(String(token?.current))
|
const hasil = await decryptToken(String(token?.current))
|
||||||
const response = await apiCreateCalendar({ data: { ...update, user: hasil, idDivision: id, member: selectMember } })
|
const response = await apiCreateCalendar({ data: { ...update, user: hasil, idDivision: id, member: selectMember } })
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
@@ -80,7 +82,9 @@ export default function CreateCalendarAddMember() {
|
|||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
Toast.show({ type: 'small', text1: 'Gagal membuat acara', })
|
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
|
||||||
|
} finally {
|
||||||
|
setLoading(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -94,7 +98,7 @@ export default function CreateCalendarAddMember() {
|
|||||||
headerRight: () => (
|
headerRight: () => (
|
||||||
<ButtonSaveHeader
|
<ButtonSaveHeader
|
||||||
category="create"
|
category="create"
|
||||||
disable={selectMember.length > 0 ? false : true}
|
disable={selectMember.length == 0 || loading ? true : false}
|
||||||
onPress={() => { handleAddMember() }}
|
onPress={() => { handleAddMember() }}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
@@ -142,7 +146,7 @@ export default function CreateCalendarAddMember() {
|
|||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
{
|
{
|
||||||
selectMember.some((i: any) => i.idUser == item.idUser) && <AntDesign name="check" size={20} />
|
selectMember.some((i: any) => i.idUser == item.idUser) && <AntDesign name="check" size={20} color={'black'}/>
|
||||||
}
|
}
|
||||||
</Pressable>
|
</Pressable>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ export default function DiscussionDivisionEdit() {
|
|||||||
const [data, setData] = useState("");
|
const [data, setData] = useState("");
|
||||||
const update = useSelector((state: any) => state.discussionUpdate);
|
const update = useSelector((state: any) => state.discussionUpdate);
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
|
const [loading, setLoading] = useState(false)
|
||||||
|
|
||||||
async function handleLoad() {
|
async function handleLoad() {
|
||||||
try {
|
try {
|
||||||
@@ -38,6 +39,7 @@ export default function DiscussionDivisionEdit() {
|
|||||||
|
|
||||||
async function handleUpdate() {
|
async function handleUpdate() {
|
||||||
try {
|
try {
|
||||||
|
setLoading(true)
|
||||||
const hasil = await decryptToken(String(token?.current));
|
const hasil = await decryptToken(String(token?.current));
|
||||||
const response = await apiEditDiscussion({
|
const response = await apiEditDiscussion({
|
||||||
data: { user: hasil, desc: data },
|
data: { user: hasil, desc: data },
|
||||||
@@ -47,9 +49,14 @@ export default function DiscussionDivisionEdit() {
|
|||||||
Toast.show({ type: 'small', text1: 'Berhasil mengubah data', })
|
Toast.show({ type: 'small', text1: 'Berhasil mengubah data', })
|
||||||
dispatch(setUpdateDiscussion({ ...update, data: !update.data }));
|
dispatch(setUpdateDiscussion({ ...update, data: !update.data }));
|
||||||
router.back();
|
router.back();
|
||||||
|
}else{
|
||||||
|
Toast.show({ type: 'small', text1: response.message, })
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
|
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
|
||||||
|
} finally {
|
||||||
|
setLoading(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -68,7 +75,7 @@ export default function DiscussionDivisionEdit() {
|
|||||||
headerTitleAlign: "center",
|
headerTitleAlign: "center",
|
||||||
headerRight: () => (
|
headerRight: () => (
|
||||||
<ButtonSaveHeader
|
<ButtonSaveHeader
|
||||||
disable={data == ""}
|
disable={data == "" || loading}
|
||||||
category="update"
|
category="update"
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
handleUpdate();
|
handleUpdate();
|
||||||
|
|||||||
@@ -17,9 +17,11 @@ export default function CreateDiscussionDivision() {
|
|||||||
const { token, decryptToken } = useAuthSession()
|
const { token, decryptToken } = useAuthSession()
|
||||||
const update = useSelector((state: any) => state.discussionUpdate)
|
const update = useSelector((state: any) => state.discussionUpdate)
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
|
const [loading, setLoading] = useState(false)
|
||||||
|
|
||||||
async function handleCreate() {
|
async function handleCreate() {
|
||||||
try {
|
try {
|
||||||
|
setLoading(true)
|
||||||
const hasil = await decryptToken(String(token?.current))
|
const hasil = await decryptToken(String(token?.current))
|
||||||
const response = await apiCreateDiscussion({ data: { user: hasil, desc, idDivision: id } })
|
const response = await apiCreateDiscussion({ data: { user: hasil, desc, idDivision: id } })
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
@@ -32,6 +34,8 @@ export default function CreateDiscussionDivision() {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
|
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
|
||||||
|
} finally {
|
||||||
|
setLoading(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -43,7 +47,7 @@ export default function CreateDiscussionDivision() {
|
|||||||
headerTitle: 'Tambah Diskusi',
|
headerTitle: 'Tambah Diskusi',
|
||||||
headerTitleAlign: 'center',
|
headerTitleAlign: 'center',
|
||||||
headerRight: () => <ButtonSaveHeader
|
headerRight: () => <ButtonSaveHeader
|
||||||
disable={desc == ""}
|
disable={desc == "" || loading}
|
||||||
category="create"
|
category="create"
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
handleCreate()
|
handleCreate()
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ export default function TaskDivisionAddFile() {
|
|||||||
const [loadingCheck, setLoadingCheck] = useState(false);
|
const [loadingCheck, setLoadingCheck] = useState(false);
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const update = useSelector((state: any) => state.taskUpdate);
|
const update = useSelector((state: any) => state.taskUpdate);
|
||||||
|
const [loading, setLoading] = useState(false);
|
||||||
|
|
||||||
const pickDocumentAsync = async () => {
|
const pickDocumentAsync = async () => {
|
||||||
let result = await DocumentPicker.getDocumentAsync({
|
let result = await DocumentPicker.getDocumentAsync({
|
||||||
@@ -90,6 +91,7 @@ export default function TaskDivisionAddFile() {
|
|||||||
|
|
||||||
async function handleAddFile() {
|
async function handleAddFile() {
|
||||||
try {
|
try {
|
||||||
|
setLoading(true)
|
||||||
const hasil = await decryptToken(String(token?.current));
|
const hasil = await decryptToken(String(token?.current));
|
||||||
const fd = new FormData();
|
const fd = new FormData();
|
||||||
|
|
||||||
@@ -119,6 +121,8 @@ export default function TaskDivisionAddFile() {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
|
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
|
||||||
|
} finally {
|
||||||
|
setLoading(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -138,7 +142,7 @@ export default function TaskDivisionAddFile() {
|
|||||||
headerRight: () => (
|
headerRight: () => (
|
||||||
<ButtonSaveHeader
|
<ButtonSaveHeader
|
||||||
category="create"
|
category="create"
|
||||||
disable={fileForm.length == 0 ? true : false}
|
disable={fileForm.length == 0 || loading ? true : false}
|
||||||
onPress={() => { handleAddFile() }}
|
onPress={() => { handleAddFile() }}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
@@ -171,6 +175,9 @@ export default function TaskDivisionAddFile() {
|
|||||||
{
|
{
|
||||||
loadingCheck && <ActivityIndicator size="small" />
|
loadingCheck && <ActivityIndicator size="small" />
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
loading && <ActivityIndicator size="large" />
|
||||||
|
}
|
||||||
</View>
|
</View>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
<DrawerBottom animation="slide" isVisible={isModal} setVisible={setModal} title="Menu">
|
<DrawerBottom animation="slide" isVisible={isModal} setVisible={setModal} title="Menu">
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ export default function AddMemberTask() {
|
|||||||
const [data, setData] = useState<Props[]>([])
|
const [data, setData] = useState<Props[]>([])
|
||||||
const [selectMember, setSelectMember] = useState<any[]>([])
|
const [selectMember, setSelectMember] = useState<any[]>([])
|
||||||
const [search, setSearch] = useState('')
|
const [search, setSearch] = useState('')
|
||||||
|
const [loading, setLoading] = useState(false)
|
||||||
|
|
||||||
async function handleLoadOldMember() {
|
async function handleLoadOldMember() {
|
||||||
try {
|
try {
|
||||||
@@ -72,6 +73,7 @@ export default function AddMemberTask() {
|
|||||||
|
|
||||||
async function handleAddMember() {
|
async function handleAddMember() {
|
||||||
try {
|
try {
|
||||||
|
setLoading(true)
|
||||||
const hasil = await decryptToken(String(token?.current))
|
const hasil = await decryptToken(String(token?.current))
|
||||||
const response = await apiAddMemberTask({ id: detail, data: { user: hasil, member: selectMember, idDivision: id } })
|
const response = await apiAddMemberTask({ id: detail, data: { user: hasil, member: selectMember, idDivision: id } })
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
@@ -83,7 +85,9 @@ export default function AddMemberTask() {
|
|||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
Toast.show({ type: 'small', text1: 'Gagal menambahkan anggota', })
|
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
|
||||||
|
} finally {
|
||||||
|
setLoading(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -98,7 +102,7 @@ export default function AddMemberTask() {
|
|||||||
headerRight: () => (
|
headerRight: () => (
|
||||||
<ButtonSaveHeader
|
<ButtonSaveHeader
|
||||||
category="update"
|
category="update"
|
||||||
disable={selectMember.length > 0 ? false : true}
|
disable={selectMember.length == 0 || loading ? true : false}
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
handleAddMember()
|
handleAddMember()
|
||||||
}}
|
}}
|
||||||
@@ -154,7 +158,7 @@ export default function AddMemberTask() {
|
|||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
{
|
{
|
||||||
selectMember.some((i: any) => i.idUser == item.idUser) && <AntDesign name="check" size={20} />
|
selectMember.some((i: any) => i.idUser == item.idUser) && <AntDesign name="check" size={20} color={'black'}/>
|
||||||
}
|
}
|
||||||
</Pressable>
|
</Pressable>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ export default function TaskDivisionAddTask() {
|
|||||||
const update = useSelector((state: any) => state.taskUpdate);
|
const update = useSelector((state: any) => state.taskUpdate);
|
||||||
const { id, detail } = useLocalSearchParams<{ id: string; detail: string }>();
|
const { id, detail } = useLocalSearchParams<{ id: string; detail: string }>();
|
||||||
const [disable, setDisable] = useState(true);
|
const [disable, setDisable] = useState(true);
|
||||||
|
const [loading, setLoading] = useState(false)
|
||||||
const [range, setRange] = useState<{
|
const [range, setRange] = useState<{
|
||||||
startDate: DateType;
|
startDate: DateType;
|
||||||
endDate: DateType;
|
endDate: DateType;
|
||||||
@@ -73,6 +74,7 @@ export default function TaskDivisionAddTask() {
|
|||||||
|
|
||||||
async function handleCreate() {
|
async function handleCreate() {
|
||||||
try {
|
try {
|
||||||
|
setLoading(true)
|
||||||
const hasil = await decryptToken(String(token?.current));
|
const hasil = await decryptToken(String(token?.current));
|
||||||
const response = await apiCreateTaskTugas({
|
const response = await apiCreateTaskTugas({
|
||||||
data: {
|
data: {
|
||||||
@@ -93,7 +95,9 @@ export default function TaskDivisionAddTask() {
|
|||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
Toast.show({ type: 'small', text1: 'Gagal menambah data', })
|
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
|
||||||
|
} finally {
|
||||||
|
setLoading(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -113,7 +117,7 @@ export default function TaskDivisionAddTask() {
|
|||||||
headerRight: () => (
|
headerRight: () => (
|
||||||
<ButtonSaveHeader
|
<ButtonSaveHeader
|
||||||
category="create"
|
category="create"
|
||||||
disable={disable}
|
disable={disable || loading}
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
handleCreate();
|
handleCreate();
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ export default function TaskDivisionCancel() {
|
|||||||
const [reason, setReason] = useState("");
|
const [reason, setReason] = useState("");
|
||||||
const [error, setError] = useState(false);
|
const [error, setError] = useState(false);
|
||||||
const [disable, setDisable] = useState(false);
|
const [disable, setDisable] = useState(false);
|
||||||
|
const [loading, setLoading] = useState(false)
|
||||||
|
|
||||||
function onValidation(val: string) {
|
function onValidation(val: string) {
|
||||||
setReason(val);
|
setReason(val);
|
||||||
@@ -43,6 +44,7 @@ export default function TaskDivisionCancel() {
|
|||||||
|
|
||||||
async function handleCancel() {
|
async function handleCancel() {
|
||||||
try {
|
try {
|
||||||
|
setLoading(true)
|
||||||
const hasil = await decryptToken(String(token?.current));
|
const hasil = await decryptToken(String(token?.current));
|
||||||
const response = await apiCancelTask(
|
const response = await apiCancelTask(
|
||||||
{
|
{
|
||||||
@@ -60,7 +62,9 @@ export default function TaskDivisionCancel() {
|
|||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
Toast.show({ type: 'small', text1: 'Gagal membatalkan kegiatan', })
|
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
|
||||||
|
} finally {
|
||||||
|
setLoading(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,7 +83,7 @@ export default function TaskDivisionCancel() {
|
|||||||
headerTitleAlign: "center",
|
headerTitleAlign: "center",
|
||||||
headerRight: () => (
|
headerRight: () => (
|
||||||
<ButtonSaveHeader
|
<ButtonSaveHeader
|
||||||
disable={disable}
|
disable={disable || loading}
|
||||||
category="cancel"
|
category="cancel"
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
handleCancel();
|
handleCancel();
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ export default function TaskDivisionEdit() {
|
|||||||
const [disable, setDisable] = useState(false);
|
const [disable, setDisable] = useState(false);
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const update = useSelector((state: any) => state.taskUpdate);
|
const update = useSelector((state: any) => state.taskUpdate);
|
||||||
|
const [loading, setLoading] = useState(false)
|
||||||
|
|
||||||
async function handleLoad() {
|
async function handleLoad() {
|
||||||
try {
|
try {
|
||||||
@@ -61,6 +62,7 @@ export default function TaskDivisionEdit() {
|
|||||||
|
|
||||||
async function handleUpdate() {
|
async function handleUpdate() {
|
||||||
try {
|
try {
|
||||||
|
setLoading(true)
|
||||||
const hasil = await decryptToken(String(token?.current));
|
const hasil = await decryptToken(String(token?.current));
|
||||||
const response = await apiEditTask(
|
const response = await apiEditTask(
|
||||||
{
|
{
|
||||||
@@ -79,6 +81,8 @@ export default function TaskDivisionEdit() {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
|
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
|
||||||
|
} finally {
|
||||||
|
setLoading(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -98,7 +102,7 @@ export default function TaskDivisionEdit() {
|
|||||||
headerRight: () => (
|
headerRight: () => (
|
||||||
<ButtonSaveHeader
|
<ButtonSaveHeader
|
||||||
category="update"
|
category="update"
|
||||||
disable={disable}
|
disable={disable || loading}
|
||||||
onPress={() => { handleUpdate() }}
|
onPress={() => { handleUpdate() }}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ export default function CreateTaskDivision() {
|
|||||||
const [title, setTitle] = useState('')
|
const [title, setTitle] = useState('')
|
||||||
const [error, setError] = useState(false);
|
const [error, setError] = useState(false);
|
||||||
const [isModal, setModal] = useState(false)
|
const [isModal, setModal] = useState(false)
|
||||||
|
const [loading, setLoading] = useState(false)
|
||||||
let hitung = 0;
|
let hitung = 0;
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -77,6 +78,7 @@ export default function CreateTaskDivision() {
|
|||||||
|
|
||||||
async function handleCreate() {
|
async function handleCreate() {
|
||||||
try {
|
try {
|
||||||
|
setLoading(true)
|
||||||
const hasil = await decryptToken(String(token?.current))
|
const hasil = await decryptToken(String(token?.current))
|
||||||
const fd = new FormData()
|
const fd = new FormData()
|
||||||
|
|
||||||
@@ -102,6 +104,9 @@ export default function CreateTaskDivision() {
|
|||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
|
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
|
||||||
|
} finally {
|
||||||
|
setLoading(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -121,7 +126,7 @@ export default function CreateTaskDivision() {
|
|||||||
headerTitleAlign: "center",
|
headerTitleAlign: "center",
|
||||||
headerRight: () => (
|
headerRight: () => (
|
||||||
<ButtonSaveHeader
|
<ButtonSaveHeader
|
||||||
disable={title == "" || entitiesMember.length == 0 || taskCreate.length == 0}
|
disable={title == "" || entitiesMember.length == 0 || taskCreate.length == 0 || loading}
|
||||||
category="create"
|
category="create"
|
||||||
onPress={() => { handleCreate() }}
|
onPress={() => { handleCreate() }}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ export default function AddMemberCreateTask() {
|
|||||||
const dispatch = useDispatch()
|
const dispatch = useDispatch()
|
||||||
const { token, decryptToken } = useAuthSession()
|
const { token, decryptToken } = useAuthSession()
|
||||||
const { id } = useLocalSearchParams<{ id: string, detail: string }>()
|
const { id } = useLocalSearchParams<{ id: string, detail: string }>()
|
||||||
const [dataOld, setDataOld] = useState<Props[]>([])
|
|
||||||
const [data, setData] = useState<Props[]>([])
|
const [data, setData] = useState<Props[]>([])
|
||||||
const [selectMember, setSelectMember] = useState<any[]>([])
|
const [selectMember, setSelectMember] = useState<any[]>([])
|
||||||
const [search, setSearch] = useState('')
|
const [search, setSearch] = useState('')
|
||||||
@@ -125,7 +124,7 @@ export default function AddMemberCreateTask() {
|
|||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
{
|
{
|
||||||
selectMember.some((i: any) => i.idUser == item.idUser) && <AntDesign name="check" size={20} />
|
selectMember.some((i: any) => i.idUser == item.idUser) && <AntDesign name="check" size={20} color={'black'}/>
|
||||||
}
|
}
|
||||||
</Pressable>
|
</Pressable>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ export default function UpdateProjectTaskDivision() {
|
|||||||
startDate: DateType;
|
startDate: DateType;
|
||||||
endDate: DateType;
|
endDate: DateType;
|
||||||
}>({ startDate: undefined, endDate: undefined });
|
}>({ startDate: undefined, endDate: undefined });
|
||||||
|
const [loadingSubmit, setLoadingSubmit] = useState(false)
|
||||||
const [month, setMonth] = useState<any>();
|
const [month, setMonth] = useState<any>();
|
||||||
const [year, setYear] = useState<any>();
|
const [year, setYear] = useState<any>();
|
||||||
const [loading, setLoading] = useState(true);
|
const [loading, setLoading] = useState(true);
|
||||||
@@ -73,6 +74,7 @@ export default function UpdateProjectTaskDivision() {
|
|||||||
|
|
||||||
async function handleEdit() {
|
async function handleEdit() {
|
||||||
try {
|
try {
|
||||||
|
setLoadingSubmit(true)
|
||||||
const hasil = await decryptToken(String(token?.current));
|
const hasil = await decryptToken(String(token?.current));
|
||||||
const response = await apiEditTaskTugas({ data: { title, dateStart: dayjs(range.startDate).format("YYYY-MM-DD"), dateEnd: dayjs(range.endDate).format("YYYY-MM-DD"), user: hasil }, id: detail });
|
const response = await apiEditTaskTugas({ data: { title, dateStart: dayjs(range.startDate).format("YYYY-MM-DD"), dateEnd: dayjs(range.endDate).format("YYYY-MM-DD"), user: hasil }, id: detail });
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
@@ -84,7 +86,9 @@ export default function UpdateProjectTaskDivision() {
|
|||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
Toast.show({ type: 'small', text1: 'Gagal mengubah data', })
|
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
|
||||||
|
} finally {
|
||||||
|
setLoadingSubmit(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -134,7 +138,7 @@ export default function UpdateProjectTaskDivision() {
|
|||||||
headerTitleAlign: "center",
|
headerTitleAlign: "center",
|
||||||
headerRight: () => (
|
headerRight: () => (
|
||||||
<ButtonSaveHeader
|
<ButtonSaveHeader
|
||||||
disable={disableBtn}
|
disable={disableBtn || loadingSubmit}
|
||||||
category="update"
|
category="update"
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
handleEdit()
|
handleEdit()
|
||||||
|
|||||||
@@ -31,9 +31,11 @@ export default function AddMemberDivision() {
|
|||||||
const [search, setSearch] = useState('')
|
const [search, setSearch] = useState('')
|
||||||
const update = useSelector((state: any) => state.divisionUpdate)
|
const update = useSelector((state: any) => state.divisionUpdate)
|
||||||
const dispatch = useDispatch()
|
const dispatch = useDispatch()
|
||||||
|
const [loading, setLoading] = useState(false)
|
||||||
|
|
||||||
async function handleLoad() {
|
async function handleLoad() {
|
||||||
try {
|
try {
|
||||||
|
setLoading(true)
|
||||||
const hasil = await decryptToken(String(token?.current))
|
const hasil = await decryptToken(String(token?.current))
|
||||||
const response = await apiGetDivisionOneDetail({ user: hasil, id })
|
const response = await apiGetDivisionOneDetail({ user: hasil, id })
|
||||||
setDataOld(response.data.member)
|
setDataOld(response.data.member)
|
||||||
@@ -72,6 +74,7 @@ export default function AddMemberDivision() {
|
|||||||
|
|
||||||
async function handleAddMember() {
|
async function handleAddMember() {
|
||||||
try {
|
try {
|
||||||
|
setLoading(true)
|
||||||
const hasil = await decryptToken(String(token?.current))
|
const hasil = await decryptToken(String(token?.current))
|
||||||
const response = await apiAddMemberDivision({ id: id, data: { user: hasil, member: selectMember } })
|
const response = await apiAddMemberDivision({ id: id, data: { user: hasil, member: selectMember } })
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
@@ -83,7 +86,9 @@ export default function AddMemberDivision() {
|
|||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
Toast.show({ type: 'small', text1: 'Gagal menambahkan anggota', })
|
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
|
||||||
|
} finally {
|
||||||
|
setLoading(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -98,7 +103,7 @@ export default function AddMemberDivision() {
|
|||||||
headerRight: () => (
|
headerRight: () => (
|
||||||
<ButtonSaveHeader
|
<ButtonSaveHeader
|
||||||
category="update"
|
category="update"
|
||||||
disable={selectMember.length > 0 ? false : true}
|
disable={selectMember.length == 0 || loading ? true : false}
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
handleAddMember()
|
handleAddMember()
|
||||||
}}
|
}}
|
||||||
@@ -154,7 +159,7 @@ export default function AddMemberDivision() {
|
|||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
{
|
{
|
||||||
selectMember.some((i: any) => i.idUser == item.id) && <AntDesign name="check" size={20} />
|
selectMember.some((i: any) => i.idUser == item.id) && <AntDesign name="check" size={20} color={'black'}/>
|
||||||
}
|
}
|
||||||
</Pressable>
|
</Pressable>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ export default function EditDivision() {
|
|||||||
const update = useSelector((state: any) => state.divisionUpdate)
|
const update = useSelector((state: any) => state.divisionUpdate)
|
||||||
const { token, decryptToken } = useAuthSession();
|
const { token, decryptToken } = useAuthSession();
|
||||||
const { id } = useLocalSearchParams<{ id: string }>();
|
const { id } = useLocalSearchParams<{ id: string }>();
|
||||||
|
const [loading, setLoading] = useState(false)
|
||||||
const [data, setData] = useState({
|
const [data, setData] = useState({
|
||||||
name: "",
|
name: "",
|
||||||
desc: "",
|
desc: "",
|
||||||
@@ -43,6 +44,7 @@ export default function EditDivision() {
|
|||||||
|
|
||||||
async function handleEdit() {
|
async function handleEdit() {
|
||||||
try {
|
try {
|
||||||
|
setLoading(true)
|
||||||
const hasil = await decryptToken(String(token?.current))
|
const hasil = await decryptToken(String(token?.current))
|
||||||
const response = await apiEditDivision({ user: hasil, name: data.name, desc: data.desc }, id)
|
const response = await apiEditDivision({ user: hasil, name: data.name, desc: data.desc }, id)
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
@@ -55,6 +57,8 @@ export default function EditDivision() {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
|
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
|
||||||
|
} finally {
|
||||||
|
setLoading(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -73,7 +77,7 @@ export default function EditDivision() {
|
|||||||
headerTitleAlign: "center",
|
headerTitleAlign: "center",
|
||||||
headerRight: () => (
|
headerRight: () => (
|
||||||
<ButtonSaveHeader
|
<ButtonSaveHeader
|
||||||
disable={error.name}
|
disable={error.name || loading ? true : false}
|
||||||
category="update"
|
category="update"
|
||||||
onPress={() => { handleEdit() }}
|
onPress={() => { handleEdit() }}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ export default function CreateDivisionAddAdmin() {
|
|||||||
const update = useSelector((state: any) => state.divisionCreate)
|
const update = useSelector((state: any) => state.divisionCreate)
|
||||||
const updateDivision = useSelector((state: any) => state.divisionUpdate)
|
const updateDivision = useSelector((state: any) => state.divisionUpdate)
|
||||||
const dispatch = useDispatch()
|
const dispatch = useDispatch()
|
||||||
|
const [loading, setLoading] = useState(false)
|
||||||
|
|
||||||
async function handleLoadMember() {
|
async function handleLoadMember() {
|
||||||
setData(update.member)
|
setData(update.member)
|
||||||
@@ -48,6 +49,7 @@ export default function CreateDivisionAddAdmin() {
|
|||||||
|
|
||||||
async function handleAddMember() {
|
async function handleAddMember() {
|
||||||
try {
|
try {
|
||||||
|
setLoading(true)
|
||||||
dispatch(setFormCreateDivision({ ...update, admin: selectMember }))
|
dispatch(setFormCreateDivision({ ...update, admin: selectMember }))
|
||||||
const hasil = await decryptToken(String(token?.current))
|
const hasil = await decryptToken(String(token?.current))
|
||||||
const response = await apiCreateDivision({ ...update, user: hasil })
|
const response = await apiCreateDivision({ ...update, user: hasil })
|
||||||
@@ -61,7 +63,9 @@ export default function CreateDivisionAddAdmin() {
|
|||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
Toast.show({ type: 'small', text1: 'Gagal membuat divisi', })
|
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
|
||||||
|
} finally {
|
||||||
|
setLoading(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -76,7 +80,7 @@ export default function CreateDivisionAddAdmin() {
|
|||||||
headerRight: () => (
|
headerRight: () => (
|
||||||
<ButtonSaveHeader
|
<ButtonSaveHeader
|
||||||
category="create"
|
category="create"
|
||||||
disable={selectMember.length > 0 ? false : true}
|
disable={selectMember.length == 0 || loading ? true : false}
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
handleAddMember()
|
handleAddMember()
|
||||||
}}
|
}}
|
||||||
@@ -108,7 +112,7 @@ export default function CreateDivisionAddAdmin() {
|
|||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
{
|
{
|
||||||
selectMember.some((i: any) => i == item.idUser) && <AntDesign name="check" size={20} />
|
selectMember.some((i: any) => i == item.idUser) && <AntDesign name="check" size={20} color={'black'}/>
|
||||||
}
|
}
|
||||||
</Pressable>
|
</Pressable>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ export default function CreateDivisionAddMember() {
|
|||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
{
|
{
|
||||||
selectMember.some((i: any) => i.idUser == item.id) && <AntDesign name="check" size={20} />
|
selectMember.some((i: any) => i.idUser == item.id) && <AntDesign name="check" size={20} color={'black'}/>
|
||||||
}
|
}
|
||||||
</Pressable>
|
</Pressable>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -46,7 +46,8 @@ export default function EditProfile() {
|
|||||||
const [isSelect, setSelect] = useState(false);
|
const [isSelect, setSelect] = useState(false);
|
||||||
const [disableBtn, setDisableBtn] = useState(false)
|
const [disableBtn, setDisableBtn] = useState(false)
|
||||||
const [valChoose, setValChoose] = useState("")
|
const [valChoose, setValChoose] = useState("")
|
||||||
const [imgForm, setImgForm] = useState<any>();
|
const [imgForm, setImgForm] = useState<any>()
|
||||||
|
const [loading, setLoading] = useState(false)
|
||||||
const [data, setData] = useState<Props>({
|
const [data, setData] = useState<Props>({
|
||||||
id: entities.id,
|
id: entities.id,
|
||||||
name: entities.name,
|
name: entities.name,
|
||||||
@@ -150,6 +151,7 @@ export default function EditProfile() {
|
|||||||
|
|
||||||
async function handleEdit() {
|
async function handleEdit() {
|
||||||
try {
|
try {
|
||||||
|
setLoading(true)
|
||||||
const hasil = await decryptToken(String(token?.current))
|
const hasil = await decryptToken(String(token?.current))
|
||||||
const fd = new FormData()
|
const fd = new FormData()
|
||||||
|
|
||||||
@@ -179,6 +181,8 @@ export default function EditProfile() {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
Toast.show({ type: 'small', text1: 'Gagal mengupdate data', })
|
Toast.show({ type: 'small', text1: 'Gagal mengupdate data', })
|
||||||
|
} finally {
|
||||||
|
setLoading(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -217,7 +221,7 @@ export default function EditProfile() {
|
|||||||
headerTitleAlign: "center",
|
headerTitleAlign: "center",
|
||||||
headerRight: () => (
|
headerRight: () => (
|
||||||
<ButtonSaveHeader
|
<ButtonSaveHeader
|
||||||
disable={disableBtn}
|
disable={disableBtn || loading ? true : false}
|
||||||
category="update"
|
category="update"
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
handleEdit()
|
handleEdit()
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ export default function CreateMember() {
|
|||||||
const [disableBtn, setDisableBtn] = useState(true)
|
const [disableBtn, setDisableBtn] = useState(true)
|
||||||
const [valChoose, setValChoose] = useState("")
|
const [valChoose, setValChoose] = useState("")
|
||||||
const [imgForm, setImgForm] = useState<any>()
|
const [imgForm, setImgForm] = useState<any>()
|
||||||
|
const [loading, setLoading] = useState(false)
|
||||||
const [error, setError] = useState({
|
const [error, setError] = useState({
|
||||||
group: false,
|
group: false,
|
||||||
position: false,
|
position: false,
|
||||||
@@ -152,6 +153,7 @@ export default function CreateMember() {
|
|||||||
|
|
||||||
async function handleCreate() {
|
async function handleCreate() {
|
||||||
try {
|
try {
|
||||||
|
setLoading(true)
|
||||||
const hasil = await decryptToken(String(token?.current))
|
const hasil = await decryptToken(String(token?.current))
|
||||||
const fd = new FormData()
|
const fd = new FormData()
|
||||||
|
|
||||||
@@ -179,6 +181,9 @@ export default function CreateMember() {
|
|||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
|
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
|
||||||
|
}finally{
|
||||||
|
setLoading(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -215,7 +220,7 @@ export default function CreateMember() {
|
|||||||
headerTitleAlign: "center",
|
headerTitleAlign: "center",
|
||||||
headerRight: () => (
|
headerRight: () => (
|
||||||
<ButtonSaveHeader
|
<ButtonSaveHeader
|
||||||
disable={disableBtn}
|
disable={disableBtn || loading}
|
||||||
category="create"
|
category="create"
|
||||||
onPress={() => { handleCreate() }}
|
onPress={() => { handleCreate() }}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ export default function EditMember() {
|
|||||||
const [disableBtn, setDisableBtn] = useState(false)
|
const [disableBtn, setDisableBtn] = useState(false)
|
||||||
const [valChoose, setValChoose] = useState("")
|
const [valChoose, setValChoose] = useState("")
|
||||||
const [imgForm, setImgForm] = useState<any>();
|
const [imgForm, setImgForm] = useState<any>();
|
||||||
|
const [loading, setLoading] = useState(false)
|
||||||
const [data, setData] = useState<Props>({
|
const [data, setData] = useState<Props>({
|
||||||
id: "",
|
id: "",
|
||||||
name: "",
|
name: "",
|
||||||
@@ -175,6 +176,7 @@ export default function EditMember() {
|
|||||||
|
|
||||||
async function handleEdit() {
|
async function handleEdit() {
|
||||||
try {
|
try {
|
||||||
|
setLoading(true)
|
||||||
const hasil = await decryptToken(String(token?.current))
|
const hasil = await decryptToken(String(token?.current))
|
||||||
const fd = new FormData()
|
const fd = new FormData()
|
||||||
|
|
||||||
@@ -203,7 +205,9 @@ export default function EditMember() {
|
|||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
Toast.show({ type: 'small', text1: 'Gagal mengupdate data', })
|
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
|
||||||
|
}finally{
|
||||||
|
setLoading(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -242,7 +246,7 @@ export default function EditMember() {
|
|||||||
headerTitleAlign: "center",
|
headerTitleAlign: "center",
|
||||||
headerRight: () => (
|
headerRight: () => (
|
||||||
<ButtonSaveHeader
|
<ButtonSaveHeader
|
||||||
disable={disableBtn}
|
disable={disableBtn || loading}
|
||||||
category="update"
|
category="update"
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
handleEdit()
|
handleEdit()
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ export default function ProjectAddFile() {
|
|||||||
const [loadingCheck, setLoadingCheck] = useState(false)
|
const [loadingCheck, setLoadingCheck] = useState(false)
|
||||||
const dispatch = useDispatch()
|
const dispatch = useDispatch()
|
||||||
const update = useSelector((state: any) => state.projectUpdate)
|
const update = useSelector((state: any) => state.projectUpdate)
|
||||||
|
const [loading, setLoading] = useState(false)
|
||||||
|
|
||||||
const pickDocumentAsync = async () => {
|
const pickDocumentAsync = async () => {
|
||||||
let result = await DocumentPicker.getDocumentAsync({
|
let result = await DocumentPicker.getDocumentAsync({
|
||||||
@@ -86,6 +87,7 @@ export default function ProjectAddFile() {
|
|||||||
|
|
||||||
async function handleAddFile() {
|
async function handleAddFile() {
|
||||||
try {
|
try {
|
||||||
|
setLoading(true)
|
||||||
const hasil = await decryptToken(String(token?.current))
|
const hasil = await decryptToken(String(token?.current))
|
||||||
const fd = new FormData();
|
const fd = new FormData();
|
||||||
|
|
||||||
@@ -116,6 +118,8 @@ export default function ProjectAddFile() {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
|
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
|
||||||
|
} finally {
|
||||||
|
setLoading(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -130,7 +134,7 @@ export default function ProjectAddFile() {
|
|||||||
headerTitle: 'Tambah File',
|
headerTitle: 'Tambah File',
|
||||||
headerTitleAlign: 'center',
|
headerTitleAlign: 'center',
|
||||||
headerRight: () => <ButtonSaveHeader
|
headerRight: () => <ButtonSaveHeader
|
||||||
disable={fileForm.length == 0 ? true : false}
|
disable={fileForm.length == 0 || loading ? true : false}
|
||||||
category="create"
|
category="create"
|
||||||
onPress={() => { handleAddFile() }} />
|
onPress={() => { handleAddFile() }} />
|
||||||
}}
|
}}
|
||||||
@@ -162,6 +166,9 @@ export default function ProjectAddFile() {
|
|||||||
{
|
{
|
||||||
loadingCheck && <ActivityIndicator size="small" />
|
loadingCheck && <ActivityIndicator size="small" />
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
loading && <ActivityIndicator size="large" />
|
||||||
|
}
|
||||||
</View>
|
</View>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
<DrawerBottom animation="slide" isVisible={isModal} setVisible={setModal} title="Menu">
|
<DrawerBottom animation="slide" isVisible={isModal} setVisible={setModal} title="Menu">
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ export default function AddMemberProject() {
|
|||||||
const [idGroup, setIdGroup] = useState('')
|
const [idGroup, setIdGroup] = useState('')
|
||||||
const [selectMember, setSelectMember] = useState<any[]>([])
|
const [selectMember, setSelectMember] = useState<any[]>([])
|
||||||
const [search, setSearch] = useState('')
|
const [search, setSearch] = useState('')
|
||||||
|
const [loading, setLoading] = useState(false)
|
||||||
|
|
||||||
async function handleLoad() {
|
async function handleLoad() {
|
||||||
try {
|
try {
|
||||||
@@ -43,6 +44,7 @@ export default function AddMemberProject() {
|
|||||||
setData(responsemember.data.filter((i: any) => i.idUserRole != 'supadmin'))
|
setData(responsemember.data.filter((i: any) => i.idUserRole != 'supadmin'))
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
|
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -73,6 +75,7 @@ export default function AddMemberProject() {
|
|||||||
|
|
||||||
async function handleAddMember() {
|
async function handleAddMember() {
|
||||||
try {
|
try {
|
||||||
|
setLoading(true)
|
||||||
const hasil = await decryptToken(String(token?.current))
|
const hasil = await decryptToken(String(token?.current))
|
||||||
const response = await apiAddMemberProject({ id: id, data: { user: hasil, member: selectMember } })
|
const response = await apiAddMemberProject({ id: id, data: { user: hasil, member: selectMember } })
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
@@ -82,6 +85,9 @@ export default function AddMemberProject() {
|
|||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
|
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
|
||||||
|
} finally {
|
||||||
|
setLoading(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -96,7 +102,7 @@ export default function AddMemberProject() {
|
|||||||
headerRight: () => (
|
headerRight: () => (
|
||||||
<ButtonSaveHeader
|
<ButtonSaveHeader
|
||||||
category="update"
|
category="update"
|
||||||
disable={selectMember.length > 0 ? false : true}
|
disable={selectMember.length == 0 || loading ? true : false}
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
handleAddMember()
|
handleAddMember()
|
||||||
}}
|
}}
|
||||||
@@ -150,7 +156,7 @@ export default function AddMemberProject() {
|
|||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
{
|
{
|
||||||
selectMember.some((i: any) => i.idUser == item.id) && <AntDesign name="check" size={20} />
|
selectMember.some((i: any) => i.idUser == item.id) && <AntDesign name="check" size={20} color={'black'}/>
|
||||||
}
|
}
|
||||||
</Pressable>
|
</Pressable>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ export default function ProjectAddTask() {
|
|||||||
title: false,
|
title: false,
|
||||||
})
|
})
|
||||||
const [title, setTitle] = useState('');
|
const [title, setTitle] = useState('');
|
||||||
|
const [loading, setLoading] = useState(false)
|
||||||
|
|
||||||
const from = range.startDate
|
const from = range.startDate
|
||||||
? dayjs(range.startDate).format("DD-MM-YYYY")
|
? dayjs(range.startDate).format("DD-MM-YYYY")
|
||||||
@@ -69,15 +70,21 @@ export default function ProjectAddTask() {
|
|||||||
|
|
||||||
async function handleCreate() {
|
async function handleCreate() {
|
||||||
try {
|
try {
|
||||||
|
setLoading(true)
|
||||||
const hasil = await decryptToken(String(token?.current));
|
const hasil = await decryptToken(String(token?.current));
|
||||||
const response = await apiCreateProjectTask({ data: { name: title, dateStart: dayjs(range.startDate).format("YYYY-MM-DD"), dateEnd: dayjs(range.endDate).format("YYYY-MM-DD"), user: hasil }, id });
|
const response = await apiCreateProjectTask({ data: { name: title, dateStart: dayjs(range.startDate).format("YYYY-MM-DD"), dateEnd: dayjs(range.endDate).format("YYYY-MM-DD"), user: hasil }, id });
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
dispatch(setUpdateProject({ ...update, task: !update.task, progress: !update.progress }))
|
dispatch(setUpdateProject({ ...update, task: !update.task, progress: !update.progress }))
|
||||||
Toast.show({ type: 'small', text1: 'Berhasil menambah data', })
|
Toast.show({ type: 'small', text1: 'Berhasil menambah data', })
|
||||||
router.back();
|
router.back();
|
||||||
|
}else{
|
||||||
|
Toast.show({ type: 'small', text1: response.message, })
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
|
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
|
||||||
|
} finally {
|
||||||
|
setLoading(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -96,7 +103,7 @@ export default function ProjectAddTask() {
|
|||||||
headerTitleAlign: "center",
|
headerTitleAlign: "center",
|
||||||
headerRight: () => (
|
headerRight: () => (
|
||||||
<ButtonSaveHeader
|
<ButtonSaveHeader
|
||||||
disable={disable}
|
disable={disable || loading}
|
||||||
category="create"
|
category="create"
|
||||||
onPress={() => { handleCreate() }}
|
onPress={() => { handleCreate() }}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ export default function ProjectCancel() {
|
|||||||
const [reason, setReason] = useState("");
|
const [reason, setReason] = useState("");
|
||||||
const [error, setError] = useState(false);
|
const [error, setError] = useState(false);
|
||||||
const [disable, setDisable] = useState(false);
|
const [disable, setDisable] = useState(false);
|
||||||
|
const [loading, setLoading] = useState(false)
|
||||||
|
|
||||||
|
|
||||||
function onValidation(val: string) {
|
function onValidation(val: string) {
|
||||||
@@ -44,6 +45,7 @@ export default function ProjectCancel() {
|
|||||||
|
|
||||||
async function handleCancel() {
|
async function handleCancel() {
|
||||||
try {
|
try {
|
||||||
|
setLoading(true)
|
||||||
const hasil = await decryptToken(String(token?.current));
|
const hasil = await decryptToken(String(token?.current));
|
||||||
const response = await apiCancelProject({
|
const response = await apiCancelProject({
|
||||||
reason: reason,
|
reason: reason,
|
||||||
@@ -56,6 +58,9 @@ export default function ProjectCancel() {
|
|||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
|
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
|
||||||
|
} finally {
|
||||||
|
setLoading(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -74,7 +79,7 @@ export default function ProjectCancel() {
|
|||||||
headerTitleAlign: "center",
|
headerTitleAlign: "center",
|
||||||
headerRight: () => (
|
headerRight: () => (
|
||||||
<ButtonSaveHeader
|
<ButtonSaveHeader
|
||||||
disable={disable}
|
disable={disable || loading}
|
||||||
category="cancel"
|
category="cancel"
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
handleCancel();
|
handleCancel();
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ export default function EditProject() {
|
|||||||
const [judul, setJudul] = useState("");
|
const [judul, setJudul] = useState("");
|
||||||
const [error, setError] = useState(false);
|
const [error, setError] = useState(false);
|
||||||
const [disable, setDisable] = useState(false);
|
const [disable, setDisable] = useState(false);
|
||||||
|
const [loading, setLoading] = useState(false)
|
||||||
|
|
||||||
async function handleLoad() {
|
async function handleLoad() {
|
||||||
try {
|
try {
|
||||||
@@ -59,6 +60,7 @@ export default function EditProject() {
|
|||||||
|
|
||||||
async function handleUpdate() {
|
async function handleUpdate() {
|
||||||
try {
|
try {
|
||||||
|
setLoading(true)
|
||||||
const hasil = await decryptToken(String(token?.current));
|
const hasil = await decryptToken(String(token?.current));
|
||||||
const response = await apiEditProject({
|
const response = await apiEditProject({
|
||||||
name: judul,
|
name: judul,
|
||||||
@@ -68,9 +70,14 @@ export default function EditProject() {
|
|||||||
dispatch(setUpdateProject({ ...update, data: !update.data }))
|
dispatch(setUpdateProject({ ...update, data: !update.data }))
|
||||||
Toast.show({ type: 'small', text1: 'Berhasil mengubah data', })
|
Toast.show({ type: 'small', text1: 'Berhasil mengubah data', })
|
||||||
router.back();
|
router.back();
|
||||||
|
} else {
|
||||||
|
Toast.show({ type: 'small', text1: response.message, })
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
|
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
|
||||||
|
} finally {
|
||||||
|
setLoading(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,7 +98,7 @@ export default function EditProject() {
|
|||||||
headerTitleAlign: "center",
|
headerTitleAlign: "center",
|
||||||
headerRight: () => (
|
headerRight: () => (
|
||||||
<ButtonSaveHeader
|
<ButtonSaveHeader
|
||||||
disable={disable}
|
disable={disable || loading}
|
||||||
category="update"
|
category="update"
|
||||||
onPress={() => { handleUpdate() }}
|
onPress={() => { handleUpdate() }}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ import Toast from "react-native-toast-message";
|
|||||||
import { useDispatch, useSelector } from "react-redux";
|
import { useDispatch, useSelector } from "react-redux";
|
||||||
|
|
||||||
export default function CreateProject() {
|
export default function CreateProject() {
|
||||||
|
const [loading, setLoading] =useState(false)
|
||||||
const { token, decryptToken } = useAuthSession();
|
const { token, decryptToken } = useAuthSession();
|
||||||
const [chooseGroup, setChooseGroup] = useState({ val: "", label: "" });
|
const [chooseGroup, setChooseGroup] = useState({ val: "", label: "" });
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
@@ -102,6 +103,7 @@ export default function CreateProject() {
|
|||||||
|
|
||||||
async function handleCreate() {
|
async function handleCreate() {
|
||||||
try {
|
try {
|
||||||
|
setLoading(true)
|
||||||
const hasil = await decryptToken(String(token?.current))
|
const hasil = await decryptToken(String(token?.current))
|
||||||
const fd = new FormData()
|
const fd = new FormData()
|
||||||
|
|
||||||
@@ -127,6 +129,9 @@ export default function CreateProject() {
|
|||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
|
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
|
||||||
|
}finally{
|
||||||
|
setLoading(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -178,7 +183,7 @@ export default function CreateProject() {
|
|||||||
headerTitleAlign: "center",
|
headerTitleAlign: "center",
|
||||||
headerRight: () => (
|
headerRight: () => (
|
||||||
<ButtonSaveHeader
|
<ButtonSaveHeader
|
||||||
disable={disableBtn}
|
disable={disableBtn || loading}
|
||||||
category="create"
|
category="create"
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
handleCreate()
|
handleCreate()
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ export default function UpdateProjectTask() {
|
|||||||
const [year, setYear] = useState<any>()
|
const [year, setYear] = useState<any>()
|
||||||
const [loading, setLoading] = useState(true)
|
const [loading, setLoading] = useState(true)
|
||||||
const [disableBtn, setDisableBtn] = useState(false)
|
const [disableBtn, setDisableBtn] = useState(false)
|
||||||
|
const [loadingSubmit, setLoadingSubmit] = useState(false)
|
||||||
|
|
||||||
const [title, setTitle] = useState('')
|
const [title, setTitle] = useState('')
|
||||||
const [error, setError] = useState({
|
const [error, setError] = useState({
|
||||||
@@ -65,15 +66,21 @@ export default function UpdateProjectTask() {
|
|||||||
|
|
||||||
async function handleEdit() {
|
async function handleEdit() {
|
||||||
try {
|
try {
|
||||||
|
setLoadingSubmit(true)
|
||||||
const hasil = await decryptToken(String(token?.current));
|
const hasil = await decryptToken(String(token?.current));
|
||||||
const response = await apiEditProjectTask({ data: { title, dateStart: dayjs(range.startDate).format("YYYY-MM-DD"), dateEnd: dayjs(range.endDate).format("YYYY-MM-DD"), user: hasil }, id: detail });
|
const response = await apiEditProjectTask({ data: { title, dateStart: dayjs(range.startDate).format("YYYY-MM-DD"), dateEnd: dayjs(range.endDate).format("YYYY-MM-DD"), user: hasil }, id: detail });
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
dispatch(setUpdateProject({ ...update, task: !update.task, progress: !update.progress }))
|
dispatch(setUpdateProject({ ...update, task: !update.task, progress: !update.progress }))
|
||||||
Toast.show({ type: 'small', text1: 'Berhasil mengubah data', })
|
Toast.show({ type: 'small', text1: 'Berhasil mengubah data', })
|
||||||
router.back();
|
router.back();
|
||||||
|
} else {
|
||||||
|
Toast.show({ type: 'small', text1: response.message, })
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
|
Toast.show({ type: 'small', text1: 'Terjadi kesalahan', })
|
||||||
|
} finally {
|
||||||
|
setLoadingSubmit(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -108,7 +115,7 @@ export default function UpdateProjectTask() {
|
|||||||
headerTitle: 'Edit Tanggal dan Tugas',
|
headerTitle: 'Edit Tanggal dan Tugas',
|
||||||
headerTitleAlign: 'center',
|
headerTitleAlign: 'center',
|
||||||
headerRight: () => <ButtonSaveHeader
|
headerRight: () => <ButtonSaveHeader
|
||||||
disable={disableBtn}
|
disable={disableBtn || loadingSubmit}
|
||||||
category="update"
|
category="update"
|
||||||
onPress={() => { handleEdit() }}
|
onPress={() => { handleEdit() }}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { MaterialCommunityIcons, MaterialIcons } from "@expo/vector-icons";
|
|||||||
import * as DocumentPicker from "expo-document-picker";
|
import * as DocumentPicker from "expo-document-picker";
|
||||||
import { useLocalSearchParams } from "expo-router";
|
import { useLocalSearchParams } from "expo-router";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { View } from "react-native";
|
import { ActivityIndicator, View } from "react-native";
|
||||||
import Toast from "react-native-toast-message";
|
import Toast from "react-native-toast-message";
|
||||||
import { useDispatch, useSelector } from "react-redux";
|
import { useDispatch, useSelector } from "react-redux";
|
||||||
import ButtonMenuHeader from "../buttonMenuHeader";
|
import ButtonMenuHeader from "../buttonMenuHeader";
|
||||||
@@ -46,26 +46,31 @@ export default function HeaderRightDocument({ path }: { path: string }) {
|
|||||||
const pickDocumentAsync = async () => {
|
const pickDocumentAsync = async () => {
|
||||||
let result = await DocumentPicker.getDocumentAsync({
|
let result = await DocumentPicker.getDocumentAsync({
|
||||||
type: ["*/*"],
|
type: ["*/*"],
|
||||||
multiple: false,
|
multiple: true,
|
||||||
});
|
});
|
||||||
if (!result.canceled) {
|
if (!result.canceled) {
|
||||||
if (result.assets?.[0].uri) {
|
let file: any[] = []
|
||||||
handleUploadFile(result.assets?.[0])
|
for (let i = 0; i < result.assets?.length; i++) {
|
||||||
|
if (result.assets?.[i].uri) {
|
||||||
|
file.push(result.assets?.[i])
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
handleUploadFile(file)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
async function handleUploadFile(file: any) {
|
async function handleUploadFile(file: any[]) {
|
||||||
try {
|
try {
|
||||||
setLoading(true)
|
setLoading(true)
|
||||||
const hasil = await decryptToken(String(token?.current))
|
const hasil = await decryptToken(String(token?.current))
|
||||||
const fd = new FormData()
|
const fd = new FormData()
|
||||||
fd.append("file", {
|
for (let i = 0; i < file.length; i++) {
|
||||||
uri: file.uri,
|
fd.append(`file${i}`, {
|
||||||
type: "application/octet-stream",
|
uri: file[i].uri,
|
||||||
name: file.name,
|
type: "application/octet-stream",
|
||||||
} as any);
|
name: file[i].name,
|
||||||
|
} as any);
|
||||||
|
}
|
||||||
fd.append(
|
fd.append(
|
||||||
"data",
|
"data",
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
@@ -73,7 +78,7 @@ export default function HeaderRightDocument({ path }: { path: string }) {
|
|||||||
idDivision: id,
|
idDivision: id,
|
||||||
user: hasil,
|
user: hasil,
|
||||||
})
|
})
|
||||||
);
|
)
|
||||||
|
|
||||||
const response = await apiUploadFileDocument({ data: fd })
|
const response = await apiUploadFileDocument({ data: fd })
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
@@ -106,28 +111,37 @@ export default function HeaderRightDocument({ path }: { path: string }) {
|
|||||||
title="Menu"
|
title="Menu"
|
||||||
>
|
>
|
||||||
<View style={Styles.rowItemsCenter}>
|
<View style={Styles.rowItemsCenter}>
|
||||||
<MenuItemRow
|
{
|
||||||
icon={
|
loading ?
|
||||||
<MaterialCommunityIcons
|
<View style={[Styles.contentItemCenter, Styles.w100, Styles.h100]}>
|
||||||
name="folder-open"
|
<ActivityIndicator size="large" />
|
||||||
color="black"
|
</View>
|
||||||
size={25}
|
:
|
||||||
/>
|
<>
|
||||||
}
|
<MenuItemRow
|
||||||
title="Tambah Folder"
|
icon={
|
||||||
onPress={() => {
|
<MaterialCommunityIcons
|
||||||
setVisible(false);
|
name="folder-open"
|
||||||
setTimeout(() => {
|
color="black"
|
||||||
setNewFolder(true);
|
size={25}
|
||||||
}, 600);
|
/>
|
||||||
}}
|
}
|
||||||
/>
|
title="Tambah Folder"
|
||||||
|
onPress={() => {
|
||||||
|
setVisible(false);
|
||||||
|
setTimeout(() => {
|
||||||
|
setNewFolder(true);
|
||||||
|
}, 600);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
|
||||||
<MenuItemRow
|
<MenuItemRow
|
||||||
icon={<MaterialIcons name="upload-file" color="black" size={25} />}
|
icon={<MaterialIcons name="upload-file" color="black" size={25} />}
|
||||||
title="Upload File"
|
title="Upload File"
|
||||||
onPress={pickDocumentAsync}
|
onPress={pickDocumentAsync}
|
||||||
/>
|
/>
|
||||||
|
</>
|
||||||
|
}
|
||||||
</View>
|
</View>
|
||||||
</DrawerBottom>
|
</DrawerBottom>
|
||||||
<ModalFloat
|
<ModalFloat
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ export default function ModalFilter({ open, close, page, category }: Props) {
|
|||||||
<Pressable key={index} style={[Styles.itemSelectModal]} onPress={() => { setChooseGroup(item.id) }}>
|
<Pressable key={index} style={[Styles.itemSelectModal]} onPress={() => { setChooseGroup(item.id) }}>
|
||||||
<Text style={[chooseGroup == item.id ? Styles.textDefaultSemiBold : Styles.textDefault]}>{item.name}</Text>
|
<Text style={[chooseGroup == item.id ? Styles.textDefaultSemiBold : Styles.textDefault]}>{item.name}</Text>
|
||||||
{
|
{
|
||||||
chooseGroup == item.id && <AntDesign name="check" size={20} />
|
chooseGroup == item.id && <AntDesign name="check" size={20} color={'black'}/>
|
||||||
}
|
}
|
||||||
</Pressable>
|
</Pressable>
|
||||||
))
|
))
|
||||||
@@ -71,7 +71,7 @@ export default function ModalFilter({ open, close, page, category }: Props) {
|
|||||||
<Pressable key={index} style={[Styles.itemSelectModal]} onPress={() => { setChooseGroup(item.id) }}>
|
<Pressable key={index} style={[Styles.itemSelectModal]} onPress={() => { setChooseGroup(item.id) }}>
|
||||||
<Text style={[chooseGroup == item.id ? Styles.textDefaultSemiBold : Styles.textDefault]}>{item.name}</Text>
|
<Text style={[chooseGroup == item.id ? Styles.textDefaultSemiBold : Styles.textDefault]}>{item.name}</Text>
|
||||||
{
|
{
|
||||||
chooseGroup == item.id && <AntDesign name="check" size={20} />
|
chooseGroup == item.id && <AntDesign name="check" size={20} color={'black'}/>
|
||||||
}
|
}
|
||||||
</Pressable>
|
</Pressable>
|
||||||
))
|
))
|
||||||
|
|||||||
@@ -174,9 +174,9 @@ export default function ModalSelect({ open, close, title, category, idParent, on
|
|||||||
{
|
{
|
||||||
(category == 'member')
|
(category == 'member')
|
||||||
?
|
?
|
||||||
selectMember.some((i: any) => i.idUser == item.id) && <AntDesign name="check" size={20} />
|
selectMember.some((i: any) => i.idUser == item.id) && <AntDesign name="check" size={20} color={'black'}/>
|
||||||
:
|
:
|
||||||
chooseValue.val == item.id && <AntDesign name="check" size={20} />
|
chooseValue.val == item.id && <AntDesign name="check" size={20} color={'black'}/>
|
||||||
}
|
}
|
||||||
</Pressable>
|
</Pressable>
|
||||||
))
|
))
|
||||||
@@ -192,7 +192,7 @@ export default function ModalSelect({ open, close, title, category, idParent, on
|
|||||||
}}>
|
}}>
|
||||||
<Text style={[chooseValue.val == item.val ? Styles.textDefaultSemiBold : Styles.textDefault]}>{item.label}</Text>
|
<Text style={[chooseValue.val == item.val ? Styles.textDefaultSemiBold : Styles.textDefault]}>{item.label}</Text>
|
||||||
{
|
{
|
||||||
valChoose == item.val && <AntDesign name="check" size={20} />
|
valChoose == item.val && <AntDesign name="check" size={20} color={'black'}/>
|
||||||
}
|
}
|
||||||
</Pressable>
|
</Pressable>
|
||||||
))
|
))
|
||||||
|
|||||||
@@ -161,7 +161,7 @@ export default function ModalSelectMultiple({ open, close, title, category, choo
|
|||||||
<Text numberOfLines={1} style={[Styles.w80]}>{item.name}</Text>
|
<Text numberOfLines={1} style={[Styles.w80]}>{item.name}</Text>
|
||||||
{
|
{
|
||||||
selectedDivision.some((i: any) => i.id == item.id)
|
selectedDivision.some((i: any) => i.id == item.id)
|
||||||
? <AntDesign name="check" size={18} />
|
? <AntDesign name="check" size={18} color={'black'}/>
|
||||||
: <></>
|
: <></>
|
||||||
}
|
}
|
||||||
</Pressable>
|
</Pressable>
|
||||||
@@ -177,9 +177,9 @@ export default function ModalSelectMultiple({ open, close, title, category, choo
|
|||||||
<Text style={[Styles.textMediumSemiBold]}>{item.name}</Text>
|
<Text style={[Styles.textMediumSemiBold]}>{item.name}</Text>
|
||||||
{
|
{
|
||||||
checked[item.id] && checked[item.id]?.length === item.Division?.length
|
checked[item.id] && checked[item.id]?.length === item.Division?.length
|
||||||
? <AntDesign name="check" size={20} />
|
? <AntDesign name="check" size={20} color={'black'}/>
|
||||||
: (checked[item.id] && checked[item.id]?.length > 0 && checked[item.id]?.length < item.Division?.length)
|
: (checked[item.id] && checked[item.id]?.length > 0 && checked[item.id]?.length < item.Division?.length)
|
||||||
? <AntDesign name="minus" size={20} />
|
? <AntDesign name="minus" size={20} color={'black'}/>
|
||||||
: <></>
|
: <></>
|
||||||
}
|
}
|
||||||
</Pressable>
|
</Pressable>
|
||||||
@@ -189,7 +189,7 @@ export default function ModalSelectMultiple({ open, close, title, category, choo
|
|||||||
<Pressable key={v} style={[Styles.itemSelectModal]} onPress={() => { handleCheck(item.id, child.id) }}>
|
<Pressable key={v} style={[Styles.itemSelectModal]} onPress={() => { handleCheck(item.id, child.id) }}>
|
||||||
<Text style={[Styles.ml10, Styles.textMediumNormal, Styles.w80]} numberOfLines={1} ellipsizeMode="tail" >{child.name}</Text>
|
<Text style={[Styles.ml10, Styles.textMediumNormal, Styles.w80]} numberOfLines={1} ellipsizeMode="tail" >{child.name}</Text>
|
||||||
{
|
{
|
||||||
checked[item.id] && checked[item.id].includes(child.id) && <AntDesign name="check" size={20} />
|
checked[item.id] && checked[item.id].includes(child.id) && <AntDesign name="check" size={20} color={'black'}/>
|
||||||
}
|
}
|
||||||
</Pressable>
|
</Pressable>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ export default function SectionCancel({ text, title }: Props) {
|
|||||||
return (
|
return (
|
||||||
<View style={[ColorsStatus.lightRed, Styles.p10, Styles.round10, Styles.mb15]}>
|
<View style={[ColorsStatus.lightRed, Styles.p10, Styles.round10, Styles.mb15]}>
|
||||||
<View style={[Styles.rowItemsCenter]}>
|
<View style={[Styles.rowItemsCenter]}>
|
||||||
<AntDesign name="warning" size={22} style={[Styles.mr10]} />
|
<AntDesign name="warning" size={22} style={[Styles.mr10]} color={'black'}/>
|
||||||
<Text style={[Styles.textDefaultSemiBold]}>{title ? title : 'Kegiatan Dibatalkan'}</Text>
|
<Text style={[Styles.textDefaultSemiBold]}>{title ? title : 'Kegiatan Dibatalkan'}</Text>
|
||||||
</View>
|
</View>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ import axios from 'axios';
|
|||||||
|
|
||||||
const api = axios.create({
|
const api = axios.create({
|
||||||
// baseURL: 'http://10.0.2.2:3000/api',
|
// baseURL: 'http://10.0.2.2:3000/api',
|
||||||
// baseURL: 'https://stg-darmasaba.wibudev.com/api',
|
baseURL: 'https://stg-darmasaba.wibudev.com/api',
|
||||||
baseURL: 'http://192.168.1.89:3000/api',
|
// baseURL: 'http://192.168.1.89:3000/api',
|
||||||
});
|
});
|
||||||
|
|
||||||
export const apiCheckPhoneLogin = async (body: { phone: string }) => {
|
export const apiCheckPhoneLogin = async (body: { phone: string }) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user