diff --git a/app/(application)/profile/[id]/edit.tsx b/app/(application)/profile/[id]/edit.tsx index cdfe797..d4d3ef4 100644 --- a/app/(application)/profile/[id]/edit.tsx +++ b/app/(application)/profile/[id]/edit.tsx @@ -1,17 +1,64 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ -import { TextInputCustom, ViewWrapper } from "@/components"; -import { StackCustom } from "@/components/Stack"; +import { + ButtonCustom, + StackCustom, + TextCustom, + TextInputCustom, + ViewWrapper, +} from "@/components"; import { useLocalSearchParams } from "expo-router"; +import { useState } from "react"; +import { Text } from "react-native"; export default function ProfileEdit() { const { id } = useLocalSearchParams(); + + const [nama, setNama] = useState("Bagas Banuna"); + const [email, setEmail] = useState("bagasbanuna@gmail.com"); + const [alamat, setAlamat] = useState("Bandar Lampung"); + return ( - - - - - - + { + console.log("data >>", nama, email, alamat); + }} + > + Simpan + + } + > + + { + setNama(text); + }} + required + /> + { + setEmail(text); + }} + required + /> + { + setAlamat(text); + }} + required + /> ); diff --git a/components/Button/ButtonCustom.tsx b/components/Button/ButtonCustom.tsx index fc36720..bdfc553 100644 --- a/components/Button/ButtonCustom.tsx +++ b/components/Button/ButtonCustom.tsx @@ -3,11 +3,13 @@ import React from "react"; import { Text, TouchableOpacity } from "react-native"; import buttonStyles from "./buttonCustomStyles"; +import { RADIUS_BUTTON } from "@/constants/constans-value"; // Definisi props dengan TypeScript interface ButtonProps { - onPress: () => void; + children?: React.ReactNode; + onPress?: () => void; title?: string; backgroundColor?: string; textColor?: string; @@ -28,6 +30,7 @@ interface ButtonProps { * @example iconLeft={ */ const ButtonCustom: React.FC = ({ + children, onPress, title = "Button", backgroundColor = "#007AFF", @@ -39,7 +42,7 @@ const ButtonCustom: React.FC = ({ const styles = buttonStyles({ backgroundColor, textColor, - borderRadius: radius, + borderRadius: RADIUS_BUTTON || radius, }); return ( @@ -51,7 +54,7 @@ const ButtonCustom: React.FC = ({ > {/* Render icon jika tersedia */} {iconLeft && iconLeft} - {title} + {children} ); }; diff --git a/components/Stack/index.ts b/components/Stack/index.ts deleted file mode 100644 index de28ada..0000000 --- a/components/Stack/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import StackCustom from "./StackCustom"; - -export { StackCustom }; diff --git a/components/Text/TextCustom.tsx b/components/Text/TextCustom.tsx index 7b0c496..47ac145 100644 --- a/components/Text/TextCustom.tsx +++ b/components/Text/TextCustom.tsx @@ -11,7 +11,7 @@ import { Text as RNText, StyleProp, StyleSheet, TextStyle } from "react-native"; type TextAlign = "left" | "center" | "right"; interface TextCustomProps { - children: string; + children: string | React.ReactNode; style?: StyleProp; bold?: boolean; semiBold?: boolean; diff --git a/components/_ShareComponent/ViewWrapper.tsx b/components/_ShareComponent/ViewWrapper.tsx index 3f7ced4..a85dd27 100644 --- a/components/_ShareComponent/ViewWrapper.tsx +++ b/components/_ShareComponent/ViewWrapper.tsx @@ -7,12 +7,14 @@ interface ViewWrapperProps { children: React.ReactNode; withBackground?: boolean; tabBarComponent?: React.ReactNode; + bottomBarComponent?: React.ReactNode; } const ViewWrapper = ({ children, withBackground = false, tabBarComponent, + bottomBarComponent, }: ViewWrapperProps) => { const assetBackground = require("../../assets/images/main-background.png"); @@ -42,10 +44,17 @@ const ViewWrapper = ({ {children} )} - {tabBarComponent} + {tabBarComponent ? tabBarComponent : null} + {bottomBarComponent ? ( + + + {bottomBarComponent} + + + ) : null} - + // //