Compare commits

...

6 Commits

Author SHA1 Message Date
e3b5d3ddb1 feat: Implement PageWrapper and migrate all Job screens
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>
2026-04-06 14:41:54 +08:00
6b786d7983 refactor: Migrate Portofolio & Maps screens to NewWrapper_V2
Phase 3 Migration - Fix keyboard handling issues across 8 screens

Portofolio Screens (5):
- portofolio/[id]/edit-social-media.tsx: ViewWrapper → NewWrapper_V2
- portofolio/[id]/edit-logo.tsx: ViewWrapper → NewWrapper_V2
- portofolio/[id]/edit.tsx: NewWrapper → NewWrapper_V2 + fix React error
- portofolio/[id]/index.tsx: ViewWrapper → NewWrapper_V2
- screens/Portofolio/ScreenPortofolioCreate.tsx: NewWrapper → NewWrapper_V2

Maps Screens (3):
- screens/Maps/ScreenMapsCreate.tsx: NewWrapper → NewWrapper_V2
- screens/Maps/ScreenMapsEdit.tsx: ViewWrapper → NewWrapper_V2
- app/(application)/(user)/maps/[id]/custom-pin.tsx: ViewWrapper → NewWrapper_V2

Changes:
- Add enableKeyboardHandling to all form screens
- Wrap TextInputCustom/SelectCustom/TextAreaCustom with View onStartShouldSetResponder
- Fix React static flag error in portofolio edit loading state
- Update TASK-004 migration task file

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-04-06 11:20:20 +08:00
76759cc547 chore: Update layout headers and iOS build config
- Update waiting-room header to use AppHeader component
- Update profile create header with 'Buat Profil' title
- Update iOS Xcode project with MapLibre signature workaround
- Add iOS workspace Package.resolved

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-04-04 13:01:51 +08:00
3382c16cdb refactor: Migrate Profile screens to NewWrapper_V2
- Replace ViewWrapper/NewWrapper with NewWrapper_V2 in all Profile screens
- Add enableKeyboardHandling to form screens (create, edit, detail-blocked)
- Wrap all TextInput/SelectCustom with View onStartShouldSetResponder
- Fix keyboard handling issues (footer lift, white area, input cutoff)
- Migrate 7 Profile screens: create, edit, index, detail-blocked, blocked-list, update-photo, update-background

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-04-04 13:00:36 +08:00
3290fa99d2 refactor: Migrate UserSearch MainView_V2 to NewWrapper_V2
- Replace NewWrapper with NewWrapper_V2
- Add contentPaddingHorizontal={16} for consistent spacing
- Verify TypeScript compilation

Phase 1 continued: UserSearch screen migrated!

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-04-04 10:13:22 +08:00
940d31bfdc refactor: Update NewWrapper_V2 padding defaults
- Change default paddingTop to 8
- Change default paddingHorizontal to 0 (safe for existing layouts)
- Add explicit contentPaddingHorizontal={16} to Job screens
- Update interface documentation

This makes NewWrapper_V2 safer for mass migration while keeping
Job screens looking good with proper spacing.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-04-04 09:16:15 +08:00
34 changed files with 1296 additions and 511 deletions

View File

@@ -21,8 +21,9 @@ export default function UserLayout() {
<Stack.Screen <Stack.Screen
name="waiting-room" name="waiting-room"
options={{ options={{
title: "Waiting Room", // title: "Waiting Room",
headerBackVisible: false, // headerBackVisible: false,
header: () => <AppHeader title="Waiting Room" showBack={false} />,
}} }}
/> />

View File

@@ -5,7 +5,7 @@ import {
DrawerCustom, DrawerCustom,
LoaderCustom, LoaderCustom,
MenuDrawerDynamicGrid, MenuDrawerDynamicGrid,
NewWrapper_V2, PageWrapper,
Spacing, Spacing,
StackCustom, StackCustom,
} from "@/components"; } from "@/components";
@@ -72,7 +72,7 @@ export default function JobDetailStatus() {
), ),
}} }}
/> />
<NewWrapper_V2> <PageWrapper>
{isLoadData ? ( {isLoadData ? (
<LoaderCustom /> <LoaderCustom />
) : ( ) : (
@@ -96,7 +96,7 @@ export default function JobDetailStatus() {
<Spacing /> <Spacing />
</> </>
)} )}
</NewWrapper_V2> </PageWrapper>
<DrawerCustom <DrawerCustom
isVisible={openDrawer} isVisible={openDrawer}

View File

@@ -2,9 +2,9 @@
import { import {
ButtonCustom, ButtonCustom,
LoaderCustom, LoaderCustom,
PageWrapper,
Spacing, Spacing,
StackCustom, StackCustom,
ViewWrapper,
} from "@/components"; } from "@/components";
import Job_BoxDetailSection from "@/screens/Job/BoxDetailSection"; import Job_BoxDetailSection from "@/screens/Job/BoxDetailSection";
import { apiJobGetOne, apiJobUpdateData } from "@/service/api-client/api-job"; import { apiJobGetOne, apiJobUpdateData } from "@/service/api-client/api-job";
@@ -71,7 +71,7 @@ export default function JobDetailArchive() {
{isLoadData ? ( {isLoadData ? (
<LoaderCustom /> <LoaderCustom />
) : ( ) : (
<ViewWrapper> <PageWrapper>
<> <>
<StackCustom> <StackCustom>
<Job_BoxDetailSection data={data} /> <Job_BoxDetailSection data={data} />
@@ -83,17 +83,10 @@ export default function JobDetailArchive() {
> >
Publish kembali Publish kembali
</ButtonCustom> </ButtonCustom>
{/* <Job_ButtonStatusSection
id={id as string}
status={status as string}
isLoading={isLoading}
onSetLoading={setIsLoading}
isArchive={true}
/> */}
</StackCustom> </StackCustom>
<Spacing /> <Spacing />
</> </>
</ViewWrapper> </PageWrapper>
)} )}
</> </>
); );

View File

@@ -1,5 +1,5 @@
/* eslint-disable react-hooks/exhaustive-deps */ /* eslint-disable react-hooks/exhaustive-deps */
import { ButtonCustom, LoaderCustom, Spacing, StackCustom, ViewWrapper } from "@/components"; import { ButtonCustom, LoaderCustom, PageWrapper, Spacing, StackCustom } from "@/components";
import { MainColor } from "@/constants/color-palet"; import { MainColor } from "@/constants/color-palet";
import { ICON_SIZE_SMALL } from "@/constants/constans-value"; import { ICON_SIZE_SMALL } from "@/constants/constans-value";
import Job_BoxDetailSection from "@/screens/Job/BoxDetailSection"; import Job_BoxDetailSection from "@/screens/Job/BoxDetailSection";
@@ -88,7 +88,7 @@ export default function JobDetail() {
}; };
return ( return (
<ViewWrapper> <PageWrapper>
{isLoading ? ( {isLoading ? (
<LoaderCustom /> <LoaderCustom />
) : ( ) : (
@@ -101,6 +101,6 @@ export default function JobDetail() {
<Spacing /> <Spacing />
</> </>
)} )}
</ViewWrapper> </PageWrapper>
); );
} }

View File

@@ -8,7 +8,7 @@ import {
MapCustom, MapCustom,
Spacing, Spacing,
StackCustom, StackCustom,
ViewWrapper, NewWrapper_V2,
} from "@/components"; } from "@/components";
import CenterCustom from "@/components/Center/CenterCustom"; import CenterCustom from "@/components/Center/CenterCustom";
import { router, useLocalSearchParams } from "expo-router"; import { router, useLocalSearchParams } from "expo-router";
@@ -30,7 +30,11 @@ export default function MapsCustomPin() {
); );
return ( return (
<> <>
<ViewWrapper footerComponent={buttonFooter}> <NewWrapper_V2
enableKeyboardHandling
keyboardScrollOffset={100}
footerComponent={buttonFooter}
>
<StackCustom> <StackCustom>
<InformationBox text="Pin map akan secara otomatis menampilkan logo pada porotofolio ini, jika anda ingin melakukan custom silahkan upload logo pin baru anda." /> <InformationBox text="Pin map akan secara otomatis menampilkan logo pada porotofolio ini, jika anda ingin melakukan custom silahkan upload logo pin baru anda." />
<CenterCustom> <CenterCustom>
@@ -49,7 +53,7 @@ export default function MapsCustomPin() {
</BaseBox> </BaseBox>
<Spacing /> <Spacing />
</StackCustom> </StackCustom>
</ViewWrapper> </NewWrapper_V2>
</> </>
); );
} }

View File

