Compare commits

...

4 Commits

Author SHA1 Message Date
c3cf354c28 feat: Migrate Portfolio & Maps screens + perbaiki bug auto-scroll keyboard
Phase 3 - Portfolio Screens (6 files):
- [id]/index.tsx: ViewWrapper → OS_Wrapper (detail dengan pull-to-refresh)
- [id]/edit.tsx: NewWrapper → OS_Wrapper (form + keyboard handling)
- [id]/edit-logo.tsx: ViewWrapper → OS_Wrapper (upload logo)
- [id]/edit-social-media.tsx: ViewWrapper → OS_Wrapper (form + keyboard handling)
- ViewListPortofolio.tsx: NewWrapper → OS_Wrapper (pagination list)
- ScreenPortofolioCreate.tsx: NewWrapper → OS_Wrapper (form + keyboard handling)

Phase 4 - Maps Screens (2 files):
- ScreenMapsCreate.tsx: NewWrapper → OS_Wrapper (form + keyboard handling)
- ScreenMapsEdit.tsx: ViewWrapper → OS_Wrapper (form + keyboard handling)

Bug Fixes:
- Perbaiki auto-scroll keyboard yang membuat input paling atas 'terlempar' keluar layar
- Gunakan UIManager.measure untuk mendapatkan posisi absolut input (pageY) secara akurat
- Logika conditional scroll:
  * Jika input terlihat (di atas keyboard) → TIDAK SCROLL
  * Jika input tertutup keyboard → Scroll secukupnya
- Helper cloneChildrenWithFocusHandler sekarang aktif menyuntikan onFocus handler ke semua TextInput/TextArea/PhoneInput/Select
- Hapus KeyboardAvoidingView dari AndroidWrapper static mode (tidak diperlukan lagi)

Pattern yang diterapkan:
- List screens: contentPaddingBottom=100 (default)
- Form screens: contentPaddingBottom={250} + enableKeyboardHandling
- NO PADDING_INLINE (sesuai preferensi user - mencegah box menyempit)

Dokumentasi:
- Update TASK-005 dengan status lengkap Phase 1-4 (27 files migrated)
- Tambahkan urutan phase baru: Event (Phase 5), Voting (Phase 6), Forum (Phase 7), Donation (Phase 8)

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-04-08 17:27:06 +08:00
6ec839fd67 feat: Migrate Profile, Waiting Room, and Delete Account to OS_Wrapper
Profile Screens (8 files):
- [id]/index.tsx: NewWrapper → OS_Wrapper (list with refresh)
- [id]/edit.tsx: ViewWrapper → OS_Wrapper (form + keyboard handling)
- create.tsx: ViewWrapper → OS_Wrapper (form + keyboard handling)
- [id]/blocked-list.tsx: NewWrapper → OS_Wrapper (pagination list)
- [id]/detail-blocked.tsx: NewWrapper → OS_Wrapper (static with footer)
- [id]/update-background.tsx: ViewWrapper → OS_Wrapper (static with footer)
- [id]/update-photo.tsx: ViewWrapper → OS_Wrapper (static with footer)
- All Profile forms use enableKeyboardHandling + contentPaddingBottom={250}

Other Screens (2 files):
- waiting-room.tsx: NewWrapper → OS_Wrapper (static with refresh + footer)
- delete-account.tsx: ViewWrapper → OS_Wrapper (form + keyboard handling)

Bug Fixes:
- AndroidWrapper: Add refreshControl to ScrollView (fix pull-to-refresh on static mode)

Pattern Applied:
- List screens: contentPaddingBottom=100 (default)
- Form screens: contentPaddingBottom=250 (with TextInput)
- No PADDING_INLINE (user preference - prevents box narrowing)

Documentation:
- Update TASK-005 with Phase 1 completion details

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-04-08 14:32:11 +08:00
b8f8a361d6 refactor: Adjust OS_Wrapper defaults for better spacing
- Reduce default contentPaddingBottom from 250 to 100
  - Better for list screens (less empty space)
  - Only form screens with TextInput need 250px

- Set OS_ANDROID_PADDING_TOP to 6px
  - More compact tabs on Android

- Update form screens (Create/Edit):
  - Explicit contentPaddingBottom={250}
  - Only screens with TextInput use larger spacing

- Remove unnecessary PADDING_INLINE from detail screens
  - Detail screen doesn't need inline padding

Pattern:
- Default: contentPaddingBottom=100 (list screens)
- Forms: contentPaddingBottom=250 (screens with TextInput)
- contentPadding=0 (per-screen control)

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-04-08 10:31:36 +08:00
1a5ca78041 feat: Complete OS_Wrapper implementation with keyboard handling and PADDING_INLINE
OS_Wrapper System:
- Simplify API: Remove PageWrapper, merge keyboard props into OS_Wrapper
- Add auto-scroll when keyboard appears (Android only)
- Add tap-to-dismiss keyboard for both Static and List modes
- Fix contentPaddingBottom default to 250px (prevent keyboard overlap)
- Change default contentPadding to 0 (per-screen control)
- Remove Platform.OS checks from IOSWrapper and AndroidWrapper

Constants:
- Add PADDING_INLINE constant (16px) for consistent inline padding
- Add OS_PADDING_TOP constants for tab layouts

Job Screens Migration (9 files):
- Apply PADDING_INLINE to all Job screens:
  - ScreenBeranda, ScreenBeranda2
  - ScreenArchive, ScreenArchive2
  - MainViewStatus, MainViewStatus2
  - ScreenJobCreate, ScreenJobEdit
  - Job detail screen

Keyboard Handling:
- Simplified useKeyboardForm hook
- Auto-scroll by keyboard height when keyboard appears
- Track scroll position for accurate scroll targets
- TouchableWithoutFeedback wraps all content for tap-to-dismiss

Documentation:
- Update TASK-005 with Phase 1 completion status
- Update Quick Reference with unified API examples

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-04-07 17:50:15 +08:00
38 changed files with 730 additions and 530 deletions

27
QWEN.md
View File

