Compare commits

...

3 Commits

Author SHA1 Message Date
0a2aa71013 Add:
-  app/(application)/(user)/delete-account.tsx
-  assets/images/constants/logo-hipmi_back.png

Fix:
- app/(application)/(user)/_layout.tsx
- assets/images/constants/logo-hipmi.png
- components/Grid/GridCustom.tsx
- screens/Profile/ListPage.tsx
- screens/Profile/menuDrawerSection.tsx
- service/api-client/api-user.ts

### No Issue
2025-11-19 17:40:35 +08:00
868e96a54a Try to notification
### Issue: package import * as Notifications from expo-notifications;
2025-11-18 17:46:33 +08:00
059b4d053a Fix rejected apple delete account & start for notification
### No issue
2025-11-18 14:29:02 +08:00
24 changed files with 293 additions and 53 deletions

View File

@@ -92,8 +92,8 @@ android {
applicationId 'com.bip.hipmimobileapp'
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0.0"
versionCode 2
versionName "1.0.1"
buildConfigField "String", "REACT_NATIVE_RELEASE_LEVEL", "\"${findProperty('reactNativeReleaseLevel') ?: 'stable'}\""
}
@@ -180,3 +180,5 @@ dependencies {
implementation jscFlavor
}
}
apply plugin: 'com.google.gms.google-services'

View File

@@ -0,0 +1,29 @@
{
"project_info": {
"project_number": "608461535079",
"project_id": "hipmi-badung-connect",
"storage_bucket": "hipmi-badung-connect.firebasestorage.app"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:608461535079:android:4ff12ddc283fb3746761c2",
"android_client_info": {
"package_name": "com.bip.hipmimobileapp"
}
},
"oauth_client": [],
"api_key": [
{
"current_key": "AIzaSyBiDtIk3Q9zffFwIdJ5cjqY7e4390JGSkM"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": []
}
}
}
],
"configuration_version": "1"
}

View File

@@ -29,6 +29,12 @@
<data android:scheme="hipmimobile"/>
<data android:scheme="exp+hipmi-mobile"/>
</intent-filter>
<intent-filter android:autoVerify="true" data-generated="true">
<action android:name="android.intent.action.VIEW"/>
<data android:scheme="https" android:host="cld-dkr-staging-hipmi.wibudev.com" android:pathPrefix="/"/>
<category android:name="android.intent.category.BROWSABLE"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
</application>
</manifest>

View File

@@ -6,6 +6,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.google.gms:google-services:4.4.1'
classpath('com.android.tools.build:gradle')
classpath('com.facebook.react:react-native-gradle-plugin')
classpath('org.jetbrains.kotlin:kotlin-gradle-plugin')

View File

