Fix semua tampilan yang memiliki fungsi infitine load
UI – User Notifications - app/(application)/(user)/notifications/index.tsx - service/api-notifications.ts - screens/Notification/ UI – Portofolio (User) - app/(application)/(user)/portofolio/[id]/create.tsx - app/(application)/(user)/portofolio/[id]/edit.tsx - app/(application)/(user)/portofolio/[id]/list.tsx - screens/Portofolio/BoxPortofolioView.tsx - screens/Portofolio/ViewListPortofolio.tsx - screens/Profile/PortofolioSection.tsx - service/api-client/api-portofolio.ts Forum & User Search - screens/Forum/DetailForum2.tsx - screens/Forum/ViewBeranda3.tsx - screens/UserSeach/MainView_V2.tsx Constants & Docs - constants/constans-value.ts - docs/prompt-for-qwen-code.md ### No Issue
This commit is contained in:
@@ -1,14 +1,17 @@
|
||||
import {
|
||||
AvatarComp,
|
||||
ClickableCustom,
|
||||
Grid,
|
||||
NewWrapper,
|
||||
StackCustom,
|
||||
TextCustom,
|
||||
TextInputCustom
|
||||
AvatarComp,
|
||||
ClickableCustom,
|
||||
Grid,
|
||||
NewWrapper,
|
||||
StackCustom,
|
||||
TextCustom,
|
||||
TextInputCustom,
|
||||
} from "@/components";
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
import { ICON_SIZE_SMALL, PAGINATION_DEFAULT_TAKE } from "@/constants/constans-value";
|
||||
import {
|
||||
ICON_SIZE_SMALL,
|
||||
PAGINATION_DEFAULT_TAKE,
|
||||
} from "@/constants/constans-value";
|
||||
import { usePagination } from "@/hooks/use-pagination";
|
||||
import { apiAllUser } from "@/service/api-client/api-user";
|
||||
import { Ionicons } from "@expo/vector-icons";
|
||||
@@ -18,7 +21,6 @@ import { useCallback, useRef, useState } from "react";
|
||||
import { RefreshControl, View } from "react-native";
|
||||
import { createPaginationComponents } from "@/helpers/paginationHelpers";
|
||||
|
||||
|
||||
export default function UserSearchMainView_V2() {
|
||||
const isInitialMount = useRef(true);
|
||||
const [search, setSearch] = useState("");
|
||||
@@ -30,7 +32,7 @@ export default function UserSearchMainView_V2() {
|
||||
hasMore,
|
||||
onRefresh,
|
||||
loadMore,
|
||||
isInitialLoad
|
||||
isInitialLoad,
|
||||
} = usePagination({
|
||||
fetchFunction: async (page, searchQuery) => {
|
||||
const response = await apiAllUser({
|
||||
@@ -83,7 +85,7 @@ export default function UserSearchMainView_V2() {
|
||||
padding: 12,
|
||||
marginBottom: 10,
|
||||
elevation: 2,
|
||||
shadowColor: '#000',
|
||||
shadowColor: "#000",
|
||||
shadowOffset: { width: 0, height: 1 },
|
||||
shadowOpacity: 0.2,
|
||||
shadowRadius: 2,
|
||||
@@ -129,18 +131,19 @@ export default function UserSearchMainView_V2() {
|
||||
</View>
|
||||
);
|
||||
|
||||
const { ListEmptyComponent, ListFooterComponent } = createPaginationComponents({
|
||||
loading,
|
||||
refreshing,
|
||||
listData,
|
||||
searchQuery: search,
|
||||
emptyMessage: "Tidak ada pengguna ditemukan",
|
||||
emptySearchMessage: "Tidak ada hasil pencarian",
|
||||
skeletonCount: 5,
|
||||
skeletonHeight: 150,
|
||||
loadingFooterText: "Memuat lebih banyak pengguna...",
|
||||
isInitialLoad
|
||||
});
|
||||
const { ListEmptyComponent, ListFooterComponent } =
|
||||
createPaginationComponents({
|
||||
loading,
|
||||
refreshing,
|
||||
listData,
|
||||
searchQuery: search,
|
||||
emptyMessage: "Tidak ada pengguna ditemukan",
|
||||
emptySearchMessage: "Tidak ada hasil pencarian",
|
||||
skeletonCount: 5,
|
||||
skeletonHeight: 150,
|
||||
loadingFooterText: "Memuat lebih banyak pengguna...",
|
||||
isInitialLoad,
|
||||
});
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -161,14 +164,4 @@ export default function UserSearchMainView_V2() {
|
||||
/>
|
||||
</>
|
||||
);
|
||||
|
||||
// return (
|
||||
// <>
|
||||
// <ViewWrapper>
|
||||
// <View style={{ padding: 16 }}>
|
||||
// <TextCustom>{JSON.stringify(listData, null, 2)}</TextCustom>
|
||||
// </View>
|
||||
// </ViewWrapper>
|
||||
// </>
|
||||
// );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user