upd: redesign
This commit is contained in:
@@ -4,7 +4,7 @@ import ButtonSaveHeader from "@/components/buttonSaveHeader";
|
||||
import ButtonSelect from "@/components/buttonSelect";
|
||||
import DrawerBottom from "@/components/drawerBottom";
|
||||
import { InputForm } from "@/components/inputForm";
|
||||
import LoadingOverlay from "@/components/loadingOverlay";
|
||||
import LoadingCenter from "@/components/loadingCenter";
|
||||
import MenuItemRow from "@/components/menuItemRow";
|
||||
import ModalSelectMultiple from "@/components/modalSelectMultiple";
|
||||
import Text from "@/components/Text";
|
||||
@@ -174,7 +174,7 @@ export default function CreateAnnouncement() {
|
||||
)
|
||||
}}
|
||||
/>
|
||||
<LoadingOverlay visible={loading} />
|
||||
{loading && <LoadingCenter />}
|
||||
<ScrollView
|
||||
showsVerticalScrollIndicator={false}
|
||||
style={[Styles.h100, { backgroundColor: colors.background }]}
|
||||
@@ -205,22 +205,27 @@ export default function CreateAnnouncement() {
|
||||
{
|
||||
fileForm.length > 0
|
||||
&&
|
||||
<View style={[Styles.borderAll, Styles.round05, Styles.p10, Styles.mb10, { borderColor: colors.icon + '20' }]}>
|
||||
<Text style={[Styles.textDefaultSemiBold]}>File</Text>
|
||||
{
|
||||
fileForm.map((item, index) => (
|
||||
<BorderBottomItem
|
||||
key={index}
|
||||
borderType={fileForm.length - 1 == index ? "none" : "bottom"}
|
||||
icon={<MaterialCommunityIcons name="file-outline" size={25} color={colors.text} />}
|
||||
title={item.name}
|
||||
bgColor="transparent"
|
||||
titleWeight="normal"
|
||||
onPress={() => { setIndexDelFile(index); setModalFile(true) }}
|
||||
/>
|
||||
))
|
||||
}
|
||||
</View>
|
||||
<>
|
||||
<View style={[Styles.rowSpaceBetween, Styles.mv05]}>
|
||||
<Text style={[Styles.textDefaultSemiBold]}>File</Text>
|
||||
<Text style={[Styles.textDefault]}>{fileForm.length} file</Text>
|
||||
</View>
|
||||
<View style={[Styles.borderAll, Styles.round05, Styles.p10, Styles.mb10, { borderColor: colors.icon + '20' }]}>
|
||||
{
|
||||
fileForm.map((item, index) => (
|
||||
<BorderBottomItem
|
||||
key={index}
|
||||
borderType={fileForm.length - 1 == index ? "none" : "bottom"}
|
||||
icon={<MaterialCommunityIcons name="file-outline" size={25} color={colors.text} />}
|
||||
title={item.name}
|
||||
bgColor="transparent"
|
||||
titleWeight="normal"
|
||||
onPress={() => { setIndexDelFile(index); setModalFile(true) }}
|
||||
/>
|
||||
))
|
||||
}
|
||||
</View>
|
||||
</>
|
||||
}
|
||||
|
||||
<ButtonSelect
|
||||
@@ -233,25 +238,30 @@ export default function CreateAnnouncement() {
|
||||
{
|
||||
divisionMember.length > 0
|
||||
&&
|
||||
<View style={[Styles.borderAll, Styles.round05, Styles.p10, { borderColor: colors.icon + '20' }]}>
|
||||
{
|
||||
divisionMember.map((item: { name: any; Division: any }, index: any) => {
|
||||
return (
|
||||
<View key={index}>
|
||||
<Text style={[Styles.textDefaultSemiBold]}>{item.name}</Text>
|
||||
{
|
||||
item.Division.map((division: any, i: any) => (
|
||||
<View key={i} style={[Styles.rowItemsCenter, Styles.w90]}>
|
||||
<Entypo name="dot-single" size={24} color={colors.text} />
|
||||
<Text style={[Styles.textDefault]} numberOfLines={1} ellipsizeMode='tail'>{division.name}</Text>
|
||||
</View>
|
||||
))
|
||||
}
|
||||
</View>
|
||||
)
|
||||
})
|
||||
}
|
||||
</View>
|
||||
<>
|
||||
<View style={[Styles.rowSpaceBetween, Styles.mv05]}>
|
||||
<Text style={[Styles.textDefaultSemiBold]}>Divisi</Text>
|
||||
</View>
|
||||
<View style={[Styles.borderAll, Styles.round05, Styles.p10, { borderColor: colors.icon + '20' }]}>
|
||||
{
|
||||
divisionMember.map((item: { name: any; Division: any }, index: any) => {
|
||||
return (
|
||||
<View key={index}>
|
||||
<Text style={[Styles.textDefaultSemiBold]}>{item.name}</Text>
|
||||
{
|
||||
item.Division.map((division: any, i: any) => (
|
||||
<View key={i} style={[Styles.rowItemsCenter, Styles.w90]}>
|
||||
<Entypo name="dot-single" size={24} color={colors.text} />
|
||||
<Text style={[Styles.textDefault]} numberOfLines={1} ellipsizeMode='tail'>{division.name}</Text>
|
||||
</View>
|
||||
))
|
||||
}
|
||||
</View>
|
||||
)
|
||||
})
|
||||
}
|
||||
</View>
|
||||
</>
|
||||
}
|
||||
</View>
|
||||
</ScrollView>
|
||||
|
||||
@@ -4,7 +4,7 @@ import ButtonSaveHeader from "@/components/buttonSaveHeader";
|
||||
import ButtonSelect from "@/components/buttonSelect";
|
||||
import DrawerBottom from "@/components/drawerBottom";
|
||||
import { InputForm } from "@/components/inputForm";
|
||||
import LoadingOverlay from "@/components/loadingOverlay";
|
||||
import LoadingCenter from "@/components/loadingCenter";
|
||||
import MenuItemRow from "@/components/menuItemRow";
|
||||
import ModalSelectMultiple from "@/components/modalSelectMultiple";
|
||||
import Text from '@/components/Text';
|
||||
@@ -225,7 +225,7 @@ export default function EditAnnouncement() {
|
||||
)
|
||||
}}
|
||||
/>
|
||||
<LoadingOverlay visible={loading} />
|
||||
{loading && <LoadingCenter />}
|
||||
<ScrollView
|
||||
showsVerticalScrollIndicator={false}
|
||||
style={[Styles.h100, { backgroundColor: colors.background }]}
|
||||
@@ -258,35 +258,40 @@ export default function EditAnnouncement() {
|
||||
{
|
||||
(fileForm.length > 0 || dataFile.filter((val) => !val.delete).length > 0)
|
||||
&&
|
||||
<View style={[Styles.borderAll, Styles.round05, Styles.p10, Styles.mb10, { borderColor: colors.icon + '20' }]}>
|
||||
<Text style={[Styles.textDefaultSemiBold]}>File</Text>
|
||||
{
|
||||
dataFile.filter((val) => !val.delete).map((item, index) => (
|
||||
<BorderBottomItem
|
||||
key={index}
|
||||
borderType={(fileForm.length + dataFile.length) > 1 ? "bottom" : "none"}
|
||||
icon={<MaterialCommunityIcons name="file-outline" size={25} color={colors.text} />}
|
||||
title={item.name + '.' + item.extension}
|
||||
titleWeight="normal"
|
||||
bgColor="transparent"
|
||||
onPress={() => { setIndexDelFile({ id: item.id, cat: "oldFile" }); setModalFile(true) }}
|
||||
/>
|
||||
))
|
||||
}
|
||||
{
|
||||
fileForm.map((item, index) => (
|
||||
<BorderBottomItem
|
||||
key={index}
|
||||
borderType={(fileForm.length + dataFile.length) > 1 ? "bottom" : "none"}
|
||||
icon={<MaterialCommunityIcons name="file-outline" size={25} color={colors.text} />}
|
||||
title={item.name}
|
||||
titleWeight="normal"
|
||||
bgColor="transparent"
|
||||
onPress={() => { setIndexDelFile({ id: index, cat: "newFile" }); setModalFile(true) }}
|
||||
/>
|
||||
))
|
||||
}
|
||||
</View>
|
||||
<>
|
||||
<View style={[Styles.rowSpaceBetween, Styles.mv05]}>
|
||||
<Text style={[Styles.textDefaultSemiBold]}>File</Text>
|
||||
<Text style={[Styles.textDefault]}>{fileForm.length + dataFile.filter((val) => !val.delete).length} file</Text>
|
||||
</View>
|
||||
<View style={[Styles.borderAll, Styles.round05, Styles.p10, Styles.mb10, { borderColor: colors.icon + '20' }]}>
|
||||
{
|
||||
dataFile.filter((val) => !val.delete).map((item, index) => (
|
||||
<BorderBottomItem
|
||||
key={index}
|
||||
borderType={dataFile.filter((val) => !val.delete).length - 1 == index && fileForm.length == 0 ? "none" : "bottom"}
|
||||
icon={<MaterialCommunityIcons name="file-outline" size={25} color={colors.text} />}
|
||||
title={item.name + '.' + item.extension}
|
||||
titleWeight="normal"
|
||||
bgColor="transparent"
|
||||
onPress={() => { setIndexDelFile({ id: item.id, cat: "oldFile" }); setModalFile(true) }}
|
||||
/>
|
||||
))
|
||||
}
|
||||
{
|
||||
fileForm.map((item, index) => (
|
||||
<BorderBottomItem
|
||||
key={index}
|
||||
borderType={fileForm.length - 1 == index ? "none" : "bottom"}
|
||||
icon={<MaterialCommunityIcons name="file-outline" size={25} color={colors.text} />}
|
||||
title={item.name}
|
||||
titleWeight="normal"
|
||||
bgColor="transparent"
|
||||
onPress={() => { setIndexDelFile({ id: index, cat: "newFile" }); setModalFile(true) }}
|
||||
/>
|
||||
))
|
||||
}
|
||||
</View>
|
||||
</>
|
||||
}
|
||||
<ButtonSelect
|
||||
value="Pilih divisi penerima pengumuman"
|
||||
@@ -297,25 +302,30 @@ export default function EditAnnouncement() {
|
||||
{
|
||||
dataMember.length > 0
|
||||
&&
|
||||
<View style={[Styles.borderAll, Styles.round05, Styles.p10, { borderColor: colors.icon + '20' }]}>
|
||||
{
|
||||
dataMember.map((item: { name: any; Division: any }, index: any) => {
|
||||
return (
|
||||
<View key={index}>
|
||||
<Text style={[Styles.textDefaultSemiBold]}>{item.name}</Text>
|
||||
{
|
||||
item.Division.map((division: any, i: any) => (
|
||||
<View key={i} style={[Styles.rowItemsCenter, Styles.w90]}>
|
||||
<Entypo name="dot-single" size={24} color={colors.text} />
|
||||
<Text style={[Styles.textDefault]} numberOfLines={1} ellipsizeMode='tail'>{division.name}</Text>
|
||||
</View>
|
||||
))
|
||||
}
|
||||
</View>
|
||||
)
|
||||
})
|
||||
}
|
||||
</View>
|
||||
<>
|
||||
<View style={[Styles.rowSpaceBetween, Styles.mv05]}>
|
||||
<Text style={[Styles.textDefaultSemiBold]}>Divisi</Text>
|
||||
</View>
|
||||
<View style={[Styles.borderAll, Styles.round05, Styles.p10, { borderColor: colors.icon + '20' }]}>
|
||||
{
|
||||
dataMember.map((item: { name: any; Division: any }, index: any) => {
|
||||
return (
|
||||
<View key={index}>
|
||||
<Text style={[Styles.textDefaultSemiBold]}>{item.name}</Text>
|
||||
{
|
||||
item.Division.map((division: any, i: any) => (
|
||||
<View key={i} style={[Styles.rowItemsCenter, Styles.w90]}>
|
||||
<Entypo name="dot-single" size={24} color={colors.text} />
|
||||
<Text style={[Styles.textDefault]} numberOfLines={1} ellipsizeMode='tail'>{division.name}</Text>
|
||||
</View>
|
||||
))
|
||||
}
|
||||
</View>
|
||||
)
|
||||
})
|
||||
}
|
||||
</View>
|
||||
</>
|
||||
}
|
||||
</View>
|
||||
</ScrollView>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import AppHeader from "@/components/AppHeader";
|
||||
import ButtonSaveHeader from "@/components/buttonSaveHeader";
|
||||
import { InputForm } from "@/components/inputForm";
|
||||
import LoadingCenter from "@/components/loadingCenter";
|
||||
import Text from "@/components/Text";
|
||||
import { ConstEnv } from "@/constants/ConstEnv";
|
||||
import Styles from "@/constants/Styles";
|
||||
@@ -145,6 +146,7 @@ export default function EditBanner() {
|
||||
)
|
||||
}}
|
||||
/>
|
||||
{loading && <LoadingCenter />}
|
||||
<ScrollView showsVerticalScrollIndicator={false} style={[Styles.h100, { backgroundColor: colors.background }]}>
|
||||
<View style={[Styles.p15, Styles.mb100]}>
|
||||
<View style={[Styles.mb15]}>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import AppHeader from "@/components/AppHeader";
|
||||
import ButtonSaveHeader from "@/components/buttonSaveHeader";
|
||||
import { InputForm } from "@/components/inputForm";
|
||||
import LoadingCenter from "@/components/loadingCenter";
|
||||
import Text from "@/components/Text";
|
||||
import Styles from "@/constants/Styles";
|
||||
import { apiCreateBanner, apiGetBanner } from "@/lib/api";
|
||||
@@ -99,24 +100,8 @@ export default function CreateBanner() {
|
||||
<SafeAreaView style={[Styles.flex1, { backgroundColor: colors.background }]}>
|
||||
<Stack.Screen
|
||||
options={{
|
||||
// headerLeft: () => (
|
||||
// <ButtonBackHeader
|
||||
// onPress={() => {
|
||||
// router.back();
|
||||
// }}
|
||||
// />
|
||||
// ),
|
||||
headerTitle: "Tambah Banner",
|
||||
headerTitleAlign: "center",
|
||||
// headerRight: () => (
|
||||
// <ButtonSaveHeader
|
||||
// disable={title == "" || selectedImage == undefined || error || loading ? true : false}
|
||||
// category="create"
|
||||
// onPress={() => {
|
||||
// handleCreateEntity();
|
||||
// }}
|
||||
// />
|
||||
// ),
|
||||
header: () => (
|
||||
<AppHeader
|
||||
title="Fitur"
|
||||
@@ -135,6 +120,7 @@ export default function CreateBanner() {
|
||||
)
|
||||
}}
|
||||
/>
|
||||
{loading && <LoadingCenter />}
|
||||
<ScrollView showsVerticalScrollIndicator={false} style={[Styles.h100, { backgroundColor: colors.background }]}>
|
||||
<View style={[Styles.p15]}>
|
||||
<View style={[Styles.mb15]}>
|
||||
@@ -148,13 +134,13 @@ export default function CreateBanner() {
|
||||
) : (
|
||||
<Pressable
|
||||
onPress={pickImageAsync}
|
||||
style={[Styles.wrapPaper, Styles.contentItemCenter]}
|
||||
style={[Styles.wrapPaper, Styles.contentItemCenter, Styles.borderAll, { backgroundColor: colors.card, borderColor: colors.icon + '20' }]}
|
||||
>
|
||||
<View
|
||||
style={[Styles.contentItemCenter]}
|
||||
>
|
||||
<Entypo name="image" size={50} color={"#aeaeae"} />
|
||||
<Text style={[Styles.textInformation, Styles.mt05]}>
|
||||
<Entypo name="image" size={50} color={colors.dimmed} />
|
||||
<Text style={[Styles.textInformation, Styles.mt05, { color: colors.dimmed }]}>
|
||||
Mohon unggah gambar dalam resolusi 1650 x 720 pixel untuk
|
||||
memastikan
|
||||
</Text>
|
||||
|
||||
@@ -5,7 +5,7 @@ import ButtonSelect from "@/components/buttonSelect";
|
||||
import DrawerBottom from "@/components/drawerBottom";
|
||||
import ImageUser from "@/components/imageNew";
|
||||
import { InputForm } from "@/components/inputForm";
|
||||
import LoadingOverlay from "@/components/loadingOverlay";
|
||||
import LoadingCenter from "@/components/loadingCenter";
|
||||
import MenuItemRow from "@/components/menuItemRow";
|
||||
import ModalSelect from "@/components/modalSelect";
|
||||
import SelectForm from "@/components/selectForm";
|
||||
@@ -206,7 +206,7 @@ export default function CreateDiscussionGeneral() {
|
||||
)
|
||||
}}
|
||||
/>
|
||||
<LoadingOverlay visible={loading} />
|
||||
{loading && <LoadingCenter />}
|
||||
<ScrollView showsVerticalScrollIndicator={false} style={[Styles.h100, Styles.flex1, { backgroundColor: colors.background }]}>
|
||||
<View style={[Styles.p15, Styles.mb100]}>
|
||||
{
|
||||
@@ -253,22 +253,27 @@ export default function CreateDiscussionGeneral() {
|
||||
{
|
||||
fileForm.length > 0
|
||||
&&
|
||||
<View style={[Styles.borderAll, Styles.round05, Styles.p10, Styles.mb10, { borderColor: colors.icon + '20' }]}>
|
||||
<Text style={[Styles.textDefaultSemiBold]}>File</Text>
|
||||
{
|
||||
fileForm.map((item, index) => (
|
||||
<BorderBottomItem
|
||||
key={index}
|
||||
borderType={fileForm.length - 1 == index ? "none" : "bottom"}
|
||||
icon={<MaterialCommunityIcons name="file-outline" size={25} color={colors.text} />}
|
||||
title={item.name}
|
||||
bgColor="transparent"
|
||||
titleWeight="normal"
|
||||
onPress={() => { setIndexDelFile(index); setModalFile(true) }}
|
||||
/>
|
||||
))
|
||||
}
|
||||
</View>
|
||||
<>
|
||||
<View style={[Styles.rowSpaceBetween, Styles.mv05]}>
|
||||
<Text style={[Styles.textDefaultSemiBold]}>File</Text>
|
||||
<Text style={[Styles.textDefault]}>{fileForm.length} file</Text>
|
||||
</View>
|
||||
<View style={[Styles.borderAll, Styles.round05, Styles.p10, Styles.mb10, { borderColor: colors.icon + '20' }]}>
|
||||
{
|
||||
fileForm.map((item, index) => (
|
||||
<BorderBottomItem
|
||||
key={index}
|
||||
borderType={fileForm.length - 1 == index ? "none" : "bottom"}
|
||||
icon={<MaterialCommunityIcons name="file-outline" size={25} color={colors.text} />}
|
||||
title={item.name}
|
||||
bgColor="transparent"
|
||||
titleWeight="normal"
|
||||
onPress={() => { setIndexDelFile(index); setModalFile(true) }}
|
||||
/>
|
||||
))
|
||||
}
|
||||
</View>
|
||||
</>
|
||||
}
|
||||
<ButtonSelect
|
||||
value="Pilih Anggota"
|
||||
@@ -293,8 +298,8 @@ export default function CreateDiscussionGeneral() {
|
||||
entitiesMember.length > 0 &&
|
||||
<View>
|
||||
<View style={[Styles.rowSpaceBetween, Styles.mv05]}>
|
||||
<Text>Anggota</Text>
|
||||
<Text>Total {entitiesMember.length} Anggota</Text>
|
||||
<Text style={[Styles.textDefaultSemiBold]}>Anggota</Text>
|
||||
<Text style={[Styles.textDefault]}>{entitiesMember.length} Anggota</Text>
|
||||
</View>
|
||||
|
||||
<View style={[Styles.borderAll, Styles.round05, Styles.p10, { borderColor: colors.icon + '20' }]}>
|
||||
|
||||
@@ -5,7 +5,7 @@ import ButtonSaveHeader from "@/components/buttonSaveHeader";
|
||||
import ButtonSelect from "@/components/buttonSelect";
|
||||
import DrawerBottom from "@/components/drawerBottom";
|
||||
import { InputForm } from "@/components/inputForm";
|
||||
import LoadingOverlay from "@/components/loadingOverlay";
|
||||
import LoadingCenter from "@/components/loadingCenter";
|
||||
import MenuItemRow from "@/components/menuItemRow";
|
||||
import Styles from "@/constants/Styles";
|
||||
import { apiEditDiscussionGeneral, apiGetDiscussionGeneralOne } from "@/lib/api";
|
||||
@@ -199,7 +199,7 @@ export default function EditDiscussionGeneral() {
|
||||
)
|
||||
}}
|
||||
/>
|
||||
<LoadingOverlay visible={loading} />
|
||||
{loading && <LoadingCenter />}
|
||||
<ScrollView showsVerticalScrollIndicator={false} style={[Styles.h100, Styles.flex1, { backgroundColor: colors.background }]}>
|
||||
<View style={[Styles.p15]}>
|
||||
<InputForm
|
||||
@@ -229,35 +229,40 @@ export default function EditDiscussionGeneral() {
|
||||
{
|
||||
(fileForm.length > 0 || dataFile.filter((val) => !val.delete).length > 0)
|
||||
&&
|
||||
<View style={[Styles.borderAll, Styles.round05, Styles.p10, Styles.mb10, { borderColor: colors.icon + '20' }]}>
|
||||
<Text style={[Styles.textDefault]}>File</Text>
|
||||
{
|
||||
dataFile.filter((val) => !val.delete).map((item, index) => (
|
||||
<BorderBottomItem
|
||||
key={index}
|
||||
borderType={(fileForm.length + dataFile.length) > 1 ? "bottom" : "none"}
|
||||
icon={<MaterialCommunityIcons name="file-outline" size={25} color={colors.text} />}
|
||||
title={item.name + '.' + item.extension}
|
||||
titleWeight="normal"
|
||||
bgColor="transparent"
|
||||
onPress={() => { setIndexDelFile({ id: item.id, cat: "oldFile" }); setModalFile(true) }}
|
||||
/>
|
||||
))
|
||||
}
|
||||
{
|
||||
fileForm.map((item, index) => (
|
||||
<BorderBottomItem
|
||||
key={index}
|
||||
borderType={(fileForm.length + dataFile.length) > 1 ? "bottom" : "none"}
|
||||
icon={<MaterialCommunityIcons name="file-outline" size={25} color={colors.text} />}
|
||||
title={item.name}
|
||||
titleWeight="normal"
|
||||
bgColor="transparent"
|
||||
onPress={() => { setIndexDelFile({ id: index, cat: "newFile" }); setModalFile(true) }}
|
||||
/>
|
||||
))
|
||||
}
|
||||
</View>
|
||||
<>
|
||||
<View style={[Styles.rowSpaceBetween, Styles.mv05]}>
|
||||
<Text style={[Styles.textDefaultSemiBold]}>File</Text>
|
||||
<Text style={[Styles.textDefault]}>{fileForm.length + dataFile.filter((val) => !val.delete).length} file</Text>
|
||||
</View>
|
||||
<View style={[Styles.borderAll, Styles.round05, Styles.p10, Styles.mb10, { borderColor: colors.icon + '20' }]}>
|
||||
{
|
||||
dataFile.filter((val) => !val.delete).map((item, index) => (
|
||||
<BorderBottomItem
|
||||
key={index}
|
||||
borderType={dataFile.filter((val) => !val.delete).length - 1 == index && fileForm.length == 0 ? "none" : "bottom"}
|
||||
icon={<MaterialCommunityIcons name="file-outline" size={25} color={colors.text} />}
|
||||
title={item.name + '.' + item.extension}
|
||||
titleWeight="normal"
|
||||
bgColor="transparent"
|
||||
onPress={() => { setIndexDelFile({ id: item.id, cat: "oldFile" }); setModalFile(true) }}
|
||||
/>
|
||||
))
|
||||
}
|
||||
{
|
||||
fileForm.map((item, index) => (
|
||||
<BorderBottomItem
|
||||
key={index}
|
||||
borderType={fileForm.length - 1 == index ? "none" : "bottom"}
|
||||
icon={<MaterialCommunityIcons name="file-outline" size={25} color={colors.text} />}
|
||||
title={item.name}
|
||||
titleWeight="normal"
|
||||
bgColor="transparent"
|
||||
onPress={() => { setIndexDelFile({ id: index, cat: "newFile" }); setModalFile(true) }}
|
||||
/>
|
||||
))
|
||||
}
|
||||
</View>
|
||||
</>
|
||||
}
|
||||
</View>
|
||||
</ScrollView>
|
||||
|
||||
@@ -169,7 +169,7 @@ export default function AddMemberCalendarEvent() {
|
||||
return (
|
||||
<Pressable
|
||||
key={index}
|
||||
style={[Styles.itemSelectModal]}
|
||||
style={[Styles.itemSelectModal, {borderColor: colors.icon + '20'}]}
|
||||
onPress={() => {
|
||||
!found && onChoose(item.idUser, item.name, item.img)
|
||||
}}
|
||||
|
||||
@@ -90,7 +90,7 @@ export default function CalendarHistory() {
|
||||
<View style={[{ flex: 1 }]}>
|
||||
<FlatList data={item.data}
|
||||
renderItem={({ item, index }: { item: { title: string, timeStart: string, timeEnd: string }, index: number }) => (
|
||||
<View key={index} style={[Styles.mb05, Styles.w80]}>
|
||||
<View key={index} style={[Styles.mb05]}>
|
||||
<Text style={[Styles.textDefaultSemiBold]} numberOfLines={1} ellipsizeMode="tail">{item.title}</Text>
|
||||
<Text style={[Styles.textDefault]}>{item.timeStart} | {item.timeEnd}</Text>
|
||||
</View>
|
||||
|
||||
@@ -4,7 +4,7 @@ import ButtonSaveHeader from "@/components/buttonSaveHeader";
|
||||
import ButtonSelect from "@/components/buttonSelect";
|
||||
import DrawerBottom from "@/components/drawerBottom";
|
||||
import { InputForm } from "@/components/inputForm";
|
||||
import LoadingOverlay from "@/components/loadingOverlay";
|
||||
import LoadingCenter from "@/components/loadingCenter";
|
||||
import MenuItemRow from "@/components/menuItemRow";
|
||||
import Text from "@/components/Text";
|
||||
import Styles from "@/constants/Styles";
|
||||
@@ -168,7 +168,7 @@ export default function DiscussionDivisionEdit() {
|
||||
)
|
||||
}}
|
||||
/>
|
||||
<LoadingOverlay visible={loading} />
|
||||
{loading && <LoadingCenter />}
|
||||
<ScrollView showsVerticalScrollIndicator={false} style={[Styles.h100]}>
|
||||
<View style={[Styles.p15]}>
|
||||
<InputForm
|
||||
|
||||
@@ -4,7 +4,7 @@ import ButtonSaveHeader from "@/components/buttonSaveHeader"
|
||||
import ButtonSelect from "@/components/buttonSelect"
|
||||
import DrawerBottom from "@/components/drawerBottom"
|
||||
import { InputForm } from "@/components/inputForm"
|
||||
import LoadingOverlay from "@/components/loadingOverlay"
|
||||
import LoadingCenter from "@/components/loadingCenter"
|
||||
import MenuItemRow from "@/components/menuItemRow"
|
||||
import Text from "@/components/Text"
|
||||
import Styles from "@/constants/Styles"
|
||||
@@ -119,7 +119,7 @@ export default function CreateDiscussionDivision() {
|
||||
)
|
||||
}}
|
||||
/>
|
||||
<LoadingOverlay visible={loading} />
|
||||
{loading && <LoadingCenter />}
|
||||
<ScrollView showsVerticalScrollIndicator={false} style={[Styles.h100]}>
|
||||
<View style={[Styles.p15, Styles.mb100]}>
|
||||
<InputForm
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import AppHeader from "@/components/AppHeader";
|
||||
import ButtonSaveHeader from "@/components/buttonSaveHeader";
|
||||
import { InputForm } from "@/components/inputForm";
|
||||
import LoadingCenter from "@/components/loadingCenter";
|
||||
import ModalSelect from "@/components/modalSelect";
|
||||
import SelectForm from "@/components/selectForm";
|
||||
import Text from "@/components/Text";
|
||||
@@ -228,6 +229,7 @@ export default function CreateMember() {
|
||||
)
|
||||
}}
|
||||
/>
|
||||
{loading && <LoadingCenter />}
|
||||
<KeyboardAvoidingView
|
||||
style={[Styles.h100, { backgroundColor: colors.background }]}
|
||||
behavior={Platform.OS === 'ios' ? 'padding' : undefined}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import AppHeader from "@/components/AppHeader";
|
||||
import ButtonSaveHeader from "@/components/buttonSaveHeader";
|
||||
import { InputForm } from "@/components/inputForm";
|
||||
import LoadingCenter from "@/components/loadingCenter";
|
||||
import ModalSelect from "@/components/modalSelect";
|
||||
import SelectForm from "@/components/selectForm";
|
||||
import Text from "@/components/Text";
|
||||
@@ -261,7 +262,7 @@ export default function EditMember() {
|
||||
)
|
||||
}}
|
||||
/>
|
||||
|
||||
{loading && <LoadingCenter />}
|
||||
<KeyboardAvoidingView
|
||||
style={[Styles.h100, { backgroundColor: colors.background }]}
|
||||
behavior={Platform.OS === 'ios' ? 'padding' : undefined}
|
||||
|
||||
@@ -3,6 +3,7 @@ import BorderBottomItem from "@/components/borderBottomItem"
|
||||
import ButtonSaveHeader from "@/components/buttonSaveHeader"
|
||||
import ButtonSelect from "@/components/buttonSelect"
|
||||
import DrawerBottom from "@/components/drawerBottom"
|
||||
import LoadingCenter from "@/components/loadingCenter"
|
||||
import MenuItemRow from "@/components/menuItemRow"
|
||||
import Styles from "@/constants/Styles"
|
||||
import { apiAddFileProject, apiCheckFileProject } from "@/lib/api"
|
||||
@@ -155,13 +156,16 @@ export default function ProjectAddFile() {
|
||||
)
|
||||
}}
|
||||
/>
|
||||
<ScrollView style={[Styles.h100, { backgroundColor: colors.background }]}>
|
||||
<View style={[Styles.p15, Styles.mb100]}>
|
||||
{
|
||||
loading && <LoadingCenter size="large" />
|
||||
}
|
||||
<ScrollView style={[Styles.flex1, { backgroundColor: colors.background }]}>
|
||||
<View style={[Styles.p15]}>
|
||||
<ButtonSelect value="Upload File" onPress={pickDocumentAsync} />
|
||||
{
|
||||
listFile.length > 0 && (
|
||||
<View style={[Styles.mb15]}>
|
||||
<Text style={[Styles.textDefaultSemiBold, Styles.mv05]}>File</Text>
|
||||
<Text style={[Styles.textDefaultSemiBold, Styles.mv05, { color: colors.text }]}>File</Text>
|
||||
<View style={[Styles.wrapPaper, { backgroundColor: colors.card, borderColor: colors.background }]}>
|
||||
{
|
||||
listFile.map((item, index) => (
|
||||
@@ -182,9 +186,6 @@ export default function ProjectAddFile() {
|
||||
{
|
||||
loadingCheck && <ActivityIndicator size="small" />
|
||||
}
|
||||
{
|
||||
loading && <ActivityIndicator size="large" />
|
||||
}
|
||||
</View>
|
||||
</ScrollView>
|
||||
<DrawerBottom animation="slide" isVisible={isModal} setVisible={setModal} title="Menu">
|
||||
|
||||
@@ -100,7 +100,7 @@ export default function AddMemberProject() {
|
||||
<Stack.Screen
|
||||
options={{
|
||||
// headerLeft: () => <ButtonBackHeader onPress={() => { router.back() }} />,
|
||||
headerTitle: 'Tambah Anggota Kegiatan',
|
||||
headerTitle: 'Tambah Anggota',
|
||||
headerTitleAlign: 'center',
|
||||
// headerRight: () => (
|
||||
// <ButtonSaveHeader
|
||||
@@ -113,7 +113,7 @@ export default function AddMemberProject() {
|
||||
// )
|
||||
header: () => (
|
||||
<AppHeader
|
||||
title="Tambah Anggota Kegiatan"
|
||||
title="Tambah Anggota"
|
||||
showBack={true}
|
||||
onPressLeft={() => router.back()}
|
||||
right={
|
||||
@@ -165,7 +165,7 @@ export default function AddMemberProject() {
|
||||
return (
|
||||
<Pressable
|
||||
key={index}
|
||||
style={[Styles.itemSelectModal]}
|
||||
style={[Styles.itemSelectModal, { borderColor: colors.icon + '20' }]}
|
||||
onPress={() => {
|
||||
!found && onChoose(item.id, item.name, item.img)
|
||||
}}
|
||||
|
||||
@@ -197,7 +197,7 @@ export default function ProjectAddTask() {
|
||||
/>
|
||||
</View>
|
||||
<View style={[Styles.mv10]}>
|
||||
<View style={[Styles.rowSpaceBetween]}>
|
||||
<View style={[Styles.rowSpaceBetween, Styles.mb10]}>
|
||||
<View style={[Styles.w48]}>
|
||||
<Text style={[Styles.mb05]}>
|
||||
Tanggal Mulai <Text style={{ color: colors.error }}>*</Text>
|
||||
|
||||
@@ -5,6 +5,7 @@ import ButtonSelect from "@/components/buttonSelect";
|
||||
import DrawerBottom from "@/components/drawerBottom";
|
||||
import ImageUser from "@/components/imageNew";
|
||||
import { InputForm } from "@/components/inputForm";
|
||||
import LoadingCenter from "@/components/loadingCenter";
|
||||
import MenuItemRow from "@/components/menuItemRow";
|
||||
import ModalSelect from "@/components/modalSelect";
|
||||
import SectionListAddTask from "@/components/project/sectionListAddTask";
|
||||
@@ -230,6 +231,9 @@ export default function CreateProject() {
|
||||
)
|
||||
}}
|
||||
/>
|
||||
{
|
||||
loading && <LoadingCenter />
|
||||
}
|
||||
<ScrollView
|
||||
showsVerticalScrollIndicator={false}
|
||||
style={[Styles.h100, { backgroundColor: colors.background }]}
|
||||
|
||||
@@ -183,7 +183,7 @@ export default function CreateProjectAddTask() {
|
||||
/>
|
||||
</View>
|
||||
<View style={[Styles.mv10]}>
|
||||
<View style={[Styles.rowSpaceBetween]}>
|
||||
<View style={[Styles.rowSpaceBetween, Styles.mb10]}>
|
||||
<View style={[{ width: "48%" }]}>
|
||||
<Text style={[Styles.mb05]}>
|
||||
Tanggal Mulai <Text style={{ color: colors.error }}>*</Text>
|
||||
|
||||
@@ -233,7 +233,7 @@ export default function UpdateProjectTask() {
|
||||
|
||||
</View>
|
||||
<View style={[Styles.mv10]}>
|
||||
<View style={[Styles.rowSpaceBetween]}>
|
||||
<View style={[Styles.rowSpaceBetween, Styles.mb10]}>
|
||||
<View style={[{ width: '48%' }]}>
|
||||
<Text style={[Styles.mb05]}>Tanggal Mulai <Text style={{ color: colors.error }}>*</Text></Text>
|
||||
<View style={[Styles.wrapPaper, Styles.noShadow, Styles.borderAll, Styles.p10, { backgroundColor: colors.card, borderColor: colors.icon + '20' }]}>
|
||||
|
||||
@@ -31,15 +31,14 @@ export default function HeaderRightAnnouncementDetail({ id }: Props) {
|
||||
const hasil = await decryptToken(String(token?.current))
|
||||
const response = await apiDeleteAnnouncement({ user: hasil }, id)
|
||||
if (response.success) {
|
||||
dispatch(setUpdateAnnouncement(!update))
|
||||
setVisible(false)
|
||||
Toast.show({ type: 'small', text1: 'Berhasil menghapus data', })
|
||||
router.back()
|
||||
dispatch(setUpdateAnnouncement(!update))
|
||||
return Toast.show({ type: 'small', text1: 'Berhasil menghapus data', })
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
} finally {
|
||||
setVisible(false)
|
||||
setShowDeleteModal(false)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ export default function ButtonNextHeader({ onPress, disable }: Props) {
|
||||
return (
|
||||
<>
|
||||
<ButtonHeader
|
||||
item={<Feather name="chevron-right" size={20} color={disable ? "grey" : "white"} />}
|
||||
item={<Feather name="chevron-right" size={25} color={disable ? "grey" : "white"} />}
|
||||
onPress={() => {
|
||||
!disable && onPress && onPress()
|
||||
}}
|
||||
|
||||
21
components/loadingCenter.tsx
Normal file
21
components/loadingCenter.tsx
Normal file
@@ -0,0 +1,21 @@
|
||||
import Text from '@/components/Text';
|
||||
import Styles from '@/constants/Styles';
|
||||
import { useTheme } from '@/providers/ThemeProvider';
|
||||
import { ActivityIndicator, View } from 'react-native';
|
||||
|
||||
type Props = {
|
||||
size?: 'small' | 'large'
|
||||
}
|
||||
|
||||
export default function LoadingCenter({ size = 'large' }: Props) {
|
||||
const { colors } = useTheme();
|
||||
|
||||
return (
|
||||
<View style={[Styles.loadingCenter]}>
|
||||
<View style={[Styles.loadingBox, Styles.shadowBox, { backgroundColor: colors.modalBackground }]}>
|
||||
<ActivityIndicator size={size} color={colors.dimmed} />
|
||||
<Text style={{ color: colors.dimmed }}>Loading</Text>
|
||||
</View>
|
||||
</View>
|
||||
)
|
||||
}
|
||||
@@ -157,7 +157,7 @@ export default function ModalSelectMultiple({ open, close, title, category, choo
|
||||
{
|
||||
data.map((item: any, index: number) => {
|
||||
return (
|
||||
<Pressable key={index} style={[Styles.itemSelectModal]} onPress={() => {
|
||||
<Pressable key={index} style={[Styles.itemSelectModal, { borderColor: colors.icon + 20 }]} onPress={() => {
|
||||
handleDivisionClick(index)
|
||||
}}>
|
||||
<Text numberOfLines={1} style={[Styles.w80]}>{item.name}</Text>
|
||||
@@ -175,7 +175,7 @@ export default function ModalSelectMultiple({ open, close, title, category, choo
|
||||
data.map((item: any, index: number) => {
|
||||
return (
|
||||
<View key={index}>
|
||||
<Pressable style={[Styles.itemSelectModal]} onPress={() => { handleGroupCheck(item.id) }}>
|
||||
<Pressable style={[Styles.itemSelectModal, { borderColor: colors.icon + 20 }]} onPress={() => { handleGroupCheck(item.id) }}>
|
||||
<Text style={[Styles.textMediumSemiBold]}>{item.name}</Text>
|
||||
{
|
||||
checked[item.id] && checked[item.id]?.length === item.Division?.length
|
||||
@@ -188,7 +188,7 @@ export default function ModalSelectMultiple({ open, close, title, category, choo
|
||||
{
|
||||
item.Division.map((child: any, v: number) => {
|
||||
return (
|
||||
<Pressable key={v} style={[Styles.itemSelectModal]} onPress={() => { handleCheck(item.id, child.id) }}>
|
||||
<Pressable key={v} style={[Styles.itemSelectModal, { borderColor: colors.icon + 20 }]} onPress={() => { handleCheck(item.id, child.id) }}>
|
||||
<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} color={colors.text} />
|
||||
|
||||
@@ -77,7 +77,7 @@ export default function ModalListDetailTugasProject({ isVisible, setVisible, idT
|
||||
getItem={getItem}
|
||||
renderItem={({ item, index }: { item: Props, index: number }) => {
|
||||
return (
|
||||
<View key={index} style={[Styles.borderBottom, Styles.pv05, { borderBottomColor: colors.icon }]}>
|
||||
<View key={index} style={[Styles.borderBottom, Styles.pv05, { borderBottomColor: colors.icon + "20" }]}>
|
||||
<Text style={[Styles.textDefaultSemiBold]}>{item.date}</Text>
|
||||
<View style={[Styles.rowSpaceBetween]}>
|
||||
<View style={[{ width: "48%" }]}>
|
||||
|
||||
@@ -157,7 +157,6 @@ export default function SectionFile({ status, member, refreshing }: { status: nu
|
||||
title={item.name + '.' + item.extension}
|
||||
titleWeight="normal"
|
||||
onPress={() => { setSelectFile(item); setModal(true) }}
|
||||
width={65}
|
||||
/>
|
||||
)
|
||||
})
|
||||
|
||||
@@ -96,7 +96,6 @@ export default function SectionLink({ status, member, refreshing }: { status: nu
|
||||
title={item.link}
|
||||
titleWeight="normal"
|
||||
onPress={() => { setSelectLink(item); setModal(true) }}
|
||||
width={65}
|
||||
/>
|
||||
)
|
||||
})
|
||||
|
||||
@@ -151,7 +151,6 @@ export default function SectionFileTask({ refreshing, isMemberDivision }: { refr
|
||||
title={item.name + '.' + item.extension}
|
||||
titleWeight="normal"
|
||||
onPress={() => { setSelectFile(item); setModal(true) }}
|
||||
width={65}
|
||||
/>
|
||||
)
|
||||
})
|
||||
|
||||
@@ -88,7 +88,6 @@ export default function SectionLinkTask({ refreshing, isMemberDivision }: { refr
|
||||
title={item.link}
|
||||
titleWeight="normal"
|
||||
onPress={() => { setSelectLink(item); setModal(true) }}
|
||||
width={65}
|
||||
/>
|
||||
)
|
||||
})
|
||||
|
||||
@@ -465,6 +465,13 @@ const Styles = StyleSheet.create({
|
||||
shadowRadius: 0,
|
||||
elevation: 0,
|
||||
},
|
||||
shadowBox: {
|
||||
shadowColor: '#171717',
|
||||
shadowOffset: { width: 0, height: 0 },
|
||||
shadowOpacity: 0.1,
|
||||
shadowRadius: 4,
|
||||
elevation: 5,
|
||||
},
|
||||
contentItemCenter: {
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center'
|
||||
@@ -860,6 +867,24 @@ const Styles = StyleSheet.create({
|
||||
},
|
||||
alignStart: {
|
||||
alignItems: 'flex-start'
|
||||
},
|
||||
loadingCenter: {
|
||||
position: 'absolute',
|
||||
top: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
zIndex: 999,
|
||||
backgroundColor: 'rgba(0,0,0,0.3)',
|
||||
},
|
||||
loadingBox: {
|
||||
paddingVertical: 15,
|
||||
paddingHorizontal: 40,
|
||||
borderRadius: 5,
|
||||
alignItems: 'center',
|
||||
gap: 10,
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user