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>
|
</Stack>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
||||||
import { BaseBox, ButtonCustom } from "@/components";
|
import { BaseBox, ButtonCustom } from "@/components";
|
||||||
import ViewWrapper from "@/components/_ShareComponent/ViewWrapper";
|
import ViewWrapper from "@/components/_ShareComponent/ViewWrapper";
|
||||||
import ButtonUpload from "@/components/Button/ButtonUpload";
|
import ButtonUpload from "@/components/Button/ButtonUpload";
|
||||||
@@ -13,7 +12,7 @@ export default function UpdateBackgroundProfile() {
|
|||||||
bottomBarComponent={
|
bottomBarComponent={
|
||||||
<ButtonCustom
|
<ButtonCustom
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
console.log("Simpan foto");
|
console.log("Simpan foto background >>", id);
|
||||||
router.back();
|
router.back();
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -32,8 +31,9 @@ export default function UpdateBackgroundProfile() {
|
|||||||
</BaseBox>
|
</BaseBox>
|
||||||
|
|
||||||
<ButtonUpload
|
<ButtonUpload
|
||||||
|
title="Update"
|
||||||
onPress={() =>
|
onPress={() =>
|
||||||
router.navigate("/(application)/profile/[id]/take-picture")
|
router.navigate(`/(application)/take-picture/${id}`)
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</ViewWrapper>
|
</ViewWrapper>
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ export default function UpdatePhotoProfile() {
|
|||||||
bottomBarComponent={
|
bottomBarComponent={
|
||||||
<ButtonCustom
|
<ButtonCustom
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
console.log("Simpan foto");
|
console.log("Simpan foto profile >>", id);
|
||||||
router.back();
|
router.back();
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -31,9 +31,10 @@ export default function UpdatePhotoProfile() {
|
|||||||
</BaseBox>
|
</BaseBox>
|
||||||
|
|
||||||
<ButtonUpload
|
<ButtonUpload
|
||||||
|
title="Update"
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
console.log("ID >>", id);
|
console.log("Update photo >>", id);
|
||||||
router.navigate("/(application)/profile/[id]/take-picture");
|
router.navigate(`/(application)/take-picture/${id}`);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</ViewWrapper>
|
</ViewWrapper>
|
||||||
|
|||||||
@@ -24,14 +24,6 @@ export default function ProfileLayout() {
|
|||||||
name="[id]/update-background"
|
name="[id]/update-background"
|
||||||
options={{ title: "Update Latar Belakang" }}
|
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>
|
</Stack>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -9,11 +9,14 @@ import FontAwesome6 from "@expo/vector-icons/FontAwesome6";
|
|||||||
import { CameraType, CameraView, useCameraPermissions } from "expo-camera";
|
import { CameraType, CameraView, useCameraPermissions } from "expo-camera";
|
||||||
import { Image } from "expo-image";
|
import { Image } from "expo-image";
|
||||||
import * as ImagePicker from "expo-image-picker";
|
import * as ImagePicker from "expo-image-picker";
|
||||||
import { router } from "expo-router";
|
import { router, useLocalSearchParams } from "expo-router";
|
||||||
import { useRef, useState } from "react";
|
import { useRef, useState } from "react";
|
||||||
import { Pressable, StyleSheet, Text, View } from "react-native";
|
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 [permission, requestPermission] = useCameraPermissions();
|
||||||
const ref = useRef<CameraView>(null);
|
const ref = useRef<CameraView>(null);
|
||||||
const [uri, setUri] = useState<string | null>(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={() => setUri(null)} title="Foto ulang" />
|
||||||
<ButtonCustom
|
<ButtonCustom
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
console.log("Update foto");
|
console.log("Upload picture >>", id);
|
||||||
router.back();
|
router.back();
|
||||||
}}
|
}}
|
||||||
title="Update Foto"
|
title="Upload Foto"
|
||||||
/>
|
/>
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
</View>
|
</View>
|
||||||
@@ -30,8 +30,8 @@ export default function LoginView() {
|
|||||||
const id = randomAlfabet + randomNumber + fixNumber;
|
const id = randomAlfabet + randomNumber + fixNumber;
|
||||||
console.log("user id :", id);
|
console.log("user id :", id);
|
||||||
|
|
||||||
router.navigate("/verification");
|
// router.navigate("/verification");
|
||||||
// router.navigate(`/(application)/profile/${id}`);
|
router.navigate(`/(application)/profile/${id}`);
|
||||||
// router.navigate("/(application)/home");
|
// router.navigate("/(application)/home");
|
||||||
// router.navigate(`/(application)/profile/${id}/edit`);
|
// router.navigate(`/(application)/profile/${id}/edit`);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user