@@ -3,7 +3,7 @@ import {
BoxButtonOnFooter, BoxButtonOnFooter,
ButtonCenteredOnly, ButtonCenteredOnly,
ButtonCustom, ButtonCustom,
ViewWrapper NewWrapper_V2
} from "@/components"; } from "@/components";
import API_STRORAGE from "@/constants/base-url-api-strorage"; import API_STRORAGE from "@/constants/base-url-api-strorage";
import DIRECTORY_ID from "@/constants/directory-id"; import DIRECTORY_ID from "@/constants/directory-id";
@@ -126,7 +126,10 @@ export default function PortofolioEditLogo() {
return ( return (
<> <>
<ViewWrapper footerComponent={buttonFooter}> <NewWrapper_V2
contentPaddingHorizontal={16}
footerComponent={buttonFooter}
>
<BaseBox <BaseBox
style={{ style={{
alignItems: "center", alignItems: "center",
@@ -146,7 +149,7 @@ export default function PortofolioEditLogo() {
> >
Upload Upload
</ButtonCenteredOnly> </ButtonCenteredOnly>
</ViewWrapper> </NewWrapper_V2>
</> </>
); );
} }

View File

@@ -1,8 +1,8 @@
import { import {
BoxButtonOnFooter, BoxButtonOnFooter,
ButtonCustom, ButtonCustom,
NewWrapper_V2,
TextInputCustom, TextInputCustom,
ViewWrapper,
} from "@/components"; } from "@/components";
import { import {
apiGetOnePortofolio, apiGetOnePortofolio,
@@ -10,6 +10,7 @@ import {
} from "@/service/api-client/api-portofolio"; } from "@/service/api-client/api-portofolio";
import { useLocalSearchParams, router } from "expo-router"; import { useLocalSearchParams, router } from "expo-router";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { View } from "react-native";
import Toast from "react-native-toast-message"; import Toast from "react-native-toast-message";
export default function PortofolioEditSocialMedia() { export default function PortofolioEditSocialMedia() {
@@ -91,38 +92,52 @@ export default function PortofolioEditSocialMedia() {
return ( return (
<> <>
<ViewWrapper footerComponent={buttonFooter}> <NewWrapper_V2
<TextInputCustom enableKeyboardHandling
value={data.tiktok} keyboardScrollOffset={100}
onChangeText={(value) => setData({ ...data, tiktok: value })} footerComponent={buttonFooter}
label="Tiktok" >
placeholder="Masukkan tiktok" <View onStartShouldSetResponder={() => true}>
/> <TextInputCustom
<TextInputCustom value={data.tiktok}
value={data.instagram} onChangeText={(value) => setData({ ...data, tiktok: value })}
onChangeText={(value) => setData({ ...data, instagram: value })} label="Tiktok"
label="Instagram" placeholder="Masukkan tiktok"
placeholder="Masukkan instagram" />
/> </View>
<TextInputCustom <View onStartShouldSetResponder={() => true}>
value={data.facebook} <TextInputCustom
onChangeText={(value) => setData({ ...data, facebook: value })} value={data.instagram}
label="Facebook" onChangeText={(value) => setData({ ...data, instagram: value })}
placeholder="Masukkan facebook" label="Instagram"
/> placeholder="Masukkan instagram"
<TextInputCustom />
value={data.twitter} </View>
onChangeText={(value) => setData({ ...data, twitter: value })} <View onStartShouldSetResponder={() => true}>
label="Twitter" <TextInputCustom
placeholder="Masukkan twitter" value={data.facebook}
/> onChangeText={(value) => setData({ ...data, facebook: value })}
<TextInputCustom label="Facebook"
value={data.youtube} placeholder="Masukkan facebook"
onChangeText={(value) => setData({ ...data, youtube: value })} />
label="Youtube" </View>
placeholder="Masukkan youtube" <View onStartShouldSetResponder={() => true}>
/> <TextInputCustom
</ViewWrapper> value={data.twitter}
onChangeText={(value) => setData({ ...data, twitter: value })}
label="Twitter"
placeholder="Masukkan twitter"
/>
</View>
<View onStartShouldSetResponder={() => true}>
<TextInputCustom
value={data.youtube}
onChangeText={(value) => setData({ ...data, youtube: value })}
label="Youtube"
placeholder="Masukkan youtube"
/>
</View>
</NewWrapper_V2>
</> </>
); );
} }

View File

@@ -4,7 +4,7 @@ import {
BoxButtonOnFooter, BoxButtonOnFooter,
ButtonCustom, ButtonCustom,
CenterCustom, CenterCustom,
NewWrapper, NewWrapper_V2,
PhoneInputCustom, PhoneInputCustom,
SelectCustom, SelectCustom,
Spacing, Spacing,
@@ -16,7 +16,11 @@ import {
import ListSkeletonComponent from "@/components/_ShareComponent/ListSkeletonComponent"; import ListSkeletonComponent from "@/components/_ShareComponent/ListSkeletonComponent";
import { MainColor } from "@/constants/color-palet"; import { MainColor } from "@/constants/color-palet";
import { ICON_SIZE_XLARGE } from "@/constants/constans-value"; import { ICON_SIZE_XLARGE } from "@/constants/constans-value";
import { DEFAULT_COUNTRY, type CountryData, COUNTRIES } from "@/constants/countries"; import {
DEFAULT_COUNTRY,
type CountryData,
COUNTRIES,
} from "@/constants/countries";
import { import {
apiMasterBidangBisnis, apiMasterBidangBisnis,
apiMasterSubBidangBisnis, apiMasterSubBidangBisnis,
@@ -61,7 +65,8 @@ export default function PortofolioEdit() {
const [isLoading, setIsLoading] = useState(false); const [isLoading, setIsLoading] = useState(false);
const [data, setData] = useState<any>({}); const [data, setData] = useState<any>({});
const [phoneNumber, setPhoneNumber] = useState<string>(""); const [phoneNumber, setPhoneNumber] = useState<string>("");
const [selectedCountry, setSelectedCountry] = useState<CountryData>(DEFAULT_COUNTRY); const [selectedCountry, setSelectedCountry] =
useState<CountryData>(DEFAULT_COUNTRY);
const [bidangBisnis, setBidangBisnis] = useState< const [bidangBisnis, setBidangBisnis] = useState<
IMasterBidangBisnis[] | null IMasterBidangBisnis[] | null
>(null); >(null);
@@ -75,38 +80,38 @@ export default function PortofolioEdit() {
function handlePhoneChange(phone: string) { function handlePhoneChange(phone: string) {
setPhoneNumber(phone); setPhoneNumber(phone);
// Format phone number for API // Format phone number for API
const callingCode = selectedCountry.callingCode; const callingCode = selectedCountry.callingCode;
let fixNumber = phone.replace(/\s+/g, "").replace(/^0+/, ""); let fixNumber = phone.replace(/\s+/g, "").replace(/^0+/, "");
// Remove country code if already present // Remove country code if already present
if (fixNumber.startsWith(callingCode)) { if (fixNumber.startsWith(callingCode)) {
fixNumber = fixNumber.substring(callingCode.length); fixNumber = fixNumber.substring(callingCode.length);
} }
// Remove leading zero // Remove leading zero
fixNumber = fixNumber.replace(/^0+/, ""); fixNumber = fixNumber.replace(/^0+/, "");
const realNumber = callingCode + fixNumber; const realNumber = callingCode + fixNumber;
setData({ ...data, tlpn: realNumber }); setData({ ...data, tlpn: realNumber });
} }
function handleCountryChange(country: CountryData) { function handleCountryChange(country: CountryData) {
setSelectedCountry(country); setSelectedCountry(country);
// Re-format with new country code // Re-format with new country code
const callingCode = country.callingCode; const callingCode = country.callingCode;
let fixNumber = phoneNumber.replace(/\s+/g, "").replace(/^0+/, ""); let fixNumber = phoneNumber.replace(/\s+/g, "").replace(/^0+/, "");
// Remove country code if already present // Remove country code if already present
if (fixNumber.startsWith(callingCode)) { if (fixNumber.startsWith(callingCode)) {
fixNumber = fixNumber.substring(callingCode.length); fixNumber = fixNumber.substring(callingCode.length);
} }
// Remove leading zero // Remove leading zero
fixNumber = fixNumber.replace(/^0+/, ""); fixNumber = fixNumber.replace(/^0+/, "");
const realNumber = callingCode + fixNumber; const realNumber = callingCode + fixNumber;
setData({ ...data, tlpn: realNumber }); setData({ ...data, tlpn: realNumber });
} }
@@ -157,7 +162,7 @@ export default function PortofolioEdit() {
const fullNumber = response.data.tlpn; const fullNumber = response.data.tlpn;
let displayNumber = fullNumber; let displayNumber = fullNumber;
let detectedCountry = DEFAULT_COUNTRY; let detectedCountry = DEFAULT_COUNTRY;
// Try to detect country from calling code // Try to detect country from calling code
for (const country of COUNTRIES) { for (const country of COUNTRIES) {
if (fullNumber.startsWith(country.callingCode)) { if (fullNumber.startsWith(country.callingCode)) {
@@ -166,12 +171,12 @@ export default function PortofolioEdit() {
break; break;
} }
} }
setSelectedCountry(detectedCountry); setSelectedCountry(detectedCountry);
// Remove leading zero if present // Remove leading zero if present
displayNumber = displayNumber.replace(/^0+/, ""); displayNumber = displayNumber.replace(/^0+/, "");
setPhoneNumber(displayNumber); setPhoneNumber(displayNumber);
setData({ ...response.data, tlpn: displayNumber }); setData({ ...response.data, tlpn: displayNumber });
@@ -363,161 +368,176 @@ export default function PortofolioEdit() {
</BoxButtonOnFooter> </BoxButtonOnFooter>
); );
if (!bidangBisnis || !subBidangBisnis) { // if (!bidangBisnis || !subBidangBisnis) {
return ( // return (
<> // <View style={{ flex: 1, justifyContent: "center", alignItems: "center" }}>
<NewWrapper> // <ListSkeletonComponent height={80} />
<ListSkeletonComponent height={80} /> // </View>
</NewWrapper> // );
</> // }
);
}
return ( return (
<> <>
<NewWrapper footerComponent={buttonUpdate}> <NewWrapper_V2
<StackCustom gap={"xs"}> enableKeyboardHandling
<TextInputCustom keyboardScrollOffset={100}
required footerComponent={buttonUpdate}
label="Nama Bisnis" >
placeholder="Masukkan nama bisnis" {!bidangBisnis || !subBidangBisnis ? (
value={data.namaBisnis} <ListSkeletonComponent height={80} />
onChangeText={(value: any) => ) : (
setData({ ...data, namaBisnis: value }) <StackCustom gap={"xs"}>
} <View onStartShouldSetResponder={() => true}>
/> <TextInputCustom
<SelectCustom
label="Bidang Usaha"
required
data={bidangBisnis?.map((item) => ({
label: item.name,
value: item.id,
}))}
value={data.masterBidangBisnisId}
onChange={(value: any) => {
handleBidangBisnisChange(value);
}}
/>
{listSubBidangSelected.map((item, index) => {
// Filter data untuk select sub bidang, menghilangkan yang sudah dipilih kecuali untuk item ini sendiri
const selectedIds = listSubBidangSelected
.filter((_, i) => i !== index)
.map((s) => s.MasterSubBidangBisnis?.id)
.filter((id) => id); // Filter hanya yang memiliki id (tidak kosong)
const availableSubBidangOptions = (selectedSubBidang || [])
.filter((sub: any) => {
// Tampilkan jika ini adalah opsi yang dipilih saat ini atau belum dipilih di sub bidang lainnya
return (
sub.id === item.MasterSubBidangBisnis?.id ||
!selectedIds.includes(sub.id)
);
})
.map((sub: any) => ({
value: sub.id,
label: sub.name,
}));
return (
<SelectCustom
key={index}
label="Sub Bidang Usaha"
required required
data={availableSubBidangOptions} label="Nama Bisnis"
value={item.MasterSubBidangBisnis?.id || null} placeholder="Masukkan nama bisnis"
value={data.namaBisnis}
onChangeText={(value: any) =>
setData({ ...data, namaBisnis: value })
}
/>
</View>
<View onStartShouldSetResponder={() => true}>
<SelectCustom
label="Bidang Usaha"
required
data={bidangBisnis?.map((item) => ({
label: item.name,
value: item.id,
}))}
value={data.masterBidangBisnisId}
onChange={(value: any) => { onChange={(value: any) => {
handleSubBidangChange(value, index); handleBidangBisnisChange(value);
}} }}
/> />
);
})}
<CenterCustom>
<View
style={{ flexDirection: "row", alignItems: "center", gap: 10 }}
>
<ActionIcon
disabled={
selectedSubBidang.length === listSubBidangSelected.length
}
onPress={() => {
handleAddSubBidang();
}}
icon={
<Ionicons
name="add-circle-outline"
size={ICON_SIZE_XLARGE}
color={MainColor.black}
/>
}
size="xl"
/>
<ActionIcon
disabled={listSubBidangSelected.length <= 1}
onPress={() => {
handleRemoveSubBidang(listSubBidangSelected.length - 1);
}}
icon={
<Ionicons
name="remove-circle-outline"
size={ICON_SIZE_XLARGE}
color={MainColor.black}
/>
}
size="xl"
/>
</View> </View>
</CenterCustom>
<Spacing />
<View> {listSubBidangSelected.map((item, index) => {
<View style={{ flexDirection: "row", alignItems: "center" }}> // Filter data untuk select sub bidang, menghilangkan yang sudah dipilih kecuali untuk item ini sendiri
<TextCustom semiBold style={{ color: MainColor.white_gray }}> const selectedIds = listSubBidangSelected
Nomor Telepon .filter((_, i) => i !== index)
</TextCustom> .map((s) => s.MasterSubBidangBisnis?.id)
<Text style={{ color: "red" }}> *</Text> .filter((id) => id); // Filter hanya yang memiliki id (tidak kosong)
const availableSubBidangOptions = (selectedSubBidang || [])
.filter((sub: any) => {
// Tampilkan jika ini adalah opsi yang dipilih saat ini atau belum dipilih di sub bidang lainnya
return (
sub.id === item.MasterSubBidangBisnis?.id ||
!selectedIds.includes(sub.id)
);
})
.map((sub: any) => ({
value: sub.id,
label: sub.name,
}));
return (
<View onStartShouldSetResponder={() => true} key={index}>
<SelectCustom
label="Sub Bidang Usaha"
required
data={availableSubBidangOptions}
value={item.MasterSubBidangBisnis?.id || null}
onChange={(value: any) => {
handleSubBidangChange(value, index);
}}
/>
</View>
);
})}
<CenterCustom>
<View
style={{ flexDirection: "row", alignItems: "center", gap: 10 }}
>
<ActionIcon
disabled={
selectedSubBidang.length === listSubBidangSelected.length
}
onPress={() => {
handleAddSubBidang();
}}
icon={
<Ionicons
name="add-circle-outline"
size={ICON_SIZE_XLARGE}
color={MainColor.black}
/>
}
size="xl"
/>
<ActionIcon
disabled={listSubBidangSelected.length <= 1}
onPress={() => {
handleRemoveSubBidang(listSubBidangSelected.length - 1);
}}
icon={
<Ionicons
name="remove-circle-outline"
size={ICON_SIZE_XLARGE}
color={MainColor.black}
/>
}
size="xl"
/>
</View>
</CenterCustom>
<Spacing />
<View>
<View style={{ flexDirection: "row", alignItems: "center" }}>
<TextCustom semiBold style={{ color: MainColor.white_gray }}>
Nomor Telepon
</TextCustom>
<Text style={{ color: "red" }}> *</Text>
</View>
<Spacing height={5} />
<PhoneInputCustom
value={phoneNumber}
onChangePhoneNumber={handlePhoneChange}
selectedCountry={selectedCountry}
onChangeCountry={handleCountryChange}
placeholder="xxx-xxx-xxx"
/>
</View> </View>
<Spacing height={5} /> <Spacing />
<PhoneInputCustom
value={phoneNumber}
onChangePhoneNumber={handlePhoneChange}
selectedCountry={selectedCountry}
onChangeCountry={handleCountryChange}
placeholder="xxx-xxx-xxx"
/>
</View>
<Spacing />
<TextInputCustom <View onStartShouldSetResponder={() => true}>
required <TextInputCustom
label="Alamat Bisnis" required
placeholder="Masukkan alamat bisnis" label="Alamat Bisnis"
value={data.alamatKantor} placeholder="Masukkan alamat bisnis"
onChangeText={(value: any) => value={data.alamatKantor}
setData({ ...data, alamatKantor: value }) onChangeText={(value: any) =>
} setData({ ...data, alamatKantor: value })
/> }
/>
</View>
<TextAreaCustom <View onStartShouldSetResponder={() => true}>
label="Deskripsi Bisnis" <TextAreaCustom
placeholder="Masukkan deskripsi bisnis" label="Deskripsi Bisnis"
value={data.deskripsi} placeholder="Masukkan deskripsi bisnis"
onChangeText={(value: any) => value={data.deskripsi}
setData({ ...data, deskripsi: value }) onChangeText={(value: any) =>
} setData({ ...data, deskripsi: value })
autosize }
minRows={2} autosize
maxRows={5} minRows={2}
required maxRows={5}
showCount required
maxLength={1000} showCount
/> maxLength={1000}
<Spacing /> />
</StackCustom> </View>
</NewWrapper> <Spacing />
</StackCustom>
)}
</NewWrapper_V2>
</> </>
); );
} }

View File

@@ -4,6 +4,7 @@ import {
DrawerCustom, DrawerCustom,
DummyLandscapeImage, DummyLandscapeImage,
LoaderCustom, LoaderCustom,
NewWrapper_V2,
Spacing, Spacing,
StackCustom, StackCustom,
TextCustom, TextCustom,
@@ -12,7 +13,6 @@ import AppHeader from "@/components/_ShareComponent/AppHeader";
import LeftButtonCustom from "@/components/Button/BackButton"; import LeftButtonCustom from "@/components/Button/BackButton";
import GridTwoView from "@/components/_ShareComponent/GridTwoView"; import GridTwoView from "@/components/_ShareComponent/GridTwoView";
import CustomSkeleton from "@/components/_ShareComponent/SkeletonCustom"; import CustomSkeleton from "@/components/_ShareComponent/SkeletonCustom";
import ViewWrapper from "@/components/_ShareComponent/ViewWrapper";
import { MainColor } from "@/constants/color-palet"; import { MainColor } from "@/constants/color-palet";
import { ICON_SIZE_SMALL } from "@/constants/constans-value"; import { ICON_SIZE_SMALL } from "@/constants/constans-value";
import { useAuth } from "@/hooks/use-auth"; import { useAuth } from "@/hooks/use-auth";
@@ -92,7 +92,7 @@ export default function Portofolio() {
), ),
}} }}
/> />
<ViewWrapper> <NewWrapper_V2>
{!data || !profileId ? ( {!data || !profileId ? (
<StackCustom> <StackCustom>
<CustomSkeleton height={400} /> <CustomSkeleton height={400} />
@@ -125,7 +125,7 @@ export default function Portofolio() {
<Spacing /> <Spacing />
</StackCustom> </StackCustom>
)} )}
</ViewWrapper> </NewWrapper_V2>
{/* Drawer Komponen Eksternal */} {/* Drawer Komponen Eksternal */}
<DrawerCustom <DrawerCustom

View File

@@ -9,7 +9,7 @@ import {
import ListEmptyComponent from "@/components/_ShareComponent/ListEmptyComponent"; import ListEmptyComponent from "@/components/_ShareComponent/ListEmptyComponent";
import ListLoaderFooterComponent from "@/components/_ShareComponent/ListLoaderFooterComponent"; import ListLoaderFooterComponent from "@/components/_ShareComponent/ListLoaderFooterComponent";
import ListSkeletonComponent from "@/components/_ShareComponent/ListSkeletonComponent"; import ListSkeletonComponent from "@/components/_ShareComponent/ListSkeletonComponent";
import NewWrapper from "@/components/_ShareComponent/NewWrapper"; import { NewWrapper_V2 } from "@/components";
import { MainColor } from "@/constants/color-palet"; import { MainColor } from "@/constants/color-palet";
import { useAuth } from "@/hooks/use-auth"; import { useAuth } from "@/hooks/use-auth";
import { usePaginatedApi } from "@/hooks/use-paginated-api"; import { usePaginatedApi } from "@/hooks/use-paginated-api";
@@ -120,7 +120,7 @@ export default function ProfileBlockedList() {
return ( return (
<> <>
<NewWrapper <NewWrapper_V2
// headerComponent={renderHeader()} // headerComponent={renderHeader()}
listData={listData} listData={listData}
renderItem={renderItem} renderItem={renderItem}

View File

@@ -5,7 +5,7 @@ import {
BoxButtonOnFooter, BoxButtonOnFooter,
BoxWithHeaderSection, BoxWithHeaderSection,
ButtonCustom, ButtonCustom,
NewWrapper, NewWrapper_V2,
StackCustom, StackCustom,
TextCustom, TextCustom,
} from "@/components"; } from "@/components";
@@ -46,7 +46,9 @@ export default function ProfileDetailBlocked() {
return ( return (
<> <>
<NewWrapper <NewWrapper_V2
enableKeyboardHandling
keyboardScrollOffset={100}
footerComponent={ footerComponent={
<BoxButtonOnFooter> <BoxButtonOnFooter>
<ButtonCustom <ButtonCustom
@@ -86,7 +88,7 @@ export default function ProfileDetailBlocked() {
</TextCustom> </TextCustom>
</StackCustom> </StackCustom>
</BoxWithHeaderSection> </BoxWithHeaderSection>
</NewWrapper> </NewWrapper_V2>
</> </>
); );
} }

View File

@@ -1,15 +1,16 @@
import { import {
ButtonCustom, ButtonCustom,
NewWrapper_V2,
SelectCustom, SelectCustom,
StackCustom, StackCustom,
TextInputCustom, TextInputCustom,
ViewWrapper,
} from "@/components"; } from "@/components";
import BoxButtonOnFooter from "@/components/Box/BoxButtonOnFooter"; import BoxButtonOnFooter from "@/components/Box/BoxButtonOnFooter";
import { apiProfile, apiUpdateProfile } from "@/service/api-client/api-profile"; import { apiProfile, apiUpdateProfile } from "@/service/api-client/api-profile";
import { IProfile } from "@/types/Type-Profile"; import { IProfile } from "@/types/Type-Profile";
import { router, useLocalSearchParams } from "expo-router"; import { router, useLocalSearchParams } from "expo-router";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { View } from "react-native";
import Toast from "react-native-toast-message"; import Toast from "react-native-toast-message";
export default function ProfileEdit() { export default function ProfileEdit() {
@@ -70,7 +71,9 @@ export default function ProfileEdit() {
}; };
return ( return (
<ViewWrapper <NewWrapper_V2
enableKeyboardHandling
keyboardScrollOffset={100}
footerComponent={ footerComponent={
<BoxButtonOnFooter> <BoxButtonOnFooter>
<ButtonCustom isLoading={isLoading} onPress={handleUpdate}> <ButtonCustom isLoading={isLoading} onPress={handleUpdate}>
@@ -80,45 +83,53 @@ export default function ProfileEdit() {
} }
> >
<StackCustom gap={"xs"}> <StackCustom gap={"xs"}>
<TextInputCustom <View onStartShouldSetResponder={() => true}>
label="Nama" <TextInputCustom
placeholder="Nama" label="Nama"
value={data?.name} placeholder="Nama"
onChangeText={(text) => { value={data?.name}
setData({ ...data, name: text }); onChangeText={(text) => {
}} setData({ ...data, name: text });
required }}
/> required
<TextInputCustom />
keyboardType="email-address" </View>
label="Email" <View onStartShouldSetResponder={() => true}>
placeholder="Email" <TextInputCustom
value={data?.email} keyboardType="email-address"
onChangeText={(text) => { label="Email"
setData({ ...data, email: text }); placeholder="Email"
}} value={data?.email}
required onChangeText={(text) => {
/> setData({ ...data, email: text });
<TextInputCustom }}
label="Alamat" required
placeholder="Alamat" />
value={data?.alamat} </View>
onChangeText={(text) => { <View onStartShouldSetResponder={() => true}>
setData({ ...data, alamat: text }); <TextInputCustom
}} label="Alamat"
required placeholder="Alamat"
/> value={data?.alamat}
<SelectCustom onChangeText={(text) => {
required setData({ ...data, alamat: text });
label="Jenis Kelamin" }}
placeholder="Pilih jenis kelamin" required
data={options} />
value={data?.jenisKelamin} </View>
onChange={(value) => { <View onStartShouldSetResponder={() => true}>
setData({ ...(data as any), jenisKelamin: value }); <SelectCustom
}} required
/> label="Jenis Kelamin"
placeholder="Pilih jenis kelamin"
data={options}
value={data?.jenisKelamin}
onChange={(value) => {
setData({ ...(data as any), jenisKelamin: value });
}}
/>
</View>
</StackCustom> </StackCustom>
</ViewWrapper> </NewWrapper_V2>
); );
} }

View File

@@ -1,5 +1,5 @@
/* eslint-disable react-hooks/exhaustive-deps */ /* eslint-disable react-hooks/exhaustive-deps */
import { NewWrapper, StackCustom } from "@/components"; import { NewWrapper_V2, StackCustom } from "@/components";
import AppHeader from "@/components/_ShareComponent/AppHeader"; import AppHeader from "@/components/_ShareComponent/AppHeader";
import CustomSkeleton from "@/components/_ShareComponent/SkeletonCustom"; import CustomSkeleton from "@/components/_ShareComponent/SkeletonCustom";
import LeftButtonCustom from "@/components/Button/BackButton"; import LeftButtonCustom from "@/components/Button/BackButton";
@@ -119,7 +119,7 @@ export default function Profile() {
}} }}
/> />
{/* Main View */} {/* Main View */}
<NewWrapper <NewWrapper_V2
refreshControl={ refreshControl={
<RefreshControl <RefreshControl
refreshing={refreshing} refreshing={refreshing}
@@ -144,7 +144,7 @@ export default function Profile() {
/> />
</> </>
)} )}
</NewWrapper> </NewWrapper_V2>
{/* Drawer Komponen Eksternal */} {/* Drawer Komponen Eksternal */}
<DrawerCustom <DrawerCustom

View File

@@ -1,10 +1,10 @@
import { import {
BaseBox, BaseBox,
BoxButtonOnFooter, BoxButtonOnFooter,
ButtonCenteredOnly, ButtonCenteredOnly,
ButtonCustom, ButtonCustom,
NewWrapper_V2,
} from "@/components"; } from "@/components";
import ViewWrapper from "@/components/_ShareComponent/ViewWrapper";
import API_STRORAGE from "@/constants/base-url-api-strorage"; import API_STRORAGE from "@/constants/base-url-api-strorage";
import DIRECTORY_ID from "@/constants/directory-id"; import DIRECTORY_ID from "@/constants/directory-id";
import DUMMY_IMAGE from "@/constants/dummy-image-value"; import DUMMY_IMAGE from "@/constants/dummy-image-value";
@@ -127,7 +127,10 @@ export default function UpdateBackgroundProfile() {
); );
return ( return (
<ViewWrapper footerComponent={buttonFooter}> <NewWrapper_V2
contentPaddingHorizontal={16}
footerComponent={buttonFooter}
>
<BaseBox <BaseBox
style={{ alignItems: "center", justifyContent: "center", height: 250 }} style={{ alignItems: "center", justifyContent: "center", height: 250 }}
> >
@@ -144,6 +147,6 @@ export default function UpdateBackgroundProfile() {
> >
Update Update
</ButtonCenteredOnly> </ButtonCenteredOnly>
</ViewWrapper> </NewWrapper_V2>
); );
} }

View File

@@ -3,8 +3,8 @@ import {
BoxButtonOnFooter, BoxButtonOnFooter,
ButtonCenteredOnly, ButtonCenteredOnly,
ButtonCustom, ButtonCustom,
NewWrapper_V2,
} from "@/components"; } from "@/components";
import ViewWrapper from "@/components/_ShareComponent/ViewWrapper";
import API_STRORAGE from "@/constants/base-url-api-strorage"; import API_STRORAGE from "@/constants/base-url-api-strorage";
import DIRECTORY_ID from "@/constants/directory-id"; import DIRECTORY_ID from "@/constants/directory-id";
import DUMMY_IMAGE from "@/constants/dummy-image-value"; import DUMMY_IMAGE from "@/constants/dummy-image-value";
@@ -125,7 +125,10 @@ export default function UpdatePhotoProfile() {
); );
return ( return (
<ViewWrapper footerComponent={buttonFooter}> <NewWrapper_V2
contentPaddingHorizontal={16}
footerComponent={buttonFooter}
>
<BaseBox <BaseBox
style={{ alignItems: "center", justifyContent: "center", height: 250 }} style={{ alignItems: "center", justifyContent: "center", height: 250 }}
> >
@@ -143,6 +146,6 @@ export default function UpdatePhotoProfile() {
> >
Upload Upload
</ButtonCenteredOnly> </ButtonCenteredOnly>
</ViewWrapper> </NewWrapper_V2>
); );
} }

View File

@@ -23,7 +23,7 @@ export default function ProfileLayout() {
/> />
<Stack.Screen <Stack.Screen
name="create" name="create"
options={{ headerBackVisible: false }} options={{ header: () => <AppHeader title="Buat Profil" showBack={false} /> }}
/> />
<Stack.Screen <Stack.Screen

View File

@@ -2,11 +2,11 @@ import {
BaseBox, BaseBox,
ButtonCenteredOnly, ButtonCenteredOnly,
ButtonCustom, ButtonCustom,
NewWrapper_V2,
SelectCustom, SelectCustom,
Spacing, Spacing,
StackCustom, StackCustom,
TextInputCustom, TextInputCustom,
ViewWrapper,
} from "@/components"; } from "@/components";
import BoxButtonOnFooter from "@/components/Box/BoxButtonOnFooter"; import BoxButtonOnFooter from "@/components/Box/BoxButtonOnFooter";
import InformationBox from "@/components/Box/InformationBox"; import InformationBox from "@/components/Box/InformationBox";
@@ -155,7 +155,11 @@ export default function CreateProfile() {
); );
return ( return (
<ViewWrapper footerComponent={footerComponent}> <NewWrapper_V2
enableKeyboardHandling
keyboardScrollOffset={100}
footerComponent={footerComponent}
>
<StackCustom> <StackCustom>
<InformationBox text="Upload foto profile anda." /> <InformationBox text="Upload foto profile anda." />
<View style={{ alignItems: "center" }}> <View style={{ alignItems: "center" }}>
@@ -204,43 +208,51 @@ export default function CreateProfile() {
</View> </View>
<Spacing /> <Spacing />
<TextInputCustom <View onStartShouldSetResponder={() => true}>
required <TextInputCustom
label="Nama" required
placeholder="Masukkan nama" label="Nama"
value={data.name} placeholder="Masukkan nama"
onChangeText={(text) => setData({ ...data, name: text })} value={data.name}
/> onChangeText={(text) => setData({ ...data, name: text })}
<TextInputCustom />
keyboardType="email-address" </View>
required <View onStartShouldSetResponder={() => true}>
label="Email" <TextInputCustom
placeholder="Masukkan email" keyboardType="email-address"
value={data.email} required
onChangeText={(text) => setData({ ...data, email: text })} label="Email"
/> placeholder="Masukkan email"
<TextInputCustom value={data.email}
required onChangeText={(text) => setData({ ...data, email: text })}
label="Alamat" />
placeholder="Masukkan alamat" </View>
value={data.alamat} <View onStartShouldSetResponder={() => true}>
onChangeText={(text) => setData({ ...data, alamat: text })} <TextInputCustom
/> required
<SelectCustom label="Alamat"
label="Jenis Kelamin" placeholder="Masukkan alamat"
placeholder="Pilih jenis kelamin" value={data.alamat}
data={[ onChangeText={(text) => setData({ ...data, alamat: text })}
{ label: "Laki-laki", value: "laki-laki" }, />
{ label: "Perempuan", value: "perempuan" }, </View>
]} <View onStartShouldSetResponder={() => true}>
value={data.jenisKelamin} <SelectCustom
required label="Jenis Kelamin"
onChange={(value) => placeholder="Pilih jenis kelamin"
setData({ ...(data as any), jenisKelamin: value }) data={[
} { label: "Laki-laki", value: "laki-laki" },
/> { label: "Perempuan", value: "perempuan" },
]}
value={data.jenisKelamin}
required
onChange={(value) =>
setData({ ...(data as any), jenisKelamin: value })
}
/>
</View>
<Spacing /> <Spacing />
</StackCustom> </StackCustom>
</ViewWrapper> </NewWrapper_V2>
); );
} }

View File

@@ -45,10 +45,14 @@ interface BaseProps {
*/ */
contentPaddingBottom?: number; contentPaddingBottom?: number;
/** /**
* Padding untuk content container (default: 16) * Padding Top untuk content container (default: 8)
* Set to 0 untuk tidak ada padding, atau custom value sesuai kebutuhan
*/ */
contentPadding?: number; contentPaddingTop?: number;
/**
* Padding Horizontal untuk content container (default: 0)
* Set ke 16 atau lebih jika butuh spacing di kiri-kanan
*/
contentPaddingHorizontal?: number;
} }
interface StaticModeProps extends BaseProps { interface StaticModeProps extends BaseProps {
@@ -83,7 +87,8 @@ export function NewWrapper_V2(props: NewWrapper_V2_Props) {
enableKeyboardHandling = false, enableKeyboardHandling = false,
keyboardScrollOffset = 100, keyboardScrollOffset = 100,
contentPaddingBottom = 80, // Default 80 untuk navigasi device contentPaddingBottom = 80, // Default 80 untuk navigasi device
contentPadding = 16, // Default 16 untuk padding konsisten contentPaddingTop = 8, // Default 8 untuk spacing atas
contentPaddingHorizontal = 0, // Default 0 agar aman untuk layout existing
} = props; } = props;
const assetBackground = require("../../assets/images/main-background.png"); const assetBackground = require("../../assets/images/main-background.png");
@@ -137,8 +142,9 @@ export function NewWrapper_V2(props: NewWrapper_V2_Props) {
ListEmptyComponent={listProps.ListEmptyComponent} ListEmptyComponent={listProps.ListEmptyComponent}
contentContainerStyle={{ contentContainerStyle={{
flexGrow: 1, flexGrow: 1,
paddingTop: contentPaddingTop,
paddingHorizontal: contentPaddingHorizontal,
paddingBottom: (footerComponent && !hideFooter ? OS_HEIGHT : 0) + contentPaddingBottom, paddingBottom: (footerComponent && !hideFooter ? OS_HEIGHT : 0) + contentPaddingBottom,
padding: contentPadding,
}} }}
keyboardShouldPersistTaps="handled" keyboardShouldPersistTaps="handled"
/> />
@@ -186,8 +192,9 @@ export function NewWrapper_V2(props: NewWrapper_V2_Props) {
style={{ flex: 1 }} style={{ flex: 1 }}
contentContainerStyle={{ contentContainerStyle={{
flexGrow: 1, flexGrow: 1,
paddingTop: contentPaddingTop,
paddingHorizontal: contentPaddingHorizontal,
paddingBottom: (footerComponent && !hideFooter ? OS_HEIGHT : 0) + contentPaddingBottom, paddingBottom: (footerComponent && !hideFooter ? OS_HEIGHT : 0) + contentPaddingBottom,
padding: contentPadding,
}} }}
keyboardShouldPersistTaps="handled" keyboardShouldPersistTaps="handled"
showsVerticalScrollIndicator={false} showsVerticalScrollIndicator={false}

View File

@@ -0,0 +1,229 @@
/**
* PageWrapper - Platform-specific wrapper component
*
* Routes to:
* - iOS: NewWrapper (stable, tested)
* - Android: NewWrapper_V2 (with keyboard handling fix)
*
* Props are automatically adjusted based on platform.
*
* @example
* <PageWrapper
* footerComponent={buttonFooter}
* enableKeyboardHandling
* keyboardScrollOffset={100}
* >
* {children}
* </PageWrapper>
*/
import { Platform } from "react-native";
import { NewWrapper_V2 } from "./NewWrapper_V2";
import type { NativeSafeAreaViewProps } from "react-native-safe-area-context";
import type { ScrollViewProps, FlatListProps } from "react-native";
import NewWrapper from "./NewWrapper";
// ========== Base Props ==========
interface BaseProps {
withBackground?: boolean;
headerComponent?: React.ReactNode;
footerComponent?: React.ReactNode;
floatingButton?: React.ReactNode;
hideFooter?: boolean;
edgesFooter?: NativeSafeAreaViewProps["edges"];
style?: any;
refreshControl?: ScrollViewProps["refreshControl"];
}
// ========== Static Mode Props ==========
interface StaticModeProps extends BaseProps {
children: React.ReactNode;
listData?: never;
renderItem?: never;
}
// ========== List Mode Props ==========
interface ListModeProps extends BaseProps {
children?: never;
listData?: any[];
renderItem?: FlatListProps<any>["renderItem"];
onEndReached?: () => void;
ListHeaderComponent?: React.ReactElement | null;
ListFooterComponent?: React.ReactElement | null;
ListEmptyComponent?: React.ReactElement | null;
keyExtractor?: FlatListProps<any>["keyExtractor"];
}
// ========== PageWrapper Props ==========
interface PageWrapperBaseProps extends BaseProps {
/**
* Enable keyboard handling (Android only - NewWrapper_V2)
* iOS ignores this prop
* @default false
*/
enableKeyboardHandling?: boolean;
/**
* Scroll offset when keyboard appears (Android only)
* iOS ignores this prop
* @default 100
*/
keyboardScrollOffset?: number;
/**
* Extra padding bottom for content (Android only)
* iOS ignores this prop
* @default 80
*/
contentPaddingBottom?: number;
/**
* Padding Top for content container (Android only)
* iOS ignores this prop
* @default 8
*/
contentPaddingTop?: number;
/**
* Padding Horizontal for content container (Android only)
* iOS ignores this prop
* @default 0
*/
contentPaddingHorizontal?: number;
}
interface PageWrapperStaticProps extends PageWrapperBaseProps {
children: React.ReactNode;
listData?: never;
renderItem?: never;
}
interface PageWrapperListProps extends PageWrapperBaseProps {
children?: never;
listData?: any[];
renderItem?: FlatListProps<any>["renderItem"];
onEndReached?: () => void;
ListHeaderComponent?: React.ReactElement | null;
ListFooterComponent?: React.ReactElement | null;
ListEmptyComponent?: React.ReactElement | null;
keyExtractor?: FlatListProps<any>["keyExtractor"];
}
type PageWrapperProps = PageWrapperStaticProps | PageWrapperListProps;
export function PageWrapper(props: PageWrapperProps) {
const {
withBackground,
headerComponent,
footerComponent,
floatingButton,
hideFooter,
edgesFooter,
style,
refreshControl,
enableKeyboardHandling,
keyboardScrollOffset,
contentPaddingBottom,
contentPaddingTop,
contentPaddingHorizontal,
...restProps
} = props;
// ========== Android: Use NewWrapper_V2 with keyboard handling ==========
if (Platform.OS === "android") {
if ("listData" in props) {
// List mode
const listProps = props as PageWrapperListProps;
return (
<NewWrapper_V2
listData={listProps.listData}
renderItem={listProps.renderItem}
onEndReached={listProps.onEndReached}
ListHeaderComponent={listProps.ListHeaderComponent}
ListFooterComponent={listProps.ListFooterComponent}
ListEmptyComponent={listProps.ListEmptyComponent}
keyExtractor={listProps.keyExtractor}
withBackground={withBackground}
headerComponent={headerComponent}
footerComponent={footerComponent}
floatingButton={floatingButton}
hideFooter={hideFooter}
edgesFooter={edgesFooter}
style={style}
refreshControl={refreshControl}
enableKeyboardHandling={enableKeyboardHandling}
keyboardScrollOffset={keyboardScrollOffset}
contentPaddingBottom={contentPaddingBottom}
contentPaddingTop={contentPaddingTop}
contentPaddingHorizontal={contentPaddingHorizontal}
/>
);
}
// Static mode
const staticProps = props as PageWrapperStaticProps;
return (
<NewWrapper_V2
withBackground={withBackground}
headerComponent={headerComponent}
footerComponent={footerComponent}
floatingButton={floatingButton}
hideFooter={hideFooter}
edgesFooter={edgesFooter}
style={style}
refreshControl={refreshControl}
enableKeyboardHandling={enableKeyboardHandling}
keyboardScrollOffset={keyboardScrollOffset}
contentPaddingBottom={contentPaddingBottom}
contentPaddingTop={contentPaddingTop}
contentPaddingHorizontal={contentPaddingHorizontal}
>
{staticProps.children}
</NewWrapper_V2>
);
}
// ========== iOS: Use NewWrapper (stable) ==========
if ("listData" in props) {
// List mode
const listProps = props as PageWrapperListProps;
return (
<NewWrapper
listData={listProps.listData}
renderItem={listProps.renderItem}
onEndReached={listProps.onEndReached}
ListHeaderComponent={listProps.ListHeaderComponent}
ListFooterComponent={listProps.ListFooterComponent}
ListEmptyComponent={listProps.ListEmptyComponent}
keyExtractor={listProps.keyExtractor}
withBackground={withBackground}
headerComponent={headerComponent}
footerComponent={footerComponent}
floatingButton={floatingButton}
hideFooter={hideFooter}
edgesFooter={edgesFooter}
style={style}
refreshControl={refreshControl}
/>
);
}
// Static mode
const staticProps = props as PageWrapperStaticProps;
return (
<NewWrapper
withBackground={withBackground}
headerComponent={headerComponent}
footerComponent={footerComponent}
floatingButton={floatingButton}
hideFooter={hideFooter}
edgesFooter={edgesFooter}
style={style}
refreshControl={refreshControl}
>
{staticProps.children}
</NewWrapper>
);
}
export default PageWrapper;

View File

@@ -65,6 +65,7 @@ import NewWrapper from "./_ShareComponent/NewWrapper";
import BasicWrapper from "./_ShareComponent/BasicWrapper"; import BasicWrapper from "./_ShareComponent/BasicWrapper";
import { FormWrapper } from "./_ShareComponent/FormWrapper"; import { FormWrapper } from "./_ShareComponent/FormWrapper";
import { NewWrapper_V2 } from "./_ShareComponent/NewWrapper_V2"; import { NewWrapper_V2 } from "./_ShareComponent/NewWrapper_V2";
import { PageWrapper } from "./_ShareComponent/PageWrapper";
// Progress // Progress
import ProgressCustom from "./Progress/ProgressCustom"; import ProgressCustom from "./Progress/ProgressCustom";
@@ -132,6 +133,7 @@ export {
BasicWrapper, BasicWrapper,
FormWrapper, FormWrapper,
NewWrapper_V2, NewWrapper_V2,
PageWrapper,
// Stack // Stack
StackCustom, StackCustom,
TabBarBackground, TabBarBackground,

304
docs/PAGEWRAPPER-USAGE.md Normal file
View File

@@ -0,0 +1,304 @@
# PageWrapper - Platform-Specific Wrapper
## 📋 Overview
`PageWrapper` adalah wrapper component yang secara otomatis memilih wrapper yang tepat berdasarkan platform:
- **iOS**: Menggunakan `NewWrapper` (stable, tested)
- **Android**: Menggunakan `NewWrapper_V2` (dengan keyboard handling fix)
## 🎯 Kapan Menggunakan PageWrapper?
### ✅ **Gunakan PageWrapper untuk:**
- Screen baru yang kamu buat
- Migrasi screen existing dari `NewWrapper`/`ViewWrapper`
- Form screens dengan TextInput/TextArea
- List screens dengan pagination
### ❌ **Jangan gunakan PageWrapper untuk:**
- Screen yang sudah menggunakan `NewWrapper_V2` langsung dan sudah tested di iOS
- Custom wrapper requirements
---
## 📝 Usage
### **Basic Usage (Static Content)**
```typescript
import { PageWrapper } from "@/components";
export function MyScreen() {
return (
<PageWrapper
footerComponent={<ButtonFooter />}
>
<StackCustom>
<TextInputCustom label="Name" />
<TextAreaCustom label="Description" />
</StackCustom>
</PageWrapper>
);
}
```
### **With Keyboard Handling (Android Only)**
```typescript
<PageWrapper
enableKeyboardHandling
keyboardScrollOffset={100}
contentPaddingHorizontal={16}
footerComponent={<ButtonFooter />}
>
<StackCustom>
<View onStartShouldSetResponder={() => true}>
<TextInputCustom label="Name" />
</View>
<View onStartShouldSetResponder={() => true}>
<TextAreaCustom label="Description" />
</View>
</StackCustom>
</PageWrapper>
```
### **List Mode (Pagination)**
```typescript
<PageWrapper
listData={pagination.listData}
renderItem={renderItem}
onEndReached={pagination.loadMore}
ListEmptyComponent={ListEmptyComponent}
ListFooterComponent={ListFooterComponent}
refreshControl={
<RefreshControl refreshing={refreshing} onRefresh={onRefresh} />
}
/>
```
---
## 🔧 Props
### **Common Props (iOS & Android)**
| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `footerComponent` | `ReactNode` | - | Fixed footer component |
| `headerComponent` | `ReactNode` | - | Header component (sticky) |
| `floatingButton` | `ReactNode` | - | Floating button overlay |
| `hideFooter` | `boolean` | `false` | Hide footer footer |
| `withBackground` | `boolean` | `false` | Use background image |
| `style` | `ViewStyle` | - | Custom container style |
| `refreshControl` | `RefreshControl` | - | Pull-to-refresh control |
### **Android-Only Props** (Ignored di iOS)
| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `enableKeyboardHandling` | `boolean` | `false` | Enable keyboard auto-scroll |
| `keyboardScrollOffset` | `number` | `100` | Scroll offset when keyboard appears |
| `contentPaddingBottom` | `number` | `80` | Bottom padding for content |
| `contentPaddingTop` | `number` | `8` | Top padding for content |
| `contentPaddingHorizontal` | `number` | `0` | Horizontal padding for content |
---
## 📊 Platform Behavior
| Feature | iOS (NewWrapper) | Android (NewWrapper_V2) |
|---------|------------------|------------------------|
| **Keyboard Handling** | ❌ No auto-scroll | ✅ Auto-scroll to input |
| **Footer Position** | ✅ Fixed bottom | ✅ Fixed bottom (absolute) |
| **Safe Area** | ✅ Handled | ✅ Handled |
| **Content Padding** | Default | Customizable |
| **List Mode** | ✅ Supported | ✅ Supported |
---
## 🔄 Migration Guide
### **From NewWrapper**
```typescript
// BEFORE
import { NewWrapper } from "@/components";
<NewWrapper footerComponent={footer}>
{children}
</NewWrapper>
// AFTER
import { PageWrapper } from "@/components";
<PageWrapper footerComponent={footer}>
{children}
</PageWrapper>
```
### **From NewWrapper_V2**
```typescript
// BEFORE
import { NewWrapper_V2 } from "@/components";
<NewWrapper_V2
enableKeyboardHandling
keyboardScrollOffset={100}
footerComponent={footer}
>
<View onStartShouldSetResponder={() => true}>
<TextInputCustom />
</View>
</NewWrapper_V2>
// AFTER
import { PageWrapper } from "@/components";
<PageWrapper
enableKeyboardHandling
keyboardScrollOffset={100}
footerComponent={footer}
>
<View onStartShouldSetResponder={() => true}>
<TextInputCustom />
</View>
</PageWrapper>
```
---
## ⚠️ Important Notes
### **For Form Screens (Android)**
Jika menggunakan `enableKeyboardHandling`, **WAJIB wrap semua input** dengan `View onStartShouldSetResponder`:
```typescript
<View onStartShouldSetResponder={() => true}>
<TextInputCustom label="Name" />
</View>
```
**Kenapa?**
- Mencegah keyboard handling conflict
- Memastikan tap outside dismiss keyboard
- Konsisten behavior di Android
### **For iOS Users**
Props berikut **diabaikan di iOS**:
- `enableKeyboardHandling`
- `keyboardScrollOffset`
- `contentPaddingBottom`
- `contentPaddingTop`
- `contentPaddingHorizontal`
iOS menggunakan `NewWrapper` yang sudah stable tanpa keyboard handling.
---
## 🎨 Examples
### **Example 1: Simple Form**
```typescript
import { PageWrapper, TextInputCustom, StackCustom } from "@/components";
export function SimpleForm() {
return (
<PageWrapper
enableKeyboardHandling
keyboardScrollOffset={100}
footerComponent={<SubmitButton />}
>
<StackCustom>
<View onStartShouldSetResponder={() => true}>
<TextInputCustom label="Name" />
</View>
<View onStartShouldSetResponder={() => true}>
<TextInputCustom label="Email" />
</View>
</StackCustom>
</PageWrapper>
);
}
```
### **Example 2: List with Pagination**
```typescript
import { PageWrapper } from "@/components";
export function UserList() {
const pagination = usePagination({ fetchFunction: fetchUsers });
return (
<PageWrapper
listData={pagination.listData}
renderItem={({ item }) => <UserCard item={item} />}
onEndReached={pagination.loadMore}
ListEmptyComponent={<EmptyState />}
ListFooterComponent={<LoadingFooter />}
refreshControl={
<RefreshControl
refreshing={pagination.refreshing}
onRefresh={pagination.refresh}
/>
}
/>
);
}
```
### **Example 3: Detail Screen (No Footer)**
```typescript
import { PageWrapper } from "@/components";
export function DetailScreen() {
return (
<PageWrapper hideFooter>
<StackCustom>
<TextCustom>Title</TextCustom>
<TextCustom>Description</TextCustom>
</StackCustom>
</PageWrapper>
);
}
```
---
## 🚀 Future Plans
### **Phase 1: Current** (Now)
-`PageWrapper` created
- ✅ iOS → `NewWrapper` (stable)
- ✅ Android → `NewWrapper_V2` (keyboard fix)
### **Phase 2: iOS Migration** (1-2 months)
- [ ] Fix iOS bugs di `NewWrapper_V2`
- [ ] Test `NewWrapper_V2` di iOS devices
- [ ] Update `PageWrapper` untuk use V2 untuk iOS juga
### **Phase 3: Unify** (3 months)
- [ ] Deprecate `NewWrapper` lama
- [ ] Rename `NewWrapper_V2``NewWrapper`
- [ ] Update `PageWrapper` untuk always use V2
---
## 📚 Related Files
- `components/_ShareComponent/PageWrapper.tsx` - Main component
- `components/_ShareComponent/NewWrapper.tsx` - iOS wrapper
- `components/_ShareComponent/NewWrapper_V2.tsx` - Android wrapper
- `hooks/useKeyboardForm.ts` - Keyboard handling hook
---
**Last Updated**: 2026-04-06
**Created by**: AI Assistant
**Status**: ✅ Ready to use

View File

@@ -154,6 +154,9 @@
3F53CC1C3B278545F11A1CAE /* [CP-User] [RNFB] Core Configuration */, 3F53CC1C3B278545F11A1CAE /* [CP-User] [RNFB] Core Configuration */,
46ED08049A384B869D77364E /* Remove signature files (Xcode workaround) */, 46ED08049A384B869D77364E /* Remove signature files (Xcode workaround) */,
92A25C61F4E34FB6A36E415B /* Remove signature files (Xcode workaround) */, 92A25C61F4E34FB6A36E415B /* Remove signature files (Xcode workaround) */,
6440E59133324659A2C60D0B /* Remove signature files (Xcode workaround) */,
35CC0495598542E6801662A3 /* Remove signature files (Xcode workaround) */,
5ED53AFC8AD1445DA81C7BD4 /* Remove signature files (Xcode workaround) */,
); );
buildRules = ( buildRules = (
); );
@@ -465,6 +468,57 @@
rm -rf \"$CONFIGURATION_BUILD_DIR/MapLibre.xcframework-ios.signature\"; rm -rf \"$CONFIGURATION_BUILD_DIR/MapLibre.xcframework-ios.signature\";
"; ";
}; };
6440E59133324659A2C60D0B /* Remove signature files (Xcode workaround) */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
name = "Remove signature files (Xcode workaround)";
inputPaths = (
);
outputPaths = (
);
shellPath = /bin/sh;
shellScript = "
echo \"Remove signature files (Xcode workaround)\";
rm -rf \"$CONFIGURATION_BUILD_DIR/MapLibre.xcframework-ios.signature\";
";
};
35CC0495598542E6801662A3 /* Remove signature files (Xcode workaround) */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
name = "Remove signature files (Xcode workaround)";
inputPaths = (
);
outputPaths = (
);
shellPath = /bin/sh;
shellScript = "
echo \"Remove signature files (Xcode workaround)\";
rm -rf \"$CONFIGURATION_BUILD_DIR/MapLibre.xcframework-ios.signature\";
";
};
5ED53AFC8AD1445DA81C7BD4 /* Remove signature files (Xcode workaround) */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
name = "Remove signature files (Xcode workaround)";
inputPaths = (
);
outputPaths = (
);
shellPath = /bin/sh;
shellScript = "
echo \"Remove signature files (Xcode workaround)\";
rm -rf \"$CONFIGURATION_BUILD_DIR/MapLibre.xcframework-ios.signature\";
";
};
/* End PBXShellScriptBuildPhase section */ /* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */

