Fix rejected apple delete account & start for notification

### No issue
This commit is contained in:
2025-11-18 14:29:02 +08:00
parent 76debfd6a6
commit 059b4d053a
14 changed files with 111 additions and 30 deletions

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: `https://cld-dkr-staging-hipmi.wibudev.com/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: `https://cld-dkr-staging-hipmi.wibudev.com/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,8 @@
import { AlertDefaultSystem } from "@/components";
import { IMenuDrawerItem } from "@/components/_Interface/types";
import MenuDrawerDynamicGrid from "@/components/Drawer/MenuDrawerDynamicGird";
import { useAuth } from "@/hooks/use-auth";
import { openBrowser } from "@/utils/openBrower";
import { router } from "expo-router";
export default function Profile_MenuDrawerSection({
@@ -13,7 +15,8 @@ export default function Profile_MenuDrawerSection({
logout: () => Promise<void>;
}) {
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 +30,9 @@ export default function Profile_MenuDrawerSection({
},
onPressLeft: () => setIsDrawerOpen(false),
});
} else if (item.value === "delete-account") {
console.log("PATH >> ", item.path);
openBrowser(item.path as any);
} else {
console.log("PATH >> ", item.path);
router.push(item.path as any);
@@ -43,6 +49,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)}