Create PageWrapper component that routes to: - iOS: NewWrapper (stable, tested) - Android: NewWrapper_V2 (keyboard handling fix) New Files: - components/_ShareComponent/PageWrapper.tsx - docs/PAGEWRAPPER-USAGE.md Migrated Job Screens (10): - screens/Job/ScreenJobCreate.tsx: NewWrapper_V2 → PageWrapper - screens/Job/ScreenJobEdit.tsx: NewWrapper_V2 → PageWrapper - screens/Job/ScreenArchive.tsx: ViewWrapper → PageWrapper - screens/Job/ScreenArchive2.tsx: NewWrapper_V2 → PageWrapper - screens/Job/ScreenBeranda2.tsx: NewWrapper_V2 → PageWrapper - screens/Job/MainViewStatus2.tsx: NewWrapper_V2 → PageWrapper - app/(application)/(user)/job/[id]/index.tsx: ViewWrapper → PageWrapper - app/(application)/(user)/job/[id]/archive.tsx: ViewWrapper → PageWrapper - app/(application)/(user)/job/[id]/[status]/detail.tsx: NewWrapper_V2 → PageWrapper Benefits: - iOS users (70%+) get stable NewWrapper - Android users get keyboard handling fix - Clean API - no Platform.OS checks in screens - Easy future migration path Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
58 lines
1.5 KiB
TypeScript
58 lines
1.5 KiB
TypeScript
/* eslint-disable react-hooks/exhaustive-deps */
|
|
import { BaseBox, LoaderCustom, PageWrapper, TextCustom } from "@/components";
|
|
import { useAuth } from "@/hooks/use-auth";
|
|
import { apiJobGetAll } from "@/service/api-client/api-job";
|
|
import { useFocusEffect } from "expo-router";
|
|
import _ from "lodash";
|
|
import { useCallback, useState } from "react";
|
|
|
|
export default function Job_ScreenArchive() {
|
|
const { user } = useAuth();
|
|
const [listData, setListData] = useState<any[]>([]);
|
|
const [isLoadData, setIsLoadData] = useState(false);
|
|
|
|
useFocusEffect(
|
|
useCallback(() => {
|
|
onLoadData();
|
|
}, [user?.id])
|
|
);
|
|
|
|
const onLoadData = async () => {
|
|
try {
|
|
setIsLoadData(true);
|
|
const response = await apiJobGetAll({
|
|
category: "archive",
|
|
authorId: user?.id,
|
|
});
|
|
setListData(response.data);
|
|
} catch (error) {
|
|
console.log("[ERROR]", error);
|
|
} finally {
|
|
setIsLoadData(false);
|
|
}
|
|
};
|
|
|
|
return (
|
|
<PageWrapper hideFooter>
|
|
{isLoadData ? (
|
|
<LoaderCustom />
|
|
) : _.isEmpty(listData) ? (
|
|
<TextCustom align="center">Anda tidak memiliki arsip</TextCustom>
|
|
) : (
|
|
listData.map((item, index) => (
|
|
<BaseBox
|
|
key={index}
|
|
paddingTop={20}
|
|
paddingBottom={20}
|
|
href={`/job/${item.id}/archive`}
|
|
>
|
|
<TextCustom align="center" bold truncate size="large">
|
|
{item?.title || "-"}
|
|
</TextCustom>
|
|
</BaseBox>
|
|
))
|
|
)}
|
|
</PageWrapper>
|
|
);
|
|
}
|