View File

@@ -0,0 +1,15 @@
{
"originHash" : "e70d3525c8e2819a8b34f22909815dab5c700c25a06c32388f3930f7b3627768",
"pins" : [
{
"identity" : "maplibre-gl-native-distribution",
"kind" : "remoteSourceControl",
"location" : "https://github.com/maplibre/maplibre-gl-native-distribution",
"state" : {
"revision" : "c68c970ff3ece56cfc3b36849db70167fa208beb",
"version" : "6.17.1"
}
}
],
"version" : 3
}

View File

@@ -1,5 +1,5 @@
/* eslint-disable react-hooks/exhaustive-deps */ /* eslint-disable react-hooks/exhaustive-deps */
import { BaseBox, NewWrapper_V2, ScrollableCustom, TextCustom } from "@/components"; import { BaseBox, PageWrapper, ScrollableCustom, TextCustom } from "@/components";
import { MainColor } from "@/constants/color-palet"; import { MainColor } from "@/constants/color-palet";
import { PAGINATION_DEFAULT_TAKE } from "@/constants/constans-value"; import { PAGINATION_DEFAULT_TAKE } from "@/constants/constans-value";
import { createPaginationComponents } from "@/helpers/paginationHelpers"; import { createPaginationComponents } from "@/helpers/paginationHelpers";
@@ -86,7 +86,8 @@ export default function Job_MainViewStatus2() {
); );
return ( return (
<NewWrapper_V2 <PageWrapper
contentPaddingHorizontal={16}
headerComponent={<View style={{ paddingTop: 8 }}>{scrollComponent}</View>} headerComponent={<View style={{ paddingTop: 8 }}>{scrollComponent}</View>}
listData={pagination.listData} listData={pagination.listData}
renderItem={renderJobItem} renderItem={renderJobItem}

View File

@@ -1,5 +1,5 @@
/* eslint-disable react-hooks/exhaustive-deps */ /* eslint-disable react-hooks/exhaustive-deps */
import { BaseBox, LoaderCustom, TextCustom, ViewWrapper } from "@/components"; import { BaseBox, LoaderCustom, PageWrapper, TextCustom } from "@/components";
import { useAuth } from "@/hooks/use-auth"; import { useAuth } from "@/hooks/use-auth";
import { apiJobGetAll } from "@/service/api-client/api-job"; import { apiJobGetAll } from "@/service/api-client/api-job";
import { useFocusEffect } from "expo-router"; import { useFocusEffect } from "expo-router";
@@ -33,7 +33,7 @@ export default function Job_ScreenArchive() {
}; };
return ( return (
<ViewWrapper hideFooter> <PageWrapper hideFooter>
{isLoadData ? ( {isLoadData ? (
<LoaderCustom /> <LoaderCustom />
) : _.isEmpty(listData) ? ( ) : _.isEmpty(listData) ? (
@@ -52,6 +52,6 @@ export default function Job_ScreenArchive() {
</BaseBox> </BaseBox>
)) ))
)} )}
</ViewWrapper> </PageWrapper>
); );
} }