@@ -513,3 +513,30 @@ When using Maplibre MapView on iOS, prevent "Attempt to recycle a mounted view"
- [Expo Router Documentation](https://docs.expo.dev/router/introduction/)
- [TypeScript Documentation](https://www.typescriptlang.org/docs/)
- [Maplibre React Native](https://github.com/maplibre/maplibre-react-native)
## Qwen Added Memories
- OS_Wrapper contentPaddingBottom pattern:
- Default: contentPaddingBottom=100 (untuk list screens)
- Forms: contentPaddingBottom=250 (HANYA untuk screens yang punya TextInput/TextArea)
- contentPadding=0 (default, per-screen control)
- OS_ANDROID_PADDING_TOP=6 (compact tabs)
- OS_IOS_PADDING_TOP=12
- PADDING_INLINE=16 (constant)
Contoh:
```tsx
// List screen (default 100px)
<OS_Wrapper listData={data} renderItem={renderItem} />
// Form screen (explicit 250px)
<OS_Wrapper enableKeyboardHandling contentPaddingBottom={250}>
<FormWithTextInput />
</OS_Wrapper>
```
- PADDING_INLINE usage pattern - User preference:
- PADDING_INLINE (16px) TIDAK selalu diperlukan
- User remove PADDING_INLINE dari Profile screens karena mempersempit box tampilan
- Decision: Tambahkan PADDING_INLINE HANYA jika diperlukan per-screen, jangan default
- User akan review dan tambahkan sendiri jika perlu
Profile screens: PADDING_INLINE dihapus dari edit.tsx dan create.tsx

View File

@@ -3,10 +3,10 @@ import {
BaseBox,
ButtonCustom,
CenterCustom,
OS_Wrapper,
StackCustom,
TextCustom,
TextInputCustom,
ViewWrapper,
} from "@/components";
import { useAuth } from "@/hooks/use-auth";
import { apiDeleteUser } from "@/service/api-client/api-user";
@@ -68,7 +68,10 @@ export default function DeleteAccount() {
return (
<>
<ViewWrapper>
<OS_Wrapper
enableKeyboardHandling
contentPaddingBottom={250}
>
<StackCustom>
<BaseBox>
<StackCustom>
@@ -105,7 +108,7 @@ export default function DeleteAccount() {
</StackCustom>
</BaseBox>
</StackCustom>
</ViewWrapper>
</OS_Wrapper>
</>
);
}

View File

@@ -5,15 +5,17 @@ import { IconHome, IconStatus } from "@/components/_Icon";
import BackButtonFromNotification from "@/components/Button/BackButtonFromNotification";
import { TabsStyles } from "@/styles/tabs-styles";
import { Ionicons } from "@expo/vector-icons";
import {
router,
Tabs,
useLocalSearchParams
} from "expo-router";
import { router, Tabs, useLocalSearchParams } from "expo-router";
import { View } from "react-native";
import { MainColor } from "@/constants/color-palet";
import { useSafeAreaInsets } from "react-native-safe-area-context";
import { Platform } from "react-native";
import {
OS_ANDROID_HEIGHT,
OS_ANDROID_PADDING_TOP,
OS_IOS_HEIGHT,
OS_IOS_PADDING_TOP,
} from "@/constants/constans-value";
function JobTabsWrapper() {
const insets = useSafeAreaInsets();
@@ -31,20 +33,23 @@ function JobTabsWrapper() {
tabBarStyle: Platform.select({
ios: {
borderTopWidth: 0,
paddingTop: 12,
height: 80,
paddingTop: OS_IOS_PADDING_TOP,
height: OS_IOS_HEIGHT,
},
android: {
borderTopWidth: 0,
paddingTop: 5,
height: 70 + paddingBottom,
paddingTop: OS_ANDROID_PADDING_TOP,
height: OS_ANDROID_HEIGHT + paddingBottom,
},
}),
header: () => (
<AppHeader
title="Job Vacancy"
left={
<BackButtonFromNotification from={from || ""} category={category} />
<BackButtonFromNotification
from={from || ""}
category={category}
/>
}
/>
),

View File

@@ -5,7 +5,7 @@ import {
DrawerCustom,
LoaderCustom,
MenuDrawerDynamicGrid,
NewWrapper_V2,
OS_Wrapper,
Spacing,
StackCustom,
} from "@/components";
@@ -23,6 +23,7 @@ import {
useLocalSearchParams,
} from "expo-router";
import { useCallback, useState } from "react";
import { PADDING_INLINE } from "@/constants/constans-value";
export default function JobDetailStatus() {
const { id, status } = useLocalSearchParams();
@@ -72,7 +73,7 @@ export default function JobDetailStatus() {
),
}}
/>
<NewWrapper_V2>
<OS_Wrapper >
{isLoadData ? (
<LoaderCustom />
) : (
@@ -96,7 +97,7 @@ export default function JobDetailStatus() {
<Spacing />
</>
)}
</NewWrapper_V2>
</OS_Wrapper>
<DrawerCustom
isVisible={openDrawer}

View File

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

View File

@@ -1,8 +1,8 @@
import {
BoxButtonOnFooter,
ButtonCustom,
OS_Wrapper,
TextInputCustom,
ViewWrapper,
} from "@/components";
import {
apiGetOnePortofolio,
@@ -91,7 +91,11 @@ export default function PortofolioEditSocialMedia() {
return (
<>
<ViewWrapper footerComponent={buttonFooter}>
<OS_Wrapper
enableKeyboardHandling
contentPaddingBottom={250}
footerComponent={buttonFooter}
>
<TextInputCustom
value={data.tiktok}
onChangeText={(value) => setData({ ...data, tiktok: value })}
@@ -122,7 +126,7 @@ export default function PortofolioEditSocialMedia() {
label="Youtube"
placeholder="Masukkan youtube"
/>
</ViewWrapper>
</OS_Wrapper>
</>
);
}

View File

@@ -4,7 +4,7 @@ import {
BoxButtonOnFooter,
ButtonCustom,
CenterCustom,
NewWrapper,
OS_Wrapper,
PhoneInputCustom,
SelectCustom,
Spacing,
@@ -16,7 +16,11 @@ import {
import ListSkeletonComponent from "@/components/_ShareComponent/ListSkeletonComponent";
import { MainColor } from "@/constants/color-palet";
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 {
apiMasterBidangBisnis,
apiMasterSubBidangBisnis,
@@ -61,7 +65,8 @@ export default function PortofolioEdit() {
const [isLoading, setIsLoading] = useState(false);
const [data, setData] = useState<any>({});
const [phoneNumber, setPhoneNumber] = useState<string>("");
const [selectedCountry, setSelectedCountry] = useState<CountryData>(DEFAULT_COUNTRY);
const [selectedCountry, setSelectedCountry] =
useState<CountryData>(DEFAULT_COUNTRY);
const [bidangBisnis, setBidangBisnis] = useState<
IMasterBidangBisnis[] | null
>(null);
@@ -75,38 +80,38 @@ export default function PortofolioEdit() {
function handlePhoneChange(phone: string) {
setPhoneNumber(phone);
// Format phone number for API
const callingCode = selectedCountry.callingCode;
let fixNumber = phone.replace(/\s+/g, "").replace(/^0+/, "");
// Remove country code if already present
if (fixNumber.startsWith(callingCode)) {
fixNumber = fixNumber.substring(callingCode.length);
}
// Remove leading zero
fixNumber = fixNumber.replace(/^0+/, "");
const realNumber = callingCode + fixNumber;
setData({ ...data, tlpn: realNumber });
}
function handleCountryChange(country: CountryData) {
setSelectedCountry(country);
// Re-format with new country code
const callingCode = country.callingCode;
let fixNumber = phoneNumber.replace(/\s+/g, "").replace(/^0+/, "");
// Remove country code if already present
if (fixNumber.startsWith(callingCode)) {
fixNumber = fixNumber.substring(callingCode.length);
}
// Remove leading zero
fixNumber = fixNumber.replace(/^0+/, "");
const realNumber = callingCode + fixNumber;
setData({ ...data, tlpn: realNumber });
}
@@ -157,7 +162,7 @@ export default function PortofolioEdit() {
const fullNumber = response.data.tlpn;
let displayNumber = fullNumber;
let detectedCountry = DEFAULT_COUNTRY;
// Try to detect country from calling code
for (const country of COUNTRIES) {
if (fullNumber.startsWith(country.callingCode)) {
@@ -166,12 +171,12 @@ export default function PortofolioEdit() {
break;
}
}
setSelectedCountry(detectedCountry);
// Remove leading zero if present
displayNumber = displayNumber.replace(/^0+/, "");
setPhoneNumber(displayNumber);
setData({ ...response.data, tlpn: displayNumber });
@@ -363,161 +368,159 @@ export default function PortofolioEdit() {
</BoxButtonOnFooter>
);
if (!bidangBisnis || !subBidangBisnis) {
return (
<>
<NewWrapper>
<ListSkeletonComponent height={80} />
</NewWrapper>
</>
);
}
return (
<>
<NewWrapper footerComponent={buttonUpdate}>
<StackCustom gap={"xs"}>
<TextInputCustom
required
label="Nama Bisnis"
placeholder="Masukkan nama bisnis"
value={data.namaBisnis}
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: 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
data={availableSubBidangOptions}
value={item.MasterSubBidangBisnis?.id || null}
onChange={(value: any) => {
handleSubBidangChange(value, index);
}}
/>
);
})}
<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"
<OS_Wrapper
enableKeyboardHandling
contentPaddingBottom={250}
footerComponent={buttonUpdate}
>
{!bidangBisnis || !subBidangBisnis ? (
<ListSkeletonComponent height={80} />
) : (
<StackCustom gap={"xs"}>
<TextInputCustom
required
label="Nama Bisnis"
placeholder="Masukkan nama bisnis"
value={data.namaBisnis}
onChangeText={(value: any) =>
setData({ ...data, namaBisnis: value })
}
/>
</View>
<Spacing />
<TextInputCustom
required
label="Alamat Bisnis"
placeholder="Masukkan alamat bisnis"
value={data.alamatKantor}
onChangeText={(value: any) =>
setData({ ...data, alamatKantor: value })
}
/>
<SelectCustom
label="Bidang Usaha"
required
data={bidangBisnis?.map((item) => ({
label: item.name,
value: item.id,
}))}
value={data.masterBidangBisnisId}
onChange={(value: any) => {
handleBidangBisnisChange(value);
}}
/>
<TextAreaCustom
label="Deskripsi Bisnis"
placeholder="Masukkan deskripsi bisnis"
value={data.deskripsi}
onChangeText={(value: any) =>
setData({ ...data, deskripsi: value })
}
autosize
minRows={2}
maxRows={5}
required
showCount
maxLength={1000}
/>
<Spacing />
</StackCustom>
</NewWrapper>
{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
data={availableSubBidangOptions}
value={item.MasterSubBidangBisnis?.id || null}
onChange={(value: any) => {
handleSubBidangChange(value, index);
}}
/>
);
})}
<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>
<Spacing />
<TextInputCustom
required
label="Alamat Bisnis"
placeholder="Masukkan alamat bisnis"
value={data.alamatKantor}
onChangeText={(value: any) =>
setData({ ...data, alamatKantor: value })
}
/>
<TextAreaCustom
label="Deskripsi Bisnis"
placeholder="Masukkan deskripsi bisnis"
value={data.deskripsi}
onChangeText={(value: any) =>
setData({ ...data, deskripsi: value })
}
autosize
minRows={2}
maxRows={5}
required
showCount
maxLength={1000}
/>
<Spacing />
</StackCustom>
)}
</OS_Wrapper>
</>
);
}

View File

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

View File

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

View File

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

View File

@@ -1,11 +1,12 @@
import {
ButtonCustom,
OS_Wrapper,
SelectCustom,
StackCustom,
TextInputCustom,
ViewWrapper,
} from "@/components";
import BoxButtonOnFooter from "@/components/Box/BoxButtonOnFooter";
import { PADDING_INLINE } from "@/constants/constans-value";
import { apiProfile, apiUpdateProfile } from "@/service/api-client/api-profile";
import { IProfile } from "@/types/Type-Profile";
import { router, useLocalSearchParams } from "expo-router";
@@ -70,7 +71,9 @@ export default function ProfileEdit() {
};
return (
<ViewWrapper
<OS_Wrapper
enableKeyboardHandling
contentPaddingBottom={250}
footerComponent={
<BoxButtonOnFooter>
<ButtonCustom isLoading={isLoading} onPress={handleUpdate}>
@@ -119,6 +122,6 @@ export default function ProfileEdit() {
}}
/>
</StackCustom>
</ViewWrapper>
</OS_Wrapper>
);
}

View File

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

View File

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

View File

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

View File

@@ -2,16 +2,17 @@ import {
BaseBox,
ButtonCenteredOnly,
ButtonCustom,
OS_Wrapper,
SelectCustom,
Spacing,
StackCustom,
TextInputCustom,
ViewWrapper,
} from "@/components";
import BoxButtonOnFooter from "@/components/Box/BoxButtonOnFooter";
import InformationBox from "@/components/Box/InformationBox";
import DIRECTORY_ID from "@/constants/directory-id";
import DUMMY_IMAGE from "@/constants/dummy-image-value";
import { PADDING_INLINE } from "@/constants/constans-value";
import { useAuth } from "@/hooks/use-auth";
import { apiCreateProfile } from "@/service/api-client/api-profile";
import { apiValidationEmail } from "@/service/api-client/api-validation";
@@ -155,7 +156,11 @@ export default function CreateProfile() {
);
return (
<ViewWrapper footerComponent={footerComponent}>
<OS_Wrapper
enableKeyboardHandling
contentPaddingBottom={250}
footerComponent={footerComponent}
>
<StackCustom>
<InformationBox text="Upload foto profile anda." />
<View style={{ alignItems: "center" }}>
@@ -241,6 +246,6 @@ export default function CreateProfile() {
/>
<Spacing />
</StackCustom>
</ViewWrapper>
</OS_Wrapper>
);
}

View File

@@ -3,7 +3,7 @@ import {
BoxButtonOnFooter,
ButtonCustom,
InformationBox,
NewWrapper,
OS_Wrapper,
StackCustom
} from "@/components";
import { ICON_SIZE_BUTTON } from "@/constants/constans-value";
@@ -82,7 +82,7 @@ export default function WaitingRoom() {
return (
<>
<NewWrapper
<OS_Wrapper
footerComponent={logoutButton()}
refreshControl={
<RefreshControl refreshing={isLoading} onRefresh={handleCheck} />
@@ -103,7 +103,7 @@ Silakan tunggu beberapa saat. Untuk memperbarui status, tarik layar ke bawah."
Check
</ButtonCenteredOnly> */}
</StackCustom>
</NewWrapper>
</OS_Wrapper>
</>
);
}

View File

@@ -7,7 +7,6 @@ import {
ImageBackground,
Keyboard,
KeyboardAvoidingView,
Platform,
ScrollView,
FlatList,
TouchableWithoutFeedback,
@@ -20,7 +19,7 @@ import {
SafeAreaView,
} from "react-native-safe-area-context";
import type { ScrollViewProps, FlatListProps } from "react-native";
import { useKeyboardForm } from "@/hooks/useKeyboardForm";
import { useKeyboardForm, cloneChildrenWithFocusHandler } from "@/hooks/useKeyboardForm";
// --- Base Props ---
interface BaseProps {
@@ -85,16 +84,21 @@ export function AndroidWrapper(props: AndroidWrapperProps) {
style,
refreshControl,
enableKeyboardHandling = false,
keyboardScrollOffset = 100,
contentPaddingBottom = 80,
contentPadding = 16,
keyboardScrollOffset,
contentPaddingBottom,
contentPadding,
} = props;
// Default values (should be set by OS_Wrapper, but fallback for direct usage)
const finalKeyboardScrollOffset = keyboardScrollOffset ?? 100;
const finalContentPaddingBottom = contentPaddingBottom ?? 250;
const finalContentPadding = contentPadding ?? 0;
const assetBackground = require("../../assets/images/main-background.png");
// Use keyboard hook if enabled
const keyboardForm = enableKeyboardHandling
? useKeyboardForm(keyboardScrollOffset)
? useKeyboardForm(finalKeyboardScrollOffset)
: null;
const renderContainer = (content: React.ReactNode) => {
@@ -119,40 +123,41 @@ export function AndroidWrapper(props: AndroidWrapperProps) {
const listProps = props as ListModeProps;
return (
<KeyboardAvoidingView
behavior={Platform.OS === "ios" ? "padding" : undefined}
style={{ flex: 1, backgroundColor: MainColor.darkblue }}
>
{headerComponent && (
<View style={GStyles.stickyHeader}>{headerComponent}</View>
)}
<FlatList
data={listProps.listData}
renderItem={listProps.renderItem}
keyExtractor={
listProps.keyExtractor ||
((item, index) => `${String(item.id)}-${index}`)
}
refreshControl={refreshControl}
onEndReached={listProps.onEndReached}
onEndReachedThreshold={0.5}
ListHeaderComponent={listProps.ListHeaderComponent}
ListFooterComponent={listProps.ListFooterComponent}
ListEmptyComponent={listProps.ListEmptyComponent}
contentContainerStyle={{
flexGrow: 1,
paddingBottom:
(footerComponent && !hideFooter ? OS_HEIGHT : 0) +
contentPaddingBottom,
padding: contentPadding,
}}
keyboardShouldPersistTaps="handled"
/>
<TouchableWithoutFeedback onPress={Keyboard.dismiss} style={{ flex: 1 }}>
<KeyboardAvoidingView
behavior={undefined}
style={{ flex: 1, backgroundColor: MainColor.darkblue }}
>
{headerComponent && (
<View style={GStyles.stickyHeader}>{headerComponent}</View>
)}
<FlatList
data={listProps.listData}
renderItem={listProps.renderItem}
keyExtractor={
listProps.keyExtractor ||
((item, index) => `${String(item.id)}-${index}`)
}
refreshControl={refreshControl}
onEndReached={listProps.onEndReached}
onEndReachedThreshold={0.5}
ListHeaderComponent={listProps.ListHeaderComponent}
ListFooterComponent={listProps.ListFooterComponent}
ListEmptyComponent={listProps.ListEmptyComponent}
contentContainerStyle={{
flexGrow: 1,
paddingBottom:
(footerComponent && !hideFooter ? OS_HEIGHT : 0) +
finalContentPaddingBottom,
padding: finalContentPadding,
}}
keyboardShouldPersistTaps="handled"
/>
{/* Footer - Fixed di bawah dengan width 100% */}
{footerComponent && !hideFooter && (
<SafeAreaView
edges={Platform.OS === "ios" ? edgesFooter : ["bottom"]}
edges={["bottom"]}
style={{ backgroundColor: MainColor.darkblue, width: "100%" }}
>
<View style={{ width: "100%" }}>{footerComponent}</View>
@@ -170,36 +175,42 @@ export function AndroidWrapper(props: AndroidWrapperProps) {
<View style={GStyles.floatingContainer}>{floatingButton}</View>
)}
</KeyboardAvoidingView>
</TouchableWithoutFeedback>
);
}
// 🔹 Mode Statis (ScrollView)
const staticProps = props as StaticModeProps;
// Inject focus handler jika keyboard handling enabled
const childrenWithFocus = enableKeyboardHandling && keyboardForm
? cloneChildrenWithFocusHandler(staticProps.children, keyboardForm.handleInputFocus)
: staticProps.children;
return (
<KeyboardAvoidingView
behavior={Platform.OS === "ios" ? "padding" : undefined}
style={{ flex: 1, backgroundColor: MainColor.darkblue }}
>
<View style={{ flex: 1, backgroundColor: MainColor.darkblue }}>
{headerComponent && (
<View style={GStyles.stickyHeader}>{headerComponent}</View>
)}
<ScrollView
ref={keyboardForm?.scrollViewRef}
onScroll={keyboardForm?.handleScroll}
scrollEventThrottle={16}
refreshControl={refreshControl}
style={{ flex: 1 }}
contentContainerStyle={{
flexGrow: 1,
paddingBottom:
(footerComponent && !hideFooter ? OS_HEIGHT : 0) +
contentPaddingBottom,
padding: contentPadding,
finalContentPaddingBottom,
padding: finalContentPadding,
}}
keyboardShouldPersistTaps="handled"
showsVerticalScrollIndicator={false}
>
<TouchableWithoutFeedback onPress={Keyboard.dismiss}>
{renderContainer(staticProps.children)}
{renderContainer(childrenWithFocus)}
</TouchableWithoutFeedback>
</ScrollView>
@@ -210,8 +221,8 @@ export function AndroidWrapper(props: AndroidWrapperProps) {
style={{
backgroundColor: MainColor.darkblue,
width: "100%",
position: Platform.OS === "android" ? "absolute" : undefined,
bottom: Platform.OS === "android" ? 0 : undefined,
position: "absolute",
bottom: 0,
left: 0,
right: 0,
}}
@@ -230,7 +241,7 @@ export function AndroidWrapper(props: AndroidWrapperProps) {
{floatingButton && (
<View style={GStyles.floatingContainer}>{floatingButton}</View>
)}
</KeyboardAvoidingView>
</View>
);
}

View File

@@ -29,7 +29,7 @@ export function FormWrapper({
contentPaddingBottom = 100,
contentPadding = 16,
}: FormWrapperProps) {
const { scrollViewRef, handleInputFocus } = useKeyboardForm(scrollOffset);
const { scrollViewRef, handleScroll } = useKeyboardForm(scrollOffset);
return (
<KeyboardAvoidingView
@@ -38,6 +38,8 @@ export function FormWrapper({
>
<ScrollView
ref={scrollViewRef}
onScroll={handleScroll}
scrollEventThrottle={16}
style={{ flex: 1 }}
contentContainerStyle={{
flexGrow: 1,

View File

@@ -7,7 +7,6 @@ import {
ImageBackground,
Keyboard,
KeyboardAvoidingView,
Platform,
ScrollView,
FlatList,
TouchableWithoutFeedback,
@@ -89,7 +88,7 @@ const iOSWrapper = (props: iOSWrapperProps) => {
return (
<KeyboardAvoidingView
behavior={Platform.OS === "ios" ? "padding" : "height"}
behavior="padding"
style={{ flex: 1, backgroundColor: MainColor.darkblue }}
>
{headerComponent && (
@@ -128,7 +127,7 @@ const iOSWrapper = (props: iOSWrapperProps) => {
{footerComponent && !hideFooter && (
<View style={styles.footerContainer}>
<SafeAreaView
edges={Platform.OS === "ios" ? edgesFooter : ["bottom"]}
edges={edgesFooter}
style={{ backgroundColor: MainColor.darkblue }}
>
{footerComponent}
@@ -155,7 +154,7 @@ const iOSWrapper = (props: iOSWrapperProps) => {
return (
<KeyboardAvoidingView
behavior={Platform.OS === "ios" ? "padding" : "height"}
behavior="padding"
style={{ flex: 1, backgroundColor: MainColor.darkblue }}
>
{headerComponent && (
@@ -181,7 +180,7 @@ const iOSWrapper = (props: iOSWrapperProps) => {
{footerComponent && !hideFooter && (
<View style={styles.footerContainer}>
<SafeAreaView
edges={Platform.OS === "ios" ? edgesFooter : ["bottom"]}
edges={edgesFooter}
style={{ backgroundColor: MainColor.darkblue }}
>
{footerComponent}

View File

@@ -43,10 +43,10 @@ interface ListModeProps extends BaseProps {
keyExtractor?: FlatListProps<any>["keyExtractor"];
}
// ========== PageWrapper Props (Android-specific keyboard handling) ==========
interface PageWrapperBaseProps extends BaseProps {
// ========== Keyboard Handling Props (Android only) ==========
interface KeyboardHandlingProps {
/**
* Enable keyboard handling (Android only - NewWrapper_V2)
* Enable keyboard handling with auto-scroll (Android only)
* iOS ignores this prop
* @default false
*/
@@ -74,81 +74,74 @@ interface PageWrapperBaseProps extends BaseProps {
contentPadding?: number;
}
interface PageWrapperStaticProps extends PageWrapperBaseProps {
children: React.ReactNode;
listData?: never;
renderItem?: never;
}
// ========== Final Props Types ==========
type OS_WrapperStaticProps = StaticModeProps & KeyboardHandlingProps;
type OS_WrapperListProps = ListModeProps & KeyboardHandlingProps;
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 OS_WrapperProps = StaticModeProps | ListModeProps;
type PageWrapperProps = PageWrapperStaticProps | PageWrapperListProps;
type OS_WrapperProps = OS_WrapperStaticProps | OS_WrapperListProps;
/**
* OS_Wrapper - Automatically selects iOSWrapper or AndroidWrapper based on platform
*
* @example Static Mode
* Features:
* - Auto platform detection
* - Optional keyboard handling for Android forms
* - Unified API for all use cases
*
* @example Static Mode (Simple Content)
* ```tsx
* <OS_Wrapper>
* <YourContent />
* </OS_Wrapper>
* ```
*
* @example List Mode
*
* @example List Mode (with pagination)
* ```tsx
* <OS_Wrapper
* listData={data}
* renderItem={({ item }) => <ItemCard item={item} />}
* ListEmptyComponent={<EmptyState />}
* onEndReached={loadMore}
* />
* ```
*
* @example Form Mode (with keyboard handling - Android only)
* ```tsx
* <OS_Wrapper
* enableKeyboardHandling
* keyboardScrollOffset={150}
* contentPaddingBottom={100}
* footerComponent={<SubmitButton />}
* >
* <FormContent />
* </OS_Wrapper>
* ```
*/
export function OS_Wrapper(props: OS_WrapperProps) {
const {
enableKeyboardHandling = false,
keyboardScrollOffset = 100,
contentPaddingBottom = 100,
contentPadding = 0,
...wrapperProps
} = props;
// iOS uses IOSWrapper (based on NewWrapper)
if (Platform.OS === "ios") {
return <IOSWrapper {...props} />;
// Keyboard handling props are ignored on iOS
return <IOSWrapper {...(wrapperProps as any)} />;
}
// Android uses AndroidWrapper (based on NewWrapper_V2 with keyboard handling)
return <AndroidWrapper {...props} />;
}
/**
* PageWrapper - OS_Wrapper with keyboard handling support (Android only)
* Use this for forms with input fields
*
* @example
* ```tsx
* <PageWrapper enableKeyboardHandling keyboardScrollOffset={150}>
* <FormContent />
* </PageWrapper>
* ```
*/
export function PageWrapper(props: PageWrapperProps) {
// iOS: Keyboard handling props are ignored
if (Platform.OS === "ios") {
const {
enableKeyboardHandling: _,
keyboardScrollOffset: __1,
contentPaddingBottom: __2,
contentPadding: __3,
...iosProps
} = props;
return <IOSWrapper {...iosProps} />;
}
// Android: Keyboard handling props are used
return <AndroidWrapper {...props} />;
// Android uses AndroidWrapper (with keyboard handling support)
return (
<AndroidWrapper
{...(wrapperProps as any)}
enableKeyboardHandling={enableKeyboardHandling}
keyboardScrollOffset={keyboardScrollOffset}
contentPaddingBottom={contentPaddingBottom}
contentPadding={contentPadding}
/>
);
}
// Re-export individual wrappers for direct usage if needed

View File

@@ -66,7 +66,7 @@ import BasicWrapper from "./_ShareComponent/BasicWrapper";
import { FormWrapper } from "./_ShareComponent/FormWrapper";
import { NewWrapper_V2 } from "./_ShareComponent/NewWrapper_V2";
// OS-Specific Wrappers
import OS_Wrapper, { PageWrapper, IOSWrapper, AndroidWrapper } from "./_ShareComponent/OS_Wrapper";
import OS_Wrapper, { IOSWrapper, AndroidWrapper } from "./_ShareComponent/OS_Wrapper";
// Progress
import ProgressCustom from "./Progress/ProgressCustom";
@@ -136,7 +136,6 @@ export {
NewWrapper_V2,
// OS-Specific Wrappers
OS_Wrapper,
PageWrapper,
IOSWrapper,
AndroidWrapper,
// Stack

View File

@@ -4,6 +4,10 @@ export {
OS_ANDROID_HEIGHT,
OS_IOS_HEIGHT,
OS_HEIGHT,
OS_ANDROID_PADDING_TOP,
OS_IOS_PADDING_TOP,
OS_PADDING_TOP,
PADDING_INLINE,
TEXT_SIZE_SMALL,
TEXT_SIZE_MEDIUM,
TEXT_SIZE_LARGE,
@@ -23,10 +27,15 @@ export {
};
// OS Height
const OS_ANDROID_HEIGHT = 65
const OS_ANDROID_HEIGHT = 60
const OS_IOS_HEIGHT = 80
const OS_HEIGHT = Platform.OS === "ios" ? OS_IOS_HEIGHT : OS_ANDROID_HEIGHT
// OS Padding Top
const OS_ANDROID_PADDING_TOP = 6
const OS_IOS_PADDING_TOP = 12
const OS_PADDING_TOP = Platform.OS === "ios" ? OS_IOS_PADDING_TOP : OS_ANDROID_PADDING_TOP
// Text Size
const TEXT_SIZE_SMALL = 12;
const TEXT_SIZE_MEDIUM = 14;
@@ -47,6 +56,7 @@ const DRAWER_HEIGHT = 500; // tinggi drawer5
const RADIUS_BUTTON = 50
// Padding
const PADDING_INLINE = 16
const PADDING_EXTRA_SMALL = 10
const PADDING_SMALL = 12
const PADDING_MEDIUM = 16

View File

@@ -2,7 +2,7 @@
## 📦 Import
```tsx
import { OS_Wrapper, PageWrapper, IOSWrapper, AndroidWrapper } from "@/components";
import { OS_Wrapper, IOSWrapper, AndroidWrapper } from "@/components";
```
## 🎯 Usage Examples
@@ -35,9 +35,9 @@ import { OS_Wrapper, PageWrapper, IOSWrapper, AndroidWrapper } from "@/component
</OS_Wrapper>
```
### 3. PageWrapper - Form dengan Keyboard Handling
### 3. OS_Wrapper - Form dengan Keyboard Handling
```tsx
<PageWrapper
<OS_Wrapper
enableKeyboardHandling
keyboardScrollOffset={150}
contentPaddingBottom={100}
@@ -53,7 +53,7 @@ import { OS_Wrapper, PageWrapper, IOSWrapper, AndroidWrapper } from "@/component
<TextInputCustom />
<TextInputCustom />
</ScrollView>
</PageWrapper>
</OS_Wrapper>
```
### 4. Platform-Specific (Rare Cases)
@@ -107,21 +107,21 @@ import { OS_Wrapper, PageWrapper, IOSWrapper, AndroidWrapper } from "@/component
```diff
- import { NewWrapper_V2 } from "@/components/_ShareComponent/NewWrapper_V2";
+ import { PageWrapper } from "@/components";
+ import { OS_Wrapper } from "@/components";
- <NewWrapper_V2 enableKeyboardHandling>
+ <PageWrapper enableKeyboardHandling>
+ <OS_Wrapper enableKeyboardHandling>
<FormContent />
</NewWrapper_V2>
```
## 💡 Tips
1. **Pakai OS_Wrapper** untuk screen biasa (list, detail, dll)
2. **Pakai PageWrapper** untuk screen dengan form input (create, edit)
1. **Pakai OS_Wrapper** untuk semua screen (list, detail, form)
2. **Tambahkan `enableKeyboardHandling`** untuk form dengan input fields
3. **Jangan mix** wrapper lama dan baru di screen yang sama
4. **Test di kedua platform** sebelum commit
5. **Keyboard handling** hanya bekerja di Android dengan PageWrapper
5. **Keyboard handling** hanya bekerja di Android (iOS mengabaikan props ini)
## ⚠️ Common Mistakes
@@ -134,6 +134,9 @@ import OS_Wrapper from "@/components/_ShareComponent/OS_Wrapper";
<OS_Wrapper>
<NewWrapper>{content}</NewWrapper>
</OS_Wrapper>
// Jangan pakai PageWrapper (sudah tidak ada)
import { PageWrapper } from "@/components";
```
### ✅ Correct
@@ -141,8 +144,13 @@ import OS_Wrapper from "@/components/_ShareComponent/OS_Wrapper";
// Import dari @/components
import { OS_Wrapper } from "@/components";
// Pakai salah satu saja
// Simple content
<OS_Wrapper>{content}</OS_Wrapper>
// Form with keyboard handling
<OS_Wrapper enableKeyboardHandling keyboardScrollOffset={150}>
<FormContent />
</OS_Wrapper>
```
---

View File

@@ -1,25 +1,62 @@
// useKeyboardForm.ts - Hook untuk keyboard handling pada form
import { Keyboard, ScrollView } from "react-native";
import { useState, useEffect, useRef } from "react";
import { Keyboard, ScrollView, Dimensions, findNodeHandle, UIManager } from "react-native";
import { useState, useEffect, useRef, useCallback } from "react";
export function useKeyboardForm(scrollOffset = 100) {
const scrollViewRef = useRef<ScrollView>(null);
const [keyboardHeight, setKeyboardHeight] = useState(0);
const [focusedInputY, setFocusedInputY] = useState<number | null>(null);
const currentScrollY = useRef(0);
const inputPageY = useRef(0);
const screenHeight = Dimensions.get('window').height;
// Fungsi untuk mengukur posisi absolut input
const handleInputFocus = useCallback((target: any) => {
const nodeHandle = findNodeHandle(target);
if (nodeHandle) {
UIManager.measure(nodeHandle, (x, y, width, height, pageX, pageY) => {
if (pageY !== undefined && pageY !== null) {
inputPageY.current = pageY;
}
});
}
}, []);
// Listen to keyboard events
useEffect(() => {
const keyboardDidShowListener = Keyboard.addListener(
'keyboardDidShow',
(e) => {
setKeyboardHeight(e.endCoordinates.height);
const kbHeight = e.endCoordinates.height;
setKeyboardHeight(kbHeight);
// Conditional scroll: hanya scroll jika input tertutup keyboard
if (scrollViewRef.current) {
const touchAbsoluteY = inputPageY.current;
// Posisi Y teratas keyboard (dari atas layar)
const keyboardTopY = screenHeight - kbHeight;
// Jika input ADA DI BAWAH keyboard (tertutup)
if (touchAbsoluteY > keyboardTopY) {
// Hitung berapa harus scroll agar input terlihat di atas keyboard
const scrollBy = touchAbsoluteY - keyboardTopY + scrollOffset;
const targetY = currentScrollY.current + scrollBy;
scrollViewRef.current.scrollTo({
y: Math.max(0, targetY),
animated: true,
});
}
// Jika input SUDAH TERLIHAT (di atas keyboard), JANGAN SCROLL
}
}
);
const keyboardDidHideListener = Keyboard.addListener(
'keyboardDidHide',
() => {
setKeyboardHeight(0);
setFocusedInputY(null);
inputPageY.current = 0;
}
);
@@ -27,41 +64,74 @@ export function useKeyboardForm(scrollOffset = 100) {
keyboardDidShowListener.remove();
keyboardDidHideListener.remove();
};
}, []);
}, [scrollOffset, screenHeight]);
// Scroll ke focused input
useEffect(() => {
if (focusedInputY !== null && keyboardHeight > 0 && scrollViewRef.current) {
setTimeout(() => {
scrollViewRef.current?.scrollTo({
y: Math.max(0, focusedInputY - scrollOffset),
animated: true,
});
}, 100);
}
}, [focusedInputY, keyboardHeight, scrollOffset]);
// Handler untuk track focused input position
const handleInputFocus = (yPosition: number) => {
setFocusedInputY(yPosition);
};
// Helper untuk create onFocus handler
const createFocusHandler = () => {
return (e: any) => {
e.target?.measure((x: number, y: number, width: number, height: number, pageX: number, pageY: number) => {
if (pageY !== null) {
handleInputFocus(pageY);
}
});
};
// Track scroll position
const handleScroll = (event: any) => {
currentScrollY.current = event.nativeEvent.contentOffset.y;
};
return {
scrollViewRef,
keyboardHeight,
focusedInputY,
handleInputFocus,
createFocusHandler,
handleScroll,
};
}
/**
* Helper untuk inject onFocus handler ke semua TextInput/TextArea children
* Menggunakan UI.measure untuk mendapatkan posisi absolut input secara akurat
*/
export function cloneChildrenWithFocusHandler(
children: React.ReactNode,
focusHandler: (target: any) => void
): React.ReactNode {
if (!children) return children;
const React = require("react");
return React.Children.map(children, (child: any) => {
if (!React.isValidElement(child)) return child;
const childType = child.type;
const childProps = child.props as Record<string, any> || {};
// Check if it's a text input component
let isTextInput = false;
if (typeof childType === 'string') {
isTextInput = childType.toLowerCase().includes('textinput');
} else if (childType) {
isTextInput =
(childType as any).displayName?.includes('TextInput') ||
(childType as any).name?.includes('TextInput') ||
(childType as any).displayName?.includes('TextArea') ||
(childType as any).name?.includes('TextArea') ||
(childType as any).displayName?.includes('PhoneInput') ||
(childType as any).name?.includes('PhoneInput') ||
(childType as any).displayName?.includes('Select') ||
(childType as any).name?.includes('Select');
}
if (isTextInput) {
const existingOnFocus = childProps.onFocus;
return React.cloneElement(child, {
...childProps,
onFocus: (e: any) => {
existingOnFocus?.(e);
focusHandler(e.target);
},
} as any);
}
// Recursively clone nested children
if (childProps.children) {
return React.cloneElement(child, {
...childProps,
children: cloneChildrenWithFocusHandler(childProps.children, focusHandler),
} as any);
}
return child;
});
}

View File

@@ -154,6 +154,7 @@
3F53CC1C3B278545F11A1CAE /* [CP-User] [RNFB] Core Configuration */,
46ED08049A384B869D77364E /* Remove signature files (Xcode workaround) */,
92A25C61F4E34FB6A36E415B /* Remove signature files (Xcode workaround) */,
B122FE573BBA4E8C86B8F1C3 /* Remove signature files (Xcode workaround) */,
);
buildRules = (
);
@@ -465,6 +466,23 @@
rm -rf \"$CONFIGURATION_BUILD_DIR/MapLibre.xcframework-ios.signature\";
";
};
B122FE573BBA4E8C86B8F1C3 /* 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 */
/* Begin PBXSourcesBuildPhase section */

View File

@@ -12,6 +12,7 @@ import { apiJobGetByStatus } from "@/service/api-client/api-job";
import { useFocusEffect, useLocalSearchParams } from "expo-router";
import _ from "lodash";
import { useCallback, useState } from "react";
import { PADDING_INLINE } from "@/constants/constans-value";
export default function Job_MainViewStatus() {
const { user } = useAuth();
@@ -64,7 +65,7 @@ export default function Job_MainViewStatus() {
return (
<>
<OS_Wrapper headerComponent={scrollComponent} hideFooter>
<OS_Wrapper headerComponent={scrollComponent} hideFooter contentPadding={PADDING_INLINE}>
{isLoadList ? (
<LoaderCustom />
) : _.isEmpty(listData) ? (

View File

@@ -1,7 +1,7 @@
/* eslint-disable react-hooks/exhaustive-deps */
import { BaseBox, OS_Wrapper, ScrollableCustom, TextCustom } from "@/components";
import { MainColor } from "@/constants/color-palet";
import { PAGINATION_DEFAULT_TAKE } from "@/constants/constans-value";
import { PAGINATION_DEFAULT_TAKE, PADDING_INLINE } from "@/constants/constans-value";
import { createPaginationComponents } from "@/helpers/paginationHelpers";
import { useAuth } from "@/hooks/use-auth";
import { usePagination } from "@/hooks/use-pagination";
@@ -102,6 +102,7 @@ export default function Job_MainViewStatus2() {
ListEmptyComponent={ListEmptyComponent}
ListFooterComponent={ListFooterComponent}
hideFooter
contentPadding={PADDING_INLINE}
/>
);
}

View File

@@ -5,6 +5,7 @@ import { apiJobGetAll } from "@/service/api-client/api-job";
import { useFocusEffect } from "expo-router";
import _ from "lodash";
import { useCallback, useState } from "react";
import { PADDING_INLINE } from "@/constants/constans-value";
export default function Job_ScreenArchive() {
const { user } = useAuth();
@@ -33,7 +34,7 @@ export default function Job_ScreenArchive() {
};
return (
<OS_Wrapper hideFooter>
<OS_Wrapper hideFooter contentPadding={PADDING_INLINE}>
{isLoadData ? (
<LoaderCustom />
) : _.isEmpty(listData) ? (

View File

@@ -1,5 +1,5 @@
/* eslint-disable react-hooks/exhaustive-deps */
import { BaseBox, OS_Wrapper, TextCustom, ViewWrapper } from "@/components";
import { BaseBox, OS_Wrapper, TextCustom } from "@/components";
import { MainColor } from "@/constants/color-palet";
import { createPaginationComponents } from "@/helpers/paginationHelpers";
import { useAuth } from "@/hooks/use-auth";
@@ -9,7 +9,7 @@ import { useFocusEffect } from "expo-router";
import _ from "lodash";
import { useState } from "react";
import { RefreshControl } from "react-native";
import { PAGINATION_DEFAULT_TAKE } from "@/constants/constans-value";
import { PAGINATION_DEFAULT_TAKE, PADDING_INLINE } from "@/constants/constans-value";
export default function Job_ScreenArchive2() {
const { user } = useAuth();
@@ -70,6 +70,7 @@ export default function Job_ScreenArchive2() {
ListEmptyComponent={ListEmptyComponent}
ListFooterComponent={ListFooterComponent}
hideFooter
contentPadding={PADDING_INLINE}
/>
);
}

View File

@@ -13,6 +13,7 @@ import { apiJobGetAll } from "@/service/api-client/api-job";
import { router, useFocusEffect } from "expo-router";
import _ from "lodash";
import { useCallback, useState } from "react";
import { PADDING_INLINE } from "@/constants/constans-value";
export default function Job_ScreenBeranda() {
const [listData, setListData] = useState<any[]>([]);
@@ -45,6 +46,7 @@ export default function Job_ScreenBeranda() {
return (
<OS_Wrapper
hideFooter
contentPadding={PADDING_INLINE}
floatingButton={
<FloatingButton onPress={() => router.push("/job/create")} />
}

View File

@@ -7,7 +7,6 @@ import {
Spacing,
StackCustom,
TextCustom,
ViewWrapper,
} from "@/components";
import { MainColor } from "@/constants/color-palet";
import { createPaginationComponents } from "@/helpers/paginationHelpers";
@@ -17,7 +16,7 @@ import { router, useFocusEffect } from "expo-router";
import _ from "lodash";
import { useState } from "react";
import { RefreshControl, View } from "react-native";
import { PAGINATION_DEFAULT_TAKE } from "@/constants/constans-value";
import { PAGINATION_DEFAULT_TAKE, PADDING_INLINE } from "@/constants/constans-value";
const PAGE_SIZE = 10;
@@ -76,6 +75,7 @@ export default function Job_ScreenBeranda2() {
return (
<OS_Wrapper
hideFooter
contentPadding={PADDING_INLINE}
headerComponent={
<View style={{ paddingTop: 8 }}>
<SearchInput

View File

@@ -4,13 +4,14 @@ import {
ButtonCustom,
InformationBox,
LandscapeFrameUploaded,
PageWrapper,
OS_Wrapper,
Spacing,
StackCustom,
TextAreaCustom,
TextInputCustom,
} from "@/components";
import DIRECTORY_ID from "@/constants/directory-id";
import { PADDING_INLINE } from "@/constants/constans-value";
import { useAuth } from "@/hooks/use-auth";
import { apiJobCreate } from "@/service/api-client/api-job";
import { uploadFileService } from "@/service/upload-service";
@@ -118,9 +119,11 @@ export function Job_ScreenCreate() {
};
return (
<PageWrapper
<OS_Wrapper
enableKeyboardHandling
keyboardScrollOffset={100}
keyboardScrollOffset={10}
// contentPadding={PADDING_INLINE}
contentPaddingBottom={250}
footerComponent={buttonSubmit()}
>
<StackCustom gap={"xs"}>
@@ -173,7 +176,9 @@ export function Job_ScreenCreate() {
onChangeText={(value) => setData({ ...data, deskripsi: value })}
/>
</View>
</StackCustom>
</PageWrapper>
</OS_Wrapper>
);
}

View File

@@ -8,13 +8,14 @@ import {
InformationBox,
LandscapeFrameUploaded,
LoaderCustom,
PageWrapper,
OS_Wrapper,
Spacing,
StackCustom,
TextAreaCustom,
TextInputCustom,
} from "@/components";
import DIRECTORY_ID from "@/constants/directory-id";
import { PADDING_INLINE } from "@/constants/constans-value";
import { apiJobGetOne, apiJobUpdateData } from "@/service/api-client/api-job";
import { deleteFileService, uploadFileService } from "@/service/upload-service";
import pickImage from "@/utils/pickImage";
@@ -134,9 +135,10 @@ export function Job_ScreenEdit() {
};
return (
<PageWrapper
<OS_Wrapper
enableKeyboardHandling
keyboardScrollOffset={100}
contentPaddingBottom={250}
footerComponent={buttonSubmit()}
>
{isLoadData ? (
@@ -203,6 +205,6 @@ export function Job_ScreenEdit() {
{buttonSubmit()}
</StackCustom>
)}
</PageWrapper>
</OS_Wrapper>
);
}

View File

@@ -1,4 +1,3 @@
import NewWrapper from "@/components/_ShareComponent/NewWrapper";
import {
BoxButtonOnFooter,
ButtonCustom,
@@ -8,6 +7,7 @@ import {
TextInputCustom,
LandscapeFrameUploaded,
ButtonCenteredOnly,
OS_Wrapper,
} from "@/components";
import { MapSelectedPlatform } from "@/components/Map/MapSelectedPlatform";
import DIRECTORY_ID from "@/constants/directory-id";
@@ -142,10 +142,14 @@ export function Maps_ScreenMapsCreate() {
);
/**
* Render screen dengan NewWrapper
* Render screen dengan OS_Wrapper
*/
return (
<NewWrapper footerComponent={buttonFooter}>
<OS_Wrapper
enableKeyboardHandling
contentPaddingBottom={250}
footerComponent={buttonFooter}
>
<InformationBox text="Tentukan lokasi pin map dengan menekan pada map." />
<BaseBox>
@@ -179,7 +183,7 @@ export function Maps_ScreenMapsCreate() {
</ButtonCenteredOnly>
<Spacing height={50} />
</NewWrapper>
</OS_Wrapper>
);
}

View File

@@ -7,7 +7,7 @@ import {
LandscapeFrameUploaded,
Spacing,
TextInputCustom,
ViewWrapper,
OS_Wrapper,
} from "@/components";
import CustomSkeleton from "@/components/_ShareComponent/SkeletonCustom";
import { MapSelectedPlatform } from "@/components/Map/MapSelectedPlatform";
@@ -166,7 +166,11 @@ export function Maps_ScreenMapsEdit() {
: defaultRegion;
return (
<ViewWrapper footerComponent={buttonFooter}>
<OS_Wrapper
enableKeyboardHandling
contentPaddingBottom={250}
footerComponent={buttonFooter}
>
<InformationBox text="Tentukan lokasi pin map dengan menekan pada map." />
{/* <MapSelectedPlatform
@@ -223,6 +227,6 @@ export function Maps_ScreenMapsEdit() {
Upload
</ButtonCenteredOnly>
<Spacing height={50} />
</ViewWrapper>
</OS_Wrapper>
);
}

View File

@@ -4,7 +4,7 @@ import {
ButtonCenteredOnly,
CenterCustom,
InformationBox,
NewWrapper,
OS_Wrapper,
PhoneInputCustom,
SelectCustom,
Spacing,
@@ -142,7 +142,9 @@ export function ScreenPortofolioCreate() {
};
return (
<NewWrapper
<OS_Wrapper
enableKeyboardHandling
contentPaddingBottom={250}
footerComponent={
<Portofolio_ButtonCreate
id={id as string}
@@ -362,6 +364,6 @@ export function ScreenPortofolioCreate() {
}
/>
</StackCustom>
</NewWrapper>
</OS_Wrapper>
);
}

View File

@@ -1,4 +1,4 @@
import { NewWrapper, TextCustom } from "@/components";
import { OS_Wrapper, TextCustom } from "@/components";
import CustomSkeleton from "@/components/_ShareComponent/SkeletonCustom";
import { MainColor } from "@/constants/color-palet";
import { usePagination } from "@/hooks/use-pagination";
@@ -52,7 +52,7 @@ export default function ViewListPortofolio() {
});
return (
<NewWrapper
<OS_Wrapper
listData={pagination.listData}
renderItem={renderItem}
refreshControl={

View File

@@ -5,25 +5,38 @@ Migrasi dari `NewWrapper` dan `NewWrapper_V2` ke `OS_Wrapper` yang otomatis meny
## 🎯 Goals
- ✅ Mengganti penggunaan `NewWrapper``OS_Wrapper` di user screens
- ✅ Mengganti penggunaan `NewWrapper_V2``OS_Wrapper` atau `PageWrapper` di form screens
- ✅ Mengganti penggunaan `NewWrapper_V2``OS_Wrapper` di form screens (dengan keyboard handling props)
- ✅ Memastikan tabs dan UI konsisten di iOS dan Android
- ✅ Backward compatible (wrapper lama tetap ada)
-**SIMPLIFIED**: Satu komponen `OS_Wrapper` untuk semua use cases (tidak ada `PageWrapper` terpisah)
## 📦 Available Wrappers
### 1. **OS_Wrapper** (Recommended)
### 1. **OS_Wrapper** (Recommended - Unified API)
Auto-detect platform dan routing ke wrapper yang sesuai:
- iOS → `IOSWrapper` (berbasis NewWrapper)
- Android → `AndroidWrapper` (berbasis NewWrapper_V2)
- Android → `AndroidWrapper` (berbasis NewWrapper_V2 dengan keyboard handling)
### 2. **PageWrapper** (For Forms)
Sama seperti OS_Wrapper tapi dengan keyboard handling (Android only):
- `enableKeyboardHandling` - Auto scroll saat input focus
- `keyboardScrollOffset` - Offset scroll (default: 100)
- `contentPaddingBottom` - Extra padding bottom (default: 80)
- `contentPadding` - Content padding (default: 16)
**Props:**
```tsx
// Base props (kedua platform)
withBackground?: boolean;
headerComponent?: React.ReactNode;
footerComponent?: React.ReactNode;
floatingButton?: React.ReactNode;
hideFooter?: boolean;
edgesFooter?: Edge[];
style?: ViewStyle;
refreshControl?: RefreshControl;
### 3. **IOSWrapper** / **AndroidWrapper** (Direct Usage)
// Keyboard handling (Android only - iOS mengabaikan)
enableKeyboardHandling?: boolean; // Default: false
keyboardScrollOffset?: number; // Default: 100
contentPaddingBottom?: number; // Default: 100
contentPadding?: number; // Default: 0
```
### 2. **IOSWrapper** / **AndroidWrapper** (Direct Usage)
Untuk kasus khusus yang butuh platform-specific behavior.
## 📝 Migration Guide
@@ -31,124 +44,149 @@ Untuk kasus khusus yang butuh platform-specific behavior.
### Before (Old Way)
```tsx
import NewWrapper from "@/components/_ShareComponent/NewWrapper";
// atau
import { NewWrapper_V2 } from "@/components/_ShareComponent/NewWrapper_V2";
```
### After (New Way)
### After (New Way - Unified API)
```tsx
import { OS_Wrapper, PageWrapper } from "@/components";
import { OS_Wrapper } from "@/components";
// Static mode
// Static mode (simple content)
<OS_Wrapper>
<YourContent />
</OS_Wrapper>
// List mode
// List mode (with pagination)
<OS_Wrapper
listData={data}
renderItem={({ item }) => <ItemCard item={item} />}
ListEmptyComponent={<EmptyState />}
onEndReached={loadMore}
/>
// Form dengan keyboard handling
<PageWrapper
// Form mode (with keyboard handling - Android only)
<OS_Wrapper
enableKeyboardHandling
keyboardScrollOffset={150}
contentPaddingBottom={250} // ← HANYA untuk screens dengan TextInput
>
<FormContent />
</PageWrapper>
</OS_Wrapper>
```
## 🚀 Implementation Phases
## 🚀 Implementation Status
### Phase 1: User Screens (Priority: HIGH)
Files yang perlu di-migrate:
### Phase 1: Job Screens - COMPLETED (2026-04-06 to 2026-04-07)
#### 1.1 Home/Beranda
- [ ] `screens/Beranda/ScreenBeranda.tsx` atau `ScreenBeranda2.tsx`
- Ganti `NewWrapper``OS_Wrapper`
- Test tabs behavior di iOS dan Android
**Files migrated: 9**
#### 1.2 Profile Screens
- [ ] `screens/Profile/ScreenProfile.tsx`
- [ ] `screens/Profile/ScreenProfileEdit.tsx`
- [ ] `screens/Profile/ScreenProfileCreate.tsx`
#### Job List Screens (OS_Wrapper):
- `screens/Job/ScreenBeranda.tsx` - ViewWrapper → OS_Wrapper + PADDING_INLINE
- `screens/Job/ScreenBeranda2.tsx` - NewWrapper_V2 → OS_Wrapper + PADDING_INLINE
- `screens/Job/ScreenArchive.tsx` - ViewWrapper → OS_Wrapper + PADDING_INLINE
-`screens/Job/ScreenArchive2.tsx` - NewWrapper_V2 → OS_Wrapper + PADDING_INLINE
-`screens/Job/MainViewStatus.tsx` - ViewWrapper → OS_Wrapper + PADDING_INLINE
-`screens/Job/MainViewStatus2.tsx` - NewWrapper_V2 → OS_Wrapper + PADDING_INLINE
#### Job Form Screens (OS_Wrapper with keyboard handling):
-`screens/Job/ScreenJobCreate.tsx` - NewWrapper_V2 → OS_Wrapper + enableKeyboardHandling + contentPaddingBottom={250}
-`screens/Job/ScreenJobEdit.tsx` - NewWrapper_V2 → OS_Wrapper + enableKeyboardHandling + contentPaddingBottom={250}
#### Job Detail Screen:
-`app/(application)/(user)/job/[id]/[status]/detail.tsx` - NewWrapper_V2 → OS_Wrapper
**Testing Status:**
- ✅ TypeScript: No errors
- ✅ Build: Success
- ✅ iOS Testing: Complete ✅
- ✅ Android Testing: Complete ✅
### ✅ Phase 2: Profile, Waiting Room, Delete Account - COMPLETED (2026-04-08)
**Files migrated: 10**
#### Profile Screens:
-`app/(application)/(user)/profile/[id]/index.tsx` - NewWrapper → OS_Wrapper (list with pull-to-refresh)
-`app/(application)/(user)/profile/[id]/edit.tsx` - ViewWrapper → OS_Wrapper (form + enableKeyboardHandling + contentPaddingBottom={250})
-`app/(application)/(user)/profile/create.tsx` - ViewWrapper → OS_Wrapper (form + enableKeyboardHandling + contentPaddingBottom={250})
-`app/(application)/(user)/profile/[id]/blocked-list.tsx` - NewWrapper → OS_Wrapper (pagination list)
-`app/(application)/(user)/profile/[id]/detail-blocked.tsx` - NewWrapper → OS_Wrapper (static with footer)
-`app/(application)/(user)/profile/[id]/update-background.tsx` - ViewWrapper → OS_Wrapper (static with footer)
-`app/(application)/(user)/profile/[id]/update-photo.tsx` - ViewWrapper → OS_Wrapper (static with footer)
#### Other Screens:
-`app/(application)/(user)/waiting-room.tsx` - NewWrapper → OS_Wrapper (static with refresh + footer)
-`app/(application)/(user)/delete-account.tsx` - ViewWrapper → OS_Wrapper (form + enableKeyboardHandling + contentPaddingBottom={250})
### ✅ Phase 3: Portfolio Screens - COMPLETED (2026-04-08)
**Files migrated: 6**
#### Portfolio Screens:
-`app/(application)/(user)/portofolio/[id]/index.tsx` - ViewWrapper → OS_Wrapper (detail screen with pull-to-refresh)
-`app/(application)/(user)/portofolio/[id]/edit.tsx` - NewWrapper → OS_Wrapper (form + enableKeyboardHandling + contentPaddingBottom={250})
-`app/(application)/(user)/portofolio/[id]/edit-logo.tsx` - ViewWrapper → OS_Wrapper (static with footer)
-`app/(application)/(user)/portofolio/[id]/edit-social-media.tsx` - ViewWrapper → OS_Wrapper (form + enableKeyboardHandling + contentPaddingBottom={250})
-`screens/Portofolio/ViewListPortofolio.tsx` - NewWrapper → OS_Wrapper (pagination list)
-`screens/Portofolio/ScreenPortofolioCreate.tsx` - NewWrapper → OS_Wrapper (form + enableKeyboardHandling + contentPaddingBottom={250})
### ✅ Phase 4: Maps Screens - COMPLETED (2026-04-08)
**Files migrated: 2**
#### Maps Screens:
-`screens/Maps/ScreenMapsCreate.tsx` - NewWrapper → OS_Wrapper (form + enableKeyboardHandling + contentPaddingBottom={250})
-`screens/Maps/ScreenMapsEdit.tsx` - ViewWrapper → OS_Wrapper (form + enableKeyboardHandling + contentPaddingBottom={250})
### ⏳ Phase 5: Event Management (Priority: MEDIUM)
- [ ] `screens/Admin/Event/ScreenEventList.tsx`
- [ ] `screens/Admin/Event/ScreenEventCreate.tsx` → pakai `enableKeyboardHandling` + `contentPaddingBottom={250}`
- [ ] `screens/Admin/Event/ScreenEventEdit.tsx` → pakai `enableKeyboardHandling` + `contentPaddingBottom={250}`
### ⏳ Phase 6: Voting Management (Priority: MEDIUM)
- [ ] `screens/Admin/Voting/ScreenVotingList.tsx`
- [ ] `screens/Admin/Voting/ScreenVotingCreate.tsx` → pakai `enableKeyboardHandling` + `contentPaddingBottom={250}`
- [ ] `screens/Admin/Voting/ScreenVotingEdit.tsx` → pakai `enableKeyboardHandling` + `contentPaddingBottom={250}`
### ⏳ Phase 7: Forum/Discussion Screens (Priority: LOW)
#### 1.3 Forum/Discussion
- [ ] `screens/Forum/ScreenForum.tsx`
- [ ] `screens/Forum/ScreenForumDetail.tsx`
- [ ] `screens/Forum/ScreenForumCreate.tsx` → pakai `PageWrapper` (ada form)
- [ ] `screens/Forum/ScreenForumCreate.tsx` → pakai `enableKeyboardHandling` + `contentPaddingBottom={250}`
#### 1.4 Portfolio
- [ ] `screens/Portfolio/ScreenPortfolio.tsx`
- [ ] `screens/Portfolio/ScreenPortfolioCreate.tsx` → pakai `PageWrapper`
- [ ] `screens/Portfolio/ScreenPortfolioEdit.tsx` → pakai `PageWrapper`
### ⏳ Phase 8: Donation Management (Priority: LOW)
### Phase 2: Admin Screens (Priority: MEDIUM)
Files yang perlu di-migrate:
#### 2.1 Event Management
- [ ] `screens/Admin/Event/ScreenEventList.tsx`
- [ ] `screens/Admin/Event/ScreenEventCreate.tsx` → pakai `PageWrapper`
- [ ] `screens/Admin/Event/ScreenEventEdit.tsx` → pakai `PageWrapper`
#### 2.2 Voting Management
- [ ] `screens/Admin/Voting/ScreenVotingList.tsx`
- [ ] `screens/Admin/Voting/ScreenVotingCreate.tsx` → pakai `PageWrapper`
- [ ] `screens/Admin/Voting/ScreenVotingEdit.tsx` → pakai `PageWrapper`
#### 2.3 Donation Management
- [ ] `screens/Admin/Donation/ScreenDonationList.tsx`
- [ ] `screens/Admin/Donation/ScreenDonationCreate.tsx` → pakai `PageWrapper`
- [ ] `screens/Admin/Donation/ScreenDonationEdit.tsx` → pakai `PageWrapper`
- [ ] `screens/Admin/Donation/ScreenDonationCreate.tsx` → pakai `enableKeyboardHandling` + `contentPaddingBottom={250}`
- [ ] `screens/Admin/Donation/ScreenDonationEdit.tsx` → pakai `enableKeyboardHandling` + `contentPaddingBottom={250}`
#### 2.4 Job Management
- [ ] `screens/Job/ScreenJobList.tsx` (jika ada)
- [ ] `screens/Job/ScreenJobCreate.tsx` → sudah pakai `BoxButtonOnFooter`?
- [ ] `screens/Job/ScreenJobEdit.tsx` → sudah pakai `BoxButtonOnFooter`?
### Phase 3: Other Screens (Priority: LOW)
### ⏳ Phase 9: Other Screens (Priority: LOW)
- [ ] `screens/Investasi/` - Investment screens
- [ ] `screens/Kolaborasi/` - Collaboration screens
- [ ] Other user-facing screens
## ✅ Testing Checklist
## 📌 Notes & Patterns
Setiap screen yang sudah di-migrate, test:
### Spacing Pattern:
- **Default**: `contentPaddingBottom=100` (list & static screens)
- **Forms**: `contentPaddingBottom={250}` (HANYA untuk screens dengan TextInput/TextArea)
- **contentPadding=0** (default, per-screen control jika perlu)
### iOS Testing
- [ ] UI tampil sesuai design
- [ ] Tabs berfungsi dengan baik
- [ ] ScrollView/FlatList scroll dengan smooth
- [ ] Keyboard tidak menutupi input (jika pakai PageWrapper)
- [ ] Footer muncul di posisi yang benar
- [ ] Pull to refresh berfungsi (jika ada)
### User Preference:
- **NO PADDING_INLINE by default** - Bisa mempersempit box tampilan
- User akan review dan tambahkan sendiri jika diperlukan per-screen
### Android Testing
- [ ] UI tampil sesuai design
- [ ] Tabs berfungsi dengan baik
- [ ] ScrollView/FlatList scroll dengan smooth
- [ ] Keyboard handling: auto scroll saat input focus (jika pakai PageWrapper)
- [ ] Footer muncul di posisi yang benar (tidak tertutup navigation bar)
- [ ] Pull to refresh berfungsi (jika ada)
### Keyboard Handling:
- `enableKeyboardHandling` → Auto-scroll saat keyboard muncul (Android only)
- **Bug Fixed (2026-04-08)**: Input di paling atas tidak lagi "terlempar" keluar layar saat keyboard muncul
- **Solusi**: Menggunakan `UIManager.measure` untuk mendapatkan posisi absolut input (`pageY`), lalu conditional scroll:
- Jika input DI ATAS keyboard (terlihat) → **TIDAK SCROLL**
- Jika input DI BAWAH keyboard (tertutup) → **Scroll secukupnya**
- Tap anywhere di luar input → keyboard dismiss (sudah implementasi di kedua mode)
### Common Testing
- [ ] Background image muncul (jika `withBackground={true}`)
- [ ] Sticky header berfungsi (jika ada `headerComponent`)
- [ ] Footer fixed di bottom (jika ada `footerComponent`)
- [ ] Floating button muncul (jika ada `floatingButton`)
- [ ] Loading skeleton muncul saat pagination
- [ ] Empty state muncul saat data kosong
## 📌 Notes
### Kapan pakai OS_Wrapper vs PageWrapper?
- **OS_Wrapper**: Untuk screen yang hanya menampilkan data (list, detail, dll)
- **PageWrapper**: Untuk screen yang ada form input (create, edit, login, dll)
### Props yang sering digunakan:
### Migration Pattern:
#### Untuk List Screen:
```tsx
@@ -158,12 +196,7 @@ Setiap screen yang sudah di-migrate, test:
ListEmptyComponent={ListEmptyComponent}
ListFooterComponent={ListFooterComponent}
onEndReached={pagination.loadMore}
refreshControl={
<RefreshControl
refreshing={pagination.refreshing}
onRefresh={pagination.onRefresh}
/>
}
refreshControl={<RefreshControl refreshing={refreshing} onRefresh={onRefresh} />}
/>
```
@@ -172,49 +205,21 @@ Setiap screen yang sudah di-migrate, test:
<OS_Wrapper
headerComponent={<HeaderSection />}
footerComponent={<FooterSection />}
refreshControl={<RefreshControl refreshing={refreshing} onRefresh={onRefresh} />}
>
<YourContent />
</OS_Wrapper>
```
#### Untuk Form Screen:
#### Untuk Form Screen (dengan keyboard handling):
```tsx
<PageWrapper
<OS_Wrapper
enableKeyboardHandling
keyboardScrollOffset={150}
contentPaddingBottom={100}
footerComponent={
<BoxButtonOnFooter>
<ButtonCustom onPress={handleSubmit}>Submit</ButtonCustom>
</BoxButtonOnFooter>
}
contentPaddingBottom={250} // ← HANYA untuk screens dengan TextInput
footerComponent={<SubmitButton />}
>
<FormContent />
</PageWrapper>
```
### Migration Pattern:
```tsx
// OLD
import NewWrapper from "@/components/_ShareComponent/NewWrapper";
<NewWrapper
listData={data}
renderItem={renderItem}
headerComponent={header}
footerComponent={footer}
/>
// NEW
import { OS_Wrapper } from "@/components";
<OS_Wrapper
listData={data}
renderItem={renderItem}
headerComponent={header}
footerComponent={footer}
/>
</OS_Wrapper>
```
## 🐛 Troubleshooting
@@ -223,22 +228,31 @@ import { OS_Wrapper } from "@/components";
**Solution**: Pastikan tidak ada custom padding yang overriding default behavior. Jika masih bermasalah, cek apakah `contentPadding` atau `contentPaddingBottom` terlalu besar.
### Issue: Keyboard menutupi input di Android
**Solution**: Pastikan pakai `PageWrapper` dengan `enableKeyboardHandling={true}`. Adjust `keyboardScrollOffset` jika perlu.
**Solution**: Pastikan pakai `OS_Wrapper` dengan `enableKeyboardHandling={true}` dan `contentPaddingBottom={250}` untuk form screens.
### Issue: Pull-to-refresh tidak berfungsi di static mode
**Solution**: Sudah diperbaiki! `refreshControl` sekarang di-pass ke ScrollView di AndroidWrapper.
### Issue: Footer terlalu jauh dari bottom
**Solution**: Kurangi `contentPaddingBottom` (default: 80). Untuk list screen tanpa navigation bar overlay, bisa set ke 0.
**Solution**: Kurangi `contentPaddingBottom` (default: 100 untuk list). Untuk form screens tetap 250.
### Issue: White space di bottom saat keyboard close (Android)
**Solution**: Ini sudah di-fix di AndroidWrapper. Pastikan screen pakai OS_Wrapper/PageWrapper, bukan NewWrapper langsung.
**Solution**: Ini sudah di-fix di AndroidWrapper. Pastikan screen pakai OS_Wrapper, bukan NewWrapper langsung.
## 📊 Progress Tracking
| Phase | Total Files | Migrated | Testing | Status |
|-------|-------------|----------|---------|--------|
| Phase 1 (User) | TBD | 0 | 0 | ⏳ Pending |
| Phase 2 (Admin) | TBD | 0 | 0 | ⏳ Pending |
| Phase 3 (Other) | TBD | 0 | 0 | ⏳ Pending |
| **Total** | **TBD** | **0** | **0** | **0%** |
| Phase 1 (Job) | 9 | 9 | ✅ Complete | ✅ Complete |
| Phase 2 (Profile + Others) | 10 | 10 | ⏳ Pending | ✅ Complete |
| Phase 3 (Portfolio) | 6 | 6 | ⏳ Pending | ✅ Complete |
| Phase 4 (Maps) | 2 | 2 | ⏳ Pending | ✅ Complete |
| Phase 5 (Event) | TBD | 0 | 0 | ⏳ Pending |
| Phase 6 (Voting) | TBD | 0 | 0 | ⏳ Pending |
| Phase 7 (Forum) | TBD | 0 | 0 | ⏳ Pending |
| Phase 8 (Donation) | TBD | 0 | 0 | ⏳ Pending |
| Phase 9 (Other) | TBD | 0 | 0 | ⏳ Pending |
| **Total** | **27+** | **27** | **9** | **Phase 1-4 Complete** |
## 🔄 Rollback Plan
@@ -252,4 +266,6 @@ Jika ada issue yang tidak bisa di-fix dalam 1 jam:
**Co-authored-by**: Qwen-Coder <qwen-coder@alibabacloud.com>
**Created**: 2026-04-06
**Status**: Ready for Implementation
**Last Updated**: 2026-04-08
**Status**: Phase 1-4 Complete ✅ (27 files migrated)
**Next**: Phase 5 - Event Management Screens