feature profile
deskripsi: - drawer & alert - screen baru: edit profile, update photo, update background, create portofolio
This commit is contained in:
31
screens/Profile/menuDrawerSection.tsx
Normal file
31
screens/Profile/menuDrawerSection.tsx
Normal file
@@ -0,0 +1,31 @@
|
||||
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
||||
import MenuDrawerDynamicGrid from "@/components/Drawer/MenuDrawerDynamicGird";
|
||||
import { router } from "expo-router";
|
||||
|
||||
export default function Profile_MenuDrawerSection({
|
||||
drawerItems,
|
||||
setShowLogoutAlert,
|
||||
}: {
|
||||
drawerItems: IMenuDrawerItem[];
|
||||
setShowLogoutAlert: (value: boolean) => void;
|
||||
}) {
|
||||
const handlePress = (item: IMenuDrawerItem) => {
|
||||
if (item.label === "Keluar") {
|
||||
// console.log("Logout clicked");
|
||||
setShowLogoutAlert(true);
|
||||
} else {
|
||||
router.push(item.path as any);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
{/* Menu Items */}
|
||||
<MenuDrawerDynamicGrid
|
||||
data={drawerItems}
|
||||
columns={4} // Ubah ke 2 jika ingin 2 kolom per baris
|
||||
onPressItem={handlePress}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user