fix & featur
deskripsi: - fix component stack dan drawer - new page list path profile
This commit is contained in:
@@ -102,6 +102,13 @@ export default function UserLayout() {
|
|||||||
headerLeft: () => <BackButton />,
|
headerLeft: () => <BackButton />,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
<Stack.Screen
|
||||||
|
name="maps/create"
|
||||||
|
options={{
|
||||||
|
title: "Tambah Maps",
|
||||||
|
headerLeft: () => <BackButton />,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
|
||||||
{/* Marketplace */}
|
{/* Marketplace */}
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
|
|||||||
59
app/(application)/(user)/maps/create.tsx
Normal file
59
app/(application)/(user)/maps/create.tsx
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
import {
|
||||||
|
BaseBox,
|
||||||
|
BoxButtonOnFooter,
|
||||||
|
ButtonCenteredOnly,
|
||||||
|
ButtonCustom,
|
||||||
|
InformationBox,
|
||||||
|
LandscapeFrameUploaded,
|
||||||
|
Spacing,
|
||||||
|
TextCustom,
|
||||||
|
TextInputCustom,
|
||||||
|
ViewWrapper,
|
||||||
|
} from "@/components";
|
||||||
|
import { router, useLocalSearchParams } from "expo-router";
|
||||||
|
|
||||||
|
export default function MapsCreate() {
|
||||||
|
const { id } = useLocalSearchParams();
|
||||||
|
const buttonFooter = (
|
||||||
|
<BoxButtonOnFooter>
|
||||||
|
<ButtonCustom
|
||||||
|
onPress={() => {
|
||||||
|
console.log("Simpan");
|
||||||
|
router.replace(`/portofolio/${id}`);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Simpan
|
||||||
|
</ButtonCustom>
|
||||||
|
</BoxButtonOnFooter>
|
||||||
|
);
|
||||||
|
return (
|
||||||
|
<ViewWrapper footerComponent={buttonFooter}>
|
||||||
|
<InformationBox text="Tentukan lokasi pin map dengan menekan pada map." />
|
||||||
|
|
||||||
|
<BaseBox style={{ height: 400 }}>
|
||||||
|
<TextCustom>Maps Her</TextCustom>
|
||||||
|
</BaseBox>
|
||||||
|
|
||||||
|
<TextInputCustom
|
||||||
|
required
|
||||||
|
label="Nama Pin"
|
||||||
|
placeholder="Masukkan nama pin maps"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<Spacing height={50} />
|
||||||
|
|
||||||
|
<InformationBox text="Upload foto lokasi bisnis anda untuk ditampilkan dalam detail maps." />
|
||||||
|
<LandscapeFrameUploaded />
|
||||||
|
<ButtonCenteredOnly
|
||||||
|
icon="upload"
|
||||||
|
onPress={() => {
|
||||||
|
console.log("Upload foto ");
|
||||||
|
router.navigate(`/take-picture/${id}`);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Upload
|
||||||
|
</ButtonCenteredOnly>
|
||||||
|
<Spacing height={50} />
|
||||||
|
</ViewWrapper>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -44,7 +44,8 @@ export default function PortofolioCreate() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleSave() {
|
function handleSave() {
|
||||||
console.log("save");
|
console.log("Selanjutnya");
|
||||||
|
router.replace(`/maps/create`);
|
||||||
}
|
}
|
||||||
|
|
||||||
const buttonSave = (
|
const buttonSave = (
|
||||||
@@ -56,16 +57,15 @@ export default function PortofolioCreate() {
|
|||||||
return (
|
return (
|
||||||
<ViewWrapper footerComponent={buttonSave}>
|
<ViewWrapper footerComponent={buttonSave}>
|
||||||
{/* <TextCustom>Portofolio Create {id}</TextCustom> */}
|
{/* <TextCustom>Portofolio Create {id}</TextCustom> */}
|
||||||
<StackCustom>
|
<StackCustom gap={"xs"}>
|
||||||
<InformationBox text="Lengkapi data bisnis anda." />
|
<InformationBox text="Lengkapi data bisnis anda." />
|
||||||
<TextInputCustom
|
<TextInputCustom
|
||||||
// disabled
|
|
||||||
required
|
required
|
||||||
label="Nama Bisnis"
|
label="Nama Bisnis"
|
||||||
placeholder="Masukkan nama bisnis"
|
placeholder="Masukkan nama bisnis"
|
||||||
|
|
||||||
/>
|
/>
|
||||||
<SelectCustom
|
<SelectCustom
|
||||||
// disabled
|
|
||||||
label="Bidang Usaha"
|
label="Bidang Usaha"
|
||||||
required
|
required
|
||||||
data={dummyMasterBidangBisnis.map((item) => ({
|
data={dummyMasterBidangBisnis.map((item) => ({
|
||||||
|
|||||||
@@ -1,32 +1,86 @@
|
|||||||
|
import { DrawerCustom, TextCustom } from "@/components";
|
||||||
import LeftButtonCustom from "@/components/Button/BackButton";
|
import LeftButtonCustom from "@/components/Button/BackButton";
|
||||||
|
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
||||||
import ViewWrapper from "@/components/_ShareComponent/ViewWrapper";
|
import ViewWrapper from "@/components/_ShareComponent/ViewWrapper";
|
||||||
|
import { MainColor } from "@/constants/color-palet";
|
||||||
|
import { DRAWER_HEIGHT } from "@/constants/constans-value";
|
||||||
|
import { drawerItems } from "@/screens/Profile/ListPage";
|
||||||
|
import Profile_MenuDrawerSection from "@/screens/Profile/MenuDrawerSection";
|
||||||
import { GStyles } from "@/styles/global-styles";
|
import { GStyles } from "@/styles/global-styles";
|
||||||
|
import { Ionicons } from "@expo/vector-icons";
|
||||||
import { Stack, useLocalSearchParams } from "expo-router";
|
import { Stack, useLocalSearchParams } from "expo-router";
|
||||||
import { Text } from "react-native";
|
import { useRef, useState } from "react";
|
||||||
|
import {
|
||||||
|
Animated,
|
||||||
|
InteractionManager,
|
||||||
|
Text,
|
||||||
|
TouchableOpacity,
|
||||||
|
} from "react-native";
|
||||||
|
|
||||||
export default function Portofolio() {
|
export default function Portofolio() {
|
||||||
const { id } = useLocalSearchParams();
|
const { id } = useLocalSearchParams();
|
||||||
|
const [isDrawerOpen, setIsDrawerOpen] = useState(false);
|
||||||
|
const [showLogoutAlert, setShowLogoutAlert] = useState(false);
|
||||||
|
|
||||||
|
const drawerAnim = useRef(new Animated.Value(DRAWER_HEIGHT)).current;
|
||||||
|
|
||||||
|
const openDrawer = () => {
|
||||||
|
setIsDrawerOpen(true);
|
||||||
|
Animated.timing(drawerAnim, {
|
||||||
|
toValue: 0,
|
||||||
|
duration: 300,
|
||||||
|
useNativeDriver: true,
|
||||||
|
}).start();
|
||||||
|
};
|
||||||
|
const closeDrawer = () => {
|
||||||
|
Animated.timing(drawerAnim, {
|
||||||
|
toValue: DRAWER_HEIGHT, // sesuaikan dengan tinggi drawer Anda
|
||||||
|
duration: 300,
|
||||||
|
useNativeDriver: true,
|
||||||
|
}).start(() => {
|
||||||
|
InteractionManager.runAfterInteractions(() => {
|
||||||
|
setIsDrawerOpen(false); // baru ganti state setelah animasi selesai
|
||||||
|
});
|
||||||
|
});
|
||||||
|
setIsDrawerOpen(false);
|
||||||
|
};
|
||||||
return (
|
return (
|
||||||
<ViewWrapper>
|
<>
|
||||||
{/* Header */}
|
<ViewWrapper>
|
||||||
<Stack.Screen
|
{/* Header */}
|
||||||
options={{
|
<Stack.Screen
|
||||||
title: "Portofolio",
|
options={{
|
||||||
headerLeft: () => <LeftButtonCustom />,
|
title: "Portofolio",
|
||||||
// headerRight: () => (
|
headerLeft: () => <LeftButtonCustom />,
|
||||||
// <TouchableOpacity onPress={openDrawer}>
|
headerRight: () => (
|
||||||
// <Ionicons
|
<TouchableOpacity onPress={openDrawer}>
|
||||||
// name="ellipsis-vertical"
|
<Ionicons
|
||||||
// size={20}
|
name="ellipsis-vertical"
|
||||||
// color={MainColor.yellow}
|
size={20}
|
||||||
// />
|
color={MainColor.yellow}
|
||||||
// </TouchableOpacity>
|
/>
|
||||||
// ),
|
</TouchableOpacity>
|
||||||
headerStyle: GStyles.headerStyle,
|
),
|
||||||
headerTitleStyle: GStyles.headerTitleStyle,
|
headerStyle: GStyles.headerStyle,
|
||||||
}}
|
headerTitleStyle: GStyles.headerTitleStyle,
|
||||||
/>
|
}}
|
||||||
<Text style={GStyles.textLabel}>Portofolio {id}</Text>
|
/>
|
||||||
</ViewWrapper>
|
<Text style={GStyles.textLabel}>Portofolio {id}</Text>
|
||||||
|
</ViewWrapper>
|
||||||
|
|
||||||
|
{/* Drawer Komponen Eksternal */}
|
||||||
|
<DrawerCustom
|
||||||
|
isVisible={isDrawerOpen}
|
||||||
|
closeDrawer={closeDrawer}
|
||||||
|
drawerAnim={drawerAnim}
|
||||||
|
height={350}
|
||||||
|
>
|
||||||
|
<Profile_MenuDrawerSection
|
||||||
|
drawerItems={drawerItems({ id: id as string })}
|
||||||
|
setShowLogoutAlert={setShowLogoutAlert}
|
||||||
|
setIsDrawerOpen={setIsDrawerOpen}
|
||||||
|
/>
|
||||||
|
</DrawerCustom>
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
|
||||||
import ViewWrapper from "@/components/_ShareComponent/ViewWrapper";
|
import ViewWrapper from "@/components/_ShareComponent/ViewWrapper";
|
||||||
import AlertCustom from "@/components/Alert/AlertCustom";
|
import AlertCustom from "@/components/Alert/AlertCustom";
|
||||||
import LeftButtonCustom from "@/components/Button/BackButton";
|
import LeftButtonCustom from "@/components/Button/BackButton";
|
||||||
import DrawerCustom from "@/components/Drawer/DrawerCustom";
|
import DrawerCustom from "@/components/Drawer/DrawerCustom";
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
import { DRAWER_HEIGHT } from "@/constants/constans-value";
|
import { DRAWER_HEIGHT } from "@/constants/constans-value";
|
||||||
|
import { drawerItems } from "@/screens/Profile/ListPage";
|
||||||
import Profile_MenuDrawerSection from "@/screens/Profile/MenuDrawerSection";
|
import Profile_MenuDrawerSection from "@/screens/Profile/MenuDrawerSection";
|
||||||
import ProfilSection from "@/screens/Profile/ProfilSection";
|
import ProfilSection from "@/screens/Profile/ProfilSection";
|
||||||
import { GStyles } from "@/styles/global-styles";
|
import { GStyles } from "@/styles/global-styles";
|
||||||
@@ -18,40 +18,6 @@ export default function Profile() {
|
|||||||
const [isDrawerOpen, setIsDrawerOpen] = useState(false);
|
const [isDrawerOpen, setIsDrawerOpen] = useState(false);
|
||||||
const [showLogoutAlert, setShowLogoutAlert] = useState(false);
|
const [showLogoutAlert, setShowLogoutAlert] = useState(false);
|
||||||
|
|
||||||
const drawerItems: IMenuDrawerItem[] = [
|
|
||||||
{
|
|
||||||
icon: "create",
|
|
||||||
label: "Edit profile",
|
|
||||||
path: `/(application)/profile/${id}/edit`,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon: "camera",
|
|
||||||
label: "Ubah foto profile",
|
|
||||||
path: `/(application)/profile/${id}/update-photo`,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon: "image",
|
|
||||||
label: "Ubah latar belakang",
|
|
||||||
path: `/(application)/profile/${id}/update-background`,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon: "add-circle",
|
|
||||||
label: "Tambah portofolio",
|
|
||||||
path: `/(application)/portofolio/${id}/create`,
|
|
||||||
},
|
|
||||||
// {
|
|
||||||
// icon: "settings",
|
|
||||||
// label: "Dashboard Admin",
|
|
||||||
// path: `/(application)/profile/dashboard-admin`,
|
|
||||||
// },
|
|
||||||
{ icon: "log-out", label: "Keluar", color: "red", path: "" },
|
|
||||||
{
|
|
||||||
icon: "create-outline",
|
|
||||||
label: "Create profile",
|
|
||||||
path: `/(application)/profile/${id}/create`,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
// Animasi menggunakan translateY (lebih kompatibel)
|
// Animasi menggunakan translateY (lebih kompatibel)
|
||||||
const drawerAnim = useRef(new Animated.Value(DRAWER_HEIGHT)).current; // mulai di luar bawah layar
|
const drawerAnim = useRef(new Animated.Value(DRAWER_HEIGHT)).current; // mulai di luar bawah layar
|
||||||
|
|
||||||
@@ -104,7 +70,6 @@ export default function Profile() {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ProfilSection />
|
<ProfilSection />
|
||||||
|
|
||||||
</ViewWrapper>
|
</ViewWrapper>
|
||||||
|
|
||||||
{/* Drawer Komponen Eksternal */}
|
{/* Drawer Komponen Eksternal */}
|
||||||
@@ -115,7 +80,7 @@ export default function Profile() {
|
|||||||
closeDrawer={closeDrawer}
|
closeDrawer={closeDrawer}
|
||||||
>
|
>
|
||||||
<Profile_MenuDrawerSection
|
<Profile_MenuDrawerSection
|
||||||
drawerItems={drawerItems}
|
drawerItems={drawerItems({ id: id as string })}
|
||||||
setShowLogoutAlert={setShowLogoutAlert}
|
setShowLogoutAlert={setShowLogoutAlert}
|
||||||
setIsDrawerOpen={setIsDrawerOpen}
|
setIsDrawerOpen={setIsDrawerOpen}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ export default function TakePicture() {
|
|||||||
/>
|
/>
|
||||||
<Spacing />
|
<Spacing />
|
||||||
|
|
||||||
<StackCustom>
|
<StackCustom >
|
||||||
<ButtonCustom onPress={() => setUri(null)} title="Foto ulang" />
|
<ButtonCustom onPress={() => setUri(null)} title="Foto ulang" />
|
||||||
<ButtonCustom
|
<ButtonCustom
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import React, { useRef } from "react";
|
import React, { useRef } from "react";
|
||||||
import {
|
import {
|
||||||
Animated,
|
Animated,
|
||||||
InteractionManager,
|
PanResponder,
|
||||||
PanResponder,
|
StyleSheet,
|
||||||
StyleSheet,
|
View,
|
||||||
View,
|
InteractionManager,
|
||||||
} from "react-native";
|
} from "react-native";
|
||||||
|
|
||||||
import { AccentColor, MainColor } from "@/constants/color-palet";
|
import { AccentColor, MainColor } from "@/constants/color-palet";
|
||||||
@@ -86,7 +86,7 @@ DrawerCustomProps) {
|
|||||||
{...panResponder.panHandlers}
|
{...panResponder.panHandlers}
|
||||||
>
|
>
|
||||||
<View
|
<View
|
||||||
style={[styles.headerBar, { backgroundColor: MainColor.white_gray }]}
|
style={[styles.headerBar, { backgroundColor: MainColor.white }]}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{children}
|
{children}
|
||||||
@@ -152,7 +152,7 @@ const styles = StyleSheet.create({
|
|||||||
headerBar: {
|
headerBar: {
|
||||||
width: 40,
|
width: 40,
|
||||||
height: 5,
|
height: 5,
|
||||||
backgroundColor: MainColor.white_gray,
|
backgroundColor: MainColor.white,
|
||||||
borderRadius: 5,
|
borderRadius: 5,
|
||||||
alignSelf: "center",
|
alignSelf: "center",
|
||||||
marginVertical: 10,
|
marginVertical: 10,
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ const StackCustom: React.FC<StackProps> = ({
|
|||||||
children,
|
children,
|
||||||
align = "stretch",
|
align = "stretch",
|
||||||
justify = "flex-start",
|
justify = "flex-start",
|
||||||
gap = "xs",
|
gap = "md",
|
||||||
direction = "column",
|
direction = "column",
|
||||||
style,
|
style,
|
||||||
}) => {
|
}) => {
|
||||||
|
|||||||
@@ -89,19 +89,14 @@ const TextInputCustom = ({
|
|||||||
disabled && GStyles.disabledBox,
|
disabled && GStyles.disabledBox,
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
{iconLeft && (
|
{/* {iconLeft && (
|
||||||
<View style={GStyles.inputIcon}>{renderIcon(iconLeft)}</View>
|
<View style={GStyles.inputIcon}>{renderIcon(iconLeft)}</View>
|
||||||
)}
|
)} */}
|
||||||
<RNTextInput
|
<RNTextInput
|
||||||
style={[
|
style={[
|
||||||
GStyles.inputText,
|
GStyles.inputText,
|
||||||
{ color: fontColor },
|
{ color: fontColor },
|
||||||
disabled
|
disabled && GStyles.inputPlaceholderDisabled, // <-- placeholder saat disabled
|
||||||
? GStyles.inputTextDisabled // <-- custom style untuk text saat disabled
|
|
||||||
: GStyles.inputText,
|
|
||||||
disabled
|
|
||||||
? GStyles.inputPlaceholderDisabled // <-- placeholder saat disabled
|
|
||||||
: GStyles.inputPlaceholder,
|
|
||||||
]}
|
]}
|
||||||
editable={!disabled}
|
editable={!disabled}
|
||||||
secureTextEntry={secureTextEntry && !isPasswordVisible}
|
secureTextEntry={secureTextEntry && !isPasswordVisible}
|
||||||
|
|||||||
@@ -31,8 +31,8 @@ export default function LoginView() {
|
|||||||
console.log("login user id :", id);
|
console.log("login user id :", id);
|
||||||
|
|
||||||
// router.navigate("/verification");
|
// router.navigate("/verification");
|
||||||
router.navigate(`/(application)/(user)/profile/${id}`);
|
// router.navigate(`/(application)/(user)/profile/${id}`);
|
||||||
// router.navigate("/(application)/home");
|
router.navigate("/(application)/(user)/home");
|
||||||
// router.navigate(`/(application)/profile/${id}/edit`);
|
// router.navigate(`/(application)/profile/${id}/edit`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
35
screens/Profile/ListPage.tsx
Normal file
35
screens/Profile/ListPage.tsx
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
||||||
|
|
||||||
|
export const drawerItems = ({ id }: { id: string }): IMenuDrawerItem[] => [
|
||||||
|
{
|
||||||
|
icon: "create",
|
||||||
|
label: "Edit profile",
|
||||||
|
path: `/(application)/profile/${id}/edit`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon: "camera",
|
||||||
|
label: "Ubah foto profile",
|
||||||
|
path: `/(application)/profile/${id}/update-photo`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon: "image",
|
||||||
|
label: "Ubah latar belakang",
|
||||||
|
path: `/(application)/profile/${id}/update-background`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon: "add-circle",
|
||||||
|
label: "Tambah portofolio",
|
||||||
|
path: `/(application)/portofolio/${id}/create`,
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// icon: "settings",
|
||||||
|
// label: "Dashboard Admin",
|
||||||
|
// path: `/(application)/profile/dashboard-admin`,
|
||||||
|
// },
|
||||||
|
{ icon: "log-out", label: "Keluar", color: "red", path: "" },
|
||||||
|
{
|
||||||
|
icon: "create-outline",
|
||||||
|
label: "Create profile",
|
||||||
|
path: `/(application)/profile/${id}/create`,
|
||||||
|
},
|
||||||
|
];
|
||||||
@@ -79,6 +79,7 @@ export const GStyles = StyleSheet.create({
|
|||||||
headerTitleStyle: {
|
headerTitleStyle: {
|
||||||
color: MainColor.yellow,
|
color: MainColor.yellow,
|
||||||
fontWeight: "bold",
|
fontWeight: "bold",
|
||||||
|
fontSize: TEXT_SIZE_LARGE,
|
||||||
},
|
},
|
||||||
// =============== STACK HEADER =============== //
|
// =============== STACK HEADER =============== //
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user