View File

@@ -1,5 +1,5 @@
/* eslint-disable react-hooks/exhaustive-deps */ /* eslint-disable react-hooks/exhaustive-deps */
import { BaseBox, NewWrapper_V2, TextCustom, ViewWrapper } from "@/components"; import { BaseBox, PageWrapper, TextCustom } from "@/components";
import { MainColor } from "@/constants/color-palet"; import { MainColor } from "@/constants/color-palet";
import { createPaginationComponents } from "@/helpers/paginationHelpers"; import { createPaginationComponents } from "@/helpers/paginationHelpers";
import { useAuth } from "@/hooks/use-auth"; import { useAuth } from "@/hooks/use-auth";
@@ -55,7 +55,8 @@ export default function Job_ScreenArchive2() {
); );
return ( return (
<NewWrapper_V2 <PageWrapper
contentPaddingHorizontal={16}
listData={pagination.listData} listData={pagination.listData}
renderItem={renderJobItem} renderItem={renderJobItem}
refreshControl={ refreshControl={

View File

@@ -2,12 +2,11 @@ import {
AvatarUsernameAndOtherComponent, AvatarUsernameAndOtherComponent,
BoxWithHeaderSection, BoxWithHeaderSection,
FloatingButton, FloatingButton,
NewWrapper_V2, PageWrapper,
SearchInput, SearchInput,
Spacing, Spacing,
StackCustom, StackCustom,
TextCustom, TextCustom,
ViewWrapper,
} from "@/components"; } from "@/components";
import { MainColor } from "@/constants/color-palet"; import { MainColor } from "@/constants/color-palet";
import { createPaginationComponents } from "@/helpers/paginationHelpers"; import { createPaginationComponents } from "@/helpers/paginationHelpers";
@@ -74,10 +73,11 @@ export default function Job_ScreenBeranda2() {
); );
return ( return (
<NewWrapper_V2 <PageWrapper
contentPaddingHorizontal={16}
hideFooter hideFooter
headerComponent={ headerComponent={
<View style={{ paddingTop: 8 }}> <View>
<SearchInput <SearchInput
placeholder="Cari pekerjaan" placeholder="Cari pekerjaan"
onChangeText={_.debounce((text) => setSearch(text), 500)} onChangeText={_.debounce((text) => setSearch(text), 500)}

View File

@@ -4,7 +4,7 @@ import {
ButtonCustom, ButtonCustom,
InformationBox, InformationBox,
LandscapeFrameUploaded, LandscapeFrameUploaded,
NewWrapper_V2, PageWrapper,
Spacing, Spacing,
StackCustom, StackCustom,
TextAreaCustom, TextAreaCustom,
@@ -118,9 +118,10 @@ export function Job_ScreenCreate() {
}; };
return ( return (
<NewWrapper_V2 <PageWrapper
enableKeyboardHandling enableKeyboardHandling
keyboardScrollOffset={100} keyboardScrollOffset={100}
contentPaddingHorizontal={16}
footerComponent={buttonSubmit()} footerComponent={buttonSubmit()}
> >
<StackCustom gap={"xs"}> <StackCustom gap={"xs"}>
@@ -174,6 +175,6 @@ export function Job_ScreenCreate() {
/> />
</View> </View>
</StackCustom> </StackCustom>
</NewWrapper_V2> </PageWrapper>
); );
} }

View File

@@ -1,13 +1,14 @@
/* eslint-disable react-hooks/exhaustive-deps */ /* eslint-disable react-hooks/exhaustive-deps */
import { import {
BaseBox, BaseBox,
BoxButtonOnFooter,
ButtonCenteredOnly, ButtonCenteredOnly,
ButtonCustom, ButtonCustom,
DummyLandscapeImage, DummyLandscapeImage,
InformationBox, InformationBox,
LandscapeFrameUploaded, LandscapeFrameUploaded,
LoaderCustom, LoaderCustom,
NewWrapper_V2, PageWrapper,
Spacing, Spacing,
StackCustom, StackCustom,
TextAreaCustom, TextAreaCustom,
@@ -15,10 +16,7 @@ import {
} from "@/components"; } from "@/components";
import DIRECTORY_ID from "@/constants/directory-id"; import DIRECTORY_ID from "@/constants/directory-id";
import { apiJobGetOne, apiJobUpdateData } from "@/service/api-client/api-job"; import { apiJobGetOne, apiJobUpdateData } from "@/service/api-client/api-job";
import { import { deleteFileService, uploadFileService } from "@/service/upload-service";
deleteFileService,
uploadFileService,
} from "@/service/upload-service";
import pickImage from "@/utils/pickImage"; import pickImage from "@/utils/pickImage";
import { router, useLocalSearchParams } from "expo-router"; import { router, useLocalSearchParams } from "expo-router";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
@@ -126,24 +124,26 @@ export function Job_ScreenEdit() {
const buttonSubmit = () => { const buttonSubmit = () => {
return ( return (
<> <>
<ButtonCustom isLoading={isLoading} onPress={() => handlerOnUpdate()}> <BoxButtonOnFooter>
Update <ButtonCustom isLoading={isLoading} onPress={() => handlerOnUpdate()}>
</ButtonCustom> Update
<Spacing /> </ButtonCustom>
</BoxButtonOnFooter>
</> </>
); );
}; };
return ( return (
<NewWrapper_V2 <PageWrapper
enableKeyboardHandling enableKeyboardHandling
keyboardScrollOffset={100} keyboardScrollOffset={100}
// contentPaddingHorizontal={16}
footerComponent={buttonSubmit()} footerComponent={buttonSubmit()}
> >
{isLoadData ? ( {isLoadData ? (
<LoaderCustom /> <LoaderCustom />
) : ( ) : (
<StackCustom gap={"xs"}> <View>
<InformationBox text="Poster atau gambar lowongan kerja bersifat opsional, tidak wajib untuk dimasukkan dan upload lah gambar yang sesuai dengan deskripsi lowongan kerja." /> <InformationBox text="Poster atau gambar lowongan kerja bersifat opsional, tidak wajib untuk dimasukkan dan upload lah gambar yang sesuai dengan deskripsi lowongan kerja." />
{imageUri ? ( {imageUri ? (
@@ -200,10 +200,8 @@ export function Job_ScreenEdit() {
onChangeText={(value) => setData({ ...data, deskripsi: value })} onChangeText={(value) => setData({ ...data, deskripsi: value })}
/> />
</View> </View>
</View>
{buttonSubmit()}
</StackCustom>
)} )}
</NewWrapper_V2> </PageWrapper>
); );
} }

View File

@@ -1,4 +1,3 @@
import NewWrapper from "@/components/_ShareComponent/NewWrapper";
import { import {
BoxButtonOnFooter, BoxButtonOnFooter,
ButtonCustom, ButtonCustom,
@@ -8,6 +7,7 @@ import {
TextInputCustom, TextInputCustom,
LandscapeFrameUploaded, LandscapeFrameUploaded,
ButtonCenteredOnly, ButtonCenteredOnly,
NewWrapper_V2,
} from "@/components"; } from "@/components";
import { MapSelectedPlatform } from "@/components/Map/MapSelectedPlatform"; import { MapSelectedPlatform } from "@/components/Map/MapSelectedPlatform";
import DIRECTORY_ID from "@/constants/directory-id"; import DIRECTORY_ID from "@/constants/directory-id";
@@ -18,6 +18,7 @@ import { IFileData } from "@/utils/pickFile";
import pickFile from "@/utils/pickFile"; import pickFile from "@/utils/pickFile";
import { router, useLocalSearchParams } from "expo-router"; import { router, useLocalSearchParams } from "expo-router";
import { useState } from "react"; import { useState } from "react";
import { View } from "react-native";
import { LatLng } from "react-native-maps"; import { LatLng } from "react-native-maps";
import Toast from "react-native-toast-message"; import Toast from "react-native-toast-message";
@@ -142,10 +143,14 @@ export function Maps_ScreenMapsCreate() {
); );
/** /**
* Render screen dengan NewWrapper * Render screen dengan NewWrapper_V2
*/ */
return ( return (
<NewWrapper footerComponent={buttonFooter}> <NewWrapper_V2
enableKeyboardHandling
keyboardScrollOffset={100}
footerComponent={buttonFooter}
>
<InformationBox text="Tentukan lokasi pin map dengan menekan pada map." /> <InformationBox text="Tentukan lokasi pin map dengan menekan pada map." />
<BaseBox> <BaseBox>
@@ -160,13 +165,15 @@ export function Maps_ScreenMapsCreate() {
/> />
</BaseBox> </BaseBox>
<TextInputCustom <View onStartShouldSetResponder={() => true}>
required <TextInputCustom
label="Nama Pin" required
placeholder="Masukkan nama pin maps" label="Nama Pin"
value={name} placeholder="Masukkan nama pin maps"
onChangeText={setName} value={name}
/> onChangeText={setName}
/>
</View>
<Spacing height={50} /> <Spacing height={50} />
@@ -179,7 +186,7 @@ export function Maps_ScreenMapsCreate() {
</ButtonCenteredOnly> </ButtonCenteredOnly>
<Spacing height={50} /> <Spacing height={50} />
</NewWrapper> </NewWrapper_V2>
); );
} }

View File

@@ -7,7 +7,7 @@ import {
LandscapeFrameUploaded, LandscapeFrameUploaded,
Spacing, Spacing,
TextInputCustom, TextInputCustom,
ViewWrapper, NewWrapper_V2,
} from "@/components"; } from "@/components";
import CustomSkeleton from "@/components/_ShareComponent/SkeletonCustom"; import CustomSkeleton from "@/components/_ShareComponent/SkeletonCustom";
import { MapSelectedPlatform } from "@/components/Map/MapSelectedPlatform"; import { MapSelectedPlatform } from "@/components/Map/MapSelectedPlatform";
@@ -19,6 +19,7 @@ import { uploadFileService } from "@/service/upload-service";
import pickFile, { IFileData } from "@/utils/pickFile"; import pickFile, { IFileData } from "@/utils/pickFile";
import { router, useFocusEffect, useLocalSearchParams } from "expo-router"; import { router, useFocusEffect, useLocalSearchParams } from "expo-router";
import { useCallback, useState } from "react"; import { useCallback, useState } from "react";
import { View } from "react-native";
import { LatLng } from "react-native-maps"; import { LatLng } from "react-native-maps";
import Toast from "react-native-toast-message"; import Toast from "react-native-toast-message";
@@ -166,7 +167,11 @@ export function Maps_ScreenMapsEdit() {
: defaultRegion; : defaultRegion;
return ( return (
<ViewWrapper footerComponent={buttonFooter}> <NewWrapper_V2
enableKeyboardHandling
keyboardScrollOffset={100}
footerComponent={buttonFooter}
>
<InformationBox text="Tentukan lokasi pin map dengan menekan pada map." /> <InformationBox text="Tentukan lokasi pin map dengan menekan pada map." />
{/* <MapSelectedPlatform {/* <MapSelectedPlatform
@@ -191,13 +196,15 @@ export function Maps_ScreenMapsEdit() {
/> />
)} )}
<TextInputCustom <View onStartShouldSetResponder={() => true}>
required <TextInputCustom
label="Nama Pin" required
placeholder="Masukkan nama pin maps" label="Nama Pin"
value={data?.namePin} placeholder="Masukkan nama pin maps"
onChangeText={(value) => setData({ ...data, namePin: value })} value={data?.namePin}
/> onChangeText={(value) => setData({ ...data, namePin: value })}
/>
</View>
<Spacing /> <Spacing />
@@ -223,6 +230,6 @@ export function Maps_ScreenMapsEdit() {
Upload Upload
</ButtonCenteredOnly> </ButtonCenteredOnly>
<Spacing height={50} /> <Spacing height={50} />
</ViewWrapper> </NewWrapper_V2>
); );
} }

View File

@@ -4,7 +4,7 @@ import {
ButtonCenteredOnly, ButtonCenteredOnly,
CenterCustom, CenterCustom,
InformationBox, InformationBox,
NewWrapper, NewWrapper_V2,
PhoneInputCustom, PhoneInputCustom,
SelectCustom, SelectCustom,
Spacing, Spacing,
@@ -142,7 +142,9 @@ export function ScreenPortofolioCreate() {
}; };
return ( return (
<NewWrapper <NewWrapper_V2
enableKeyboardHandling
keyboardScrollOffset={100}
footerComponent={ footerComponent={
<Portofolio_ButtonCreate <Portofolio_ButtonCreate
id={id as string} id={id as string}
@@ -158,57 +160,62 @@ export function ScreenPortofolioCreate() {
<StackCustom gap="xs"> <StackCustom gap="xs">
<InformationBox text="Lengkapi data bisnis anda." /> <InformationBox text="Lengkapi data bisnis anda." />
<TextInputCustom <View onStartShouldSetResponder={() => true}>
required <TextInputCustom
label="Nama Bisnis"
placeholder="Masukkan nama bisnis"
onChangeText={(value: any) => setData({ ...data, namaBisnis: value })}
/>
<SelectCustom
label="Bidang Usaha"
required
data={bidangBisnis.map((item) => ({
label: item.name,
value: item.id,
}))}
value={data.masterBidangBisnisId}
onChange={(value) => {
const isSameBidang = data.masterBidangBisnisId === value;
if (!isSameBidang) {
setListSubBidangSelected([{ id: "" }]);
}
setData({ ...(data as any), masterBidangBisnisId: value });
handlerSelectedSubBidang({ id: value as string });
}}
/>
{listSubBidangSelected.map((item, index) => (
<SelectCustom
key={index}
disabled={data.masterBidangBisnisId === ""}
label="Sub Bidang Usaha"
required required
data={_.map(selectedSubBidang as any) label="Nama Bisnis"
.filter((option: any) => { placeholder="Masukkan nama bisnis"
const selectedValues = listSubBidangSelected.map((s) => s.id); onChangeText={(value: any) => setData({ ...data, namaBisnis: value })}
return ( />
option.id === item.id || !selectedValues.includes(option.id) </View>
);
}) <View onStartShouldSetResponder={() => true}>
.map((e: any) => ({ <SelectCustom
value: e.id, label="Bidang Usaha"
label: e.name, required
}))} data={bidangBisnis.map((item) => ({
value={item.id || null} label: item.name,
value: item.id,
}))}
value={data.masterBidangBisnisId}
onChange={(value) => { onChange={(value) => {
const list = _.clone(listSubBidangSelected); const isSameBidang = data.masterBidangBisnisId === value;
list[index].id = value as any;
setListSubBidangSelected(list); if (!isSameBidang) {
setListSubBidangSelected([{ id: "" }]);
}
setData({ ...(data as any), masterBidangBisnisId: value });
handlerSelectedSubBidang({ id: value as string });
}} }}
/> />
</View>
{listSubBidangSelected.map((item, index) => (
<View onStartShouldSetResponder={() => true} key={index}>
<SelectCustom
disabled={data.masterBidangBisnisId === ""}
label="Sub Bidang Usaha"
required
data={_.map(selectedSubBidang as any)
.filter((option: any) => {
const selectedValues = listSubBidangSelected.map((s) => s.id);
return (
option.id === item.id || !selectedValues.includes(option.id)
);
})
.map((e: any) => ({
value: e.id,
label: e.name,
}))}
value={item.id || null}
onChange={(value) => {
const list = _.clone(listSubBidangSelected);
list[index].id = value as any;
setListSubBidangSelected(list);
}}
/>
</View>
))} ))}
<CenterCustom> <CenterCustom>
@@ -272,27 +279,31 @@ export function ScreenPortofolioCreate() {
<Spacing /> <Spacing />
<TextInputCustom <View onStartShouldSetResponder={() => true}>
required <TextInputCustom
label="Alamat Bisnis" required
placeholder="Masukkan alamat bisnis" label="Alamat Bisnis"
onChangeText={(value: any) => placeholder="Masukkan alamat bisnis"
setData({ ...data, alamatKantor: value }) onChangeText={(value: any) =>
} setData({ ...data, alamatKantor: value })
/> }
/>
</View>
<TextAreaCustom <View onStartShouldSetResponder={() => true}>
label="Deskripsi Bisnis" <TextAreaCustom
placeholder="Masukkan deskripsi bisnis" label="Deskripsi Bisnis"
value={data.deskripsi} placeholder="Masukkan deskripsi bisnis"
onChangeText={(value: any) => setData({ ...data, deskripsi: value })} value={data.deskripsi}
autosize onChangeText={(value: any) => setData({ ...data, deskripsi: value })}
minRows={2} autosize
maxRows={5} minRows={2}
required maxRows={5}
showCount required
maxLength={1000} showCount
/> maxLength={1000}
/>
</View>
<Spacing /> <Spacing />
@@ -322,46 +333,56 @@ export function ScreenPortofolioCreate() {
<InformationBox text="Isi hanya pada sosial media yang anda miliki." /> <InformationBox text="Isi hanya pada sosial media yang anda miliki." />
<TextInputCustom <View onStartShouldSetResponder={() => true}>
label="Tiktok" <TextInputCustom
placeholder="Masukkan username tiktok" label="Tiktok"
onChangeText={(value: any) => placeholder="Masukkan username tiktok"
setDataMedsos({ ...dataMedsos, tiktok: value }) onChangeText={(value: any) =>
} setDataMedsos({ ...dataMedsos, tiktok: value })
/> }
/>
</View>
<TextInputCustom <View onStartShouldSetResponder={() => true}>
label="Facebook" <TextInputCustom
placeholder="Masukkan username facebook" label="Facebook"
onChangeText={(value: any) => placeholder="Masukkan username facebook"
setDataMedsos({ ...dataMedsos, facebook: value }) onChangeText={(value: any) =>
} setDataMedsos({ ...dataMedsos, facebook: value })
/> }
/>
</View>
<TextInputCustom <View onStartShouldSetResponder={() => true}>
label="Instagram" <TextInputCustom
placeholder="Masukkan username instagram" label="Instagram"
onChangeText={(value: any) => placeholder="Masukkan username instagram"
setDataMedsos({ ...dataMedsos, instagram: value }) onChangeText={(value: any) =>
} setDataMedsos({ ...dataMedsos, instagram: value })
/> }
/>
</View>
<TextInputCustom <View onStartShouldSetResponder={() => true}>
label="Twitter" <TextInputCustom
placeholder="Masukkan username twitter" label="Twitter"
onChangeText={(value: any) => placeholder="Masukkan username twitter"
setDataMedsos({ ...dataMedsos, twitter: value }) onChangeText={(value: any) =>
} setDataMedsos({ ...dataMedsos, twitter: value })
/> }
/>
</View>
<TextInputCustom <View onStartShouldSetResponder={() => true}>
label="Youtube" <TextInputCustom
placeholder="Masukkan username youtube" label="Youtube"
onChangeText={(value: any) => placeholder="Masukkan username youtube"
setDataMedsos({ ...dataMedsos, youtube: value }) onChangeText={(value: any) =>
} setDataMedsos({ ...dataMedsos, youtube: value })
/> }
/>
</View>
</StackCustom> </StackCustom>
</NewWrapper> </NewWrapper_V2>
); );
} }

View File

@@ -2,7 +2,7 @@ import {
AvatarComp, AvatarComp,
ClickableCustom, ClickableCustom,
Grid, Grid,
NewWrapper, NewWrapper_V2,
StackCustom, StackCustom,
TextCustom, TextCustom,
TextInputCustom, TextInputCustom,
@@ -140,7 +140,9 @@ export default function UserSearchMainView_V2() {
}); });
return ( return (
<NewWrapper <NewWrapper_V2
hideFooter
contentPaddingHorizontal={16}
headerComponent={renderHeader(search, setSearch)} headerComponent={renderHeader(search, setSearch)}
listData={pagination.listData} listData={pagination.listData}
renderItem={renderItem} renderItem={renderItem}

View File

@@ -15,29 +15,47 @@ Migrasi bertahap dari `NewWrapper` ke `NewWrapper_V2` untuk memperbaiki bug keyb
## 📊 Migration Priority ## 📊 Migration Priority
### **Phase 1: Job Screens** (Week 1) - CURRENT ### **Phase 1: Job Screens** (Week 1) COMPLETED
- [x] `screens/Job/ScreenJobCreate2.tsx` → Already using keyboard handling - [x] `screens/Job/ScreenJobCreate2.tsx` → Already using keyboard handling
- [ ] `screens/Job/ScreenJobCreate.tsx` → Migrate to NewWrapper_V2 - [x] `screens/Job/ScreenJobCreate.tsx` → Migrate to NewWrapper_V2
- [ ] `screens/Job/ScreenJobEdit.tsx` → Migrate to NewWrapper_V2 - [x] `screens/Job/ScreenJobEdit.tsx` → Migrate to NewWrapper_V2
- [ ] Delete test files after migration - [x] Delete test files after migration
### **Phase 2: Event & Profile Screens** (Week 2) ### **Phase 2: Profile Screens** (Week 2) ✅ COMPLETED
- [x] `app/(application)/(user)/profile/create.tsx` → Migrate to NewWrapper_V2
- [x] `app/(application)/(user)/profile/[id]/edit.tsx` → Migrate to NewWrapper_V2
- [x] `app/(application)/(user)/profile/[id]/index.tsx` → Migrate to NewWrapper_V2
- [x] `app/(application)/(user)/profile/[id]/detail-blocked.tsx` → Migrate to NewWrapper_V2
- [x] `app/(application)/(user)/profile/[id]/blocked-list.tsx` → Migrate to NewWrapper_V2
- [x] `app/(application)/(user)/profile/[id]/update-photo.tsx` → Migrate to NewWrapper_V2
- [x] `app/(application)/(user)/profile/[id]/update-background.tsx` → Migrate to NewWrapper_V2
### **Phase 3: Portofolio & Maps Screens** (Week 3) - NEXT
- [ ] `app/(application)/(user)/portofolio/[id]/create.tsx`
- [ ] `app/(application)/(user)/portofolio/[id]/edit.tsx`
- [ ] `app/(application)/(user)/portofolio/[id]/edit-logo.tsx`
- [ ] `app/(application)/(user)/portofolio/[id]/edit-social-media.tsx`
- [ ] `app/(application)/(user)/portofolio/[id]/index.tsx`
- [ ] `app/(application)/(user)/portofolio/[id]/list.tsx`
- [ ] `screens/Maps/ScreenMapsCreate.tsx`
- [ ] `screens/Maps/ScreenMapsEdit.tsx`
- [ ] `app/(application)/(user)/maps/[id]/custom-pin.tsx`
### **Phase 4: Event Screens** (Week 4)
- [ ] `screens/Event/ScreenEventCreate.tsx` - [ ] `screens/Event/ScreenEventCreate.tsx`
- [ ] `screens/Event/ScreenEventEdit.tsx` - [ ] `screens/Event/ScreenEventEdit.tsx`
- [ ] `screens/Profile/ScreenProfileCreate.tsx`
- [ ] `screens/Profile/ScreenProfileEdit.tsx`
### **Phase 3: Other Form Screens** (Week 3) ### **Phase 5: Other Form Screens** (Week 5)
- [ ] `screens/Donation/` - All create/edit screens - [ ] `screens/Donation/` - All create/edit screens
- [ ] `screens/Investment/` - All create/edit screens - [ ] `screens/Investment/` - All create/edit screens
- [ ] `screens/Voting/` - All create/edit screens - [ ] `screens/Voting/` - All create/edit screens
### **Phase 4: Complex Screens** (Week 4) ### **Phase 6: Complex Screens** (Week 6)
- [ ] `screens/Forum/` - Create/edit with rich text - [ ] `screens/Forum/` - Create/edit with rich text
- [ ] `screens/Collaboration/` - Complex forms - [ ] `screens/Collaboration/` - Complex forms
- [ ] Other complex forms - [ ] Other complex forms
### **Phase 5: Cleanup** (Week 5) ### **Phase 7: Cleanup** (Week 7)
- [ ] Remove old `NewWrapper.tsx` (or deprecate) - [ ] Remove old `NewWrapper.tsx` (or deprecate)
- [ ] Rename `NewWrapper_V2.tsx``NewWrapper.tsx` - [ ] Rename `NewWrapper_V2.tsx``NewWrapper.tsx`
- [ ] Update documentation - [ ] Update documentation
@@ -214,10 +232,12 @@ import { View } from "react-native";
| Phase | Screens | Status | Completed Date | | Phase | Screens | Status | Completed Date |
|-------|---------|--------|----------------| |-------|---------|--------|----------------|
| **Phase 1: Job** | 6 screens | ✅ COMPLETED | 2026-04-01 | | **Phase 1: Job** | 6 screens | ✅ COMPLETED | 2026-04-01 |
| **Phase 2: Event & Profile** | 4 screens | ⏳ Pending | - | | **Phase 2: Profile** | 7 screens | ✅ COMPLETED | 2026-04-04 |
| **Phase 3: Forms** | 6-8 screens | ⏳ Pending | - | | **Phase 3: Portofolio & Maps** | 9 screens | ⏳ Pending | - |
| **Phase 4: Complex** | 4-6 screens | ⏳ Pending | - | | **Phase 4: Event** | 2 screens | ⏳ Pending | - |
| **Phase 5: Cleanup** | Cleanup | ⏳ Pending | - | | **Phase 5: Forms** | 6-8 screens | ⏳ Pending | - |
| **Phase 6: Complex** | 4-6 screens | ⏳ Pending | - |
| **Phase 7: Cleanup** | Cleanup | ⏳ Pending | - |
--- ---
@@ -256,30 +276,63 @@ import { View } from "react-native";
--- ---
## ✅ Phase 2: COMPLETED!
**Migrated Screens:**
1.`app/(application)/(user)/profile/create.tsx` - Form with keyboard handling
2.`app/(application)/(user)/profile/[id]/edit.tsx` - Form with keyboard handling
3.`app/(application)/(user)/profile/[id]/index.tsx` - Profile detail (list, no keyboard handling)
4.`app/(application)/(user)/profile/[id]/detail-blocked.tsx` - Blocked detail with keyboard handling
5.`app/(application)/(user)/profile/[id]/blocked-list.tsx` - Blocked list (list, no keyboard handling)
6.`app/(application)/(user)/profile/[id]/update-photo.tsx` - Photo update screen
7.`app/(application)/(user)/profile/[id]/update-background.tsx` - Background update screen
**Changes Applied:**
- Replaced `ViewWrapper`/`NewWrapper``NewWrapper_V2`
- Added `enableKeyboardHandling` prop to form screens
- Added `keyboardScrollOffset={100}` to form screens
- Wrapped all `TextInputCustom`/`SelectCustom` with `<View onStartShouldSetResponder={() => true}>`
- Fixed keyboard handling issues (footer lift, white area, input cutoff)
**Commits:**
- `3382c16` - refactor: Migrate Profile screens to NewWrapper_V2
- `76759cc` - chore: Update layout headers and iOS build config
**Total:** 7 screens migrated, 2 commits pushed to branch `qc/4-apr-26`
---
## 🚀 Current Status ## 🚀 Current Status
**Status**: 🟡 IN PROGRESS **Status**: 🟡 IN PROGRESS
**Current Phase**: Phase 1 - Job Screens **Current Phase**: Phase 2 - Profile Screens ✅ COMPLETED
**Next Phase**: Phase 3 - Portofolio & Maps Screens
**Started**: 2026-04-01 **Started**: 2026-04-01
**ETA**: 2026-04-07 (Phase 1 complete) **Last Updated**: 2026-04-04
**Overall Progress**: 13/34+ screens completed (38%)
--- ---
## 📞 Next Actions ## 📞 Next Actions
1. **Immediate** (Today): 1. **Immediate** (Today):
- [ ] Migrate `ScreenJobCreate.tsx` - [ ] Migrate `app/(application)/(user)/portofolio/[id]/create.tsx`
- [ ] Migrate `ScreenJobEdit.tsx` - [ ] Migrate `app/(application)/(user)/portofolio/[id]/edit.tsx`
- [ ] Test both screens - [ ] Migrate `app/(application)/(user)/portofolio/[id]/edit-logo.tsx`
- [ ] Migrate `app/(application)/(user)/portofolio/[id]/edit-social-media.tsx`
- [ ] Migrate `screens/Maps/ScreenMapsCreate.tsx`
- [ ] Migrate `screens/Maps/ScreenMapsEdit.tsx`
- [ ] Migrate `app/(application)/(user)/maps/[id]/custom-pin.tsx`
- [ ] Test all Portofolio & Maps screens
2. **This Week**: 2. **This Week**:
- [ ] Delete test files - [ ] Complete Phase 3 (Portofolio & Maps screens)
- [ ] Document any issues - [ ] Document any issues
- [ ] Prepare Phase 2 - [ ] Prepare Phase 4
3. **Next Week**: 3. **Next Week**:
- [ ] Start Phase 2 (Event & Profile) - [ ] Start Phase 4 (Event screens)
- [ ] Review Phase 1 results - [ ] Review Phase 2-3 results
- [ ] Adjust migration guide if needed - [ ] Adjust migration guide if needed
--- ---
@@ -297,8 +350,13 @@ import { View } from "react-native";
- `tasks/TASK-004-newwrapper-migration.md` (This file) - `tasks/TASK-004-newwrapper-migration.md` (This file)
**Screens to Migrate:** **Screens to Migrate:**
- `screens/Job/ScreenJobCreate.tsx` - `app/(application)/(user)/portofolio/[id]/create.tsx` (Phase 3)
- `screens/Job/ScreenJobEdit.tsx` - `app/(application)/(user)/portofolio/[id]/edit.tsx` (Phase 3)
- `app/(application)/(user)/portofolio/[id]/edit-logo.tsx` (Phase 3)
- `app/(application)/(user)/portofolio/[id]/edit-social-media.tsx` (Phase 3)
- `screens/Maps/ScreenMapsCreate.tsx` (Phase 3)
- `screens/Maps/ScreenMapsEdit.tsx` (Phase 3)
- `app/(application)/(user)/maps/[id]/custom-pin.tsx` (Phase 3)
- (More in subsequent phases) - (More in subsequent phases)
--- ---
@@ -322,12 +380,23 @@ import { View } from "react-native";
## ✅ Success Criteria ## ✅ Success Criteria
**Phase 1 Complete when:** **Phase 2 Complete when:**
- [ ] Job Create migrated - [x] Profile Create migrated
- [ ] Job Edit migrated - [x] Profile Edit migrated
- [ ] Both screens tested on iOS & Android - [x] Profile detail screens migrated
- [x] All screens tested
- [x] Commits pushed to branch
**Phase 3 Complete when:**
- [ ] Portofolio Create migrated
- [ ] Portofolio Edit migrated
- [ ] Portofolio edit-logo migrated
- [ ] Portofolio edit-social-media migrated
- [ ] Maps Create migrated
- [ ] Maps Edit migrated
- [ ] Maps custom-pin migrated
- [ ] All Portofolio & Maps screens tested on iOS & Android
- [ ] No critical bugs - [ ] No critical bugs
- [ ] Test files deleted
- [ ] Documentation updated - [ ] Documentation updated
**Overall Migration Complete when:** **Overall Migration Complete when:**
@@ -339,6 +408,6 @@ import { View } from "react-native";
--- ---
**Last Updated**: 2026-04-01 **Last Updated**: 2026-04-04
**Created by**: AI Assistant **Created by**: AI Assistant
**Status**: 🟡 IN PROGRESS **Status**: 🟡 IN PROGRESS - Phase 2 Complete, Ready for Phase 3 (Portofolio & Maps)