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>
This commit is contained in:
@@ -3,7 +3,7 @@ import {
|
|||||||
BoxButtonOnFooter,
|
BoxButtonOnFooter,
|
||||||
ButtonCenteredOnly,
|
ButtonCenteredOnly,
|
||||||
ButtonCustom,
|
ButtonCustom,
|
||||||
ViewWrapper
|
OS_Wrapper
|
||||||
} 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,7 @@ export default function PortofolioEditLogo() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ViewWrapper footerComponent={buttonFooter}>
|
<OS_Wrapper footerComponent={buttonFooter}>
|
||||||
<BaseBox
|
<BaseBox
|
||||||
style={{
|
style={{
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
@@ -146,7 +146,7 @@ export default function PortofolioEditLogo() {
|
|||||||
>
|
>
|
||||||
Upload
|
Upload
|
||||||
</ButtonCenteredOnly>
|
</ButtonCenteredOnly>
|
||||||
</ViewWrapper>
|
</OS_Wrapper>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import {
|
import {
|
||||||
BoxButtonOnFooter,
|
BoxButtonOnFooter,
|
||||||
ButtonCustom,
|
ButtonCustom,
|
||||||
|
OS_Wrapper,
|
||||||
TextInputCustom,
|
TextInputCustom,
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import {
|
import {
|
||||||
apiGetOnePortofolio,
|
apiGetOnePortofolio,
|
||||||
@@ -91,7 +91,11 @@ export default function PortofolioEditSocialMedia() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ViewWrapper footerComponent={buttonFooter}>
|
<OS_Wrapper
|
||||||
|
enableKeyboardHandling
|
||||||
|
contentPaddingBottom={250}
|
||||||
|
footerComponent={buttonFooter}
|
||||||
|
>
|
||||||
<TextInputCustom
|
<TextInputCustom
|
||||||
value={data.tiktok}
|
value={data.tiktok}
|
||||||
onChangeText={(value) => setData({ ...data, tiktok: value })}
|
onChangeText={(value) => setData({ ...data, tiktok: value })}
|
||||||
@@ -122,7 +126,7 @@ export default function PortofolioEditSocialMedia() {
|
|||||||
label="Youtube"
|
label="Youtube"
|
||||||
placeholder="Masukkan youtube"
|
placeholder="Masukkan youtube"
|
||||||
/>
|
/>
|
||||||
</ViewWrapper>
|
</OS_Wrapper>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import {
|
|||||||
BoxButtonOnFooter,
|
BoxButtonOnFooter,
|
||||||
ButtonCustom,
|
ButtonCustom,
|
||||||
CenterCustom,
|
CenterCustom,
|
||||||
NewWrapper,
|
OS_Wrapper,
|
||||||
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);
|
||||||
@@ -363,161 +368,159 @@ export default function PortofolioEdit() {
|
|||||||
</BoxButtonOnFooter>
|
</BoxButtonOnFooter>
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!bidangBisnis || !subBidangBisnis) {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<NewWrapper>
|
|
||||||
<ListSkeletonComponent height={80} />
|
|
||||||
</NewWrapper>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<NewWrapper footerComponent={buttonUpdate}>
|
<OS_Wrapper
|
||||||
<StackCustom gap={"xs"}>
|
enableKeyboardHandling
|
||||||
<TextInputCustom
|
contentPaddingBottom={250}
|
||||||
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"}>
|
||||||
}
|
<TextInputCustom
|
||||||
/>
|
required
|
||||||
|
label="Nama Bisnis"
|
||||||
<SelectCustom
|
placeholder="Masukkan nama bisnis"
|
||||||
label="Bidang Usaha"
|
value={data.namaBisnis}
|
||||||
required
|
onChangeText={(value: any) =>
|
||||||
data={bidangBisnis?.map((item) => ({
|
setData({ ...data, namaBisnis: value })
|
||||||
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"
|
|
||||||
/>
|
/>
|
||||||
</View>
|
|
||||||
<Spacing />
|
|
||||||
|
|
||||||
<TextInputCustom
|
<SelectCustom
|
||||||
required
|
label="Bidang Usaha"
|
||||||
label="Alamat Bisnis"
|
required
|
||||||
placeholder="Masukkan alamat bisnis"
|
data={bidangBisnis?.map((item) => ({
|
||||||
value={data.alamatKantor}
|
label: item.name,
|
||||||
onChangeText={(value: any) =>
|
value: item.id,
|
||||||
setData({ ...data, alamatKantor: value })
|
}))}
|
||||||
}
|
value={data.masterBidangBisnisId}
|
||||||
/>
|
onChange={(value: any) => {
|
||||||
|
handleBidangBisnisChange(value);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
|
||||||
<TextAreaCustom
|
{listSubBidangSelected.map((item, index) => {
|
||||||
label="Deskripsi Bisnis"
|
// Filter data untuk select sub bidang, menghilangkan yang sudah dipilih kecuali untuk item ini sendiri
|
||||||
placeholder="Masukkan deskripsi bisnis"
|
const selectedIds = listSubBidangSelected
|
||||||
value={data.deskripsi}
|
.filter((_, i) => i !== index)
|
||||||
onChangeText={(value: any) =>
|
.map((s) => s.MasterSubBidangBisnis?.id)
|
||||||
setData({ ...data, deskripsi: value })
|
.filter((id) => id); // Filter hanya yang memiliki id (tidak kosong)
|
||||||
}
|
|
||||||
autosize
|
const availableSubBidangOptions = (selectedSubBidang || [])
|
||||||
minRows={2}
|
.filter((sub: any) => {
|
||||||
maxRows={5}
|
// Tampilkan jika ini adalah opsi yang dipilih saat ini atau belum dipilih di sub bidang lainnya
|
||||||
required
|
|
||||||
showCount
|
return (
|
||||||
maxLength={1000}
|
sub.id === item.MasterSubBidangBisnis?.id ||
|
||||||
/>
|
!selectedIds.includes(sub.id)
|
||||||
<Spacing />
|
);
|
||||||
</StackCustom>
|
})
|
||||||
</NewWrapper>
|
.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>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import {
|
|||||||
DrawerCustom,
|
DrawerCustom,
|
||||||
DummyLandscapeImage,
|
DummyLandscapeImage,
|
||||||
LoaderCustom,
|
LoaderCustom,
|
||||||
|
OS_Wrapper,
|
||||||
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>
|
<OS_Wrapper>
|
||||||
{!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>
|
</OS_Wrapper>
|
||||||
|
|
||||||
{/* Drawer Komponen Eksternal */}
|
{/* Drawer Komponen Eksternal */}
|
||||||
<DrawerCustom
|
<DrawerCustom
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import {
|
|||||||
SafeAreaView,
|
SafeAreaView,
|
||||||
} from "react-native-safe-area-context";
|
} from "react-native-safe-area-context";
|
||||||
import type { ScrollViewProps, FlatListProps } from "react-native";
|
import type { ScrollViewProps, FlatListProps } from "react-native";
|
||||||
import { useKeyboardForm } from "@/hooks/useKeyboardForm";
|
import { useKeyboardForm, cloneChildrenWithFocusHandler } from "@/hooks/useKeyboardForm";
|
||||||
|
|
||||||
// --- Base Props ---
|
// --- Base Props ---
|
||||||
interface BaseProps {
|
interface BaseProps {
|
||||||
@@ -182,11 +182,13 @@ export function AndroidWrapper(props: AndroidWrapperProps) {
|
|||||||
// 🔹 Mode Statis (ScrollView)
|
// 🔹 Mode Statis (ScrollView)
|
||||||
const staticProps = props as StaticModeProps;
|
const staticProps = props as StaticModeProps;
|
||||||
|
|
||||||
|
// Inject focus handler jika keyboard handling enabled
|
||||||
|
const childrenWithFocus = enableKeyboardHandling && keyboardForm
|
||||||
|
? cloneChildrenWithFocusHandler(staticProps.children, keyboardForm.handleInputFocus)
|
||||||
|
: staticProps.children;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<KeyboardAvoidingView
|
<View style={{ flex: 1, backgroundColor: MainColor.darkblue }}>
|
||||||
behavior={undefined}
|
|
||||||
style={{ flex: 1, backgroundColor: MainColor.darkblue }}
|
|
||||||
>
|
|
||||||
{headerComponent && (
|
{headerComponent && (
|
||||||
<View style={GStyles.stickyHeader}>{headerComponent}</View>
|
<View style={GStyles.stickyHeader}>{headerComponent}</View>
|
||||||
)}
|
)}
|
||||||
@@ -208,7 +210,7 @@ export function AndroidWrapper(props: AndroidWrapperProps) {
|
|||||||
showsVerticalScrollIndicator={false}
|
showsVerticalScrollIndicator={false}
|
||||||
>
|
>
|
||||||
<TouchableWithoutFeedback onPress={Keyboard.dismiss}>
|
<TouchableWithoutFeedback onPress={Keyboard.dismiss}>
|
||||||
{renderContainer(staticProps.children)}
|
{renderContainer(childrenWithFocus)}
|
||||||
</TouchableWithoutFeedback>
|
</TouchableWithoutFeedback>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|
||||||
@@ -239,7 +241,7 @@ export function AndroidWrapper(props: AndroidWrapperProps) {
|
|||||||
{floatingButton && (
|
{floatingButton && (
|
||||||
<View style={GStyles.floatingContainer}>{floatingButton}</View>
|
<View style={GStyles.floatingContainer}>{floatingButton}</View>
|
||||||
)}
|
)}
|
||||||
</KeyboardAvoidingView>
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,25 @@
|
|||||||
// useKeyboardForm.ts - Hook untuk keyboard handling pada form
|
// useKeyboardForm.ts - Hook untuk keyboard handling pada form
|
||||||
import { Keyboard, ScrollView, Dimensions } from "react-native";
|
import { Keyboard, ScrollView, Dimensions, findNodeHandle, UIManager } from "react-native";
|
||||||
import { useState, useEffect, useRef } from "react";
|
import { useState, useEffect, useRef, useCallback } from "react";
|
||||||
import React from "react";
|
|
||||||
|
|
||||||
export function useKeyboardForm(scrollOffset = 100) {
|
export function useKeyboardForm(scrollOffset = 100) {
|
||||||
const scrollViewRef = useRef<ScrollView>(null);
|
const scrollViewRef = useRef<ScrollView>(null);
|
||||||
const [keyboardHeight, setKeyboardHeight] = useState(0);
|
const [keyboardHeight, setKeyboardHeight] = useState(0);
|
||||||
const currentScrollY = useRef(0);
|
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
|
// Listen to keyboard events
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -16,20 +29,34 @@ export function useKeyboardForm(scrollOffset = 100) {
|
|||||||
const kbHeight = e.endCoordinates.height;
|
const kbHeight = e.endCoordinates.height;
|
||||||
setKeyboardHeight(kbHeight);
|
setKeyboardHeight(kbHeight);
|
||||||
|
|
||||||
// Simple: scroll by keyboard height saat keyboard muncul
|
// Conditional scroll: hanya scroll jika input tertutup keyboard
|
||||||
if (scrollViewRef.current) {
|
if (scrollViewRef.current) {
|
||||||
const targetY = currentScrollY.current + kbHeight - scrollOffset;
|
const touchAbsoluteY = inputPageY.current;
|
||||||
scrollViewRef.current.scrollTo({
|
|
||||||
y: Math.max(0, targetY),
|
// Posisi Y teratas keyboard (dari atas layar)
|
||||||
animated: true,
|
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(
|
const keyboardDidHideListener = Keyboard.addListener(
|
||||||
'keyboardDidHide',
|
'keyboardDidHide',
|
||||||
() => {
|
() => {
|
||||||
setKeyboardHeight(0);
|
setKeyboardHeight(0);
|
||||||
|
inputPageY.current = 0;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -37,35 +64,74 @@ export function useKeyboardForm(scrollOffset = 100) {
|
|||||||
keyboardDidShowListener.remove();
|
keyboardDidShowListener.remove();
|
||||||
keyboardDidHideListener.remove();
|
keyboardDidHideListener.remove();
|
||||||
};
|
};
|
||||||
}, [scrollOffset]);
|
}, [scrollOffset, screenHeight]);
|
||||||
|
|
||||||
// Track scroll position
|
// Track scroll position
|
||||||
const handleScroll = (event: any) => {
|
const handleScroll = (event: any) => {
|
||||||
currentScrollY.current = event.nativeEvent.contentOffset.y;
|
currentScrollY.current = event.nativeEvent.contentOffset.y;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Dummy handlers (for API compatibility)
|
|
||||||
const createFocusHandler = () => {
|
|
||||||
return () => {};
|
|
||||||
};
|
|
||||||
|
|
||||||
const registerInputFocus = () => {};
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
scrollViewRef,
|
scrollViewRef,
|
||||||
keyboardHeight,
|
keyboardHeight,
|
||||||
registerInputFocus,
|
handleInputFocus,
|
||||||
createFocusHandler,
|
|
||||||
handleScroll,
|
handleScroll,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dummy helper (no-op, for API compatibility)
|
* Helper untuk inject onFocus handler ke semua TextInput/TextArea children
|
||||||
|
* Menggunakan UI.measure untuk mendapatkan posisi absolut input secara akurat
|
||||||
*/
|
*/
|
||||||
export function cloneChildrenWithFocusHandler(
|
export function cloneChildrenWithFocusHandler(
|
||||||
children: React.ReactNode,
|
children: React.ReactNode,
|
||||||
_focusHandler: (inputRef: any) => void
|
focusHandler: (target: any) => void
|
||||||
): React.ReactNode {
|
): React.ReactNode {
|
||||||
return children;
|
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;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
@@ -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,
|
||||||
|
OS_Wrapper,
|
||||||
} 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";
|
||||||
@@ -142,10 +142,14 @@ export function Maps_ScreenMapsCreate() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Render screen dengan NewWrapper
|
* Render screen dengan OS_Wrapper
|
||||||
*/
|
*/
|
||||||
return (
|
return (
|
||||||
<NewWrapper footerComponent={buttonFooter}>
|
<OS_Wrapper
|
||||||
|
enableKeyboardHandling
|
||||||
|
contentPaddingBottom={250}
|
||||||
|
footerComponent={buttonFooter}
|
||||||
|
>
|
||||||
<InformationBox text="Tentukan lokasi pin map dengan menekan pada map." />
|
<InformationBox text="Tentukan lokasi pin map dengan menekan pada map." />
|
||||||
|
|
||||||
<BaseBox>
|
<BaseBox>
|
||||||
@@ -179,7 +183,7 @@ export function Maps_ScreenMapsCreate() {
|
|||||||
</ButtonCenteredOnly>
|
</ButtonCenteredOnly>
|
||||||
|
|
||||||
<Spacing height={50} />
|
<Spacing height={50} />
|
||||||
</NewWrapper>
|
</OS_Wrapper>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import {
|
|||||||
LandscapeFrameUploaded,
|
LandscapeFrameUploaded,
|
||||||
Spacing,
|
Spacing,
|
||||||
TextInputCustom,
|
TextInputCustom,
|
||||||
ViewWrapper,
|
OS_Wrapper,
|
||||||
} 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";
|
||||||
@@ -166,7 +166,11 @@ export function Maps_ScreenMapsEdit() {
|
|||||||
: defaultRegion;
|
: defaultRegion;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ViewWrapper footerComponent={buttonFooter}>
|
<OS_Wrapper
|
||||||
|
enableKeyboardHandling
|
||||||
|
contentPaddingBottom={250}
|
||||||
|
footerComponent={buttonFooter}
|
||||||
|
>
|
||||||
<InformationBox text="Tentukan lokasi pin map dengan menekan pada map." />
|
<InformationBox text="Tentukan lokasi pin map dengan menekan pada map." />
|
||||||
|
|
||||||
{/* <MapSelectedPlatform
|
{/* <MapSelectedPlatform
|
||||||
@@ -223,6 +227,6 @@ export function Maps_ScreenMapsEdit() {
|
|||||||
Upload
|
Upload
|
||||||
</ButtonCenteredOnly>
|
</ButtonCenteredOnly>
|
||||||
<Spacing height={50} />
|
<Spacing height={50} />
|
||||||
</ViewWrapper>
|
</OS_Wrapper>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import {
|
|||||||
ButtonCenteredOnly,
|
ButtonCenteredOnly,
|
||||||
CenterCustom,
|
CenterCustom,
|
||||||
InformationBox,
|
InformationBox,
|
||||||
NewWrapper,
|
OS_Wrapper,
|
||||||
PhoneInputCustom,
|
PhoneInputCustom,
|
||||||
SelectCustom,
|
SelectCustom,
|
||||||
Spacing,
|
Spacing,
|
||||||
@@ -142,7 +142,9 @@ export function ScreenPortofolioCreate() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<NewWrapper
|
<OS_Wrapper
|
||||||
|
enableKeyboardHandling
|
||||||
|
contentPaddingBottom={250}
|
||||||
footerComponent={
|
footerComponent={
|
||||||
<Portofolio_ButtonCreate
|
<Portofolio_ButtonCreate
|
||||||
id={id as string}
|
id={id as string}
|
||||||
@@ -362,6 +364,6 @@ export function ScreenPortofolioCreate() {
|
|||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
</NewWrapper>
|
</OS_Wrapper>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { NewWrapper, TextCustom } from "@/components";
|
import { OS_Wrapper, TextCustom } from "@/components";
|
||||||
import CustomSkeleton from "@/components/_ShareComponent/SkeletonCustom";
|
import CustomSkeleton from "@/components/_ShareComponent/SkeletonCustom";
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
import { usePagination } from "@/hooks/use-pagination";
|
import { usePagination } from "@/hooks/use-pagination";
|
||||||
@@ -52,7 +52,7 @@ export default function ViewListPortofolio() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<NewWrapper
|
<OS_Wrapper
|
||||||
listData={pagination.listData}
|
listData={pagination.listData}
|
||||||
renderItem={renderItem}
|
renderItem={renderItem}
|
||||||
refreshControl={
|
refreshControl={
|
||||||
|
|||||||
@@ -101,106 +101,102 @@ import { OS_Wrapper } from "@/components";
|
|||||||
- ✅ iOS Testing: Complete ✅
|
- ✅ iOS Testing: Complete ✅
|
||||||
- ✅ Android Testing: Complete ✅
|
- ✅ Android Testing: Complete ✅
|
||||||
|
|
||||||
**Implementation Notes:**
|
### ✅ Phase 2: Profile, Waiting Room, Delete Account - COMPLETED (2026-04-08)
|
||||||
- **contentPaddingBottom pattern**:
|
|
||||||
- Default: `100` (list screens)
|
|
||||||
- Forms: `250` (screens with TextInput/TextArea)
|
|
||||||
- Override per-screen sesuai kebutuhan
|
|
||||||
- **PADDING_INLINE constant**: `16px` untuk konsisten padding horizontal
|
|
||||||
- Semua form screens menggunakan `enableKeyboardHandling` untuk keyboard auto-scroll di Android
|
|
||||||
- Semua list screens menggunakan pagination dengan `onEndReached`
|
|
||||||
- Floating button dan sticky header berfungsi dengan baik
|
|
||||||
- Footer component tetap di posisi bawah
|
|
||||||
- Tap anywhere untuk dismiss keyboard sudah implementasi
|
|
||||||
|
|
||||||
### ⏳ Phase 2: Other User Screens (Priority: HIGH)
|
**Files migrated: 10**
|
||||||
|
|
||||||
#### Profile Screens:
|
#### Profile Screens:
|
||||||
- [ ] `screens/Profile/ScreenProfile.tsx`
|
- ✅ `app/(application)/(user)/profile/[id]/index.tsx` - NewWrapper → OS_Wrapper (list with pull-to-refresh)
|
||||||
- [ ] `screens/Profile/ScreenProfileEdit.tsx` → pakai `enableKeyboardHandling` + `contentPaddingBottom={250}`
|
- ✅ `app/(application)/(user)/profile/[id]/edit.tsx` - ViewWrapper → OS_Wrapper (form + enableKeyboardHandling + contentPaddingBottom={250})
|
||||||
- [ ] `screens/Profile/ScreenProfileCreate.tsx` → pakai `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)
|
||||||
|
|
||||||
#### Forum/Discussion:
|
#### Other Screens:
|
||||||
- [ ] `screens/Forum/ScreenForum.tsx`
|
- ✅ `app/(application)/(user)/waiting-room.tsx` - NewWrapper → OS_Wrapper (static with refresh + footer)
|
||||||
- [ ] `screens/Forum/ScreenForumDetail.tsx`
|
- ✅ `app/(application)/(user)/delete-account.tsx` - ViewWrapper → OS_Wrapper (form + enableKeyboardHandling + contentPaddingBottom={250})
|
||||||
- [ ] `screens/Forum/ScreenForumCreate.tsx` → pakai `enableKeyboardHandling` + `contentPaddingBottom={250}`
|
|
||||||
|
|
||||||
#### Portfolio:
|
### ✅ Phase 3: Portfolio Screens - COMPLETED (2026-04-08)
|
||||||
- [ ] `screens/Portfolio/ScreenPortfolio.tsx`
|
|
||||||
- [ ] `screens/Portfolio/ScreenPortfolioCreate.tsx` → pakai `enableKeyboardHandling` + `contentPaddingBottom={250}`
|
|
||||||
- [ ] `screens/Portfolio/ScreenPortfolioEdit.tsx` → pakai `enableKeyboardHandling` + `contentPaddingBottom={250}`
|
|
||||||
|
|
||||||
### ⏳ Phase 3: Admin Screens (Priority: MEDIUM)
|
**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)
|
||||||
|
|
||||||
#### Event Management:
|
|
||||||
- [ ] `screens/Admin/Event/ScreenEventList.tsx`
|
- [ ] `screens/Admin/Event/ScreenEventList.tsx`
|
||||||
- [ ] `screens/Admin/Event/ScreenEventCreate.tsx` → pakai `enableKeyboardHandling` + `contentPaddingBottom={250}`
|
- [ ] `screens/Admin/Event/ScreenEventCreate.tsx` → pakai `enableKeyboardHandling` + `contentPaddingBottom={250}`
|
||||||
- [ ] `screens/Admin/Event/ScreenEventEdit.tsx` → pakai `enableKeyboardHandling` + `contentPaddingBottom={250}`
|
- [ ] `screens/Admin/Event/ScreenEventEdit.tsx` → pakai `enableKeyboardHandling` + `contentPaddingBottom={250}`
|
||||||
|
|
||||||
#### Voting Management:
|
### ⏳ Phase 6: Voting Management (Priority: MEDIUM)
|
||||||
|
|
||||||
- [ ] `screens/Admin/Voting/ScreenVotingList.tsx`
|
- [ ] `screens/Admin/Voting/ScreenVotingList.tsx`
|
||||||
- [ ] `screens/Admin/Voting/ScreenVotingCreate.tsx` → pakai `enableKeyboardHandling` + `contentPaddingBottom={250}`
|
- [ ] `screens/Admin/Voting/ScreenVotingCreate.tsx` → pakai `enableKeyboardHandling` + `contentPaddingBottom={250}`
|
||||||
- [ ] `screens/Admin/Voting/ScreenVotingEdit.tsx` → pakai `enableKeyboardHandling` + `contentPaddingBottom={250}`
|
- [ ] `screens/Admin/Voting/ScreenVotingEdit.tsx` → pakai `enableKeyboardHandling` + `contentPaddingBottom={250}`
|
||||||
|
|
||||||
#### Donation Management:
|
### ⏳ Phase 7: Forum/Discussion Screens (Priority: LOW)
|
||||||
|
|
||||||
|
- [ ] `screens/Forum/ScreenForum.tsx`
|
||||||
|
- [ ] `screens/Forum/ScreenForumDetail.tsx`
|
||||||
|
- [ ] `screens/Forum/ScreenForumCreate.tsx` → pakai `enableKeyboardHandling` + `contentPaddingBottom={250}`
|
||||||
|
|
||||||
|
### ⏳ Phase 8: Donation Management (Priority: LOW)
|
||||||
|
|
||||||
- [ ] `screens/Admin/Donation/ScreenDonationList.tsx`
|
- [ ] `screens/Admin/Donation/ScreenDonationList.tsx`
|
||||||
- [ ] `screens/Admin/Donation/ScreenDonationCreate.tsx` → pakai `enableKeyboardHandling` + `contentPaddingBottom={250}`
|
- [ ] `screens/Admin/Donation/ScreenDonationCreate.tsx` → pakai `enableKeyboardHandling` + `contentPaddingBottom={250}`
|
||||||
- [ ] `screens/Admin/Donation/ScreenDonationEdit.tsx` → pakai `enableKeyboardHandling` + `contentPaddingBottom={250}`
|
- [ ] `screens/Admin/Donation/ScreenDonationEdit.tsx` → pakai `enableKeyboardHandling` + `contentPaddingBottom={250}`
|
||||||
|
|
||||||
### ⏳ Phase 4: Other Screens (Priority: LOW)
|
### ⏳ Phase 9: Other Screens (Priority: LOW)
|
||||||
- [ ] `screens/Investasi/` - Investment screens
|
- [ ] `screens/Investasi/` - Investment screens
|
||||||
- [ ] `screens/Kolaborasi/` - Collaboration screens
|
- [ ] `screens/Kolaborasi/` - Collaboration screens
|
||||||
- [ ] Other user-facing 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
|
### User Preference:
|
||||||
- [ ] UI tampil sesuai design
|
- **NO PADDING_INLINE by default** - Bisa mempersempit box tampilan
|
||||||
- [ ] Tabs berfungsi dengan baik
|
- User akan review dan tambahkan sendiri jika diperlukan per-screen
|
||||||
- [ ] ScrollView/FlatList scroll dengan smooth
|
|
||||||
- [ ] Keyboard tidak menutupi input (jika pakai `enableKeyboardHandling`)
|
|
||||||
- [ ] Footer muncul di posisi yang benar
|
|
||||||
- [ ] Pull to refresh berfungsi (jika ada)
|
|
||||||
|
|
||||||
### Android Testing
|
### Keyboard Handling:
|
||||||
- [ ] UI tampil sesuai design
|
- `enableKeyboardHandling` → Auto-scroll saat keyboard muncul (Android only)
|
||||||
- [ ] Tabs berfungsi dengan baik
|
- **Bug Fixed (2026-04-08)**: Input di paling atas tidak lagi "terlempar" keluar layar saat keyboard muncul
|
||||||
- [ ] ScrollView/FlatList scroll dengan smooth
|
- **Solusi**: Menggunakan `UIManager.measure` untuk mendapatkan posisi absolut input (`pageY`), lalu conditional scroll:
|
||||||
- [ ] Keyboard handling: auto scroll saat input focus (jika pakai `enableKeyboardHandling`)
|
- Jika input DI ATAS keyboard (terlihat) → **TIDAK SCROLL**
|
||||||
- [ ] Footer muncul di posisi yang benar (tidak tertutup navigation bar)
|
- Jika input DI BAWAH keyboard (tertutup) → **Scroll secukupnya**
|
||||||
- [ ] Pull to refresh berfungsi (jika ada)
|
- Tap anywhere di luar input → keyboard dismiss (sudah implementasi di kedua mode)
|
||||||
|
|
||||||
### Common Testing
|
### Migration Pattern:
|
||||||
- [ ] 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
|
|
||||||
- [ ] Tap anywhere dismiss keyboard berfungsi
|
|
||||||
- [ ] contentPaddingBottom: 100 (list) / 250 (form) sesuai kebutuhan
|
|
||||||
|
|
||||||
## 📌 Notes
|
|
||||||
|
|
||||||
### Usage Pattern:
|
|
||||||
|
|
||||||
#### Untuk List Screen:
|
#### Untuk List Screen:
|
||||||
```tsx
|
```tsx
|
||||||
<OS_Wrapper
|
<OS_Wrapper
|
||||||
listData={pagination.listData}
|
listData={pagination.listData}
|
||||||
renderItem={renderItem}
|
renderItem={renderItem}
|
||||||
contentPadding={PADDING_INLINE}
|
|
||||||
ListEmptyComponent={ListEmptyComponent}
|
ListEmptyComponent={ListEmptyComponent}
|
||||||
ListFooterComponent={ListFooterComponent}
|
ListFooterComponent={ListFooterComponent}
|
||||||
onEndReached={pagination.loadMore}
|
onEndReached={pagination.loadMore}
|
||||||
refreshControl={
|
refreshControl={<RefreshControl refreshing={refreshing} onRefresh={onRefresh} />}
|
||||||
<RefreshControl
|
|
||||||
refreshing={pagination.refreshing}
|
|
||||||
onRefresh={pagination.onRefresh}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
/>
|
/>
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -209,7 +205,7 @@ Setiap screen yang sudah di-migrate, test:
|
|||||||
<OS_Wrapper
|
<OS_Wrapper
|
||||||
headerComponent={<HeaderSection />}
|
headerComponent={<HeaderSection />}
|
||||||
footerComponent={<FooterSection />}
|
footerComponent={<FooterSection />}
|
||||||
contentPadding={PADDING_INLINE}
|
refreshControl={<RefreshControl refreshing={refreshing} onRefresh={onRefresh} />}
|
||||||
>
|
>
|
||||||
<YourContent />
|
<YourContent />
|
||||||
</OS_Wrapper>
|
</OS_Wrapper>
|
||||||
@@ -220,60 +216,7 @@ Setiap screen yang sudah di-migrate, test:
|
|||||||
<OS_Wrapper
|
<OS_Wrapper
|
||||||
enableKeyboardHandling
|
enableKeyboardHandling
|
||||||
contentPaddingBottom={250} // ← HANYA untuk screens dengan TextInput
|
contentPaddingBottom={250} // ← HANYA untuk screens dengan TextInput
|
||||||
contentPadding={PADDING_INLINE}
|
footerComponent={<SubmitButton />}
|
||||||
footerComponent={
|
|
||||||
<BoxButtonOnFooter>
|
|
||||||
<ButtonCustom onPress={handleSubmit}>Submit</ButtonCustom>
|
|
||||||
</BoxButtonOnFooter>
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<FormContent />
|
|
||||||
</OS_Wrapper>
|
|
||||||
```
|
|
||||||
|
|
||||||
### 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";
|
|
||||||
import { PADDING_INLINE } from "@/constants/constans-value";
|
|
||||||
|
|
||||||
<OS_Wrapper
|
|
||||||
listData={data}
|
|
||||||
renderItem={renderItem}
|
|
||||||
contentPadding={PADDING_INLINE}
|
|
||||||
headerComponent={header}
|
|
||||||
footerComponent={footer}
|
|
||||||
/>
|
|
||||||
```
|
|
||||||
|
|
||||||
```tsx
|
|
||||||
// OLD (Form with keyboard handling)
|
|
||||||
import { NewWrapper_V2 } from "@/components/_ShareComponent/NewWrapper_V2";
|
|
||||||
|
|
||||||
<NewWrapper_V2
|
|
||||||
enableKeyboardHandling
|
|
||||||
keyboardScrollOffset={150}
|
|
||||||
>
|
|
||||||
<FormContent />
|
|
||||||
</NewWrapper_V2>
|
|
||||||
|
|
||||||
// NEW (Unified API)
|
|
||||||
import { OS_Wrapper } from "@/components";
|
|
||||||
|
|
||||||
<OS_Wrapper
|
|
||||||
enableKeyboardHandling
|
|
||||||
contentPaddingBottom={250} // ← Explicit untuk form screens
|
|
||||||
>
|
>
|
||||||
<FormContent />
|
<FormContent />
|
||||||
</OS_Wrapper>
|
</OS_Wrapper>
|
||||||
@@ -287,6 +230,9 @@ import { OS_Wrapper } from "@/components";
|
|||||||
### Issue: Keyboard menutupi input di Android
|
### Issue: Keyboard menutupi input di Android
|
||||||
**Solution**: Pastikan pakai `OS_Wrapper` dengan `enableKeyboardHandling={true}` dan `contentPaddingBottom={250}` untuk form screens.
|
**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
|
### Issue: Footer terlalu jauh dari bottom
|
||||||
**Solution**: Kurangi `contentPaddingBottom` (default: 100 untuk list). Untuk form screens tetap 250.
|
**Solution**: Kurangi `contentPaddingBottom` (default: 100 untuk list). Untuk form screens tetap 250.
|
||||||
|
|
||||||
@@ -298,10 +244,15 @@ import { OS_Wrapper } from "@/components";
|
|||||||
| Phase | Total Files | Migrated | Testing | Status |
|
| Phase | Total Files | Migrated | Testing | Status |
|
||||||
|-------|-------------|----------|---------|--------|
|
|-------|-------------|----------|---------|--------|
|
||||||
| Phase 1 (Job) | 9 | 9 | ✅ Complete | ✅ Complete |
|
| Phase 1 (Job) | 9 | 9 | ✅ Complete | ✅ Complete |
|
||||||
| Phase 2 (User) | TBD | 0 | 0 | ⏳ Pending |
|
| Phase 2 (Profile + Others) | 10 | 10 | ⏳ Pending | ✅ Complete |
|
||||||
| Phase 3 (Admin) | TBD | 0 | 0 | ⏳ Pending |
|
| Phase 3 (Portfolio) | 6 | 6 | ⏳ Pending | ✅ Complete |
|
||||||
| Phase 4 (Other) | TBD | 0 | 0 | ⏳ Pending |
|
| Phase 4 (Maps) | 2 | 2 | ⏳ Pending | ✅ Complete |
|
||||||
| **Total** | **9+** | **9** | **9** | **100% (Phase 1)** |
|
| 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
|
## 🔄 Rollback Plan
|
||||||
|
|
||||||
@@ -316,5 +267,5 @@ Jika ada issue yang tidak bisa di-fix dalam 1 jam:
|
|||||||
**Co-authored-by**: Qwen-Coder <qwen-coder@alibabacloud.com>
|
**Co-authored-by**: Qwen-Coder <qwen-coder@alibabacloud.com>
|
||||||
**Created**: 2026-04-06
|
**Created**: 2026-04-06
|
||||||
**Last Updated**: 2026-04-08
|
**Last Updated**: 2026-04-08
|
||||||
**Status**: Phase 1 (Job Screens) Complete ✅
|
**Status**: Phase 1-4 Complete ✅ (27 files migrated)
|
||||||
**Next**: Phase 2 - Other User Screens (Profile, Forum, Portfolio)
|
**Next**: Phase 5 - Event Management Screens
|
||||||
|
|||||||
Reference in New Issue
Block a user