Compare commits

...

5 Commits

Author SHA1 Message Date
da89673271 upd: alert pick image
Deskripsi:
- menghilangkan alert pada picker image

No Issues
2025-08-06 17:24:10 +08:00
d052b7a0d4 upd: tampilan statys
Deskripsi:
- update label status
- menampilkan status pada detail member

No Issues
2025-08-06 17:18:34 +08:00
9370aac9a3 fix : file
Deskripsi:
- lihat atau share file
- view file ios pada home divisi > ga pake loading

No Issues
2025-08-06 17:09:46 +08:00
1298ec079a upd: tampilan pengumuman
Deskripsi:
- menambah tinggi text area
- mengurangi margin list divisi

No Issues
2025-08-06 16:50:31 +08:00
5db712d4b9 upd: notifikasi diskusi umum 2025-08-06 11:58:54 +08:00
16 changed files with 51 additions and 23 deletions

View File

@@ -13,8 +13,9 @@ import { apiReadOneNotification } from "@/lib/api";
import { pushToPage } from "@/lib/pushToPage";
import store from "@/lib/store";
import { useAuthSession } from "@/providers/AuthProvider";
import AsyncStorage from "@react-native-async-storage/async-storage";
import firebase from '@react-native-firebase/app';
import { Redirect, router, Stack } from "expo-router";
import { Redirect, router, Stack, usePathname } from "expo-router";
import { StatusBar } from 'expo-status-bar';
import { useEffect } from "react";
import { Easing, Notifier } from 'react-native-notifier';
@@ -22,6 +23,7 @@ import { Provider } from "react-redux";
export default function RootLayout() {
const { token, decryptToken, isLoading } = useAuthSession()
const pathname = usePathname()
async function handleReadNotification(id: string, category: string, idContent: string) {
try {
@@ -33,12 +35,30 @@ export default function RootLayout() {
}
}
useEffect(() => {
const checkNavigation = async () => {
const navData = await AsyncStorage.getItem('navigateOnOpen');
if (navData) {
const { screen, content } = JSON.parse(navData);
await AsyncStorage.removeItem('navigateOnOpen'); // reset
pushToPage(screen, content)
}
};
checkNavigation();
}, []);
useEffect(() => {
const unsubscribe = firebase.app().messaging().onMessage(async remoteMessage => {
const id = remoteMessage?.data?.id;
const category = remoteMessage?.data?.category;
const content = remoteMessage?.data?.content;
if (remoteMessage.notification != undefined && remoteMessage.notification.title != undefined && remoteMessage.notification.body != undefined) {
if (
remoteMessage.notification != undefined &&
remoteMessage.notification.title != undefined &&
remoteMessage.notification.body != undefined &&
pathname != `/${category}/${content}`
) {
Notifier.showNotification({
title: remoteMessage.notification?.title,
description: remoteMessage.notification?.body,

View File

@@ -149,7 +149,7 @@ export default function CreateAnnouncement() {
<Text style={[Styles.textDefaultSemiBold]}>{item.name}</Text>
{
item.Division.map((division: any, i: any) => (
<View key={i} style={[Styles.rowItemsCenter, Styles.mv05]}>
<View key={i} style={[Styles.rowItemsCenter]}>
<Entypo name="dot-single" size={24} color="black" />
<Text style={[Styles.textDefault]}>{division.name}</Text>
</View>

View File

@@ -193,7 +193,7 @@ export default function EditAnnouncement() {
<Text style={[Styles.textDefaultSemiBold]}>{item.name}</Text>
{
item.Division.map((division: any, i: any) => (
<View key={i} style={[Styles.rowItemsCenter, Styles.mv05]}>
<View key={i} style={[Styles.rowItemsCenter]}>
<Entypo name="dot-single" size={24} color="black" />
<Text style={[Styles.textDefault]}>{division.name}</Text>
</View>

View File

@@ -43,8 +43,6 @@ export default function EditBanner() {
if (!result.canceled) {
setSelectedImage(result.assets[0].uri);
setImgForm(result.assets[0]);
} else {
alert("Tidak ada gambar yang dipilih");
}
};

View File

@@ -42,8 +42,6 @@ export default function CreateBanner() {
if (result.assets?.[0].uri) {
setSelectedImage(result.assets[0].uri);
setImgForm(result.assets[0]);
} else {
alert("Tidak ada gambar yang dipilih");
}
}
};

View File

@@ -155,7 +155,7 @@ export default function BannerList() {
/>
<MenuItemRow
icon={<MaterialCommunityIcons name="file-eye" color="black" size={25} />}
title="Lihat File"
title="Lihat / Share"
onPress={() => { openFile() }}
/>
<MenuItemRow

View File

@@ -201,7 +201,6 @@ export default function EditProfile() {
setSelectedImage(result.assets[0].uri);
setImgForm(result.assets[0]);
} else {
alert("Tidak ada gambar yang dipilih");
setErrorImg(false)
}
};

View File

@@ -1,6 +1,7 @@
import ButtonBackHeader from "@/components/buttonBackHeader";
import ImageUser from "@/components/imageNew";
import ItemDetailMember from "@/components/itemDetailMember";
import LabelStatus from "@/components/labelStatus";
import HeaderRightMemberDetail from "@/components/member/headerMemberDetail";
import Skeleton from "@/components/skeleton";
import Text from "@/components/Text";
@@ -102,6 +103,11 @@ export default function MemberDetail() {
<View style={[Styles.p15]}>
<View style={[Styles.rowSpaceBetween]}>
<Text style={[Styles.textDefaultSemiBold]}>Informasi</Text>
<LabelStatus
size="small"
category={data?.isActive ? 'success' : 'error'}
text={data?.isActive ? 'AKTIF' : 'TIDAK AKTIF'}
/>
</View>
{
loading ?

View File

@@ -201,9 +201,6 @@ export default function CreateMember() {
if (!result.canceled) {
setSelectedImage(result.assets[0].uri);
setImgForm(result.assets[0]);
} else {
alert("Tidak ada gambar yang dipilih");
}
};

View File

@@ -228,7 +228,6 @@ export default function EditMember() {
setSelectedImage(result.assets[0].uri);
setImgForm(result.assets[0]);
} else {
alert("Tidak ada gambar yang dipilih");
setErrorImg(false)
}
};

View File

@@ -51,7 +51,7 @@ export default function FileDivisionDetail() {
const openFile = (item: Props) => {
setLoadingOpen(true)
if (Platform.OS == 'android') setLoadingOpen(true)
let remoteUrl = 'https://wibu-storage.wibudev.com/api/files/' + item.idStorage;
const fileName = item.name + '.' + item.extension;
let localPath = `${FileSystem.documentDirectory}/${fileName}`;
@@ -59,6 +59,7 @@ export default function FileDivisionDetail() {
FileSystem.downloadAsync(remoteUrl, localPath).then(async ({ uri }) => {
const contentURL = await FileSystem.getContentUriAsync(uri);
setLoadingOpen(false)
try {
if (Platform.OS == 'android') {
// open with android intent
@@ -79,7 +80,7 @@ export default function FileDivisionDetail() {
} catch (error) {
Alert.alert('INFO', 'Gagal membuka file, tidak ada aplikasi yang dapat membuka file ini');
} finally {
setLoadingOpen(false)
if (Platform.OS == 'android') setLoadingOpen(false)
}
});
};

View File

@@ -78,11 +78,11 @@ export function InputForm({ label, value, placeholder, onChange, info, disable,
placeholder={placeholder}
keyboardType={type}
editable={!disable}
style={[Styles.inputRoundForm, error && { borderColor: "red" }, round && Styles.round30, { backgroundColor: bg && bg == 'white' ? 'white' : 'transparent' }, { color: 'black' }, multiline && { height: 100, textAlignVertical: 'top' }]}
style={[Styles.inputRoundForm, error && { borderColor: "red" }, round && Styles.round30, { backgroundColor: bg && bg == 'white' ? 'white' : 'transparent' }, { color: 'black' }, multiline && { height: 150, textAlignVertical: 'top' }]}
onChangeText={onChange}
placeholderTextColor={'gray'}
multiline={multiline}
numberOfLines={multiline ? 4 : undefined}
numberOfLines={multiline ? 5 : undefined}
/>
{error && (<Text style={[Styles.textInformation, Styles.cError, Styles.mt05]}>{errorText}</Text>)}
{info != undefined && (<Text style={[Styles.textInformation, Styles.mt05, Styles.cGray]}>{info}</Text>)}

View File

@@ -10,7 +10,7 @@ type Props = {
}
export default function LabelStatus({ category, text, size }: Props) {
return (
<View style={[size == "small" ? Styles.labelStatusSmall : Styles.labelStatus, ColorsStatus[category], Styles.round10]}>
<View style={[size == "small" ? Styles.labelStatusSmall : Styles.labelStatus, ColorsStatus[category], Styles.round10, Styles.contentItemCenter]}>
<Text style={[size == "small" ? Styles.textSmallSemiBold : Styles.textMediumSemiBold, Styles.cWhite, { textAlign: 'center' }]}>{text}</Text>
</View>
)

View File

@@ -173,7 +173,7 @@ export default function SectionFile({ status, member, refreshing }: { status: nu
<View style={Styles.rowItemsCenter}>
<MenuItemRow
icon={<MaterialCommunityIcons name="file-eye" color="black" size={25} />}
title="Lihat File"
title="Lihat / Share"
onPress={() => {
openFile()
}}

View File

@@ -157,7 +157,7 @@ export default function SectionFileTask({refreshing}: {refreshing: boolean}) {
<View style={Styles.rowItemsCenter}>
<MenuItemRow
icon={<MaterialCommunityIcons name="file-eye" color="black" size={25} />}
title="Lihat File"
title="Lihat / Share"
onPress={() => {
openFile()
// setModal(false)

View File

@@ -1,3 +1,4 @@
import AsyncStorage from '@react-native-async-storage/async-storage';
import { getApp, getApps, initializeApp } from '@react-native-firebase/app';
import messaging, { getMessaging } from '@react-native-firebase/messaging';
import { useEffect } from 'react';
@@ -24,9 +25,18 @@ const initializeFirebase = async () => {
// Set auto initialization and background message handler
mess.setAutoInitEnabled(true);
// mess.setBackgroundMessageHandler(async remoteMessage => {
// // console.log('Message handled in the background!', remoteMessage);
// // pushToPage(String(remoteMessage?.data?.category), String(remoteMessage?.data?.content))
// });
mess.setBackgroundMessageHandler(async remoteMessage => {
// console.log('Message handled in the background!', remoteMessage);
// pushToPage(String(remoteMessage?.data?.category), String(remoteMessage?.data?.content))
const screen = remoteMessage?.data?.category;
const content = remoteMessage?.data?.content;
if (screen && content) {
await AsyncStorage.setItem('navigateOnOpen', JSON.stringify({ screen, content }));
}
});
return mess