fix: tampilan

Deskrispi:
- color input
- value length

No ISSues
This commit is contained in:
2025-07-02 16:49:34 +08:00
parent 32908e1362
commit b38d339a28
4 changed files with 11 additions and 9 deletions

View File

@@ -68,7 +68,7 @@ export function InputForm({ label, value, placeholder, onChange, info, disable,
value={value}
placeholder={placeholder}
keyboardType={type}
style={[Styles.inputRoundForm, error && { borderColor: "red" }, round && Styles.round30, { backgroundColor: bg && bg == 'white' ? 'white' : 'transparent' }]}
style={[Styles.inputRoundForm, error && { borderColor: "red" }, round && Styles.round30, { backgroundColor: bg && bg == 'white' ? 'white' : 'transparent' }, { color: 'black' }]}
onChangeText={onChange}
placeholderTextColor={'gray'}
/>

View File

@@ -44,7 +44,7 @@ export default function ModalSelectMultiple({ open, close, title, category, choo
const response = await apiGetDivisionGroup({ user: hasil })
setData(response.data)
if (value.length > 0) {
if (value?.length > 0) {
const formatArray = value.reduce((result: any, obj: any) => {
result[obj.id] = obj.Division.map((item: any) => item.id);
return result;
@@ -84,7 +84,7 @@ export default function ModalSelectMultiple({ open, close, title, category, choo
if (newChecked[groupId]) {
if (newChecked[groupId].includes(divisionId)) {
newChecked[groupId] = newChecked[groupId].filter(item => item !== divisionId);
if (newChecked[groupId].length === 0) {
if (newChecked[groupId]?.length === 0) {
delete newChecked[groupId];
}
} else {
@@ -102,7 +102,7 @@ export default function ModalSelectMultiple({ open, close, title, category, choo
if (newChecked[groupId]) {
delete newChecked[groupId];
} else {
if (data.find((item: { id: string }) => item.id === groupId)?.Division.length == 0) {
if (data.find((item: { id: string }) => item.id === groupId)?.Division?.length == 0) {
return ToastAndroid.show('Tidak ada divisi', ToastAndroid.SHORT)
}
newChecked[groupId] = data.find((item: { id: string }) => item.id === groupId)?.Division.map((item: { id: any }) => item.id) || [];
@@ -174,9 +174,9 @@ export default function ModalSelectMultiple({ open, close, title, category, choo
<Pressable style={[Styles.itemSelectModal]} onPress={() => { handleGroupCheck(item.id) }}>
<Text style={[Styles.textMediumSemiBold]}>{item.name}</Text>
{
checked[item.id] && checked[item.id].length === item.Division.length
checked[item.id] && checked[item.id]?.length === item.Division?.length
? <AntDesign name="check" size={20} />
: (checked[item.id] && checked[item.id].length > 0 && checked[item.id].length < item.Division.length)
: (checked[item.id] && checked[item.id]?.length > 0 && checked[item.id]?.length < item.Division?.length)
? <AntDesign name="minus" size={20} />
: <></>
}

View File

@@ -2,8 +2,8 @@ import axios from 'axios';
const api = axios.create({
// baseURL: 'http://10.0.2.2:3000/api',
// baseURL: 'https://stg-darmasaba.wibudev.com/api',
baseURL: 'http://192.168.1.243:3000/api',
baseURL: 'https://stg-darmasaba.wibudev.com/api',
// baseURL: 'http://192.168.1.243:3000/api',
});
export const apiCheckPhoneLogin = async (body: { phone: string }) => {

View File

@@ -2,6 +2,7 @@ import { getApp, getApps, initializeApp } from '@react-native-firebase/app';
import { getMessaging } from '@react-native-firebase/messaging';
import { useEffect } from 'react';
import { PermissionsAndroid } from 'react-native';
import { pushToPage } from './pushToPage';
// Your Firebase project configuration
const RNfirebaseConfig = {
@@ -23,7 +24,8 @@ 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);
// console.log('Message handled in the background!', remoteMessage);
// pushToPage(String(remoteMessage?.data?.category), String(remoteMessage?.data?.content))
});
return mess