Merge pull request 'Fix rejected apple delete account & start for notification' (#12) from qc/18-nov-25 into staging
Reviewed-on: http://wibugit.wibudev.com/wibu/hipmi-mobile/pulls/12
This commit is contained in:
@@ -92,8 +92,8 @@ android {
|
|||||||
applicationId 'com.bip.hipmimobileapp'
|
applicationId 'com.bip.hipmimobileapp'
|
||||||
minSdkVersion rootProject.ext.minSdkVersion
|
minSdkVersion rootProject.ext.minSdkVersion
|
||||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||||
versionCode 1
|
versionCode 2
|
||||||
versionName "1.0.0"
|
versionName "1.0.1"
|
||||||
|
|
||||||
buildConfigField "String", "REACT_NATIVE_RELEASE_LEVEL", "\"${findProperty('reactNativeReleaseLevel') ?: 'stable'}\""
|
buildConfigField "String", "REACT_NATIVE_RELEASE_LEVEL", "\"${findProperty('reactNativeReleaseLevel') ?: 'stable'}\""
|
||||||
}
|
}
|
||||||
@@ -180,3 +180,5 @@ dependencies {
|
|||||||
implementation jscFlavor
|
implementation jscFlavor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
apply plugin: 'com.google.gms.google-services'
|
||||||
29
android/app/google-services.json
Normal file
29
android/app/google-services.json
Normal 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"
|
||||||
|
}
|
||||||
@@ -29,6 +29,12 @@
|
|||||||
<data android:scheme="hipmimobile"/>
|
<data android:scheme="hipmimobile"/>
|
||||||
<data android:scheme="exp+hipmi-mobile"/>
|
<data android:scheme="exp+hipmi-mobile"/>
|
||||||
</intent-filter>
|
</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>
|
</activity>
|
||||||
</application>
|
</application>
|
||||||
</manifest>
|
</manifest>
|
||||||
@@ -6,6 +6,7 @@ buildscript {
|
|||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
|
classpath 'com.google.gms:google-services:4.4.1'
|
||||||
classpath('com.android.tools.build:gradle')
|
classpath('com.android.tools.build:gradle')
|
||||||
classpath('com.facebook.react:react-native-gradle-plugin')
|
classpath('com.facebook.react:react-native-gradle-plugin')
|
||||||
classpath('org.jetbrains.kotlin:kotlin-gradle-plugin')
|
classpath('org.jetbrains.kotlin:kotlin-gradle-plugin')
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ export default {
|
|||||||
ITSAppUsesNonExemptEncryption: false,
|
ITSAppUsesNonExemptEncryption: false,
|
||||||
},
|
},
|
||||||
associatedDomains: ["applinks:cld-dkr-staging-hipmi.wibudev.com"],
|
associatedDomains: ["applinks:cld-dkr-staging-hipmi.wibudev.com"],
|
||||||
buildNumber: "5",
|
buildNumber: "7",
|
||||||
},
|
},
|
||||||
|
|
||||||
android: {
|
android: {
|
||||||
@@ -55,6 +55,7 @@ export default {
|
|||||||
|
|
||||||
plugins: [
|
plugins: [
|
||||||
"expo-router",
|
"expo-router",
|
||||||
|
"expo-notifications",
|
||||||
"expo-web-browser",
|
"expo-web-browser",
|
||||||
[
|
[
|
||||||
"expo-splash-screen",
|
"expo-splash-screen",
|
||||||
|
|||||||
@@ -1,27 +1,10 @@
|
|||||||
import { AuthProvider } from "@/context/AuthContext";
|
import { AuthProvider } from "@/context/AuthContext";
|
||||||
import AppRoot from "@/screens/RootLayout/AppRoot";
|
import AppRoot from "@/screens/RootLayout/AppRoot";
|
||||||
import { registerForPushNotificationsAsync } from "@/utils/notifications";
|
|
||||||
import { useEffect } from "react";
|
|
||||||
import "react-native-gesture-handler";
|
import "react-native-gesture-handler";
|
||||||
import { SafeAreaProvider } from "react-native-safe-area-context";
|
import { SafeAreaProvider } from "react-native-safe-area-context";
|
||||||
import Toast from "react-native-toast-message";
|
import Toast from "react-native-toast-message";
|
||||||
|
|
||||||
export default function RootLayout() {
|
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 (
|
return (
|
||||||
<>
|
<>
|
||||||
<SafeAreaProvider>
|
<SafeAreaProvider>
|
||||||
|
|||||||
8
bun.lock
8
bun.lock
@@ -29,13 +29,13 @@
|
|||||||
"expo-image": "~3.0.8",
|
"expo-image": "~3.0.8",
|
||||||
"expo-image-picker": "~17.0.8",
|
"expo-image-picker": "~17.0.8",
|
||||||
"expo-linking": "~8.0.8",
|
"expo-linking": "~8.0.8",
|
||||||
"expo-notifications": "~0.32.12",
|
"expo-notifications": "~0.32.13",
|
||||||
"expo-router": "~6.0.1",
|
"expo-router": "~6.0.1",
|
||||||
"expo-splash-screen": "~31.0.9",
|
"expo-splash-screen": "~31.0.9",
|
||||||
"expo-status-bar": "~3.0.8",
|
"expo-status-bar": "~3.0.8",
|
||||||
"expo-symbols": "~1.0.7",
|
"expo-symbols": "~1.0.7",
|
||||||
"expo-system-ui": "~6.0.7",
|
"expo-system-ui": "~6.0.7",
|
||||||
"expo-web-browser": "~15.0.7",
|
"expo-web-browser": "~15.0.9",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"react": "19.1.0",
|
"react": "19.1.0",
|
||||||
"react-dom": "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-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=="],
|
"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-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=="],
|
"exponential-backoff": ["exponential-backoff@3.1.2", "", {}, "sha512-8QxYTVXUkuy7fIIoitQkPwGonB8F3Zj8eEO8Sqg9Zv/bkI7RJAzowee4gr81Hak/dUTpA2Z7VfQgoijjPNlUZA=="],
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
|
<key>aps-environment</key>
|
||||||
|
<string>development</string>
|
||||||
<key>com.apple.developer.associated-domains</key>
|
<key>com.apple.developer.associated-domains</key>
|
||||||
<array>
|
<array>
|
||||||
<string>applinks:cld-dkr-staging-hipmi.wibudev.com</string>
|
<string>applinks:cld-dkr-staging-hipmi.wibudev.com</string>
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
</dict>
|
</dict>
|
||||||
</array>
|
</array>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>5</string>
|
<string>7</string>
|
||||||
<key>ITSAppUsesNonExemptEncryption</key>
|
<key>ITSAppUsesNonExemptEncryption</key>
|
||||||
<false/>
|
<false/>
|
||||||
<key>LSMinimumSystemVersion</key>
|
<key>LSMinimumSystemVersion</key>
|
||||||
|
|||||||
@@ -36,13 +36,13 @@
|
|||||||
"expo-image": "~3.0.8",
|
"expo-image": "~3.0.8",
|
||||||
"expo-image-picker": "~17.0.8",
|
"expo-image-picker": "~17.0.8",
|
||||||
"expo-linking": "~8.0.8",
|
"expo-linking": "~8.0.8",
|
||||||
"expo-notifications": "~0.32.12",
|
"expo-notifications": "~0.32.13",
|
||||||
"expo-router": "~6.0.1",
|
"expo-router": "~6.0.1",
|
||||||
"expo-splash-screen": "~31.0.9",
|
"expo-splash-screen": "~31.0.9",
|
||||||
"expo-status-bar": "~3.0.8",
|
"expo-status-bar": "~3.0.8",
|
||||||
"expo-symbols": "~1.0.7",
|
"expo-symbols": "~1.0.7",
|
||||||
"expo-system-ui": "~6.0.7",
|
"expo-system-ui": "~6.0.7",
|
||||||
"expo-web-browser": "~15.0.7",
|
"expo-web-browser": "~15.0.9",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"react": "19.1.0",
|
"react": "19.1.0",
|
||||||
"react-dom": "19.1.0",
|
"react-dom": "19.1.0",
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
||||||
import { AccentColor, MainColor } from "@/constants/color-palet";
|
import { AccentColor, MainColor } from "@/constants/color-palet";
|
||||||
import { ICON_SIZE_MEDIUM } from "@/constants/constans-value";
|
import { ICON_SIZE_MEDIUM } from "@/constants/constans-value";
|
||||||
|
import { useAuth } from "@/hooks/use-auth";
|
||||||
import { Ionicons } from "@expo/vector-icons";
|
import { Ionicons } from "@expo/vector-icons";
|
||||||
|
|
||||||
export const drawerItemsProfile = ({
|
export const drawerItemsProfile = ({
|
||||||
@@ -10,6 +11,8 @@ export const drawerItemsProfile = ({
|
|||||||
id: string;
|
id: string;
|
||||||
isAdmin: boolean;
|
isAdmin: boolean;
|
||||||
}) => {
|
}) => {
|
||||||
|
const { user } = useAuth();
|
||||||
|
|
||||||
const adminItems: IMenuDrawerItem[] = [
|
const adminItems: IMenuDrawerItem[] = [
|
||||||
{
|
{
|
||||||
icon: (
|
icon: (
|
||||||
@@ -21,6 +24,7 @@ export const drawerItemsProfile = ({
|
|||||||
),
|
),
|
||||||
label: "Edit profile",
|
label: "Edit profile",
|
||||||
path: `/(application)/profile/${id}/edit`,
|
path: `/(application)/profile/${id}/edit`,
|
||||||
|
value: "edit-profile",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon: (
|
icon: (
|
||||||
@@ -32,6 +36,7 @@ export const drawerItemsProfile = ({
|
|||||||
),
|
),
|
||||||
label: "Ubah foto profile",
|
label: "Ubah foto profile",
|
||||||
path: `/(application)/profile/${id}/update-photo`,
|
path: `/(application)/profile/${id}/update-photo`,
|
||||||
|
value: "update-photo",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon: (
|
icon: (
|
||||||
@@ -43,6 +48,7 @@ export const drawerItemsProfile = ({
|
|||||||
),
|
),
|
||||||
label: "Ubah latar belakang",
|
label: "Ubah latar belakang",
|
||||||
path: `/(application)/profile/${id}/update-background`,
|
path: `/(application)/profile/${id}/update-background`,
|
||||||
|
value: "update-background",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon: (
|
icon: (
|
||||||
@@ -54,6 +60,7 @@ export const drawerItemsProfile = ({
|
|||||||
),
|
),
|
||||||
label: "Tambah portofolio",
|
label: "Tambah portofolio",
|
||||||
path: `/(application)/portofolio/${id}/create`,
|
path: `/(application)/portofolio/${id}/create`,
|
||||||
|
value: "create-portofolio",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon: (
|
icon: (
|
||||||
@@ -65,6 +72,20 @@ export const drawerItemsProfile = ({
|
|||||||
),
|
),
|
||||||
label: "Dashboard Admin",
|
label: "Dashboard Admin",
|
||||||
path: `/(application)/admin/dashboard`,
|
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: `https://cld-dkr-staging-hipmi.wibudev.com/delete-account?phone=${user?.nomor}`,
|
||||||
|
value: "delete-account",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon: (
|
icon: (
|
||||||
@@ -77,6 +98,7 @@ export const drawerItemsProfile = ({
|
|||||||
label: "Keluar",
|
label: "Keluar",
|
||||||
color: MainColor.red,
|
color: MainColor.red,
|
||||||
path: "",
|
path: "",
|
||||||
|
value: "logout",
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -91,6 +113,7 @@ export const drawerItemsProfile = ({
|
|||||||
),
|
),
|
||||||
label: "Edit profile",
|
label: "Edit profile",
|
||||||
path: `/(application)/profile/${id}/edit`,
|
path: `/(application)/profile/${id}/edit`,
|
||||||
|
value: "edit-profile",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon: (
|
icon: (
|
||||||
@@ -102,6 +125,7 @@ export const drawerItemsProfile = ({
|
|||||||
),
|
),
|
||||||
label: "Ubah foto profile",
|
label: "Ubah foto profile",
|
||||||
path: `/(application)/profile/${id}/update-photo`,
|
path: `/(application)/profile/${id}/update-photo`,
|
||||||
|
value: "update-photo",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon: (
|
icon: (
|
||||||
@@ -113,6 +137,7 @@ export const drawerItemsProfile = ({
|
|||||||
),
|
),
|
||||||
label: "Ubah latar belakang",
|
label: "Ubah latar belakang",
|
||||||
path: `/(application)/profile/${id}/update-background`,
|
path: `/(application)/profile/${id}/update-background`,
|
||||||
|
value: "update-background",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon: (
|
icon: (
|
||||||
@@ -124,6 +149,20 @@ export const drawerItemsProfile = ({
|
|||||||
),
|
),
|
||||||
label: "Tambah portofolio",
|
label: "Tambah portofolio",
|
||||||
path: `/(application)/portofolio/${id}/create`,
|
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: `https://cld-dkr-staging-hipmi.wibudev.com/delete-account?phone=${user?.nomor}`,
|
||||||
|
value: "delete-account",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
icon: (
|
icon: (
|
||||||
@@ -136,6 +175,7 @@ export const drawerItemsProfile = ({
|
|||||||
label: "Keluar",
|
label: "Keluar",
|
||||||
color: MainColor.red,
|
color: MainColor.red,
|
||||||
path: "",
|
path: "",
|
||||||
|
value: "logout",
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
import { AlertDefaultSystem } from "@/components";
|
import { AlertDefaultSystem } from "@/components";
|
||||||
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
||||||
import MenuDrawerDynamicGrid from "@/components/Drawer/MenuDrawerDynamicGird";
|
import MenuDrawerDynamicGrid from "@/components/Drawer/MenuDrawerDynamicGird";
|
||||||
|
import { useAuth } from "@/hooks/use-auth";
|
||||||
|
import { openBrowser } from "@/utils/openBrower";
|
||||||
import { router } from "expo-router";
|
import { router } from "expo-router";
|
||||||
|
|
||||||
export default function Profile_MenuDrawerSection({
|
export default function Profile_MenuDrawerSection({
|
||||||
@@ -13,7 +15,8 @@ export default function Profile_MenuDrawerSection({
|
|||||||
logout: () => Promise<void>;
|
logout: () => Promise<void>;
|
||||||
}) {
|
}) {
|
||||||
const handlePress = (item: IMenuDrawerItem) => {
|
const handlePress = (item: IMenuDrawerItem) => {
|
||||||
if (item.label === "Keluar") {
|
// console.log("ITEM >> ", item);
|
||||||
|
if (item.value === "logout") {
|
||||||
// console.log("Logout clicked");
|
// console.log("Logout clicked");
|
||||||
// setShowLogoutAlert(true);
|
// setShowLogoutAlert(true);
|
||||||
AlertDefaultSystem({
|
AlertDefaultSystem({
|
||||||
@@ -27,6 +30,9 @@ export default function Profile_MenuDrawerSection({
|
|||||||
},
|
},
|
||||||
onPressLeft: () => setIsDrawerOpen(false),
|
onPressLeft: () => setIsDrawerOpen(false),
|
||||||
});
|
});
|
||||||
|
} else if (item.value === "delete-account") {
|
||||||
|
console.log("PATH >> ", item.path);
|
||||||
|
openBrowser(item.path as any);
|
||||||
} else {
|
} else {
|
||||||
console.log("PATH >> ", item.path);
|
console.log("PATH >> ", item.path);
|
||||||
router.push(item.path as any);
|
router.push(item.path as any);
|
||||||
@@ -43,6 +49,7 @@ export default function Profile_MenuDrawerSection({
|
|||||||
label: item.label,
|
label: item.label,
|
||||||
path: item.path as any,
|
path: item.path as any,
|
||||||
color: item.color,
|
color: item.color,
|
||||||
|
value: item.value,
|
||||||
}))}
|
}))}
|
||||||
columns={4} // Ubah ke 2 jika ingin 2 kolom per baris
|
columns={4} // Ubah ke 2 jika ingin 2 kolom per baris
|
||||||
onPressItem={(item) => handlePress(item as any)}
|
onPressItem={(item) => handlePress(item as any)}
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
// utils/notifications.ts
|
// utils/notifications.ts
|
||||||
import * as Device from 'expo-device';
|
|
||||||
import * as Notifications from 'expo-notifications';
|
import * as Notifications from 'expo-notifications';
|
||||||
import Constants from 'expo-constants';
|
import Constants from 'expo-constants';
|
||||||
|
import * as Device from 'expo-device';
|
||||||
|
|
||||||
|
|
||||||
Notifications.setNotificationHandler({
|
Notifications.setNotificationHandler({
|
||||||
handleNotification: async () => ({
|
handleNotification: async () => ({
|
||||||
@@ -13,7 +14,7 @@ Notifications.setNotificationHandler({
|
|||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
export async function registerForPushNotificationsAsync() {
|
export default async function registerForPushNotificationsAsync() {
|
||||||
if (!Device.isDevice) {
|
if (!Device.isDevice) {
|
||||||
console.warn("Push notifications don't work on simulator");
|
console.warn("Push notifications don't work on simulator");
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
9
utils/openBrower.ts
Normal file
9
utils/openBrower.ts
Normal 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);
|
||||||
|
}
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user