feat: Complete Forum & Admin User Access migration + fix scroll issues
Forum Screens (User Phase 5 - 17 files):
- Migrate all forum list, detail, create, and report screens to OS_Wrapper.
- ViewBeranda, ViewBeranda2, ViewBeranda3: List screens with pull-to-refresh.
- DetailForum, DetailForum2: Comment sections with headers (apply disableFlexGrow fix).
- create, edit, report-*, other-report-*, preview-report-*: Forms with keyboard handling.
Admin Phase 9 (User Access - 2 files):
- index.tsx: List with search and pagination.
- [id]/index.tsx: Detail with status toggle footer.
Scroll Fixes (Critical Bugs):
- Fix "Ghost Scroll" in Android FlatList: Removed TouchableWithoutFeedback and KeyboardAvoidingView wrappers in List Mode.
- Fix Large Header Cut-off: Added optional disableFlexGrow={true} to OS_Wrapper for screens with complex ListHeaderComponents (e.g., Forum Detail).
- Fix Keyboard Dismiss: Changed keyboardShouldPersistTaps to "handled" so taps on empty areas dismiss the keyboard while allowing scroll.
Documentation:
- Update TASK-005 with complete Phase 5 details and new progress totals.
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
@@ -3,12 +3,11 @@ import {
|
||||
ButtonCustom,
|
||||
DrawerCustom,
|
||||
LoaderCustom,
|
||||
NewWrapper,
|
||||
OS_Wrapper,
|
||||
Spacing,
|
||||
TextAreaCustom,
|
||||
TextCustom,
|
||||
TextInputCustom,
|
||||
ViewWrapper,
|
||||
} from "@/components";
|
||||
import CustomSkeleton from "@/components/_ShareComponent/SkeletonCustom";
|
||||
import AlertWarning from "@/components/Alert/AlertWarning";
|
||||
@@ -193,7 +192,7 @@ export default function DetailForum() {
|
||||
|
||||
return (
|
||||
<>
|
||||
<NewWrapper
|
||||
<OS_Wrapper
|
||||
// headerComponent={headerComponent()}
|
||||
>
|
||||
{!data && !listComment ? (
|
||||
@@ -225,7 +224,7 @@ export default function DetailForum() {
|
||||
))}
|
||||
</>
|
||||
)}
|
||||
</NewWrapper>
|
||||
</OS_Wrapper>
|
||||
|
||||
{/* Posting Drawer */}
|
||||
<DrawerCustom
|
||||
|
||||
@@ -3,13 +3,12 @@ import {
|
||||
ButtonCustom,
|
||||
DrawerCustom,
|
||||
LoaderCustom,
|
||||
NewWrapper,
|
||||
OS_Wrapper,
|
||||
Spacing,
|
||||
StackCustom,
|
||||
TextAreaCustom,
|
||||
TextCustom,
|
||||
TextInputCustom,
|
||||
ViewWrapper,
|
||||
} from "@/components";
|
||||
import CustomSkeleton from "@/components/_ShareComponent/SkeletonCustom";
|
||||
import AlertWarning from "@/components/Alert/AlertWarning";
|
||||
@@ -34,6 +33,7 @@ import _ from "lodash";
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
import { RefreshControl } from "react-native";
|
||||
import ListSkeletonComponent from "@/components/_ShareComponent/ListSkeletonComponent";
|
||||
import { PADDING_INLINE } from "@/constants/constans-value";
|
||||
|
||||
export default function DetailForum2() {
|
||||
const { id } = useLocalSearchParams();
|
||||
@@ -213,20 +213,6 @@ export default function DetailForum2() {
|
||||
}}
|
||||
/>
|
||||
)
|
||||
// !data || !commentPagination.listData ? (
|
||||
// // <ListSkeletonComponent height={120} />
|
||||
// <LoaderCustom />
|
||||
// ) : (
|
||||
// <Forum_CommentarBoxSection
|
||||
// key={item.id}
|
||||
// data={item}
|
||||
// onSetData={(value) => {
|
||||
// setCommentId(value.setCommentId);
|
||||
// setOpenDrawerCommentar(value.setOpenDrawer);
|
||||
// setCommentAuthorId(value.setCommentAuthorId);
|
||||
// }}
|
||||
// />
|
||||
// );
|
||||
|
||||
// Generate pagination components using helper
|
||||
const { ListEmptyComponent, ListFooterComponent } =
|
||||
@@ -242,8 +228,9 @@ export default function DetailForum2() {
|
||||
|
||||
return (
|
||||
<>
|
||||
<NewWrapper
|
||||
// headerComponent={}
|
||||
<OS_Wrapper
|
||||
contentPadding={PADDING_INLINE}
|
||||
disableFlexGrow
|
||||
listData={commentPagination.listData}
|
||||
renderItem={renderCommentItem}
|
||||
refreshControl={
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {
|
||||
BackButton,
|
||||
AvatarComp,
|
||||
ViewWrapper,
|
||||
OS_Wrapper,
|
||||
SearchInput,
|
||||
FloatingButton,
|
||||
LoaderCustom,
|
||||
@@ -71,7 +71,7 @@ export default function Forum_ViewBeranda() {
|
||||
}}
|
||||
/>
|
||||
|
||||
<ViewWrapper
|
||||
<OS_Wrapper
|
||||
headerComponent={
|
||||
<SearchInput
|
||||
placeholder="Cari topik diskusi"
|
||||
@@ -107,7 +107,7 @@ export default function Forum_ViewBeranda() {
|
||||
/>
|
||||
))
|
||||
)}
|
||||
</ViewWrapper>
|
||||
</OS_Wrapper>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -6,11 +6,11 @@ import {
|
||||
LoaderCustom,
|
||||
SearchInput,
|
||||
StackCustom,
|
||||
TextCustom, // ← gunakan NewWrapper yang sudah diperbaiki
|
||||
TextCustom,
|
||||
OS_Wrapper,
|
||||
} from "@/components";
|
||||
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||
import SkeletonCustom from "@/components/_ShareComponent/SkeletonCustom";
|
||||
import NewWrapper from "@/components/_ShareComponent/NewWrapper";
|
||||
import { useAuth } from "@/hooks/use-auth";
|
||||
import Forum_BoxDetailSection from "@/screens/Forum/DiscussionBoxSection";
|
||||
import { apiForumGetAll } from "@/service/api-client/api-forum";
|
||||
@@ -172,8 +172,8 @@ export default function Forum_ViewBeranda2() {
|
||||
}}
|
||||
/>
|
||||
|
||||
{/* 🔹 NewWrapper dalam mode list */}
|
||||
<NewWrapper
|
||||
{/* 🔹 OS_Wrapper dalam mode list */}
|
||||
<OS_Wrapper
|
||||
// Header global (di atas FlatList, sticky)
|
||||
headerComponent={
|
||||
<View style={{ paddingHorizontal: 16, paddingTop: 8 }}>
|
||||
|
||||
@@ -2,11 +2,12 @@ import {
|
||||
AvatarComp,
|
||||
BackButton,
|
||||
FloatingButton,
|
||||
OS_Wrapper,
|
||||
SearchInput,
|
||||
} from "@/components";
|
||||
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||
import NewWrapper from "@/components/_ShareComponent/NewWrapper";
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
import { PADDING_INLINE } from "@/constants/constans-value";
|
||||
import { createPaginationComponents } from "@/helpers/paginationHelpers";
|
||||
import { useAuth } from "@/hooks/use-auth";
|
||||
import { usePagination } from "@/hooks/use-pagination";
|
||||
@@ -75,12 +76,6 @@ export default function Forum_ViewBeranda3() {
|
||||
/>
|
||||
);
|
||||
|
||||
// const ListHeaderComponent = (
|
||||
// <View style={{ paddingVertical: 8, alignItems: "center" }}>
|
||||
// <TextCustom>Diskusi Terbaru</TextCustom>
|
||||
// </View>
|
||||
// );
|
||||
|
||||
return (
|
||||
<>
|
||||
<Stack.Screen
|
||||
@@ -105,8 +100,9 @@ export default function Forum_ViewBeranda3() {
|
||||
}}
|
||||
/>
|
||||
|
||||
<NewWrapper
|
||||
<OS_Wrapper
|
||||
hideFooter
|
||||
contentPadding={PADDING_INLINE}
|
||||
headerComponent={
|
||||
<View style={{ paddingTop: 8 }}>
|
||||
<SearchInput
|
||||
|
||||
@@ -7,9 +7,9 @@ import {
|
||||
FloatingButton,
|
||||
Grid,
|
||||
LoaderCustom,
|
||||
OS_Wrapper,
|
||||
StackCustom,
|
||||
TextCustom,
|
||||
ViewWrapper,
|
||||
} from "@/components";
|
||||
import { useAuth } from "@/hooks/use-auth";
|
||||
import Forum_BoxDetailSection from "@/screens/Forum/DiscussionBoxSection";
|
||||
@@ -66,7 +66,7 @@ export default function View_Forumku() {
|
||||
|
||||
return (
|
||||
<>
|
||||
<ViewWrapper
|
||||
<OS_Wrapper
|
||||
floatingButton={
|
||||
user?.id === id && (
|
||||
<FloatingButton
|
||||
@@ -121,7 +121,7 @@ export default function View_Forumku() {
|
||||
</>
|
||||
)}
|
||||
</StackCustom>
|
||||
</ViewWrapper>
|
||||
</OS_Wrapper>
|
||||
|
||||
{/* Drawer Komponen Eksternal */}
|
||||
<DrawerCustom
|
||||
|
||||
@@ -6,11 +6,11 @@ import {
|
||||
FloatingButton,
|
||||
Grid,
|
||||
LoaderCustom,
|
||||
OS_Wrapper,
|
||||
Spacing,
|
||||
StackCustom,
|
||||
TextCustom,
|
||||
} from "@/components";
|
||||
import NewWrapper from "@/components/_ShareComponent/NewWrapper";
|
||||
import NoDataText from "@/components/_ShareComponent/NoDataText";
|
||||
import CustomSkeleton from "@/components/_ShareComponent/SkeletonCustom";
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
@@ -24,6 +24,7 @@ import { router, useLocalSearchParams } from "expo-router";
|
||||
import _ from "lodash";
|
||||
import { useEffect, useState } from "react";
|
||||
import { RefreshControl, View } from "react-native";
|
||||
import { PADDING_INLINE } from "@/constants/constans-value";
|
||||
|
||||
export default function View_Forumku2() {
|
||||
const { id } = useLocalSearchParams();
|
||||
@@ -120,7 +121,8 @@ export default function View_Forumku2() {
|
||||
|
||||
return (
|
||||
<>
|
||||
<NewWrapper
|
||||
<OS_Wrapper
|
||||
contentPadding={PADDING_INLINE}
|
||||
floatingButton={
|
||||
user?.id === id && (
|
||||
<FloatingButton
|
||||
|
||||
Reference in New Issue
Block a user