From f9297910751c58f67616cfd45ff28b5e7dad940e Mon Sep 17 00:00:00 2001 From: amaliadwiy Date: Mon, 11 Aug 2025 10:43:50 +0800 Subject: [PATCH 1/2] fix: list data Deskripsi: - perbaikan list data pada jabatan dan group menggunakan virtualized No Issues --- app/(application)/group/index.tsx | 105 +++++++++++++++------------ app/(application)/position/index.tsx | 101 ++++++++++++++------------ 2 files changed, 113 insertions(+), 93 deletions(-) diff --git a/app/(application)/group/index.tsx b/app/(application)/group/index.tsx index 575ce1b..f7485ff 100644 --- a/app/(application)/group/index.tsx +++ b/app/(application)/group/index.tsx @@ -15,7 +15,7 @@ import { setUpdateGroup } from "@/lib/groupSlice"; import { useAuthSession } from "@/providers/AuthProvider"; import { AntDesign, Feather, MaterialCommunityIcons } from "@expo/vector-icons"; import { useEffect, useState } from "react"; -import { RefreshControl, SafeAreaView, ScrollView, View } from "react-native"; +import { RefreshControl, View, VirtualizedList } from "react-native"; import Toast from "react-native-toast-message"; import { useDispatch, useSelector } from "react-redux"; @@ -116,9 +116,17 @@ export default function Index() { } + const getItem = (_data: unknown, index: number): Props => ({ + id: data[index].id, + name: data[index].name, + isActive: data[index].isActive, + }); + + + return ( - - + + - - } - style={[Styles.h100]} - > - - { - - loading ? - arrSkeleton.map((item, index) => { + + + { + loading ? + arrSkeleton.map((item, index) => { + return ( + + ) + }) + : + data.length > 0 ? + data.length} + getItem={getItem} + renderItem={({ item, index }: { item: Props, index: number }) => { return ( - + { + setIdChoose(item.id) + setActiveChoose(item.isActive) + setTitleChoose(item.name) + setModal(true) + }} + borderType="all" + icon={ + + + + } + title={item.name} + /> ) - }) - : - data.length > 0 ? - data.map((item, index) => { - return ( - { - setIdChoose(item.id) - setActiveChoose(item.isActive) - setTitleChoose(item.name) - setModal(true) - }} - borderType="all" - icon={ - - - - } - title={item.name} - /> - ) - }) - : - Tidak ada data - } - - + }} + keyExtractor={(item, index) => String(index)} + showsVerticalScrollIndicator={false} + refreshControl={ + + } + /> + : + Tidak ada data + } setModal(false)} title={titleChoose}> @@ -228,8 +238,7 @@ export default function Index() { + - - ) } \ No newline at end of file diff --git a/app/(application)/position/index.tsx b/app/(application)/position/index.tsx index 57aaa4a..21026d3 100644 --- a/app/(application)/position/index.tsx +++ b/app/(application)/position/index.tsx @@ -16,7 +16,7 @@ import { useAuthSession } from "@/providers/AuthProvider"; import { AntDesign, Feather, MaterialCommunityIcons } from "@expo/vector-icons"; import { useLocalSearchParams } from "expo-router"; import { useEffect, useState } from "react"; -import { RefreshControl, SafeAreaView, ScrollView, View } from "react-native"; +import { RefreshControl, View, VirtualizedList } from "react-native"; import Toast from "react-native-toast-message"; import { useDispatch, useSelector } from "react-redux"; @@ -129,9 +129,18 @@ export default function Index() { setRefreshing(false) }; + + const getItem = (_data: unknown, index: number): Props => ({ + id: data[index].id, + name: data[index].name, + idGroup: data[index].idGroup, + group: data[index].group, + isActive: data[index].isActive, + }); + return ( - - + + Filter : {nameGroup} } - - }> - - { - loading ? - arrSkeleton.map((item, index) => { - return ( - - ) - }) - : - data.length > 0 ? - data.map((item, index) => { - return ( - { handleChooseData(item.id, item.name, item.isActive, item.idGroup) }} - borderType="all" - icon={ - - - - } - title={item.name} - subtitle={item.group} - /> - ) - }) - : - Tidak ada data - } - - - + + { + loading ? + arrSkeleton.map((item, index) => { + return ( + + ) + }) + : + data.length > 0 ? + data.length} + getItem={getItem} + renderItem={({ item, index }: { item: Props, index: number }) => { + return ( + { handleChooseData(item.id, item.name, item.isActive, item.idGroup) }} + borderType="all" + icon={ + + + + } + title={item.name} + subtitle={item.group} + /> + ) + }} + keyExtractor={(item, index) => String(index)} + showsVerticalScrollIndicator={false} + refreshControl={ + + } + /> + : + Tidak ada data + } + setModal(false)} title={chooseData.name}> - - + ) } \ No newline at end of file From 0f5a56c6124d0c5d34dcc61bf706200711598cdf Mon Sep 17 00:00:00 2001 From: amaliadwiy Date: Mon, 11 Aug 2025 17:08:55 +0800 Subject: [PATCH 2/2] upd: login Deskripsi: - tinggi view - toast error kode verification No Issues --- components/auth/viewLogin.tsx | 2 +- components/auth/viewVerification.tsx | 2 +- lib/api.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/auth/viewLogin.tsx b/components/auth/viewLogin.tsx index c98239f..0098854 100644 --- a/components/auth/viewLogin.tsx +++ b/components/auth/viewLogin.tsx @@ -44,7 +44,7 @@ export default function ViewLogin({ onValidate }: Props) { return ( - + {