feature
deskripsi: - folder take-picture
This commit is contained in:
@@ -166,6 +166,22 @@ export default function ApplicationLayout() {
|
||||
),
|
||||
}}
|
||||
/>
|
||||
|
||||
{/* Take Picture */}
|
||||
<Stack.Screen
|
||||
name="take-picture/[id]/index"
|
||||
options={{
|
||||
title: "Ambil Gambar",
|
||||
headerLeft: () => (
|
||||
<Ionicons
|
||||
name="arrow-back"
|
||||
size={20}
|
||||
color={MainColor.yellow}
|
||||
onPress={() => router.back()}
|
||||
/>
|
||||
),
|
||||
}}
|
||||
/>
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||
import { BaseBox, ButtonCustom } from "@/components";
|
||||
import ViewWrapper from "@/components/_ShareComponent/ViewWrapper";
|
||||
import ButtonUpload from "@/components/Button/ButtonUpload";
|
||||
@@ -13,7 +12,7 @@ export default function UpdateBackgroundProfile() {
|
||||
bottomBarComponent={
|
||||
<ButtonCustom
|
||||
onPress={() => {
|
||||
console.log("Simpan foto");
|
||||
console.log("Simpan foto background >>", id);
|
||||
router.back();
|
||||
}}
|
||||
>
|
||||
@@ -32,8 +31,9 @@ export default function UpdateBackgroundProfile() {
|
||||
</BaseBox>
|
||||
|
||||
<ButtonUpload
|
||||
title="Update"
|
||||
onPress={() =>
|
||||
router.navigate("/(application)/profile/[id]/take-picture")
|
||||
router.navigate(`/(application)/take-picture/${id}`)
|
||||
}
|
||||
/>
|
||||
</ViewWrapper>
|
||||
|
||||
@@ -12,7 +12,7 @@ export default function UpdatePhotoProfile() {
|
||||
bottomBarComponent={
|
||||
<ButtonCustom
|
||||
onPress={() => {
|
||||
console.log("Simpan foto");
|
||||
console.log("Simpan foto profile >>", id);
|
||||
router.back();
|
||||
}}
|
||||
>
|
||||
@@ -31,9 +31,10 @@ export default function UpdatePhotoProfile() {
|
||||
</BaseBox>
|
||||
|
||||
<ButtonUpload
|
||||
title="Update"
|
||||
onPress={() => {
|
||||
console.log("ID >>", id);
|
||||
router.navigate("/(application)/profile/[id]/take-picture");
|
||||
console.log("Update photo >>", id);
|
||||
router.navigate(`/(application)/take-picture/${id}`);
|
||||
}}
|
||||
/>
|
||||
</ViewWrapper>
|
||||
|
||||
@@ -24,14 +24,6 @@ export default function ProfileLayout() {
|
||||
name="[id]/update-background"
|
||||
options={{ title: "Update Latar Belakang" }}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="[id]/take-picture"
|
||||
options={{ title: "Ambil Foto" }}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="[id]/take-picture2"
|
||||
options={{ title: "Ambil Foto 2" }}
|
||||
/>
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -9,11 +9,14 @@ import FontAwesome6 from "@expo/vector-icons/FontAwesome6";
|
||||
import { CameraType, CameraView, useCameraPermissions } from "expo-camera";
|
||||
import { Image } from "expo-image";
|
||||
import * as ImagePicker from "expo-image-picker";
|
||||
import { router } from "expo-router";
|
||||
import { router, useLocalSearchParams } from "expo-router";
|
||||
import { useRef, useState } from "react";
|
||||
import { Pressable, StyleSheet, Text, View } from "react-native";
|
||||
|
||||
export default function TakePictureProfile() {
|
||||
export default function TakePicture() {
|
||||
const { id } = useLocalSearchParams();
|
||||
// console.log("Take Picture ID >>", id);
|
||||
|
||||
const [permission, requestPermission] = useCameraPermissions();
|
||||
const ref = useRef<CameraView>(null);
|
||||
const [uri, setUri] = useState<string | null>(null);
|
||||
@@ -68,10 +71,10 @@ export default function TakePictureProfile() {
|
||||
<ButtonCustom onPress={() => setUri(null)} title="Foto ulang" />
|
||||
<ButtonCustom
|
||||
onPress={() => {
|
||||
console.log("Update foto");
|
||||
console.log("Upload picture >>", id);
|
||||
router.back();
|
||||
}}
|
||||
title="Update Foto"
|
||||
title="Upload Foto"
|
||||
/>
|
||||
</StackCustom>
|
||||
</View>
|
||||
Reference in New Issue
Block a user