fix : tampilan
Deskripsi: - input time pada kalender divisi - api dokumen divisi >> blm selesai No Issues
This commit is contained in:
@@ -10,6 +10,8 @@ import { stringToDateTime } from "@/lib/fun_stringToDate";
|
|||||||
import { Stack, router, useLocalSearchParams } from "expo-router";
|
import { Stack, router, useLocalSearchParams } from "expo-router";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import {
|
import {
|
||||||
|
KeyboardAvoidingView,
|
||||||
|
Platform,
|
||||||
SafeAreaView,
|
SafeAreaView,
|
||||||
ScrollView,
|
ScrollView,
|
||||||
View
|
View
|
||||||
@@ -141,8 +143,12 @@ export default function CalendarDivisionCreate() {
|
|||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
<KeyboardAvoidingView
|
||||||
|
behavior={Platform.OS === 'ios' ? 'padding' : undefined}
|
||||||
|
keyboardVerticalOffset={110}
|
||||||
|
>
|
||||||
<ScrollView>
|
<ScrollView>
|
||||||
<View style={[Styles.p15, Styles.mb100]}>
|
<View style={[Styles.p15]}>
|
||||||
<InputForm
|
<InputForm
|
||||||
label="Nama Acara"
|
label="Nama Acara"
|
||||||
type="default"
|
type="default"
|
||||||
@@ -229,6 +235,7 @@ export default function CalendarDivisionCreate() {
|
|||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
</KeyboardAvoidingView>
|
||||||
|
|
||||||
<ModalSelect
|
<ModalSelect
|
||||||
category={"type-event-repeat"}
|
category={"type-event-repeat"}
|
||||||
|
|||||||
@@ -110,10 +110,6 @@ export default function DocumentDivision() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
handleLoad(true);
|
|
||||||
}, [path]);
|
|
||||||
|
|
||||||
const handleCheckboxChange = (index: number) => {
|
const handleCheckboxChange = (index: number) => {
|
||||||
setDariSelectAll(false);
|
setDariSelectAll(false);
|
||||||
if (selectedFiles.some((i: any) => i.id == data[index].id)) {
|
if (selectedFiles.some((i: any) => i.id == data[index].id)) {
|
||||||
@@ -308,6 +304,10 @@ export default function DocumentDivision() {
|
|||||||
setRefreshing(false)
|
setRefreshing(false)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
handleLoad(true);
|
||||||
|
}, [path]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SafeAreaView>
|
<SafeAreaView>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ export default function HeaderRightDocument({ path }: { path: string }) {
|
|||||||
async function handleCreateFolder() {
|
async function handleCreateFolder() {
|
||||||
try {
|
try {
|
||||||
const hasil = await decryptToken(String(token?.current))
|
const hasil = await decryptToken(String(token?.current))
|
||||||
const response = await apiCreateFolderDocument({ user: hasil, name, path, idDivision: id })
|
const response = await apiCreateFolderDocument({ data: { user: hasil, name, path, idDivision: id } })
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
Toast.show({ type: 'small', text1: 'Berhasil membuat folder baru', })
|
Toast.show({ type: 'small', text1: 'Berhasil membuat folder baru', })
|
||||||
dispatch(setUpdateDokumen(!update))
|
dispatch(setUpdateDokumen(!update))
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ type Props = {
|
|||||||
export function InputDate({ label, value, placeholder, onChange, info, disable, error, errorText, required, mode, round, width, }: Props) {
|
export function InputDate({ label, value, placeholder, onChange, info, disable, error, errorText, required, mode, round, width, }: Props) {
|
||||||
const [modal, setModal] = useState(false);
|
const [modal, setModal] = useState(false);
|
||||||
|
|
||||||
const onChangeDate = ({ type }: { type: string }, selectedDate: any) => {
|
const onChangeDate = (type: string, selectedDate: any) => {
|
||||||
if (type === "set") {
|
if (type === "set") {
|
||||||
if (mode == "date") {
|
if (mode == "date") {
|
||||||
onChange(dayjs(selectedDate).format("DD-MM-YYYY"))
|
onChange(dayjs(selectedDate).format("DD-MM-YYYY"))
|
||||||
@@ -60,10 +60,10 @@ export function InputDate({ label, value, placeholder, onChange, info, disable,
|
|||||||
{
|
{
|
||||||
modal && (
|
modal && (
|
||||||
<DateTimePicker
|
<DateTimePicker
|
||||||
value={value ? stringToDate(value) : new Date()}
|
value={new Date()}
|
||||||
mode={mode}
|
mode={mode}
|
||||||
display="default"
|
display="default"
|
||||||
onChange={onChangeDate}
|
onChange={(event, date) => { onChangeDate(event.type, date) }}
|
||||||
onTouchCancel={() => setModal(false)}
|
onTouchCancel={() => setModal(false)}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -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.135:3000/api',
|
baseURL: 'http://192.168.1.89:3000/api',
|
||||||
});
|
});
|
||||||
|
|
||||||
export const apiCheckPhoneLogin = async (body: { phone: string }) => {
|
export const apiCheckPhoneLogin = async (body: { phone: string }) => {
|
||||||
@@ -613,7 +613,7 @@ export const apiDocumentDelete = async (data: { user: string, data: any[] }) =>
|
|||||||
return response.data
|
return response.data
|
||||||
};
|
};
|
||||||
|
|
||||||
export const apiCreateFolderDocument = async (data: { name: string, path: string, idDivision: string, user: string }) => {
|
export const apiCreateFolderDocument = async ({ data }: { data: { name: string, path: string, idDivision: string, user: string } }) => {
|
||||||
const response = await api.post(`/mobile/document/`, data)
|
const response = await api.post(`/mobile/document/`, data)
|
||||||
return response.data;
|
return response.data;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user