diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index a43b8d0..01b4438 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,6 +1,4 @@ - + @@ -17,36 +15,13 @@ xmlns:tools="http://schemas.android.com/tools"> - - - - - - - + + + + + + + diff --git a/app/(application)/(user)/job/(tabs)/_layout.tsx b/app/(application)/(user)/job/(tabs)/_layout.tsx index 48846bb..6a63193 100644 --- a/app/(application)/(user)/job/(tabs)/_layout.tsx +++ b/app/(application)/(user)/job/(tabs)/_layout.tsx @@ -1,13 +1,13 @@ +/* eslint-disable react-hooks/exhaustive-deps */ import { BackButton } from "@/components"; import { IconHome, IconStatus } from "@/components/_Icon"; import { TabsStyles } from "@/styles/tabs-styles"; import { Ionicons } from "@expo/vector-icons"; import { - Stack, + router, Tabs, useLocalSearchParams, - router, - useNavigation, + useNavigation } from "expo-router"; import { useLayoutEffect } from "react"; @@ -31,7 +31,7 @@ export default function JobTabsLayout() { if (from) { router.replace(`/${from}` as any); } else { - router.back(); + router.navigate("/home"); } } }} diff --git a/app/(application)/(user)/job/[id]/index.tsx b/app/(application)/(user)/job/[id]/index.tsx index 43356d7..a4183a1 100644 --- a/app/(application)/(user)/job/[id]/index.tsx +++ b/app/(application)/(user)/job/[id]/index.tsx @@ -25,6 +25,8 @@ export default function JobDetail() { setIsLoading(true); const response = await apiJobGetOne({ id: id as string }); + console.log("DATA", JSON.stringify(response.data, null,2)); + setData(response.data); } catch (error) { console.log("[ERROR]", error); diff --git a/app/(application)/(user)/notifications/index.tsx b/app/(application)/(user)/notifications/index.tsx index 3eba978..15be826 100644 --- a/app/(application)/(user)/notifications/index.tsx +++ b/app/(application)/(user)/notifications/index.tsx @@ -1,3 +1,4 @@ +/* eslint-disable react-hooks/exhaustive-deps */ import { BaseBox, NewWrapper, @@ -32,10 +33,18 @@ const fixPath = ({ deepLink: string; categoryApp: string; }) => { - const fixPath = - deepLink + "&from=notifications&category=" + _.lowerCase(categoryApp); + if (categoryApp === "OTHER") { + return deepLink; + } - return fixPath; + const separator = deepLink.includes("?") ? "&" : "?"; + + const fixedPath = + `${deepLink}${separator}from=notifications&category=${_.lowerCase(categoryApp)}`; + + console.log("Fix Path", fixedPath); + + return fixedPath; }; const BoxNotification = ({ @@ -114,7 +123,6 @@ export default function Notifications() { category: activeCategory as any, }); - console.log("Response Notification", JSON.stringify(response, null, 2)); if (response.success) { setListData(response.data); } else { diff --git a/app/(application)/(user)/profile/[id]/index.tsx b/app/(application)/(user)/profile/[id]/index.tsx index 8af3a02..01e8856 100644 --- a/app/(application)/(user)/profile/[id]/index.tsx +++ b/app/(application)/(user)/profile/[id]/index.tsx @@ -139,7 +139,9 @@ const ButtonnDot = ({ isUserCheck: boolean; logout: () => Promise; }) => { - const isId = id === undefined || id === null; + console.log("[ID] >>", id); + + const isId = id === undefined || id === "undefined"; if (isId) { return ( diff --git a/app/(application)/admin/job/[id]/[status]/index.tsx b/app/(application)/admin/job/[id]/[status]/index.tsx index 1345932..d1a6d0a 100644 --- a/app/(application)/admin/job/[id]/[status]/index.tsx +++ b/app/(application)/admin/job/[id]/[status]/index.tsx @@ -15,6 +15,7 @@ import AdminButtonReject from "@/components/_ShareComponent/Admin/ButtonReject"; import AdminButtonReview from "@/components/_ShareComponent/Admin/ButtonReview"; import ReportBox from "@/components/Box/ReportBox"; import { MainColor } from "@/constants/color-palet"; +import { useAuth } from "@/hooks/use-auth"; import funUpdateStatusJob from "@/screens/Admin/Job/funUpdateStatus"; import { apiAdminJobGetById } from "@/service/api-admin/api-admin-job"; import { router, useFocusEffect, useLocalSearchParams } from "expo-router"; @@ -23,8 +24,10 @@ import { useCallback, useState } from "react"; import Toast from "react-native-toast-message"; export default function AdminJobDetailStatus() { + const { user } = useAuth(); const { id, status } = useLocalSearchParams(); const [data, setData] = useState(null); + const [isLoading, setIsLoading] = useState(false); useFocusEffect( useCallback(() => { @@ -92,6 +95,9 @@ export default function AdminJobDetailStatus() { const response = await funUpdateStatusJob({ id: id as string, changeStatus, + data: { + senderId: user?.id as string, + }, }); if (!response.success) { @@ -142,12 +148,15 @@ export default function AdminJobDetailStatus() { - {data && data?.catatan && (status === "reject" || status === "review") && ( - - )} + {data && + data?.catatan && + (status === "reject" || status === "review") && ( + + )} {status === "review" && ( { AlertDefaultSystem({ title: "Publish", @@ -156,6 +165,7 @@ export default function AdminJobDetailStatus() { textRight: "Ya", onPressRight: () => { handleUpdate({ changeStatus: "publish" }); + setIsLoading(true); }, }); }} diff --git a/app/(application)/admin/notification/index.tsx b/app/(application)/admin/notification/index.tsx index 0ff1992..9dc0a75 100644 --- a/app/(application)/admin/notification/index.tsx +++ b/app/(application)/admin/notification/index.tsx @@ -89,7 +89,7 @@ export default function AdminNotification() { id: user?.id as any, category: activeCategory as any, }); - // console.log("Response Notification", JSON.stringify(response, null, 2)); + if (response.success) { setListData(response.data); } else { diff --git a/app/+not-found.tsx b/app/+not-found.tsx index 297838a..8356007 100644 --- a/app/+not-found.tsx +++ b/app/+not-found.tsx @@ -1,10 +1,19 @@ -import { StackCustom, TextCustom, ViewWrapper } from "@/components"; +import { BackButton, StackCustom, TextCustom, ViewWrapper } from "@/components"; +import { Stack } from "expo-router"; export default function NotFoundScreen() { - return ( + return ( + <> + }} + /> - - + + 404 @@ -12,5 +21,6 @@ export default function NotFoundScreen() { - ); -} \ No newline at end of file + + ); +} diff --git a/ios/HIPMIBadungConnect.xcodeproj/project.pbxproj b/ios/HIPMIBadungConnect.xcodeproj/project.pbxproj index 09b1789..fb1ba31 100644 --- a/ios/HIPMIBadungConnect.xcodeproj/project.pbxproj +++ b/ios/HIPMIBadungConnect.xcodeproj/project.pbxproj @@ -458,7 +458,7 @@ ); OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_DEBUG"; PRODUCT_BUNDLE_IDENTIFIER = "com.anonymous.hipmi-mobile"; - PRODUCT_NAME = "HIPMIBadungConnect"; + PRODUCT_NAME = HIPMIBadungConnect; SWIFT_OBJC_BRIDGING_HEADER = "HIPMIBadungConnect/HIPMIBadungConnect-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; @@ -490,7 +490,7 @@ ); OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_RELEASE"; PRODUCT_BUNDLE_IDENTIFIER = "com.anonymous.hipmi-mobile"; - PRODUCT_NAME = "HIPMIBadungConnect"; + PRODUCT_NAME = HIPMIBadungConnect; SWIFT_OBJC_BRIDGING_HEADER = "HIPMIBadungConnect/HIPMIBadungConnect-Bridging-Header.h"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; diff --git a/screens/Admin/Job/funUpdateStatus.ts b/screens/Admin/Job/funUpdateStatus.ts index 5e82cc3..2f07cb0 100644 --- a/screens/Admin/Job/funUpdateStatus.ts +++ b/screens/Admin/Job/funUpdateStatus.ts @@ -7,13 +7,17 @@ const funUpdateStatusJob = async ({ }: { id: string; changeStatus: "publish" | "review" | "reject"; - data?: any; + data: { + catatan?: string; + senderId: string; + }; }) => { try { + const fixData = data; const response = await apiAdminJobUpdate({ id: id, status: changeStatus as any, - data: data, + data: fixData as any, }); return response; diff --git a/screens/Home/bottomFeatureSection.tsx b/screens/Home/bottomFeatureSection.tsx index b952055..d01e602 100644 --- a/screens/Home/bottomFeatureSection.tsx +++ b/screens/Home/bottomFeatureSection.tsx @@ -17,7 +17,12 @@ export default function Home_BottomFeatureSection() { }); // console.log("[DATA JOB]", JSON.stringify(response.data, null, 2)); - const result = response.data.slice(-2); + const result = response.data + .sort( + (a: any, b: any) => + new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime() + ) + .slice(0, 2); setListData(result); } catch (error) { console.log("[ERROR]", error);