@@ -18,7 +18,7 @@ export default {
ITSAppUsesNonExemptEncryption: false,
},
associatedDomains: ["applinks:cld-dkr-staging-hipmi.wibudev.com"],
buildNumber: "5",
buildNumber: "7",
},
android: {
@@ -55,6 +55,7 @@ export default {
plugins: [
"expo-router",
"expo-notifications",
"expo-web-browser",
[
"expo-splash-screen",

View File

@@ -10,6 +10,13 @@ export default function UserLayout() {
return (
<>
<Stack screenOptions={HeaderStyles}>
<Stack.Screen
name="delete-account"
options={{
title: "Hapus Akun",
headerLeft: () => <BackButton />,
}}
/>
<Stack.Screen
name="waiting-room"
options={{

View File

@@ -0,0 +1,85 @@
import {
AlertDefaultSystem,
BaseBox,
ButtonCustom,
CenterCustom,
StackCustom,
TextCustom,
TextInputCustom,
ViewWrapper,
} from "@/components";
import { useAuth } from "@/hooks/use-auth";
import { apiDeleteUser } from "@/service/api-client/api-user";
import { Image } from "expo-image";
import { useLocalSearchParams } from "expo-router/build/hooks";
import { useState } from "react";
import Toast from "react-native-toast-message";
export default function DeleteAccount() {
const { token, logout, user } = useAuth();
const { phone } = useLocalSearchParams();
const [text, setText] = useState("");
const deleteAccount = async () => {
if (text !== "Delete Account") {
return Toast.show({
type: "error",
text1: "Ketik 'Delete Account' untuk menghapus akun",
});
}
AlertDefaultSystem({
title: "Apakah anda yakin ingin menghapus akun ini?",
message:
"Semua data yang pernah anda buat akan terhapus secara permanen !",
textLeft: "Batal",
textRight: "Ya",
onPressRight: async () => {
const response = await apiDeleteUser({ id: user?.id as string });
console.log("RESPONSE >> ", response);
logout();
},
});
};
return (
<>
<ViewWrapper>
<StackCustom>
<BaseBox>
<StackCustom>
<CenterCustom>
<Image
source={require("@/assets/images/constants/logo-hipmi.png")}
style={{
width: 150,
height: 150,
}}
/>
</CenterCustom>
<TextCustom align="center">
Anda akan menghapus akun dengan nomor +{phone}
</TextCustom>
<TextCustom align="center">
Ketik 'Delete Account' untuk menghapus akun
</TextCustom>
<TextInputCustom
value={text}
onChangeText={setText}
placeholder="Ketik 'Delete Account'"
/>
<ButtonCustom
backgroundColor="red"
textColor="white"
onPress={deleteAccount}
>
Submit
</ButtonCustom>
</StackCustom>
</BaseBox>
</StackCustom>
</ViewWrapper>
</>
);
}

View File

@@ -1,27 +1,10 @@
import { AuthProvider } from "@/context/AuthContext";
import AppRoot from "@/screens/RootLayout/AppRoot";
import { registerForPushNotificationsAsync } from "@/utils/notifications";
import { useEffect } from "react";
import "react-native-gesture-handler";
import { SafeAreaProvider } from "react-native-safe-area-context";
import Toast from "react-native-toast-message";
export default function RootLayout() {
useEffect(() => {
// Jalankan sekali saat app pertama kali dibuka
registerForPushNotificationsAsync().then((token) => {
if (token) {
// TODO: Kirim token ke backend kamu
// Contoh:
// fetch('https://api.hipmibadung.id/save-token', {
// method: 'POST',
// headers: { 'Content-Type': 'application/json' },
// body: JSON.stringify({ token })
// });
}
});
}, []);
return (
<>
<SafeAreaProvider>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 MiB

After

Width:  |  Height:  |  Size: 509 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

View File

@@ -19,9 +19,9 @@
"expo": "^54.0.0",
"expo-camera": "~17.0.7",
"expo-clipboard": "~8.0.7",
"expo-constants": "~18.0.10",
"expo-constants": "^18.0.10",
"expo-dev-client": "~6.0.12",
"expo-device": "~8.0.9",
"expo-device": "^8.0.9",
"expo-document-picker": "~14.0.7",
"expo-file-system": "^19.0.15",
"expo-font": "~14.0.8",
@@ -29,13 +29,13 @@
"expo-image": "~3.0.8",
"expo-image-picker": "~17.0.8",
"expo-linking": "~8.0.8",
"expo-notifications": "~0.32.12",
"expo-notifications": "^0.32.13",
"expo-router": "~6.0.1",
"expo-splash-screen": "~31.0.9",
"expo-status-bar": "~3.0.8",
"expo-symbols": "~1.0.7",
"expo-system-ui": "~6.0.7",
"expo-web-browser": "~15.0.7",
"expo-web-browser": "~15.0.9",
"lodash": "^4.17.21",
"react": "19.1.0",
"react-dom": "19.1.0",
@@ -1206,7 +1206,7 @@
"expo-modules-core": ["expo-modules-core@3.0.15", "", { "dependencies": { "invariant": "^2.2.4" }, "peerDependencies": { "react": "*", "react-native": "*" } }, "sha512-vGI7osd0/IjprldD08k4bckWSu7ID4HhZNP68l/UtilONQ8XZig8mWJd/Fm7i7KGvE3HyuF+HOXE9l671no42Q=="],
"expo-notifications": ["expo-notifications@0.32.12", "", { "dependencies": { "@expo/image-utils": "^0.8.7", "@ide/backoff": "^1.0.0", "abort-controller": "^3.0.0", "assert": "^2.0.0", "badgin": "^1.1.5", "expo-application": "~7.0.7", "expo-constants": "~18.0.9" }, "peerDependencies": { "expo": "*", "react": "*", "react-native": "*" } }, "sha512-FVJ5W4rOpKvmrLJ1Sd5pxiVTV4a7ApgTlKro+E5X8M2TBbXmEVOjs09klzdalXTjlzmU/Gu8aRw9xr7Ea/gZdw=="],
"expo-notifications": ["expo-notifications@0.32.13", "", { "dependencies": { "@expo/image-utils": "^0.8.7", "@ide/backoff": "^1.0.0", "abort-controller": "^3.0.0", "assert": "^2.0.0", "badgin": "^1.1.5", "expo-application": "~7.0.7", "expo-constants": "~18.0.10" }, "peerDependencies": { "expo": "*", "react": "*", "react-native": "*" } }, "sha512-PL0R1ulLVUgAswlXtRDKxBlcipNM3YA6+P5nB5JIhXbsjLJ7y+EKVaEhHhbaGzuK1QVsRQSJNm/4oISX+vsmFQ=="],
"expo-router": ["expo-router@6.0.1", "", { "dependencies": { "@expo/metro-runtime": "6.1.1", "@expo/schema-utils": "^0.1.7", "@expo/server": "^0.7.4", "@radix-ui/react-slot": "1.2.0", "@radix-ui/react-tabs": "^1.1.12", "@react-navigation/bottom-tabs": "^7.4.0", "@react-navigation/native": "^7.1.8", "@react-navigation/native-stack": "^7.3.16", "client-only": "^0.0.1", "debug": "^4.3.4", "escape-string-regexp": "^4.0.0", "fast-deep-equal": "^3.1.3", "invariant": "^2.2.4", "nanoid": "^3.3.8", "query-string": "^7.1.3", "react-fast-compare": "^3.2.2", "react-native-is-edge-to-edge": "^1.1.6", "semver": "~7.6.3", "server-only": "^0.0.1", "sf-symbols-typescript": "^2.1.0", "shallowequal": "^1.1.0", "use-latest-callback": "^0.2.1", "vaul": "^1.1.2" }, "peerDependencies": { "@react-navigation/drawer": "^7.5.0", "@testing-library/react-native": ">= 12.0.0", "expo": "*", "expo-constants": "^18.0.8", "expo-linking": "^8.0.8", "react": "*", "react-dom": "*", "react-native": "*", "react-native-gesture-handler": "*", "react-native-reanimated": "*", "react-native-safe-area-context": ">= 5.4.0", "react-native-screens": "*", "react-native-web": "*", "react-server-dom-webpack": ">= 19.0.0" }, "optionalPeers": ["@react-navigation/drawer", "@testing-library/react-native", "react-dom", "react-native-gesture-handler", "react-native-reanimated", "react-native-web", "react-server-dom-webpack"] }, "sha512-5wXkWyNMqUbjCWH0PRkOM0P6UsgLVdgchDkiLz5FY7HfU00ToBcxij965bqtlaATBgoaIo4DuLu6EgxewrKJ8Q=="],
@@ -1220,7 +1220,7 @@
"expo-updates-interface": ["expo-updates-interface@2.0.0", "", { "peerDependencies": { "expo": "*" } }, "sha512-pTzAIufEZdVPKql6iMi5ylVSPqV1qbEopz9G6TSECQmnNde2nwq42PxdFBaUEd8IZJ/fdJLQnOT3m6+XJ5s7jg=="],
"expo-web-browser": ["expo-web-browser@15.0.7", "", { "peerDependencies": { "expo": "*", "react-native": "*" } }, "sha512-eXnfO3FQ2WthTA8uEPNJ7SDRfPaLIU/P2k082HGEYIHAFZMwh2o9Wo+SDVytO3E95TAv1qwhggUjOrczYzxteQ=="],
"expo-web-browser": ["expo-web-browser@15.0.9", "", { "peerDependencies": { "expo": "*", "react-native": "*" } }, "sha512-Dj8kNFO+oXsxqCDNlUT/GhOrJnm10kAElH++3RplLydogFm5jTzXYWDEeNIDmV+F+BzGYs+sIhxiBf7RyaxXZg=="],
"exponential-backoff": ["exponential-backoff@3.1.2", "", {}, "sha512-8QxYTVXUkuy7fIIoitQkPwGonB8F3Zj8eEO8Sqg9Zv/bkI7RJAzowee4gr81Hak/dUTpA2Z7VfQgoijjPNlUZA=="],

View File

@@ -109,6 +109,7 @@ const styles = StyleSheet.create({
flexDirection: "row",
flexWrap: "wrap",
justifyContent: "flex-start",
marginInline: 0.1
// marginInline: 0.1
margin: 0.1
},
});

View File

@@ -294,8 +294,11 @@
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-HIPMIBadungConnect/Pods-HIPMIBadungConnect-resources.sh",
"${PODS_CONFIGURATION_BUILD_DIR}/EXApplication/ExpoApplication_privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/EXConstants/EXConstants.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/EXConstants/ExpoConstants_privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/EXNotifications/ExpoNotifications_privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/ExpoDevice/ExpoDevice_privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/ExpoFileSystem/ExpoFileSystem_privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/ExpoSystemUI/ExpoSystemUI_privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/RNCAsyncStorage/RNCAsyncStorage_resources.bundle",
@@ -328,8 +331,11 @@
);
name = "[CP] Copy Pods Resources";
outputPaths = (
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/ExpoApplication_privacy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/EXConstants.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/ExpoConstants_privacy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/ExpoNotifications_privacy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/ExpoDevice_privacy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/ExpoFileSystem_privacy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/ExpoSystemUI_privacy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RNCAsyncStorage_resources.bundle",

View File

@@ -2,6 +2,8 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>aps-environment</key>
<string>development</string>
<key>com.apple.developer.associated-domains</key>
<array>
<string>applinks:cld-dkr-staging-hipmi.wibudev.com</string>

View File

@@ -39,7 +39,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>5</string>
<string>7</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSMinimumSystemVersion</key>

View File

@@ -4,6 +4,16 @@
<dict>
<key>NSPrivacyAccessedAPITypes</key>
<array>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryFileTimestamp</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>C617.1</string>
<string>0A2A.1</string>
<string>3B52.1</string>
</array>
</dict>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryUserDefaults</string>
@@ -14,12 +24,10 @@
</dict>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryFileTimestamp</string>
<string>NSPrivacyAccessedAPICategorySystemBootTime</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>0A2A.1</string>
<string>3B52.1</string>
<string>C617.1</string>
<string>35F9.1</string>
</array>
</dict>
<dict>
@@ -31,14 +39,6 @@
<string>85F4.1</string>
</array>
</dict>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategorySystemBootTime</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>35F9.1</string>
</array>
</dict>
</array>
<key>NSPrivacyCollectedDataTypes</key>
<array/>

View File

@@ -1,5 +1,7 @@
PODS:
- EXConstants (18.0.8):
- EXApplication (7.0.7):
- ExpoModulesCore
- EXConstants (18.0.10):
- ExpoModulesCore
- EXImageLoader (6.0.0):
- ExpoModulesCore
@@ -7,6 +9,8 @@ PODS:
- EXJSONUtils (0.15.0)
- EXManifests (1.0.8):
- ExpoModulesCore
- EXNotifications (0.32.13):
- ExpoModulesCore
- Expo (54.0.2):
- ExpoModulesCore
- hermes-engine
@@ -211,6 +215,8 @@ PODS:
- ZXingObjC/PDF417
- ExpoClipboard (8.0.7):
- ExpoModulesCore
- ExpoDevice (8.0.9):
- ExpoModulesCore
- ExpoDocumentPicker (14.0.7):
- ExpoModulesCore
- ExpoFileSystem (19.0.15):
@@ -264,7 +270,7 @@ PODS:
- ExpoModulesCore
- ExpoSystemUI (6.0.7):
- ExpoModulesCore
- ExpoWebBrowser (15.0.7):
- ExpoWebBrowser (15.0.9):
- ExpoModulesCore
- EXUpdatesInterface (2.0.0):
- ExpoModulesCore
@@ -2422,10 +2428,12 @@ PODS:
- ZXingObjC/Core
DEPENDENCIES:
- EXApplication (from `../node_modules/expo-application/ios`)
- EXConstants (from `../node_modules/expo-constants/ios`)
- EXImageLoader (from `../node_modules/expo-image-loader/ios`)
- EXJSONUtils (from `../node_modules/expo-json-utils/ios`)
- EXManifests (from `../node_modules/expo-manifests/ios`)
- EXNotifications (from `../node_modules/expo-notifications/ios`)
- Expo (from `../node_modules/expo`)
- expo-dev-client (from `../node_modules/expo-dev-client/ios`)
- expo-dev-launcher (from `../node_modules/expo-dev-launcher`)
@@ -2434,6 +2442,7 @@ DEPENDENCIES:
- ExpoAsset (from `../node_modules/expo-asset/ios`)
- ExpoCamera (from `../node_modules/expo-camera/ios`)
- ExpoClipboard (from `../node_modules/expo-clipboard/ios`)
- ExpoDevice (from `../node_modules/expo-device/ios`)
- ExpoDocumentPicker (from `../node_modules/expo-document-picker/ios`)
- ExpoFileSystem (from `../node_modules/expo-file-system/ios`)
- ExpoFont (from `../node_modules/expo-font/ios`)
@@ -2543,6 +2552,8 @@ SPEC REPOS:
- ZXingObjC
EXTERNAL SOURCES:
EXApplication:
:path: "../node_modules/expo-application/ios"
EXConstants:
:path: "../node_modules/expo-constants/ios"
EXImageLoader:
@@ -2551,6 +2562,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/expo-json-utils/ios"
EXManifests:
:path: "../node_modules/expo-manifests/ios"
EXNotifications:
:path: "../node_modules/expo-notifications/ios"
Expo:
:path: "../node_modules/expo"
expo-dev-client:
@@ -2567,6 +2580,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/expo-camera/ios"
ExpoClipboard:
:path: "../node_modules/expo-clipboard/ios"
ExpoDevice:
:path: "../node_modules/expo-device/ios"
ExpoDocumentPicker:
:path: "../node_modules/expo-document-picker/ios"
ExpoFileSystem:
@@ -2760,10 +2775,12 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/yoga"
SPEC CHECKSUMS:
EXConstants: 7e4654405af367ff908c863fe77a8a22d60bd37d
EXApplication: 296622817d459f46b6c5fe8691f4aac44d2b79e7
EXConstants: fd688cef4e401dcf798a021cfb5d87c890c30ba3
EXImageLoader: 189e3476581efe3ad4d1d3fb4735b7179eb26f05
EXJSONUtils: 1d3e4590438c3ee593684186007028a14b3686cd
EXManifests: 224345a575fca389073c416297b6348163f28d1a
EXNotifications: a62e1f8e3edd258dc3b155d3caa49f32920f1c6c
Expo: 9e6ddfbc1f5aefde22029899293c701f1d34c2b1
expo-dev-client: f3434d6ca09ecb14ae48c2a3912bdbb07464cc85
expo-dev-launcher: b9538b1e0dc3fd2ddad75017b6ee9c8dfb206925
@@ -2772,6 +2789,7 @@ SPEC CHECKSUMS:
ExpoAsset: 84810d6fed8179f04d4a7a4a6b37028bbd726e26
ExpoCamera: ae1d6691b05b753261a845536d2b19a9788a8750
ExpoClipboard: af650d14765f19c60ce2a1eaf9dfe6445eff7365
ExpoDevice: 148accb4071873d19fba80a2506c58ffa433d620
ExpoDocumentPicker: 2200eefc2817f19315fa18f0147e0b80ece86926
ExpoFileSystem: 5fb091ea11198e109ceef2bdef2e6e66523e62c4
ExpoFont: 86ceec09ffed1c99cfee36ceb79ba149074901b5
@@ -2785,7 +2803,7 @@ SPEC CHECKSUMS:
ExpoSplashScreen: 0634b705953e6934a5156397162eefc1ee5d6a7c
ExpoSymbols: 1ae04ce686de719b9720453b988d8bc5bf776c68
ExpoSystemUI: 6cd74248a2282adf6dec488a75fa532d69dee314
ExpoWebBrowser: 533bc2a1b188eec1c10e4926decf658f1687b5e5
ExpoWebBrowser: b973e1351fdcf5fec0c400997b1851f5a8219ec3
EXUpdatesInterface: 5adf50cb41e079c861da6d9b4b954c3db9a50734
FBLazyVector: 9e0cd874afd81d9a4d36679daca991b58b260d42
hermes-engine: 35c763d57c9832d0eef764316ca1c4d043581394

View File

@@ -26,9 +26,9 @@
"expo": "^54.0.0",
"expo-camera": "~17.0.7",
"expo-clipboard": "~8.0.7",
"expo-constants": "~18.0.10",
"expo-constants": "^18.0.10",
"expo-dev-client": "~6.0.12",
"expo-device": "~8.0.9",
"expo-device": "^8.0.9",
"expo-document-picker": "~14.0.7",
"expo-file-system": "^19.0.15",
"expo-font": "~14.0.8",
@@ -36,13 +36,13 @@
"expo-image": "~3.0.8",
"expo-image-picker": "~17.0.8",
"expo-linking": "~8.0.8",
"expo-notifications": "~0.32.12",
"expo-notifications": "^0.32.13",
"expo-router": "~6.0.1",
"expo-splash-screen": "~31.0.9",
"expo-status-bar": "~3.0.8",
"expo-symbols": "~1.0.7",
"expo-system-ui": "~6.0.7",
"expo-web-browser": "~15.0.7",
"expo-web-browser": "~15.0.9",
"lodash": "^4.17.21",
"react": "19.1.0",
"react-dom": "19.1.0",

View File

@@ -5,6 +5,7 @@ import { MainColor } from "@/constants/color-palet";
import { useAuth } from "@/hooks/use-auth";
import { apiCheckCodeOtp } from "@/service/api-config";
import { GStyles } from "@/styles/global-styles";
import { registerForPushNotificationsAsync } from "@/utils/notifications";
import AsyncStorage from "@react-native-async-storage/async-storage";
import { router, useLocalSearchParams } from "expo-router";
import { useEffect, useState } from "react";
@@ -28,7 +29,7 @@ export default function VerificationView() {
nomor === "6282340374412";
// --- Context ---
const { validateOtp, isLoading } = useAuth();
const { validateOtp, isLoading, loginWithNomor } = useAuth();
useEffect(() => {
setUserNumber(nomor?.replace(/^\+/, "") || "");
@@ -70,6 +71,9 @@ export default function VerificationView() {
try {
setLoading(true);
await loginWithNomor(nomor as string);
setRecodeOtp(true);
// ❌ Kamu tidak punya nomor di sini, jadi pastikan `nomor` tersedia
// Sebaiknya simpan nomor saat login, atau gunakan dari `useLocalSearchParams`
router.setParams({ nomor }); // opsional
@@ -100,6 +104,14 @@ export default function VerificationView() {
// 🔁 VERIFIKASI NORMAL (untuk pengguna sungguhan)
try {
const response = await validateOtp(nomor as string);
// registerForPushNotificationsAsync().then((token) => {
// if (token) {
// console.log("Expo Push Token:", token);
// // TODO: Kirim token ke backend kamu
// } else {
// console.log("Failed to get Expo Push Token");
// }
// });
router.replace(response);
} catch (error) {
console.log("Error verification", error);

View File

@@ -1,6 +1,7 @@
import { IMenuDrawerItem } from "@/components/_Interface/types";
import { AccentColor, MainColor } from "@/constants/color-palet";
import { ICON_SIZE_MEDIUM } from "@/constants/constans-value";
import { useAuth } from "@/hooks/use-auth";
import { Ionicons } from "@expo/vector-icons";
export const drawerItemsProfile = ({
@@ -10,6 +11,8 @@ export const drawerItemsProfile = ({
id: string;
isAdmin: boolean;
}) => {
const { user } = useAuth();
const adminItems: IMenuDrawerItem[] = [
{
icon: (
@@ -21,6 +24,7 @@ export const drawerItemsProfile = ({
),
label: "Edit profile",
path: `/(application)/profile/${id}/edit`,
value: "edit-profile",
},
{
icon: (
@@ -32,6 +36,7 @@ export const drawerItemsProfile = ({
),
label: "Ubah foto profile",
path: `/(application)/profile/${id}/update-photo`,
value: "update-photo",
},
{
icon: (
@@ -43,6 +48,7 @@ export const drawerItemsProfile = ({
),
label: "Ubah latar belakang",
path: `/(application)/profile/${id}/update-background`,
value: "update-background",
},
{
icon: (
@@ -54,6 +60,7 @@ export const drawerItemsProfile = ({
),
label: "Tambah portofolio",
path: `/(application)/portofolio/${id}/create`,
value: "create-portofolio",
},
{
icon: (
@@ -65,6 +72,20 @@ export const drawerItemsProfile = ({
),
label: "Dashboard Admin",
path: `/(application)/admin/dashboard`,
value: "dashboard-admin",
},
{
icon: (
<Ionicons
name="trash"
size={ICON_SIZE_MEDIUM}
color={AccentColor.white}
/>
),
label: "Hapus Akun",
color: MainColor.red,
path: `/(application)/(user)/delete-account?phone=${user?.nomor}`,
value: "delete-account",
},
{
icon: (
@@ -77,6 +98,7 @@ export const drawerItemsProfile = ({
label: "Keluar",
color: MainColor.red,
path: "",
value: "logout",
},
];
@@ -91,6 +113,7 @@ export const drawerItemsProfile = ({
),
label: "Edit profile",
path: `/(application)/profile/${id}/edit`,
value: "edit-profile",
},
{
icon: (
@@ -102,6 +125,7 @@ export const drawerItemsProfile = ({
),
label: "Ubah foto profile",
path: `/(application)/profile/${id}/update-photo`,
value: "update-photo",
},
{
icon: (
@@ -113,6 +137,7 @@ export const drawerItemsProfile = ({
),
label: "Ubah latar belakang",
path: `/(application)/profile/${id}/update-background`,
value: "update-background",
},
{
icon: (
@@ -124,6 +149,20 @@ export const drawerItemsProfile = ({
),
label: "Tambah portofolio",
path: `/(application)/portofolio/${id}/create`,
value: "create-portofolio",
},
{
icon: (
<Ionicons
name="trash"
size={ICON_SIZE_MEDIUM}
color={AccentColor.white}
/>
),
label: "Hapus Akun",
color: MainColor.red,
path: `/(application)/(user)/delete-account?phone=${user?.nomor}`,
value: "delete-account",
},
{
icon: (
@@ -136,6 +175,7 @@ export const drawerItemsProfile = ({
label: "Keluar",
color: MainColor.red,
path: "",
value: "logout",
},
];

View File

@@ -1,6 +1,9 @@
import { AlertDefaultSystem } from "@/components";
import { IMenuDrawerItem } from "@/components/_Interface/types";
import MenuDrawerDynamicGrid from "@/components/Drawer/MenuDrawerDynamicGird";
import { useAuth } from "@/hooks/use-auth";
import { apiDeleteUser } from "@/service/api-client/api-user";
import { openBrowser } from "@/utils/openBrower";
import { router } from "expo-router";
export default function Profile_MenuDrawerSection({
@@ -12,8 +15,11 @@ export default function Profile_MenuDrawerSection({
setIsDrawerOpen: (value: boolean) => void;
logout: () => Promise<void>;
}) {
const { user } = useAuth();
const handlePress = (item: IMenuDrawerItem) => {
if (item.label === "Keluar") {
// console.log("ITEM >> ", item);
if (item.value === "logout") {
// console.log("Logout clicked");
// setShowLogoutAlert(true);
AlertDefaultSystem({
@@ -27,6 +33,22 @@ export default function Profile_MenuDrawerSection({
},
onPressLeft: () => setIsDrawerOpen(false),
});
} else if (item.value === "delete-account") {
console.log("PATH >> ", item.path);
// openBrowser(item.path as any);
AlertDefaultSystem({
title: "Apakah anda yakin ingin menghapus akun ini?",
message:
"Semua data yang pernah anda buat akan terhapus secara permanen!",
textLeft: "Batal",
textRight: "Ya",
onPressRight: async () => {
router.push(item.path as any);
setIsDrawerOpen(false);
},
onPressLeft: () => setIsDrawerOpen(false),
});
} else {
console.log("PATH >> ", item.path);
router.push(item.path as any);
@@ -43,6 +65,7 @@ export default function Profile_MenuDrawerSection({
label: item.label,
path: item.path as any,
color: item.color,
value: item.value,
}))}
columns={4} // Ubah ke 2 jika ingin 2 kolom per baris
onPressItem={(item) => handlePress(item as any)}

View File

@@ -10,3 +10,7 @@ export async function apiAllUser({ search }: { search: string }) {
return response.data;
}
export async function apiDeleteUser({id}:{id: string}) {
const response = await apiConfig.delete(`/mobile/user/${id}`);
return response.data;
}

View File

@@ -1,18 +1,29 @@
// utils/notifications.ts
import * as Device from 'expo-device';
import * as Notifications from 'expo-notifications';
import Constants from 'expo-constants';
import * as Device from 'expo-device';
// Notifications.setNotificationHandler({
// handleNotification: async () => ({
// shouldShowAlert: true,
// shouldPlaySound: true,
// shouldSetBadge: false,
// shouldShowBanner: true,
// shouldShowList: true,
// }),
// });
Notifications.setNotificationHandler({
handleNotification: async () => ({
shouldShowAlert: true,
shouldPlaySound: true,
shouldPlaySound: false,
shouldSetBadge: false,
shouldShowBanner: true,
shouldShowList: true,
}),
});
export async function registerForPushNotificationsAsync() {
if (!Device.isDevice) {
console.warn("Push notifications don't work on simulator");

9
utils/openBrower.ts Normal file
View File

@@ -0,0 +1,9 @@
import * as WebBrowser from "expo-web-browser";
export const openBrowser = async (url: string) => {
try {
await WebBrowser.openBrowserAsync(url);
} catch (error) {
console.error("Gagal membuka browser:", error);
}
};