diff --git a/app/(application)/announcement/create.tsx b/app/(application)/announcement/create.tsx index 458b851..92c26a1 100644 --- a/app/(application)/announcement/create.tsx +++ b/app/(application)/announcement/create.tsx @@ -99,7 +99,7 @@ export default function CreateAnnouncement() { headerTitleAlign: "center", headerRight: () => ( { divisionMember.length == 0 diff --git a/app/(application)/announcement/index.tsx b/app/(application)/announcement/index.tsx index df24a86..75e628b 100644 --- a/app/(application)/announcement/index.tsx +++ b/app/(application)/announcement/index.tsx @@ -114,7 +114,7 @@ export default function Announcement() { } title={item.title} - desc={item.desc.replace(/<[^>]*>?/gm, '')} + desc={item.desc.replace(/<[^>]*>?/gm, '').replace(/\r?\n|\r/g, ' ')} rightTopInfo={item.createdAt} /> ) diff --git a/app/(application)/discussion/index.tsx b/app/(application)/discussion/index.tsx index 25336c7..9fc4f8c 100644 --- a/app/(application)/discussion/index.tsx +++ b/app/(application)/discussion/index.tsx @@ -153,7 +153,7 @@ export default function Discussion() { status != "false" && } rightTopInfo={item.createdAt} - desc={item.desc} + desc={item.desc.replace(/<[^>]*>?/gm, ' ').replace(/\r?\n|\r/g, ' ')} leftBottomInfo={ @@ -176,34 +176,6 @@ export default function Discussion() { /> } /> - // data.map((item: any, i: number) => { - // return ( - // { router.push(`/discussion/${item.id}`) }} - // borderType="bottom" - // icon={ - // - // - // - // } - // title={item.title} - // subtitle={ - // status != "false" && - // } - // rightTopInfo={item.createdAt} - // desc={item.desc} - // leftBottomInfo={ - // - // - // Diskusikan - // - // } - // rightBottomInfo={`${item.total_komentar} Komentar`} - - // /> - // ) - // }) : Tidak ada data } diff --git a/app/(application)/division/[id]/info.tsx b/app/(application)/division/[id]/info.tsx index e384326..055ced6 100644 --- a/app/(application)/division/[id]/info.tsx +++ b/app/(application)/division/[id]/info.tsx @@ -7,6 +7,7 @@ import ImageUser from "@/components/imageNew" import SectionCancel from "@/components/sectionCancel" import Skeleton from "@/components/skeleton" import SkeletonTwoItem from "@/components/skeletonTwoItem" +import Text from "@/components/Text" import { ColorsStatus } from "@/constants/ColorsStatus" import { ConstEnv } from "@/constants/ConstEnv" import Styles from "@/constants/Styles" @@ -15,7 +16,7 @@ import { useAuthSession } from "@/providers/AuthProvider" import { Feather, MaterialCommunityIcons, MaterialIcons } from "@expo/vector-icons" import { router, Stack, useLocalSearchParams } from "expo-router" import { useEffect, useState } from "react" -import { Pressable, SafeAreaView, ScrollView, Text, View } from "react-native" +import { Pressable, SafeAreaView, ScrollView, View } from "react-native" import Toast from "react-native-toast-message" import { useSelector } from "react-redux" diff --git a/app/(application)/division/create/add-admin-division.tsx b/app/(application)/division/create/add-admin-division.tsx index 61d55eb..aa7b9b9 100644 --- a/app/(application)/division/create/add-admin-division.tsx +++ b/app/(application)/division/create/add-admin-division.tsx @@ -51,9 +51,8 @@ export default function CreateDivisionAddAdmin() { async function handleAddMember() { try { setLoading(true) - dispatch(setFormCreateDivision({ ...update, admin: selectMember })) const hasil = await decryptToken(String(token?.current)) - const response = await apiCreateDivision({ ...update, user: hasil }) + const response = await apiCreateDivision({ ...update, admin: selectMember, user: hasil }) if (response.success) { Toast.show({ type: 'small', text1: 'Berhasil membuat divisi', }) dispatch(setFormCreateDivision({ admin: [], member: [], data: { idGroup: '', name: '', desc: '' } })) diff --git a/app/(application)/edit-profile.tsx b/app/(application)/edit-profile.tsx index e0ef9ba..c0fd456 100644 --- a/app/(application)/edit-profile.tsx +++ b/app/(application)/edit-profile.tsx @@ -122,7 +122,7 @@ export default function EditProfile() { } } else if (cat == "phone") { setData({ ...data, phone: val }); - if (val == "" || !(val.length >= 10 && val.length <= 15)) { + if (val == "" || !(val.length >= 9 && val.length <= 16)) { setError({ ...error, phone: true }); } else { setError({ ...error, phone: false }); diff --git a/app/(application)/member/create.tsx b/app/(application)/member/create.tsx index 48631d8..1fba8e9 100644 --- a/app/(application)/member/create.tsx +++ b/app/(application)/member/create.tsx @@ -117,7 +117,7 @@ export default function CreateMember() { } } else if (cat == "phone") { setDataForm({ ...dataForm, phone: val }); - if (val == "" || !(val.length >= 10 && val.length <= 15)) { + if (val == "" || !(val.length >= 9 && val.length <= 16)) { setError({ ...error, phone: true }); } else { setError({ ...error, phone: false }); diff --git a/app/(application)/member/edit/[id].tsx b/app/(application)/member/edit/[id].tsx index 55c0d9f..8d2d7e5 100644 --- a/app/(application)/member/edit/[id].tsx +++ b/app/(application)/member/edit/[id].tsx @@ -149,7 +149,7 @@ export default function EditMember() { } } else if (cat == "phone") { setData({ ...data, phone: val }); - if (val == "" || !(val.length >= 10 && val.length <= 15)) { + if (val == "" || !(val.length >= 9 && val.length <= 16)) { setError({ ...error, phone: true }); } else { setError({ ...error, phone: false }); diff --git a/components/borderBottomItem.tsx b/components/borderBottomItem.tsx index 7b28062..e4aab06 100644 --- a/components/borderBottomItem.tsx +++ b/components/borderBottomItem.tsx @@ -48,7 +48,7 @@ export default function BorderBottomItem({ title, subtitle, icon, desc, onPress, - {desc && {desc}} + {desc && {desc}} { (leftBottomInfo || rightBottomInfo) && ( diff --git a/lib/divisionCreate.ts b/lib/divisionCreate.ts index 070b4bb..9538e54 100644 --- a/lib/divisionCreate.ts +++ b/lib/divisionCreate.ts @@ -7,7 +7,9 @@ const divisionCreate = createSlice({ idGroup: "", name: "", desc: "", - }, member: [], admin: [], + }, + member: [], + admin: [], }, reducers: { setFormCreateDivision: (state, action) => {