join #19

Merged
amaliadwiy merged 222 commits from join into v1 2026-02-09 11:18:03 +08:00
68 changed files with 816 additions and 278 deletions
Showing only changes of commit cd16b8ba04 - Show all commits

View File

@@ -10,14 +10,15 @@ import Text from '@/components/Text';
import { ColorsStatus } from "@/constants/ColorsStatus";
import Styles from "@/constants/Styles";
import { apiGetDiscussionGeneralOne, apiSendDiscussionGeneralCommentar } from "@/lib/api";
import { getDB } from "@/lib/firebaseDatabase";
import { useAuthSession } from "@/providers/AuthProvider";
import { Ionicons, MaterialIcons } from "@expo/vector-icons";
import { firebase } from '@react-native-firebase/database';
import { ref } from '@react-native-firebase/database';
import { useHeaderHeight } from '@react-navigation/elements';
import { router, Stack, useLocalSearchParams } from "expo-router";
import { useEffect, useState } from "react";
import { KeyboardAvoidingView, Platform, Pressable, ScrollView, View } from "react-native";
import { useSelector } from "react-redux";
import { useHeaderHeight } from '@react-navigation/elements';
type Props = {
id: string
@@ -49,7 +50,7 @@ export default function DetailDiscussionGeneral() {
const [loading, setLoading] = useState(true)
const [loadingKomentar, setLoadingKomentar] = useState(true)
const arrSkeleton = Array.from({ length: 3 }, (_, index) => index)
const reference = firebase.app().database('https://mobile-darmasaba-default-rtdb.asia-southeast1.firebasedatabase.app').ref(`/discussion-general/${id}`);
const reference = ref(getDB(), `/discussion-general/${id}`);
const headerHeight = useHeaderHeight();
useEffect(() => {

View File

@@ -13,14 +13,15 @@ import {
apiGetDivisionOneFeature,
apiSendDiscussionCommentar,
} from "@/lib/api";
import { getDB } from "@/lib/firebaseDatabase";
import { useAuthSession } from "@/providers/AuthProvider";
import { Ionicons, MaterialIcons } from "@expo/vector-icons";
import { firebase } from "@react-native-firebase/database";
import { ref } from "@react-native-firebase/database";
import { useHeaderHeight } from '@react-navigation/elements';
import { router, Stack, useLocalSearchParams } from "expo-router";
import { useEffect, useState } from "react";
import { KeyboardAvoidingView, Platform, Pressable, RefreshControl, ScrollView, View } from "react-native";
import { useSelector } from "react-redux";
import { useHeaderHeight } from '@react-navigation/elements';
type Props = {
id: string;
@@ -58,7 +59,7 @@ export default function DiscussionDetail() {
const [loading, setLoading] = useState(true)
const [loadingKomentar, setLoadingKomentar] = useState(true)
const arrSkeleton = Array.from({ length: 3 })
const reference = firebase.app().database('https://mobile-darmasaba-default-rtdb.asia-southeast1.firebasedatabase.app').ref(`/discussion-division/${detail}`);
const reference = ref(getDB(), `/discussion-division/${detail}`);
const [refreshing, setRefreshing] = useState(false)
const headerHeight = useHeaderHeight();

9
lib/firebaseDatabase.ts Normal file
View File

@@ -0,0 +1,9 @@
import { getApp } from '@react-native-firebase/app';
import { getDatabase } from '@react-native-firebase/database';
// Ganti URL sesuai punya kamu
const DATABASE_URL = 'https://mobile-darmasaba-default-rtdb.asia-southeast1.firebasedatabase.app';
export function getDB() {
return getDatabase(getApp(), DATABASE_URL);
}