fix: tampilan
Deskrispi: - color input - value length No ISSues
This commit is contained in:
@@ -68,7 +68,7 @@ export function InputForm({ label, value, placeholder, onChange, info, disable,
|
|||||||
value={value}
|
value={value}
|
||||||
placeholder={placeholder}
|
placeholder={placeholder}
|
||||||
keyboardType={type}
|
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}
|
onChangeText={onChange}
|
||||||
placeholderTextColor={'gray'}
|
placeholderTextColor={'gray'}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ export default function ModalSelectMultiple({ open, close, title, category, choo
|
|||||||
const response = await apiGetDivisionGroup({ user: hasil })
|
const response = await apiGetDivisionGroup({ user: hasil })
|
||||||
setData(response.data)
|
setData(response.data)
|
||||||
|
|
||||||
if (value.length > 0) {
|
if (value?.length > 0) {
|
||||||
const formatArray = value.reduce((result: any, obj: any) => {
|
const formatArray = value.reduce((result: any, obj: any) => {
|
||||||
result[obj.id] = obj.Division.map((item: any) => item.id);
|
result[obj.id] = obj.Division.map((item: any) => item.id);
|
||||||
return result;
|
return result;
|
||||||
@@ -84,7 +84,7 @@ export default function ModalSelectMultiple({ open, close, title, category, choo
|
|||||||
if (newChecked[groupId]) {
|
if (newChecked[groupId]) {
|
||||||
if (newChecked[groupId].includes(divisionId)) {
|
if (newChecked[groupId].includes(divisionId)) {
|
||||||
newChecked[groupId] = newChecked[groupId].filter(item => item !== divisionId);
|
newChecked[groupId] = newChecked[groupId].filter(item => item !== divisionId);
|
||||||
if (newChecked[groupId].length === 0) {
|
if (newChecked[groupId]?.length === 0) {
|
||||||
delete newChecked[groupId];
|
delete newChecked[groupId];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -102,7 +102,7 @@ export default function ModalSelectMultiple({ open, close, title, category, choo
|
|||||||
if (newChecked[groupId]) {
|
if (newChecked[groupId]) {
|
||||||
delete newChecked[groupId];
|
delete newChecked[groupId];
|
||||||
} else {
|
} 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)
|
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) || [];
|
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) }}>
|
<Pressable style={[Styles.itemSelectModal]} onPress={() => { handleGroupCheck(item.id) }}>
|
||||||
<Text style={[Styles.textMediumSemiBold]}>{item.name}</Text>
|
<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} />
|
? <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} />
|
? <AntDesign name="minus" size={20} />
|
||||||
: <></>
|
: <></>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ import axios from 'axios';
|
|||||||
|
|
||||||
const api = axios.create({
|
const api = axios.create({
|
||||||
// baseURL: 'http://10.0.2.2:3000/api',
|
// baseURL: 'http://10.0.2.2:3000/api',
|
||||||
// baseURL: 'https://stg-darmasaba.wibudev.com/api',
|
baseURL: 'https://stg-darmasaba.wibudev.com/api',
|
||||||
baseURL: 'http://192.168.1.243:3000/api',
|
// baseURL: 'http://192.168.1.243:3000/api',
|
||||||
});
|
});
|
||||||
|
|
||||||
export const apiCheckPhoneLogin = async (body: { phone: string }) => {
|
export const apiCheckPhoneLogin = async (body: { phone: string }) => {
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import { getApp, getApps, initializeApp } from '@react-native-firebase/app';
|
|||||||
import { getMessaging } from '@react-native-firebase/messaging';
|
import { getMessaging } from '@react-native-firebase/messaging';
|
||||||
import { useEffect } from 'react';
|
import { useEffect } from 'react';
|
||||||
import { PermissionsAndroid } from 'react-native';
|
import { PermissionsAndroid } from 'react-native';
|
||||||
|
import { pushToPage } from './pushToPage';
|
||||||
|
|
||||||
// Your Firebase project configuration
|
// Your Firebase project configuration
|
||||||
const RNfirebaseConfig = {
|
const RNfirebaseConfig = {
|
||||||
@@ -23,7 +24,8 @@ const initializeFirebase = async () => {
|
|||||||
// Set auto initialization and background message handler
|
// Set auto initialization and background message handler
|
||||||
mess.setAutoInitEnabled(true);
|
mess.setAutoInitEnabled(true);
|
||||||
mess.setBackgroundMessageHandler(async remoteMessage => {
|
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
|
return mess
|
||||||
|
|||||||
Reference in New Issue
Block a user