Fix Alur Login & Load data forum , user search

Admin – User Access
- app/(application)/admin/user-access/[id]/index.tsx

Authentication
- context/AuthContext.tsx
- screens/Authentication/EULASection.tsx
- screens/Authentication/LoginView.tsx

Forum
- screens/Forum/ViewBeranda3.tsx

Profile & UI Components
- components/Image/AvatarComp.tsx
- screens/Profile/AvatarAndBackground.tsx

### No Issue
This commit is contained in:
2026-01-29 15:08:00 +08:00
parent b3bfbc0f7e
commit d693550a1f
7 changed files with 87 additions and 105 deletions

View File

@@ -7,13 +7,21 @@ import {
StyleSheet,
} from "react-native";
import { useState, useRef } from "react";
import { useLocalSearchParams, useRouter } from "expo-router";
import { router, useLocalSearchParams, useRouter } from "expo-router";
import { SafeAreaView } from "react-native-safe-area-context";
import { AccentColor, MainColor } from "@/constants/color-palet";
import { useAuth } from "@/hooks/use-auth";
import Toast from "react-native-toast-message";
export default function EULASection({ nomor, onSetModalVisible }: { nomor: string, onSetModalVisible: (visible: boolean) => void }) {
export default function EULASection({
nomor,
onSetModalVisible,
setLoadingTerm,
}: {
nomor: string;
onSetModalVisible: (visible: boolean) => void;
setLoadingTerm: (loading: boolean) => void;
}) {
const { acceptedTerms } = useAuth();
const [isLoading, setIsLoading] = useState<boolean>(false);
const [isAtBottom, setIsAtBottom] = useState(false);
@@ -35,12 +43,26 @@ export default function EULASection({ nomor, onSetModalVisible }: { nomor: strin
if (!isAtBottom) return;
setIsLoading(true);
await acceptedTerms(nomor as string, onSetModalVisible);
const responseAccept = await acceptedTerms(
nomor as string,
onSetModalVisible,
);
console.log("Accept terms", responseAccept);
setLoadingTerm(true);
setTimeout(() => {
router.replace(responseAccept);
}, 500);
} catch (error) {
console.log("Error accept terms", error);
Toast.show({
type: "error",
text1: "Error",
text2: "Terjadi kesalahan saat menerima syarat dan ketentuan",
});
} finally {
setIsLoading(false);
}
};