Merge pull request 'amalia/19-feb-26' (#26) from amalia/19-feb-26 into join

Reviewed-on: #26
This commit is contained in:
2026-02-20 10:50:38 +08:00
49 changed files with 237 additions and 166 deletions

View File

@@ -20,10 +20,12 @@ import { StatusBar } from 'expo-status-bar';
import { useEffect } from "react"; import { useEffect } from "react";
import { Easing, Notifier } from 'react-native-notifier'; import { Easing, Notifier } from 'react-native-notifier';
import { Provider } from "react-redux"; import { Provider } from "react-redux";
import { useTheme } from "@/providers/ThemeProvider";
export default function RootLayout() { export default function RootLayout() {
const { token, decryptToken, isLoading } = useAuthSession() const { token, decryptToken, isLoading } = useAuthSession()
const pathname = usePathname() const pathname = usePathname()
const { colors } = useTheme()
async function handleReadNotification(id: string, category: string, idContent: string, title: string) { async function handleReadNotification(id: string, category: string, idContent: string, title: string) {
try { try {
@@ -93,11 +95,10 @@ export default function RootLayout() {
<Stack screenOptions={{ <Stack screenOptions={{
headerShown: true, headerShown: true,
animation: "slide_from_right", animation: "slide_from_right",
// ⬇️ PENTING BANGET
animationTypeForReplace: "pop", animationTypeForReplace: "pop",
fullScreenGestureEnabled: true, fullScreenGestureEnabled: true,
gestureEnabled: true, gestureEnabled: true,
contentStyle: { backgroundColor: colors.header },
}} > }} >
<Stack.Screen name="home" options={{ title: 'Home' }} /> <Stack.Screen name="home" options={{ title: 'Home' }} />
<Stack.Screen name="feature" options={{ title: 'Fitur' }} /> <Stack.Screen name="feature" options={{ title: 'Fitur' }} />

View File

@@ -177,7 +177,7 @@ export default function DetailAnnouncement() {
}; };
return ( return (
<SafeAreaView style={{ flex: 1, backgroundColor: colors.background }}> <SafeAreaView style={[Styles.flex1, { backgroundColor: colors.background }]}>
<Stack.Screen <Stack.Screen
options={{ options={{
// headerLeft: () => <ButtonBackHeader onPress={() => { router.back() }} />, // headerLeft: () => <ButtonBackHeader onPress={() => { router.back() }} />,
@@ -211,7 +211,7 @@ export default function DetailAnnouncement() {
<View> <View>
<View style={[Styles.rowOnly]}> <View style={[Styles.rowOnly]}>
<Skeleton width={30} height={30} borderRadius={10} /> <Skeleton width={30} height={30} borderRadius={10} />
<View style={[{ flex: 1 }, Styles.ph05]}> <View style={[Styles.flex1, Styles.ph05]}>
<Skeleton width={100} widthType="percent" height={30} borderRadius={10} /> <Skeleton width={100} widthType="percent" height={30} borderRadius={10} />
</View> </View>
</View> </View>
@@ -221,7 +221,7 @@ export default function DetailAnnouncement() {
</View> </View>
: :
<> <>
<View style={[Styles.rowItemsCenter, { alignItems: 'flex-start' }]}> <View style={[Styles.rowOnly, Styles.alignStart]}>
<MaterialIcons name="campaign" size={25} color={colors.text} style={[Styles.mr05]} /> <MaterialIcons name="campaign" size={25} color={colors.text} style={[Styles.mr05]} />
<Text style={[Styles.textDefaultSemiBold, Styles.w90, Styles.mt02]}>{data?.title}</Text> <Text style={[Styles.textDefaultSemiBold, Styles.w90, Styles.mt02]}>{data?.title}</Text>
</View> </View>
@@ -318,7 +318,7 @@ export default function DetailAnnouncement() {
accessibilityRole="button" accessibilityRole="button"
accessibilityLabel="Close image viewer" accessibilityLabel="Close image viewer"
> >
<Text style={{ color: 'white', fontSize: 26 }}></Text> <Text style={[Styles.textWhite, Styles.font26]}></Text>
</Pressable> </Pressable>
{/* MENU */} {/* MENU */}
@@ -328,17 +328,17 @@ export default function DetailAnnouncement() {
accessibilityLabel="Download or share image" accessibilityLabel="Download or share image"
disabled={loadingOpen} disabled={loadingOpen}
> >
<Text style={{ color: loadingOpen ? 'gray' : 'white', fontSize: 26 }}></Text> <Text style={[{ color: loadingOpen ? 'gray' : 'white' }, Styles.font26]}></Text>
</Pressable> </Pressable>
</View> </View>
)} )}
FooterComponent={({ imageIndex }) => ( FooterComponent={({ imageIndex }) => (
<View style={{ <View style={[
paddingBottom: 20, Styles.pb20,
paddingHorizontal: 16, Styles.ph16,
alignItems: 'center', Styles.alignCenter,
}}> ]}>
<Text style={{ color: 'white', fontSize: 16 }}>{chooseFile?.name}.{chooseFile?.extension}</Text> <Text style={[Styles.textWhite, Styles.font16]}>{chooseFile?.name}.{chooseFile?.extension}</Text>
</View> </View>
)} )}
/> />

View File

@@ -17,7 +17,7 @@ import { Entypo, Ionicons, MaterialCommunityIcons } from "@expo/vector-icons";
import * as DocumentPicker from "expo-document-picker"; import * as DocumentPicker from "expo-document-picker";
import { router, Stack } from "expo-router"; import { router, Stack } from "expo-router";
import React, { useEffect, useState } from "react"; import React, { useEffect, useState } from "react";
import { SafeAreaView, ScrollView, StyleSheet, View } from "react-native"; import { SafeAreaView, ScrollView, 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";
@@ -131,7 +131,7 @@ export default function CreateAnnouncement() {
} }
return ( return (
<SafeAreaView style={{ flex: 1, backgroundColor: colors.background }}> <SafeAreaView style={[Styles.flex1, { backgroundColor: colors.background }]}>
<Stack.Screen <Stack.Screen
options={{ options={{
// headerLeft: () => ( // headerLeft: () => (
@@ -281,15 +281,4 @@ export default function CreateAnnouncement() {
); );
} }
const styles = StyleSheet.create({
container: {
padding: 20,
},
textArea: {
height: 100, // Or use flex-based sizing
borderColor: 'gray',
borderWidth: 1,
padding: 10,
textAlignVertical: 'top', // Important for Android to align text at the top
},
});

View File

@@ -85,11 +85,11 @@ export default function Announcement() {
}) })
return ( return (
<View style={[Styles.p15, { flex: 1, backgroundColor: colors.background }]}> <View style={[Styles.p15, Styles.flex1, { backgroundColor: colors.background }]}>
<View> <View>
<InputSearch onChange={setSearch} /> <InputSearch onChange={setSearch} />
</View> </View>
<View style={[{ flex: 2 }, Styles.mt05]}> <View style={[Styles.flex2, Styles.mt05]}>
{ {
loading ? loading ?
arrSkeleton.map((item, index) => { arrSkeleton.map((item, index) => {
@@ -113,7 +113,7 @@ export default function Announcement() {
bgColor="transparent" bgColor="transparent"
icon={ icon={
// <View style={[Styles.iconContent]}> // <View style={[Styles.iconContent]}>
<MaterialIcons name="campaign" size={25} color={'white'} /> <MaterialIcons name="campaign" size={25} color={colors.text} />
// </View> // </View>
} }
title={item.title} title={item.title}
@@ -135,7 +135,7 @@ export default function Announcement() {
} }
/> />
: :
<Text style={[Styles.textDefault, { textAlign: 'center', color: colors.dimmed }]}>Tidak ada pengumuman</Text> <Text style={[Styles.textDefault, Styles.textCenter, { color: colors.dimmed }]}>Tidak ada pengumuman</Text>
} }
</View> </View>
</View> </View>

View File

@@ -114,7 +114,7 @@ export default function EditBanner() {
}; };
return ( return (
<SafeAreaView style={{ flex: 1, backgroundColor: colors.background }}> <SafeAreaView style={[Styles.flex1, { backgroundColor: colors.background }]}>
<Stack.Screen <Stack.Screen
options={{ options={{
// headerLeft: () => ( // headerLeft: () => (
@@ -156,7 +156,7 @@ export default function EditBanner() {
? selectedImage ? selectedImage
: selectedImage.uri : selectedImage.uri
} }
style={{ resizeMode: "contain", width: "100%", height: 100 }} style={[Styles.resizeContain, Styles.w100, { height: 100 }]}
/> />
</Pressable> </Pressable>
) : ( ) : (
@@ -165,7 +165,7 @@ export default function EditBanner() {
style={[Styles.wrapPaper, Styles.contentItemCenter]} style={[Styles.wrapPaper, Styles.contentItemCenter]}
> >
<View <View
style={{ justifyContent: "center", alignItems: "center" }} style={[Styles.contentItemCenter]}
> >
<Entypo name="image" size={50} color={"#aeaeae"} /> <Entypo name="image" size={50} color={"#aeaeae"} />
<Text style={[Styles.textInformation, Styles.mt05]}> <Text style={[Styles.textInformation, Styles.mt05]}>

View File

@@ -96,7 +96,7 @@ export default function CreateBanner() {
}; };
return ( return (
<SafeAreaView style={{ flex: 1, backgroundColor: colors.background }}> <SafeAreaView style={[Styles.flex1, { backgroundColor: colors.background }]}>
<Stack.Screen <Stack.Screen
options={{ options={{
// headerLeft: () => ( // headerLeft: () => (
@@ -142,7 +142,7 @@ export default function CreateBanner() {
<Pressable onPress={pickImageAsync}> <Pressable onPress={pickImageAsync}>
<Image <Image
src={selectedImage} src={selectedImage}
style={{ resizeMode: "contain", width: "100%", height: 100 }} style={[Styles.resizeContain, Styles.w100, { height: 100 }]}
/> />
</Pressable> </Pressable>
) : ( ) : (
@@ -151,7 +151,7 @@ export default function CreateBanner() {
style={[Styles.wrapPaper, Styles.contentItemCenter]} style={[Styles.wrapPaper, Styles.contentItemCenter]}
> >
<View <View
style={{ justifyContent: "center", alignItems: "center" }} style={[Styles.contentItemCenter]}
> >
<Entypo name="image" size={50} color={"#aeaeae"} /> <Entypo name="image" size={50} color={"#aeaeae"} />
<Text style={[Styles.textInformation, Styles.mt05]}> <Text style={[Styles.textInformation, Styles.mt05]}>

View File

@@ -108,7 +108,7 @@ export default function BannerList() {
return ( return (
<SafeAreaView style={{ flex: 1, backgroundColor: colors.background }}> <SafeAreaView style={[Styles.flex1, { backgroundColor: colors.background }]}>
<Stack.Screen <Stack.Screen
options={{ options={{
// headerLeft: () => <ButtonBackHeader onPress={() => { router.back() }} />, // headerLeft: () => <ButtonBackHeader onPress={() => { router.back() }} />,
@@ -158,13 +158,12 @@ export default function BannerList() {
/> />
} }
title={index.title} title={index.title}
width={65}
/> />
))} ))}
</View> </View>
: :
<View style={[Styles.p15, Styles.mb100]}> <View style={[Styles.p15, Styles.mb100]}>
<Text style={[Styles.textDefault, { textAlign: 'center' }]}>Tidak ada data</Text> <Text style={[Styles.textDefault, Styles.textCenter]}>Tidak ada data</Text>
</View> </View>
} }

View File

@@ -239,7 +239,7 @@ export default function DetailDiscussionGeneral() {
) )
}} }}
/> />
<View style={{ flex: 1, backgroundColor: colors.background }}> <View style={[Styles.flex1, { backgroundColor: colors.background }]}>
<ScrollView <ScrollView
showsVerticalScrollIndicator={false} showsVerticalScrollIndicator={false}
style={[Styles.h100, { backgroundColor: colors.background }]} style={[Styles.h100, { backgroundColor: colors.background }]}
@@ -259,7 +259,8 @@ export default function DetailDiscussionGeneral() {
<BorderBottomItem2 <BorderBottomItem2
dataFile={fileDiscussion} dataFile={fileDiscussion}
descEllipsize={false} descEllipsize={false}
borderType="bottom" borderType="all"
bgColor="white"
icon={ icon={
<View style={[Styles.iconContent]}> <View style={[Styles.iconContent]}>
<MaterialIcons name="chat" size={25} color={'black'} /> <MaterialIcons name="chat" size={25} color={'black'} />
@@ -287,7 +288,7 @@ export default function DetailDiscussionGeneral() {
} }
/> />
} }
<View style={[Styles.p15]}> <View style={[Styles.mt10]}>
{ {
loadingKomentar ? loadingKomentar ?
arrSkeleton.map((item: any, i: number) => { arrSkeleton.map((item: any, i: number) => {
@@ -300,7 +301,7 @@ export default function DetailDiscussionGeneral() {
return ( return (
<BorderBottomItem <BorderBottomItem
key={i} key={i}
borderType="bottom" borderType="all"
colorPress colorPress
icon={ icon={
<ImageUser src={`${ConstEnv.url_storage}/files/${item.img}`} size="xs" /> <ImageUser src={`${ConstEnv.url_storage}/files/${item.img}`} size="xs" />
@@ -310,7 +311,7 @@ export default function DetailDiscussionGeneral() {
desc={item.comment} desc={item.comment}
rightBottomInfo={item.isEdited ? "Edited" : ""} rightBottomInfo={item.isEdited ? "Edited" : ""}
descEllipsize={detailMore.includes(item.id) ? false : true} descEllipsize={detailMore.includes(item.id) ? false : true}
bgColor="transparent" bgColor="white"
onPress={() => { onPress={() => {
setDetailMore((prev: any) => { setDetailMore((prev: any) => {
if (prev.includes(item.id)) { if (prev.includes(item.id)) {
@@ -401,7 +402,7 @@ export default function DetailDiscussionGeneral() {
} }
/> />
: :
<View style={[Styles.pv20, { alignItems: 'center' }]}> <View style={[Styles.pv20, Styles.itemsCenter]}>
<Text style={[Styles.textInformation, { color: colors.dimmed }]}> <Text style={[Styles.textInformation, { color: colors.dimmed }]}>
{ {
data?.status == 2 ? "Diskusi telah ditutup" : data?.isActive == false ? "Diskusi telah diarsipkan" : "Hanya anggota diskusi yang dapat memberikan komentar" data?.status == 2 ? "Diskusi telah ditutup" : data?.isActive == false ? "Diskusi telah diarsipkan" : "Hanya anggota diskusi yang dapat memberikan komentar"

View File

@@ -127,7 +127,7 @@ export default function AddMemberDiscussionDetail() {
) )
}} }}
/> />
<View style={[Styles.p15, {flex: 1, backgroundColor: colors.background }]}> <View style={[Styles.p15, Styles.flex1, { backgroundColor: colors.background }]}>
<InputSearch onChange={setSearch} value={search} /> <InputSearch onChange={setSearch} value={search} />
{ {
@@ -149,7 +149,7 @@ export default function AddMemberDiscussionDetail() {
</View> </View>
: :
<Text style={[Styles.textDefault, Styles.pv05, { textAlign: 'center', color: colors.dimmed }]}>Tidak ada member yang dipilih</Text> <Text style={[Styles.textDefault, Styles.pv05, Styles.textCenter, { color: colors.dimmed }]}>Tidak ada member yang dipilih</Text>
} }
<ScrollView <ScrollView
showsVerticalScrollIndicator={false} showsVerticalScrollIndicator={false}
@@ -172,7 +172,7 @@ export default function AddMemberDiscussionDetail() {
<View style={[Styles.ml10]}> <View style={[Styles.ml10]}>
<Text style={[Styles.textDefault]}>{item.name}</Text> <Text style={[Styles.textDefault]}>{item.name}</Text>
{ {
found && <Text style={[Styles.textInformation, {color: colors.dimmed}]}>sudah menjadi anggota</Text> found && <Text style={[Styles.textInformation, { color: colors.dimmed }]}>sudah menjadi anggota</Text>
} }
</View> </View>
</View> </View>
@@ -184,7 +184,7 @@ export default function AddMemberDiscussionDetail() {
} }
) )
: :
<Text style={[Styles.textDefault, { textAlign: 'center' }]}>Tidak ada data</Text> <Text style={[Styles.textDefault, Styles.textCenter]}>Tidak ada data</Text>
} }
</ScrollView> </ScrollView>
</View> </View>

View File

@@ -165,7 +165,7 @@ export default function CreateDiscussionGeneral() {
} }
return ( return (
<SafeAreaView style={{ flex: 1, backgroundColor: colors.background }}> <SafeAreaView style={[Styles.flex1, { backgroundColor: colors.background }]}>
<Stack.Screen <Stack.Screen
options={{ options={{
// headerLeft: () => ( // headerLeft: () => (
@@ -207,7 +207,7 @@ export default function CreateDiscussionGeneral() {
}} }}
/> />
<LoadingOverlay visible={loading} /> <LoadingOverlay visible={loading} />
<ScrollView showsVerticalScrollIndicator={false} style={[Styles.h100, { backgroundColor: colors.background }]}> <ScrollView showsVerticalScrollIndicator={false} style={[Styles.h100, Styles.flex1, { backgroundColor: colors.background }]}>
<View style={[Styles.p15, Styles.mb100]}> <View style={[Styles.p15, Styles.mb100]}>
{ {
(entityUser.role == "supadmin" || (entityUser.role == "supadmin" ||

View File

@@ -164,7 +164,7 @@ export default function EditDiscussionGeneral() {
} }
return ( return (
<SafeAreaView style={{ flex: 1, backgroundColor: colors.background }}> <SafeAreaView style={[Styles.flex1, { backgroundColor: colors.background }]}>
<Stack.Screen <Stack.Screen
options={{ options={{
// headerLeft: () => ( // headerLeft: () => (
@@ -200,7 +200,7 @@ export default function EditDiscussionGeneral() {
}} }}
/> />
<LoadingOverlay visible={loading} /> <LoadingOverlay visible={loading} />
<ScrollView showsVerticalScrollIndicator={false} style={[Styles.h100, { backgroundColor: colors.background }]}> <ScrollView showsVerticalScrollIndicator={false} style={[Styles.h100, Styles.flex1, { backgroundColor: colors.background }]}>
<View style={[Styles.p15]}> <View style={[Styles.p15]}>
<InputForm <InputForm
label="Judul" label="Judul"

View File

@@ -99,7 +99,7 @@ export default function Discussion() {
}) })
return ( return (
<View style={[Styles.p15, { flex: 1, backgroundColor: colors.background }]}> <View style={[Styles.p15, Styles.flex1, { backgroundColor: colors.background }]}>
<View> <View>
{ {
entityUser.role != "user" && entityUser.role != "coadmin" && entityUser.role != "user" && entityUser.role != "coadmin" &&
@@ -130,7 +130,7 @@ export default function Discussion() {
</View> </View>
} }
</View> </View>
<View style={[{ flex: 2 }, Styles.mt05]}> <View style={[Styles.flex2, Styles.mt05]}>
{ {
loading ? loading ?
arrSkeleton.map((item: any, i: number) => { arrSkeleton.map((item: any, i: number) => {
@@ -153,9 +153,9 @@ export default function Discussion() {
onPress={() => { router.push(`/discussion/${item.id}`) }} onPress={() => { router.push(`/discussion/${item.id}`) }}
borderType="bottom" borderType="bottom"
icon={ icon={
<View style={[Styles.iconContent]}> // <View style={[Styles.iconContent]}>
<MaterialIcons name="chat" size={25} color={'black'} /> <MaterialIcons name="chat" size={25} color={colors.text} />
</View> // </View>
} }
title={item.title} title={item.title}
subtitle={ subtitle={
@@ -187,7 +187,7 @@ export default function Discussion() {
} }
/> />
: :
<Text style={[Styles.textDefault, { textAlign: 'center', color: colors.dimmed }]}>Tidak ada data</Text> <Text style={[Styles.textDefault, Styles.textCenter, { color: colors.dimmed }]}>Tidak ada data</Text>
} }
</View> </View>
</View> </View>

View File

@@ -75,7 +75,7 @@ export default function MemberDiscussionDetail() {
} }
return ( return (
<SafeAreaView style={{ flex: 1, backgroundColor: colors.background }}> <SafeAreaView style={[Styles.flex1, { backgroundColor: colors.background }]}>
<Stack.Screen <Stack.Screen
options={{ options={{
// headerLeft: () => <ButtonBackHeader onPress={() => { router.back() }} />, // headerLeft: () => <ButtonBackHeader onPress={() => { router.back() }} />,
@@ -90,7 +90,7 @@ export default function MemberDiscussionDetail() {
) )
}} }}
/> />
<ScrollView style={{ backgroundColor: colors.background }}> <ScrollView style={[Styles.h100, Styles.flex1, { backgroundColor: colors.background }]}>
<View style={[Styles.p15]}> <View style={[Styles.p15]}>
<Text style={[Styles.textDefault, Styles.mv05]}>{data.length} Anggota</Text> <Text style={[Styles.textDefault, Styles.mv05]}>{data.length} Anggota</Text>
<View style={[Styles.wrapPaper, { backgroundColor: colors.card, borderColor: colors.background }]}> <View style={[Styles.wrapPaper, { backgroundColor: colors.card, borderColor: colors.background }]}>

View File

@@ -156,7 +156,7 @@ export default function CreateCalendarAddMember() {
return ( return (
<Pressable <Pressable
key={index} key={index}
style={[Styles.itemSelectModal, {borderColor: colors.icon + '20'}]} style={[Styles.itemSelectModal, { borderColor: colors.icon + '20' }]}
onPress={() => { onChoose(item.idUser, item.name, item.img) }} onPress={() => { onChoose(item.idUser, item.name, item.img) }}
> >
<View style={[Styles.rowItemsCenter, Styles.w70]}> <View style={[Styles.rowItemsCenter, Styles.w70]}>

View File

@@ -327,7 +327,8 @@ export default function DiscussionDetail() {
<BorderBottomItem2 <BorderBottomItem2
dataFile={fileDiscussion} dataFile={fileDiscussion}
descEllipsize={false} descEllipsize={false}
borderType="bottom" bgColor="white"
borderType="all"
icon={ icon={
<ImageUser <ImageUser
src={`${ConstEnv.url_storage}/files/${data?.user_img}`} src={`${ConstEnv.url_storage}/files/${data?.user_img}`}
@@ -364,7 +365,7 @@ export default function DiscussionDetail() {
/> />
} }
<View style={[Styles.p15]}> <View style={[Styles.mt10]}>
{ {
loadingKomentar ? loadingKomentar ?
arrSkeleton.map((item, index) => ( arrSkeleton.map((item, index) => (
@@ -374,7 +375,7 @@ export default function DiscussionDetail() {
dataComment.map((item, index) => ( dataComment.map((item, index) => (
<BorderBottomItem <BorderBottomItem
key={index} key={index}
borderType="bottom" borderType="all"
colorPress colorPress
icon={ icon={
<ImageUser <ImageUser
@@ -387,7 +388,7 @@ export default function DiscussionDetail() {
desc={item.comment} desc={item.comment}
rightBottomInfo={item.isEdited ? "Edited" : ""} rightBottomInfo={item.isEdited ? "Edited" : ""}
descEllipsize={detailMore.includes(item.id) ? false : true} descEllipsize={detailMore.includes(item.id) ? false : true}
bgColor="transparent" bgColor="white"
onPress={() => { onPress={() => {
setDetailMore((prev: any) => { setDetailMore((prev: any) => {
if (prev.includes(item.id)) { if (prev.includes(item.id)) {
@@ -465,8 +466,8 @@ export default function DiscussionDetail() {
size={25} size={25}
style={ style={
[selectKomentar.comment == "" || regexOnlySpacesOrEnter.test(selectKomentar.comment) || loadingSend || ((entityUser.role == "user" || entityUser.role == "coadmin") && !isMemberDivision) [selectKomentar.comment == "" || regexOnlySpacesOrEnter.test(selectKomentar.comment) || loadingSend || ((entityUser.role == "user" || entityUser.role == "coadmin") && !isMemberDivision)
? Styles.cGray ? { color: colors.dimmed }
: Styles.cDefault, : { color: colors.tint },
] ]
} }
/> />
@@ -479,7 +480,6 @@ export default function DiscussionDetail() {
isMemberDivision) isMemberDivision)
? ?
<InputForm <InputForm
bg={colors.card}
type="default" type="default"
round round
multiline multiline
@@ -512,8 +512,8 @@ export default function DiscussionDetail() {
size={25} size={25}
style={ style={
[komentar == "" || regexOnlySpacesOrEnter.test(komentar) || loadingSend || ((entityUser.role == "user" || entityUser.role == "coadmin") && !isMemberDivision) [komentar == "" || regexOnlySpacesOrEnter.test(komentar) || loadingSend || ((entityUser.role == "user" || entityUser.role == "coadmin") && !isMemberDivision)
? Styles.cGray ? { color: colors.dimmed }
: Styles.cDefault, : { color: colors.tint }
] ]
} }
/> />

View File

@@ -177,7 +177,7 @@ export default function DiscussionDivision() {
onPress={() => { router.push(`./discussion/${item.id}`) }} onPress={() => { router.push(`./discussion/${item.id}`) }}
borderType="bottom" borderType="bottom"
icon={ icon={
<ImageUser src={`${ConstEnv.url_storage}/files/${item.img}`} size="sm" /> <ImageUser src={`${ConstEnv.url_storage}/files/${item.img}`} size="xs" />
} }
title={item.user_name} title={item.user_name}
subtitle={ subtitle={
@@ -209,7 +209,7 @@ export default function DiscussionDivision() {
} }
/> />
: :
(<Text style={[Styles.textDefault, Styles.mv10, { textAlign: "center", color:colors.dimmed }]}>Tidak ada diskusi</Text>) (<Text style={[Styles.textDefault, Styles.mv10, { textAlign: "center", color: colors.dimmed }]}>Tidak ada diskusi</Text>)
} }
</View> </View>
</View> </View>

View File

@@ -89,7 +89,7 @@ export default function TaskDivisionReport() {
} }
return ( return (
<SafeAreaView style={{ flex: 1, backgroundColor: colors.background }}> <SafeAreaView style={[Styles.flex1, { backgroundColor: colors.background }]}>
<Stack.Screen <Stack.Screen
options={{ options={{
// headerLeft: () => ( // headerLeft: () => (

View File

@@ -112,7 +112,7 @@ export default function ListTask() {
}) })
return ( return (
<View style={[Styles.p15, { flex: 1, backgroundColor: colors.background }]}> <View style={[Styles.p15, Styles.flex1, { backgroundColor: colors.background }]}>
<View> <View>
<ScrollView horizontal style={[Styles.mb10]} showsHorizontalScrollIndicator={false}> <ScrollView horizontal style={[Styles.mb10]} showsHorizontalScrollIndicator={false}>
<ButtonTab <ButtonTab
@@ -190,7 +190,7 @@ export default function ListTask() {
<View style={[Styles.mv05]}> <View style={[Styles.mv05]}>
<View style={[Styles.rowOnly]}> <View style={[Styles.rowOnly]}>
<Text style={[Styles.mr05]}>Filter :</Text> <Text style={[Styles.mr05]}>Filter :</Text>
<LabelStatus size="small" category="secondary" text={isYear} style={{ marginRight: 5 }} /> <LabelStatus size="small" category="secondary" text={isYear} style={[Styles.mr05]} />
</View> </View>
</View> </View>
<View style={[{ flex: 2 }]}> <View style={[{ flex: 2 }]}>
@@ -342,13 +342,13 @@ export default function ListTask() {
</View> </View>
) )
) : ( ) : (
<Text style={[Styles.textDefault, { textAlign: "center", color: colors.dimmed }]} > <Text style={[Styles.textDefault, Styles.textCenter]} >
Tidak ada data Tidak ada data
</Text> </Text>
) )
} }
</View> </View >
</View> </View >
); );
} }

View File

@@ -204,7 +204,7 @@ export default function ListDivision() {
</View> </View>
)} )}
</View> </View>
<View style={[{ flex: 2 }, Styles.mt05]}> <View style={[{ flex: 2 }, Styles.mt10]}>
{ {
loading ? loading ?
isList ? isList ?

View File

@@ -216,7 +216,7 @@ export default function EditProfile() {
}; };
return ( return (
<SafeAreaView style={{ flex: 1, backgroundColor: colors.background }}> <SafeAreaView style={[Styles.flex1, { backgroundColor: colors.background }]}>
<Stack.Screen <Stack.Screen
options={{ options={{
// headerLeft: () => ( // headerLeft: () => (
@@ -262,7 +262,7 @@ export default function EditProfile() {
> >
<ScrollView showsVerticalScrollIndicator={false}> <ScrollView showsVerticalScrollIndicator={false}>
<View style={[Styles.p15]}> <View style={[Styles.p15]}>
<View style={{ justifyContent: "center", alignItems: "center" }}> <View style={[Styles.contentItemCenter]}>
{ {
selectedImage != undefined ? ( selectedImage != undefined ? (
<Pressable onPress={pickImageAsync}> <Pressable onPress={pickImageAsync}>

View File

@@ -150,7 +150,7 @@ export default function Index() {
</WrapTab> </WrapTab>
<InputSearch onChange={setSearch} /> <InputSearch onChange={setSearch} />
</View> </View>
<View style={[{ flex: 2 }, Styles.mt05]}> <View style={[{ flex: 2 }, Styles.mt10]}>
{ {
loading ? loading ?
arrSkeleton.map((item, index) => { arrSkeleton.map((item, index) => {

View File

@@ -49,7 +49,7 @@ export default function Home() {
}; };
return ( return (
<SafeAreaView style={{ flex: 1, backgroundColor: colors.background }}> <SafeAreaView style={[Styles.flex1, { backgroundColor: colors.background }]}>
<Stack.Screen <Stack.Screen
options={{ options={{
title: 'Home', title: 'Home',
@@ -71,19 +71,21 @@ export default function Home() {
/> />
} }
showsVerticalScrollIndicator={false} showsVerticalScrollIndicator={false}
style={{ backgroundColor: colors.background }} style={[Styles.h100, { backgroundColor: colors.background }]}
> >
<LinearGradient <LinearGradient
colors={[colors.header, colors.header, colors.header, colors.header, colors.homeGradient]} colors={[colors.header, colors.header, colors.header, colors.header, colors.homeGradient]}
style={{ style={[
position: 'absolute', Styles.posAbsolute,
width: Dimensions.get('window').width * 1.5, Styles.zIndexMinus1,
height: Dimensions.get('window').width * 1.5, {
borderRadius: Dimensions.get('window').width * 0.5, width: Dimensions.get('window').width * 1.5,
top: -Dimensions.get('window').width * 1, // Positioned to show the bottom part of the circle as an arc height: Dimensions.get('window').width * 1.5,
left: -Dimensions.get('window').width * 0.25, borderRadius: Dimensions.get('window').width * 0.5,
zIndex: -1, top: -Dimensions.get('window').width * 1, // Positioned to show the bottom part of the circle as an arc
}} left: -Dimensions.get('window').width * 0.25,
}
]}
/> />
{/* <CaraouselHome refreshing={refreshing} /> */} {/* <CaraouselHome refreshing={refreshing} /> */}
<View style={[Styles.ph15]}> <View style={[Styles.ph15]}>

View File

@@ -77,7 +77,7 @@ export default function MemberDetail() {
}; };
return ( return (
<SafeAreaView style={{ flex: 1, backgroundColor: colors.background }}> <SafeAreaView style={[Styles.flex1, { backgroundColor: colors.background }]}>
<Stack.Screen <Stack.Screen
options={{ options={{
headerTitle: 'Anggota', headerTitle: 'Anggota',
@@ -119,7 +119,7 @@ export default function MemberDetail() {
<Pressable onPress={() => setPreview(true)}> <Pressable onPress={() => setPreview(true)}>
<ImageUser src={`${ConstEnv.url_storage}/files/${data?.img}`} size="lg" onError={setErrorImg} /> <ImageUser src={`${ConstEnv.url_storage}/files/${data?.img}`} size="lg" onError={setErrorImg} />
</Pressable> </Pressable>
<Text style={[Styles.textSubtitle, Styles.cWhite, Styles.mt10, { textAlign: 'center' }]}>{data?.name}</Text> <Text style={[Styles.textSubtitle, Styles.cWhite, Styles.mt10, Styles.textCenter]}>{data?.name}</Text>
<Text style={[Styles.textMediumNormal, Styles.cWhite]}>{data?.role}</Text> <Text style={[Styles.textMediumNormal, Styles.cWhite]}>{data?.role}</Text>
</> </>

View File

@@ -208,7 +208,7 @@ export default function CreateMember() {
}; };
return ( return (
<SafeAreaView style={{ flex: 1, backgroundColor: colors.background }}> <SafeAreaView style={[Styles.flex1, { backgroundColor: colors.background }]}>
<Stack.Screen <Stack.Screen
options={{ options={{
headerTitle: "Tambah Anggota", headerTitle: "Tambah Anggota",
@@ -235,7 +235,7 @@ export default function CreateMember() {
> >
<ScrollView showsVerticalScrollIndicator={false}> <ScrollView showsVerticalScrollIndicator={false}>
<View style={[Styles.p15]}> <View style={[Styles.p15]}>
<View style={{ justifyContent: "center", alignItems: "center" }}> <View style={[Styles.contentItemCenter]}>
{selectedImage != undefined ? ( {selectedImage != undefined ? (
<Pressable onPress={pickImageAsync}> <Pressable onPress={pickImageAsync}>
<Image src={selectedImage} style={[Styles.userProfileBig]} /> <Image src={selectedImage} style={[Styles.userProfileBig]} />

View File

@@ -238,7 +238,7 @@ export default function EditMember() {
}; };
return ( return (
<SafeAreaView style={{ flex: 1, backgroundColor: colors.background }}> <SafeAreaView style={[Styles.flex1, { backgroundColor: colors.background }]}>
<Stack.Screen <Stack.Screen
options={{ options={{
headerTitle: "Edit Anggota", headerTitle: "Edit Anggota",
@@ -269,7 +269,7 @@ export default function EditMember() {
> >
<ScrollView showsVerticalScrollIndicator={false} style={[Styles.h100]}> <ScrollView showsVerticalScrollIndicator={false} style={[Styles.h100]}>
<View style={[Styles.p15]}> <View style={[Styles.p15]}>
<View style={{ justifyContent: "center", alignItems: "center" }}> <View style={[Styles.contentItemCenter]}>
{ {
errorImg ? errorImg ?
<Pressable onPress={pickImageAsync}> <Pressable onPress={pickImageAsync}>

View File

@@ -134,7 +134,7 @@ export default function Index() {
</View> </View>
} }
</View> </View>
<View style={[{ flex: 2 }, Styles.mt05]}> <View style={[{ flex: 2 }, Styles.mt10]}>
{ {
loading ? loading ?
arrSkeleton.map((item, index) => { arrSkeleton.map((item, index) => {

View File

@@ -100,7 +100,7 @@ export default function Notification() {
}; };
return ( return (
<SafeAreaView style={{ flex: 1, backgroundColor: colors.background }}> <SafeAreaView style={[Styles.flex1, { backgroundColor: colors.background }]}>
<View style={[Styles.p15]}> <View style={[Styles.p15]}>
{ {
loading ? loading ?
@@ -148,7 +148,7 @@ export default function Notification() {
} }
/> />
: :
<Text style={[Styles.textDefault, { textAlign: 'center', color: colors.dimmed }]}>Tidak ada data</Text> <Text style={[Styles.textDefault, Styles.textCenter, { color: colors.dimmed }]}>Tidak ada data</Text>
} }
</View> </View>
</SafeAreaView> </SafeAreaView>

View File

@@ -1,4 +1,3 @@
import ModalConfirmation from "@/components/ModalConfirmation";
import BorderBottomItem from "@/components/borderBottomItem"; import BorderBottomItem from "@/components/borderBottomItem";
import { ButtonForm } from "@/components/buttonForm"; import { ButtonForm } from "@/components/buttonForm";
import ButtonTab from "@/components/buttonTab"; import ButtonTab from "@/components/buttonTab";
@@ -7,10 +6,10 @@ import { InputForm } from "@/components/inputForm";
import InputSearch from "@/components/inputSearch"; import InputSearch from "@/components/inputSearch";
import LabelStatus from "@/components/labelStatus"; import LabelStatus from "@/components/labelStatus";
import MenuItemRow from "@/components/menuItemRow"; import MenuItemRow from "@/components/menuItemRow";
import ModalConfirmation from "@/components/ModalConfirmation";
import SkeletonTwoItem from "@/components/skeletonTwoItem"; import SkeletonTwoItem from "@/components/skeletonTwoItem";
import Text from "@/components/Text"; import Text from "@/components/Text";
import WrapTab from "@/components/wrapTab"; import WrapTab from "@/components/wrapTab";
import { ColorsStatus } from "@/constants/ColorsStatus";
import Styles from "@/constants/Styles"; import Styles from "@/constants/Styles";
import { apiDeletePosition, apiEditPosition, apiGetPosition } from "@/lib/api"; import { apiDeletePosition, apiEditPosition, apiGetPosition } from "@/lib/api";
import { setUpdatePosition } from "@/lib/positionSlice"; import { setUpdatePosition } from "@/lib/positionSlice";
@@ -150,7 +149,7 @@ export default function Index() {
}); });
return ( return (
<View style={[Styles.p15, { flex: 1, backgroundColor: colors.background }]}> <View style={[Styles.p15, Styles.flex1, { backgroundColor: colors.background }]}>
<View> <View>
<WrapTab> <WrapTab>
<ButtonTab <ButtonTab
@@ -177,7 +176,7 @@ export default function Index() {
</View> </View>
} }
</View> </View>
<View style={[{ flex: 2 }, Styles.mt05]}> <View style={[Styles.flex2, Styles.mt10]}>
{ {
loading ? loading ?
arrSkeleton.map((item, index) => { arrSkeleton.map((item, index) => {
@@ -221,7 +220,7 @@ export default function Index() {
} }
/> />
: :
<Text style={[Styles.textDefault, { textAlign: 'center', color: colors.dimmed }]}>Tidak ada data</Text> <Text style={[Styles.textDefault, Styles.textCenter, { color: colors.dimmed }]}>Tidak ada data</Text>
} }
</View> </View>
<DrawerBottom animation="slide" isVisible={isModal} setVisible={() => setModal(false)} title={chooseData.name}> <DrawerBottom animation="slide" isVisible={isModal} setVisible={() => setModal(false)} title={chooseData.name}>
@@ -251,7 +250,7 @@ export default function Index() {
<DrawerBottom animation="none" keyboard height={30} backdropPressable={false} isVisible={isVisibleEdit} setVisible={() => setVisibleEdit(false)} title="Edit Jabatan"> <DrawerBottom animation="none" keyboard height={30} backdropPressable={false} isVisible={isVisibleEdit} setVisible={() => setVisibleEdit(false)} title="Edit Jabatan">
<View style={{ justifyContent: 'space-between', flex: 1 }}> <View style={[Styles.justifySpaceBetween, Styles.flex1]}>
<View> <View>
<InputForm <InputForm
type="default" type="default"

View File

@@ -43,7 +43,7 @@ export default function Profile() {
}; };
return ( return (
<SafeAreaView style={{ flex: 1, backgroundColor: colors.background }}> <SafeAreaView style={[Styles.flex1, { backgroundColor: colors.background }]}>
<Stack.Screen <Stack.Screen
options={{ options={{
headerTitle: 'Profile', headerTitle: 'Profile',
@@ -75,7 +75,7 @@ export default function Profile() {
} }
style={[Styles.h100, { backgroundColor: colors.background }]} style={[Styles.h100, { backgroundColor: colors.background }]}
> >
<View style={{ flexDirection: 'column' }}> <View style={[Styles.flexColumn]}>
<LinearGradient <LinearGradient
colors={[colors.header, colors.homeGradient]} colors={[colors.header, colors.homeGradient]}
style={[Styles.wrapHeadViewMember]} style={[Styles.wrapHeadViewMember]}

View File

@@ -129,7 +129,7 @@ export default function ProjectAddFile() {
return ( return (
<SafeAreaView style={{ flex: 1, backgroundColor: colors.background }}> <SafeAreaView style={[Styles.flex1, { backgroundColor: colors.background }]}>
<Stack.Screen <Stack.Screen
options={{ options={{
// headerLeft: () => <ButtonBackHeader onPress={() => { router.back() }} />, // headerLeft: () => <ButtonBackHeader onPress={() => { router.back() }} />,
@@ -155,7 +155,7 @@ export default function ProjectAddFile() {
) )
}} }}
/> />
<ScrollView style={{ backgroundColor: colors.background }}> <ScrollView style={[Styles.h100, { backgroundColor: colors.background }]}>
<View style={[Styles.p15, Styles.mb100]}> <View style={[Styles.p15, Styles.mb100]}>
<ButtonSelect value="Upload File" onPress={pickDocumentAsync} /> <ButtonSelect value="Upload File" onPress={pickDocumentAsync} />
{ {

View File

@@ -135,7 +135,7 @@ export default function ProjectAddTask() {
} }
return ( return (
<SafeAreaView style={{ flex: 1, backgroundColor: colors.background }}> <SafeAreaView style={[Styles.flex1, { backgroundColor: colors.background }]}>
<Stack.Screen <Stack.Screen
options={{ options={{
// headerLeft: () => ( // headerLeft: () => (
@@ -174,7 +174,7 @@ export default function ProjectAddTask() {
behavior={Platform.OS === 'ios' ? 'padding' : undefined} behavior={Platform.OS === 'ios' ? 'padding' : undefined}
keyboardVerticalOffset={headerHeight} keyboardVerticalOffset={headerHeight}
> >
<ScrollView style={{ backgroundColor: colors.background }}> <ScrollView style={[Styles.h100, { backgroundColor: colors.background }]}>
<View style={[Styles.p15, Styles.mb100]}> <View style={[Styles.p15, Styles.mb100]}>
<View style={[Styles.wrapPaper, Styles.p10, { backgroundColor: colors.card, borderColor: colors.background }]}> <View style={[Styles.wrapPaper, Styles.p10, { backgroundColor: colors.card, borderColor: colors.background }]}>
<DateTimePicker <DateTimePicker
@@ -198,20 +198,20 @@ export default function ProjectAddTask() {
</View> </View>
<View style={[Styles.mv10]}> <View style={[Styles.mv10]}>
<View style={[Styles.rowSpaceBetween]}> <View style={[Styles.rowSpaceBetween]}>
<View style={[{ width: "48%" }]}> <View style={[Styles.w48]}>
<Text style={[Styles.mb05]}> <Text style={[Styles.mb05]}>
Tanggal Mulai <Text style={{ color: colors.error }}>*</Text> Tanggal Mulai <Text style={{ color: colors.error }}>*</Text>
</Text> </Text>
<View style={[Styles.wrapPaper, Styles.noShadow, Styles.borderAll, Styles.p10, { backgroundColor: colors.card, borderColor: colors.icon + '20' }]}> <View style={[Styles.wrapPaper, Styles.noShadow, Styles.borderAll, Styles.p10, { backgroundColor: colors.card, borderColor: colors.icon + '20' }]}>
<Text style={{ textAlign: "center" }}>{from}</Text> <Text style={Styles.textCenter}>{from}</Text>
</View> </View>
</View> </View>
<View style={[{ width: "48%" }]}> <View style={[Styles.w48]}>
<Text style={[Styles.mb05]}> <Text style={[Styles.mb05]}>
Tanggal Berakhir <Text style={{ color: colors.error }}>*</Text> Tanggal Berakhir <Text style={{ color: colors.error }}>*</Text>
</Text> </Text>
<View style={[Styles.wrapPaper, Styles.noShadow, Styles.borderAll, Styles.p10, { backgroundColor: colors.card, borderColor: colors.icon + '20' }]}> <View style={[Styles.wrapPaper, Styles.noShadow, Styles.borderAll, Styles.p10, { backgroundColor: colors.card, borderColor: colors.icon + '20' }]}>
<Text style={{ textAlign: "center" }}>{to}</Text> <Text style={Styles.textCenter}>{to}</Text>
</View> </View>
</View> </View>
</View> </View>

View File

@@ -67,7 +67,7 @@ export default function ProjectCancel() {
} }
return ( return (
<SafeAreaView style={{ flex: 1, backgroundColor: colors.background }}> <SafeAreaView style={[Styles.flex1, { backgroundColor: colors.background }]}>
<Stack.Screen <Stack.Screen
options={{ options={{
// headerLeft: () => ( // headerLeft: () => (

View File

@@ -88,7 +88,7 @@ export default function EditProject() {
return ( return (
<SafeAreaView style={{ flex: 1, backgroundColor: colors.background }}> <SafeAreaView style={[Styles.flex1, { backgroundColor: colors.background }]}>
<Stack.Screen <Stack.Screen
options={{ options={{
// headerLeft: () => ( // headerLeft: () => (
@@ -123,7 +123,7 @@ export default function EditProject() {
) )
}} }}
/> />
<ScrollView style={{ backgroundColor: colors.background }}> <ScrollView style={[Styles.h100, { backgroundColor: colors.background }]}>
<View style={[Styles.p15, Styles.mb100]}> <View style={[Styles.p15, Styles.mb100]}>
<InputForm <InputForm
label="Judul Kegiatan" label="Judul Kegiatan"

View File

@@ -93,7 +93,7 @@ export default function DetailProject() {
}; };
return ( return (
<SafeAreaView style={{ flex: 1, backgroundColor: colors.background }}> <SafeAreaView style={[Styles.flex1, { backgroundColor: colors.background }]}>
<Stack.Screen <Stack.Screen
options={{ options={{
// headerLeft: () => <ButtonBackHeader onPress={() => { router.back() }} />, // headerLeft: () => <ButtonBackHeader onPress={() => { router.back() }} />,
@@ -113,7 +113,7 @@ export default function DetailProject() {
}} }}
/> />
<ScrollView <ScrollView
style={{ backgroundColor: colors.background }} style={[Styles.h100, { backgroundColor: colors.background }]}
refreshControl={ refreshControl={
<RefreshControl <RefreshControl
refreshing={refreshing} refreshing={refreshing}

View File

@@ -88,7 +88,7 @@ export default function ReportProject() {
return ( return (
<SafeAreaView style={{ flex: 1, backgroundColor: colors.background }}> <SafeAreaView style={[Styles.flex1, { backgroundColor: colors.background }]}>
<Stack.Screen <Stack.Screen
options={{ options={{
// headerLeft: () => ( // headerLeft: () => (

View File

@@ -192,7 +192,7 @@ export default function CreateProject() {
return ( return (
<SafeAreaView style={{ flex: 1, backgroundColor: colors.background }}> <SafeAreaView style={[Styles.flex1, { backgroundColor: colors.background }]}>
<Stack.Screen <Stack.Screen
options={{ options={{
// headerLeft: () => ( // headerLeft: () => (

View File

@@ -105,7 +105,7 @@ export default function AddMemberCreateProject() {
) )
}} }}
/> />
<View style={[Styles.p15, { flex: 1, backgroundColor: colors.background }]}> <View style={[Styles.p15, Styles.flex1, { backgroundColor: colors.background }]}>
<InputSearch onChange={(val) => setSearch(val)} value={search} /> <InputSearch onChange={(val) => setSearch(val)} value={search} />
{ {
@@ -127,11 +127,11 @@ export default function AddMemberCreateProject() {
</View> </View>
: :
<Text style={[Styles.textDefault, { textAlign: 'center', color: colors.dimmed }, Styles.pv05]}>Tidak ada member yang dipilih</Text> <Text style={[Styles.textDefault, Styles.textCenter, { color: colors.dimmed }, Styles.pv05]}>Tidak ada member yang dipilih</Text>
} }
<ScrollView <ScrollView
showsVerticalScrollIndicator={false} showsVerticalScrollIndicator={false}
style={{ backgroundColor: colors.background }} style={[Styles.h100, Styles.flex1, { backgroundColor: colors.background }]}
> >
{ {
@@ -159,7 +159,7 @@ export default function AddMemberCreateProject() {
} }
) )
: :
<Text style={[Styles.textDefault, { textAlign: 'center' }]}>Tidak ada data</Text> <Text style={[Styles.textDefault, Styles.textCenter]}>Tidak ada data</Text>
} }
</ScrollView> </ScrollView>
</View> </View>

View File

@@ -121,7 +121,7 @@ export default function CreateProjectAddTask() {
} }
return ( return (
<SafeAreaView style={{ flex: 1, backgroundColor: colors.background }}> <SafeAreaView style={[Styles.flex1, { backgroundColor: colors.background }]}>
<Stack.Screen <Stack.Screen
options={{ options={{
// headerLeft: () => ( // headerLeft: () => (
@@ -160,7 +160,7 @@ export default function CreateProjectAddTask() {
behavior={Platform.OS === 'ios' ? 'padding' : undefined} behavior={Platform.OS === 'ios' ? 'padding' : undefined}
keyboardVerticalOffset={headerHeight} keyboardVerticalOffset={headerHeight}
> >
<ScrollView style={{ backgroundColor: colors.background }}> <ScrollView style={[Styles.h100, { backgroundColor: colors.background }]}>
<View style={[Styles.p15, Styles.mb100]}> <View style={[Styles.p15, Styles.mb100]}>
<View style={[Styles.wrapPaper, Styles.p10, { backgroundColor: colors.card, borderColor: colors.background }]}> <View style={[Styles.wrapPaper, Styles.p10, { backgroundColor: colors.card, borderColor: colors.background }]}>
<DateTimePicker <DateTimePicker
@@ -189,7 +189,7 @@ export default function CreateProjectAddTask() {
Tanggal Mulai <Text style={{ color: colors.error }}>*</Text> Tanggal Mulai <Text style={{ color: colors.error }}>*</Text>
</Text> </Text>
<View style={[Styles.wrapPaper, Styles.noShadow, Styles.borderAll, Styles.p10, { backgroundColor: colors.card, borderColor: colors.icon + '20' }]}> <View style={[Styles.wrapPaper, Styles.noShadow, Styles.borderAll, Styles.p10, { backgroundColor: colors.card, borderColor: colors.icon + '20' }]}>
<Text style={{ textAlign: "center" }}>{from}</Text> <Text style={Styles.textCenter}>{from}</Text>
</View> </View>
</View> </View>
<View style={[{ width: "48%" }]}> <View style={[{ width: "48%" }]}>
@@ -197,7 +197,7 @@ export default function CreateProjectAddTask() {
Tanggal Berakhir <Text style={{ color: colors.error }}>*</Text> Tanggal Berakhir <Text style={{ color: colors.error }}>*</Text>
</Text> </Text>
<View style={[Styles.wrapPaper, Styles.noShadow, Styles.borderAll, Styles.p10, { backgroundColor: colors.card, borderColor: colors.icon + '20' }]}> <View style={[Styles.wrapPaper, Styles.noShadow, Styles.borderAll, Styles.p10, { backgroundColor: colors.card, borderColor: colors.icon + '20' }]}>
<Text style={{ textAlign: "center" }}>{to}</Text> <Text style={Styles.textCenter}>{to}</Text>
</View> </View>
</View> </View>
</View> </View>

View File

@@ -126,7 +126,7 @@ export default function ListProject() {
}) })
return ( return (
<View style={[Styles.p15, { flex: 1, backgroundColor: colors.background }]}> <View style={[Styles.p15, Styles.flex1, { backgroundColor: colors.background }]}>
<View> <View>
<WrapTab> <WrapTab>
<ScrollView horizontal showsHorizontalScrollIndicator={false} style={[Styles.round20]}> <ScrollView horizontal showsHorizontalScrollIndicator={false} style={[Styles.round20]}>
@@ -189,7 +189,7 @@ export default function ListProject() {
</ScrollView> </ScrollView>
</WrapTab> </WrapTab>
<View style={[Styles.rowSpaceBetween, { alignItems: 'center' }]}> <View style={[Styles.rowSpaceBetween, Styles.rowItemsCenter]}>
<InputSearch width={68} onChange={setSearch} /> <InputSearch width={68} onChange={setSearch} />
<Pressable <Pressable
onPress={() => { onPress={() => {
@@ -203,21 +203,21 @@ export default function ListProject() {
/> />
</Pressable> </Pressable>
</View> </View>
<View style={[Styles.mv05]}> <View style={[Styles.mt10]}>
{ {
// entityUser.role != 'cosupadmin' && entityUser.role != 'admin' && // entityUser.role != 'cosupadmin' && entityUser.role != 'admin' &&
<View style={[Styles.rowOnly]}> <View style={[Styles.rowOnly]}>
<Text style={[Styles.mr05]}>Filter :</Text> <Text style={[Styles.mr05]}>Filter :</Text>
{ {
(entityUser.role == "supadmin" || entityUser.role == "developer") && (entityUser.role == "supadmin" || entityUser.role == "developer") &&
<LabelStatus size="small" category="secondary" text={nameGroup} style={{ marginRight: 5 }} /> <LabelStatus size="small" category="secondary" text={nameGroup} style={[Styles.mr05]} />
} }
{ {
(entityUser.role == 'user' || entityUser.role == 'coadmin') (entityUser.role == 'user' || entityUser.role == 'coadmin')
? (cat == 'null' || cat == 'undefined' || cat == undefined || cat == '' || cat == 'data-saya') ? <LabelStatus size="small" category="secondary" text="Kegiatan Saya" style={{ marginRight: 5 }} /> : <LabelStatus size="small" category="secondary" text="Semua Kegiatan" style={{ marginRight: 5 }} /> ? (cat == 'null' || cat == 'undefined' || cat == undefined || cat == '' || cat == 'data-saya') ? <LabelStatus size="small" category="secondary" text="Kegiatan Saya" style={[Styles.mr05]} /> : <LabelStatus size="small" category="secondary" text="Semua Kegiatan" style={[Styles.mr05]} />
: '' : ''
} }
<LabelStatus size="small" category="secondary" text={isYear} style={{ marginRight: 5 }} /> <LabelStatus size="small" category="secondary" text={isYear} style={[Styles.mr05]} />
{/* { {/* {
(entityUser.role == 'user' || entityUser.role == 'coadmin') (entityUser.role == 'user' || entityUser.role == 'coadmin')
? (cat == 'null' || cat == 'undefined' || cat == undefined || cat == '' || cat == 'data-saya') ? <LabelStatus size="small" category="primary" text="Kegiatan Saya" /> : <LabelStatus size="small" category="primary" text="Semua Kegiatan" /> ? (cat == 'null' || cat == 'undefined' || cat == undefined || cat == '' || cat == 'data-saya') ? <LabelStatus size="small" category="primary" text="Kegiatan Saya" /> : <LabelStatus size="small" category="primary" text="Semua Kegiatan" />
@@ -227,7 +227,7 @@ export default function ListProject() {
} }
</View> </View>
</View> </View>
<View style={[{ flex: 2 }]}> <View style={[Styles.flex2, Styles.mt10]}>
{ {
loading ? loading ?
isList ? isList ?
@@ -399,7 +399,7 @@ export default function ListProject() {
) )
: :
<View style={[Styles.mt15]}> <View style={[Styles.mt15]}>
<Text style={[Styles.textDefault, { textAlign: 'center', color: colors.dimmed }]}>Tidak ada kegiatan</Text> <Text style={[Styles.textDefault, Styles.textCenter, { color: colors.dimmed }]}>Tidak ada kegiatan</Text>
</View> </View>
} }
</View> </View>

View File

@@ -172,7 +172,7 @@ export default function UpdateProjectTask() {
}, [range]) }, [range])
return ( return (
<SafeAreaView style={{ flex: 1, backgroundColor: colors.background }}> <SafeAreaView style={[Styles.flex1, { backgroundColor: colors.background }]}>
<Stack.Screen <Stack.Screen
options={{ options={{
// headerLeft: () => <ButtonBackHeader onPress={() => { router.back() }} />, // headerLeft: () => <ButtonBackHeader onPress={() => { router.back() }} />,
@@ -203,7 +203,7 @@ export default function UpdateProjectTask() {
behavior={Platform.OS === 'ios' ? 'padding' : undefined} behavior={Platform.OS === 'ios' ? 'padding' : undefined}
keyboardVerticalOffset={headerHeight} keyboardVerticalOffset={headerHeight}
> >
<ScrollView style={{ backgroundColor: colors.background }}> <ScrollView style={[Styles.h100, { backgroundColor: colors.background }]}>
<View style={[Styles.p15, Styles.mb100]}> <View style={[Styles.p15, Styles.mb100]}>
<View style={[Styles.wrapPaper, Styles.p10, { backgroundColor: colors.card, borderColor: colors.background }]}> <View style={[Styles.wrapPaper, Styles.p10, { backgroundColor: colors.card, borderColor: colors.background }]}>
{ {
@@ -237,13 +237,13 @@ export default function UpdateProjectTask() {
<View style={[{ width: '48%' }]}> <View style={[{ width: '48%' }]}>
<Text style={[Styles.mb05]}>Tanggal Mulai <Text style={{ color: colors.error }}>*</Text></Text> <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' }]}> <View style={[Styles.wrapPaper, Styles.noShadow, Styles.borderAll, Styles.p10, { backgroundColor: colors.card, borderColor: colors.icon + '20' }]}>
<Text style={{ textAlign: 'center' }}>{from}</Text> <Text style={Styles.textCenter}>{from}</Text>
</View> </View>
</View> </View>
<View style={[{ width: '48%' }]}> <View style={[{ width: '48%' }]}>
<Text style={[Styles.mb05]}>Tanggal Berakhir <Text style={{ color: colors.error }}>*</Text></Text> <Text style={[Styles.mb05]}>Tanggal Berakhir <Text style={{ color: colors.error }}>*</Text></Text>
<View style={[Styles.wrapPaper, Styles.noShadow, Styles.borderAll, Styles.p10, { backgroundColor: colors.card, borderColor: colors.icon + '20' }]}> <View style={[Styles.wrapPaper, Styles.noShadow, Styles.borderAll, Styles.p10, { backgroundColor: colors.card, borderColor: colors.icon + '20' }]}>
<Text style={{ textAlign: 'center' }}>{to}</Text> <Text style={Styles.textCenter}>{to}</Text>
</View> </View>
</View> </View>
</View> </View>

View File

@@ -82,7 +82,7 @@ export default function Search() {
return ( return (
<> <>
<SafeAreaView style={{ flex: 1, backgroundColor: colors.background }}> <SafeAreaView style={[Styles.flex1, { backgroundColor: colors.background }]}>
<Stack.Screen <Stack.Screen
options={{ options={{
headerTitle: 'Pencarian', headerTitle: 'Pencarian',

View File

@@ -117,7 +117,7 @@ export default function ListSetting() {
}} }}
> >
<View style={Styles.rowItemsCenter}> <View style={Styles.rowItemsCenter}>
<Ionicons name={icon as any} size={20} color={colors.text} style={{ marginRight: 10 }} /> <Ionicons name={icon as any} size={20} color={colors.text} style={Styles.mr10} />
<Text style={{ color: colors.text }}>{label}</Text> <Text style={{ color: colors.text }}>{label}</Text>
</View> </View>
{theme === value && <Ionicons name="checkmark" size={20} color={colors.text} />} {theme === value && <Ionicons name="checkmark" size={20} color={colors.text} />}
@@ -125,7 +125,7 @@ export default function ListSetting() {
); );
return ( return (
<View style={[Styles.p15, { flex: 1, backgroundColor: colors.background }]}> <View style={[Styles.p15, Styles.flex1, { backgroundColor: colors.background }]}>
<View style={[Styles.wrapPaper, { backgroundColor: colors.card, borderColor: colors.icon + '20' }, Styles.p0, Styles.round05]}> <View style={[Styles.wrapPaper, { backgroundColor: colors.card, borderColor: colors.icon + '20' }, Styles.p0, Styles.round05]}>
{ {
entities.idUserRole != "developer" && entities.idUserRole != "developer" &&

View File

@@ -1,5 +1,5 @@
import AuthProvider from '@/providers/AuthProvider'; import AuthProvider from '@/providers/AuthProvider';
import ThemeProvider from '@/providers/ThemeProvider'; import ThemeProvider, { useTheme } from '@/providers/ThemeProvider';
import { useFonts } from 'expo-font'; import { useFonts } from 'expo-font';
import { Stack } from 'expo-router'; import { Stack } from 'expo-router';
import * as SplashScreen from 'expo-splash-screen'; import * as SplashScreen from 'expo-splash-screen';
@@ -8,10 +8,27 @@ import { useEffect } from 'react';
import { GestureHandlerRootView } from 'react-native-gesture-handler'; import { GestureHandlerRootView } from 'react-native-gesture-handler';
import { NotifierWrapper } from 'react-native-notifier'; import { NotifierWrapper } from 'react-native-notifier';
import 'react-native-reanimated'; import 'react-native-reanimated';
import Styles from '@/constants/Styles';
// Prevent the splash screen from auto-hiding before asset loading is complete. // Prevent the splash screen from auto-hiding before asset loading is complete.
SplashScreen.preventAutoHideAsync(); SplashScreen.preventAutoHideAsync();
// Inner component - berada di dalam ThemeProvider, bisa pakai useTheme()
function AppStack() {
const { colors } = useTheme();
return (
<>
<Stack screenOptions={{ contentStyle: { backgroundColor: colors.header } }}>
<Stack.Screen name="index" options={{ headerShown: false }} />
<Stack.Screen name="verification" options={{ headerShown: false }} />
<Stack.Screen name="(application)" options={{ headerShown: false }} />
</Stack>
<StatusBar style="auto" />
</>
);
}
export default function RootLayout() { export default function RootLayout() {
const [loaded] = useFonts({ const [loaded] = useFonts({
SpaceMono: require('../assets/fonts/SpaceMono-Regular.ttf'), SpaceMono: require('../assets/fonts/SpaceMono-Regular.ttf'),
@@ -28,16 +45,11 @@ export default function RootLayout() {
} }
return ( return (
<GestureHandlerRootView style={{ flex: 1 }}> <GestureHandlerRootView style={Styles.flex1}>
<NotifierWrapper> <NotifierWrapper>
<ThemeProvider> <ThemeProvider>
<AuthProvider> <AuthProvider>
<Stack> <AppStack />
<Stack.Screen name="index" options={{ headerShown: false }} />
<Stack.Screen name="verification" options={{ headerShown: false }} />
<Stack.Screen name="(application)" options={{ headerShown: false }} />
</Stack>
<StatusBar style="auto" />
</AuthProvider> </AuthProvider>
</ThemeProvider> </ThemeProvider>
</NotifierWrapper> </NotifierWrapper>

View File

@@ -33,7 +33,7 @@ export default function Index() {
} }
return ( return (
<View style={[Styles.wrapLogin, { backgroundColor: colors.background }]} > <View style={[Styles.wrapLogin, { backgroundColor: colors.background }]} >
<View style={{ alignItems: "center", marginVertical: 50 }}> <View style={[Styles.rowItemsCenter, Styles.mv50]}>
<Image <Image
source={require("../assets/images/logo.png")} source={require("../assets/images/logo.png")}
style={[{ width: 300, height: 150 }]} style={[{ width: 300, height: 150 }]}

View File

@@ -1,8 +1,7 @@
import { ColorsStatus } from "@/constants/ColorsStatus";
import Styles from "@/constants/Styles"; import Styles from "@/constants/Styles";
import { useTheme } from "@/providers/ThemeProvider"; import { useTheme } from "@/providers/ThemeProvider";
import React, { useState } from "react"; import React, { useState } from "react";
import { Dimensions, Pressable, View } from "react-native"; import { Pressable, View } from "react-native";
import Text from "./Text"; import Text from "./Text";
type Props = { type Props = {
@@ -69,7 +68,7 @@ export default function BorderBottomItem({ title, subtitle, icon, desc, onPress,
{ {
(leftBottomInfo || rightBottomInfo) && (leftBottomInfo || rightBottomInfo) &&
( (
<View style={[rightBottomInfo && !leftBottomInfo ? Styles.rowSpaceBetweenReverse : Styles.rowSpaceBetween, Styles.mt05]}> <View style={[rightBottomInfo && !leftBottomInfo ? Styles.rowSpaceBetweenReverse : Styles.rowSpaceBetween, Styles.mt02]}>
{ {
typeof leftBottomInfo == 'string' ? typeof leftBottomInfo == 'string' ?
<Text style={[Styles.textInformation, { color: colors.dimmed }]}>{leftBottomInfo}</Text> <Text style={[Styles.textInformation, { color: colors.dimmed }]}>{leftBottomInfo}</Text>

View File

@@ -149,7 +149,7 @@ export default function BorderBottomItem2({ title, subtitle, icon, desc, onPress
{desc && <Text style={[Styles.textDefault, Styles.mt05, { textAlign: 'left', color: textColorFix }]} numberOfLines={descEllipsize == false ? 0 : 2} ellipsizeMode='tail'>{desc}</Text>} {desc && <Text style={[Styles.textDefault, Styles.mt05, { textAlign: 'left', color: textColorFix }]} numberOfLines={descEllipsize == false ? 0 : 2} ellipsizeMode='tail'>{desc}</Text>}
{ {
dataFile.length > 0 && ( dataFile.length > 0 && (
<ScrollView horizontal style={[Styles.mv05]} showsHorizontalScrollIndicator={false}> <ScrollView horizontal style={[Styles.mv10]} showsHorizontalScrollIndicator={false}>
{dataFile.map((item, index) => ( {dataFile.map((item, index) => (
<Pressable <Pressable
key={index} key={index}
@@ -173,7 +173,7 @@ export default function BorderBottomItem2({ title, subtitle, icon, desc, onPress
{ {
(leftBottomInfo || rightBottomInfo) && (leftBottomInfo || rightBottomInfo) &&
( (
<View style={[rightBottomInfo && !leftBottomInfo ? Styles.rowSpaceBetweenReverse : Styles.rowSpaceBetween, Styles.mt05]}> <View style={[rightBottomInfo && !leftBottomInfo ? Styles.rowSpaceBetweenReverse : Styles.rowSpaceBetween, Styles.mt10]}>
{ {
typeof leftBottomInfo == 'string' ? typeof leftBottomInfo == 'string' ?
<Text style={[Styles.textInformation, { color: colors.dimmed }]}>{leftBottomInfo}</Text> <Text style={[Styles.textInformation, { color: colors.dimmed }]}>{leftBottomInfo}</Text>

View File

@@ -25,7 +25,7 @@ export default function ButtonSetting({ title, onPress, icon, borderBottom = tru
{icon} {icon}
<Text style={[{ color: colors.text }, Styles.ml05]}>{title}</Text> <Text style={[{ color: colors.text }, Styles.ml05]}>{title}</Text>
</View> </View>
{value && <Text style={[{ color: colors.dimmed }]}>{value}</Text>} {value && <Text style={[{ color: colors.dimmed, alignSelf: 'center' }]}>{value}</Text>}
</View> </View>
</Pressable> </Pressable>
) )

View File

@@ -69,7 +69,7 @@ export function InputForm({ label, value, placeholder, onChange, info, disable,
Styles.mh05, Styles.mh05,
multiline && { height: '100%', maxHeight: 100 }, multiline && { height: '100%', maxHeight: 100 },
{ width: width ? lebar * width / 100 : lebar * 0.78, color: colors.text }, { width: width ? lebar * width / 100 : lebar * 0.78, color: colors.text },
Platform.OS == 'ios' ? { paddingVertical: 1, paddingTop: 3 } : { paddingVertical: 0 }, Platform.OS == 'ios' ? { paddingVertical: 1, paddingTop: 4 } : { paddingVertical: 0 },
]} ]}
/> />
</View> </View>

View File

@@ -118,6 +118,9 @@ const Styles = StyleSheet.create({
mh15: { mh15: {
marginHorizontal: 15 marginHorizontal: 15
}, },
mv50: {
marginVertical: 50
},
mv10: { mv10: {
marginVertical: 10 marginVertical: 10
}, },
@@ -169,12 +172,21 @@ const Styles = StyleSheet.create({
pb10: { pb10: {
paddingBottom: 10 paddingBottom: 10
}, },
pb50: {
paddingBottom: 50
},
pb100: {
paddingBottom: 100
},
pb13: { pb13: {
paddingBottom: 13 paddingBottom: 13
}, },
pb15: { pb15: {
paddingBottom: 15 paddingBottom: 15
}, },
pb20: {
paddingBottom: 20
},
ph05: { ph05: {
paddingHorizontal: 5, paddingHorizontal: 5,
}, },
@@ -235,6 +247,9 @@ const Styles = StyleSheet.create({
w100: { w100: {
width: '100%' width: '100%'
}, },
w48: {
width: '48%'
},
w95: { w95: {
width: '95%' width: '95%'
}, },
@@ -277,6 +292,9 @@ const Styles = StyleSheet.create({
justifyContent: 'space-between', justifyContent: 'space-between',
flexDirection: 'row' flexDirection: 'row'
}, },
justifySpaceBetween: {
justifyContent: 'space-between'
},
rowSpaceBetweenReverse: { rowSpaceBetweenReverse: {
justifyContent: 'space-between', justifyContent: 'space-between',
flexDirection: 'row-reverse' flexDirection: 'row-reverse'
@@ -791,6 +809,57 @@ const Styles = StyleSheet.create({
}, },
flex1: { flex1: {
flex: 1 flex: 1
},
flex2: {
flex: 2
},
flexColumn: {
flexDirection: 'column'
},
textCenter: {
textAlign: 'center'
},
posAbsolute: {
position: 'absolute'
},
zIndex1: {
zIndex: 1
},
zIndexMinus1: {
zIndex: -1
},
alignCenter: {
alignItems: 'center'
},
itemsCenter: {
alignItems: 'center'
},
justifyCenter: {
justifyContent: 'center'
},
resizeContain: {
resizeMode: 'contain'
},
resizeCover: {
resizeMode: 'cover'
},
resizeStretch: {
resizeMode: 'stretch'
},
textWhite: {
color: 'white'
},
font16: {
fontSize: 16
},
font26: {
fontSize: 26
},
ph16: {
paddingHorizontal: 16
},
alignStart: {
alignItems: 'flex-start'
} }
}) })