feature & fix
deskripsi: - new component Clickable - new folder (image) untuk take picture dan imaga preview - fix klik gambar # No Issue
This commit is contained in:
9
app/(application)/(image)/preview-image/[id]/index.tsx
Normal file
9
app/(application)/(image)/preview-image/[id]/index.tsx
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
import { LandscapeFrameUploaded, ViewWrapper } from "@/components";
|
||||||
|
|
||||||
|
export default function PreviewImage() {
|
||||||
|
return (
|
||||||
|
<ViewWrapper>
|
||||||
|
<LandscapeFrameUploaded />
|
||||||
|
</ViewWrapper>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
import { MainColor } from "@/constants/color-palet";
|
import { BackButton } from "@/components";
|
||||||
import { HeaderStyles } from "@/styles/header-styles";
|
import { HeaderStyles } from "@/styles/header-styles";
|
||||||
import { Ionicons } from "@expo/vector-icons";
|
import { Stack } from "expo-router";
|
||||||
import { router, Stack } from "expo-router";
|
|
||||||
|
|
||||||
export default function ApplicationLayout() {
|
export default function ApplicationLayout() {
|
||||||
return (
|
return (
|
||||||
@@ -11,17 +10,19 @@ export default function ApplicationLayout() {
|
|||||||
|
|
||||||
{/* Take Picture */}
|
{/* Take Picture */}
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="take-picture/[id]/index"
|
name="(image)/take-picture/[id]/index"
|
||||||
options={{
|
options={{
|
||||||
title: "Ambil Gambar",
|
title: "Ambil Gambar",
|
||||||
headerLeft: () => (
|
headerLeft: () => <BackButton />,
|
||||||
<Ionicons
|
}}
|
||||||
name="arrow-back"
|
|
||||||
size={20}
|
|
||||||
color={MainColor.yellow}
|
|
||||||
onPress={() => router.back()}
|
|
||||||
/>
|
/>
|
||||||
),
|
|
||||||
|
{/* Preview Image */}
|
||||||
|
<Stack.Screen
|
||||||
|
name="(image)/preview-image/[id]/index"
|
||||||
|
options={{
|
||||||
|
title: "Preview Gambar",
|
||||||
|
headerLeft: () => <BackButton />,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|||||||
36
components/Clickable/ClickableCustom.tsx
Normal file
36
components/Clickable/ClickableCustom.tsx
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
import { StyleSheet, TouchableOpacity } from "react-native";
|
||||||
|
|
||||||
|
export default function ClickableCustom({
|
||||||
|
children,
|
||||||
|
onPress,
|
||||||
|
disabled,
|
||||||
|
style,
|
||||||
|
...props
|
||||||
|
}: {
|
||||||
|
children: React.ReactNode;
|
||||||
|
onPress: () => void;
|
||||||
|
disabled?: boolean;
|
||||||
|
style?: any;
|
||||||
|
[key: string]: any;
|
||||||
|
}) {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<TouchableOpacity
|
||||||
|
activeOpacity={0.7}
|
||||||
|
onPress={onPress}
|
||||||
|
disabled={disabled}
|
||||||
|
style={[styles.container, style]}
|
||||||
|
{...props}
|
||||||
|
>
|
||||||
|
{children}
|
||||||
|
</TouchableOpacity>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
container: {
|
||||||
|
width: "100%",
|
||||||
|
height: "auto",
|
||||||
|
},
|
||||||
|
});
|
||||||
@@ -33,16 +33,22 @@ import LandscapeFrameUploaded from "./Image/LandscapeFrameUploaded";
|
|||||||
import DividerCustom from "./Divider/DividerCustom";
|
import DividerCustom from "./Divider/DividerCustom";
|
||||||
// Map
|
// Map
|
||||||
import MapCustom from "./Map/MapCustom";
|
import MapCustom from "./Map/MapCustom";
|
||||||
|
// Center
|
||||||
|
import CenterCustom from "./Center/CenterCustom";
|
||||||
|
// Clickable
|
||||||
|
import ClickableCustom from "./Clickable/ClickableCustom";
|
||||||
|
|
||||||
export {
|
export {
|
||||||
AlertCustom,
|
AlertCustom,
|
||||||
// Image
|
// Image
|
||||||
AvatarCustom,
|
AvatarCustom,
|
||||||
LeftButtonCustom as BackButton,
|
LandscapeFrameUploaded,
|
||||||
// Box
|
// Box
|
||||||
BaseBox,
|
BaseBox,
|
||||||
BoxButtonOnFooter,
|
BoxButtonOnFooter,
|
||||||
ButtonCenteredOnly,
|
ButtonCenteredOnly,
|
||||||
|
InformationBox,
|
||||||
|
LeftButtonCustom as BackButton,
|
||||||
// Button
|
// Button
|
||||||
ButtonCustom,
|
ButtonCustom,
|
||||||
// Drawer
|
// Drawer
|
||||||
@@ -50,8 +56,6 @@ export {
|
|||||||
MenuDrawerDynamicGrid,
|
MenuDrawerDynamicGrid,
|
||||||
// Grid
|
// Grid
|
||||||
Grid,
|
Grid,
|
||||||
InformationBox,
|
|
||||||
LandscapeFrameUploaded,
|
|
||||||
// Map
|
// Map
|
||||||
MapCustom,
|
MapCustom,
|
||||||
// Select
|
// Select
|
||||||
@@ -70,4 +74,8 @@ export {
|
|||||||
ViewWrapper,
|
ViewWrapper,
|
||||||
// Divider
|
// Divider
|
||||||
DividerCustom,
|
DividerCustom,
|
||||||
|
// Center
|
||||||
|
CenterCustom,
|
||||||
|
// Clickable
|
||||||
|
ClickableCustom,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ export default function LoginView() {
|
|||||||
// router.navigate("/(application)/(user)/home");
|
// router.navigate("/(application)/(user)/home");
|
||||||
// router.navigate(`/(application)/profile/${id}/edit`);
|
// router.navigate(`/(application)/profile/${id}/edit`);
|
||||||
// router.navigate(`/(application)/(user)/portofolio/${id}`)
|
// router.navigate(`/(application)/(user)/portofolio/${id}`)
|
||||||
|
// router.navigate(`/(application)/(image)/preview-image/${id}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
import {
|
import {
|
||||||
AvatarCustom,
|
AvatarCustom,
|
||||||
BaseBox,
|
BaseBox,
|
||||||
|
CenterCustom,
|
||||||
|
ClickableCustom,
|
||||||
Grid,
|
Grid,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
TextCustom,
|
TextCustom,
|
||||||
@@ -9,7 +11,7 @@ import DividerCustom from "@/components/Divider/DividerCustom";
|
|||||||
import { AccentColor } from "@/constants/color-palet";
|
import { AccentColor } from "@/constants/color-palet";
|
||||||
import { ICON_SIZE_SMALL } from "@/constants/constans-value";
|
import { ICON_SIZE_SMALL } from "@/constants/constans-value";
|
||||||
import { FontAwesome, Ionicons } from "@expo/vector-icons";
|
import { FontAwesome, Ionicons } from "@expo/vector-icons";
|
||||||
import { useLocalSearchParams } from "expo-router";
|
import { router, useLocalSearchParams } from "expo-router";
|
||||||
import { View } from "react-native";
|
import { View } from "react-native";
|
||||||
|
|
||||||
export default function Portofolio_Data() {
|
export default function Portofolio_Data() {
|
||||||
@@ -88,9 +90,26 @@ export default function Portofolio_Data() {
|
|||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<View style={{ alignItems: "center" }}>
|
{/* <ClickableCustom
|
||||||
|
style={{ backgroundColor: "blue" }}
|
||||||
|
onPress={() => {
|
||||||
|
router.navigate(`/(application)/(image)/preview-image/${id}`);
|
||||||
|
}}
|
||||||
|
>
|
||||||
<AvatarCustom size="xl" />
|
<AvatarCustom size="xl" />
|
||||||
</View>
|
</ClickableCustom> */}
|
||||||
|
|
||||||
|
<ClickableCustom
|
||||||
|
style={{}}
|
||||||
|
onPress={() => {
|
||||||
|
router.navigate(`/(application)/(image)/preview-image/${id}`);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<CenterCustom>
|
||||||
|
<AvatarCustom size="xl" />
|
||||||
|
</CenterCustom>
|
||||||
|
</ClickableCustom>
|
||||||
|
|
||||||
{/* <Spacing height={10}/> */}
|
{/* <Spacing height={10}/> */}
|
||||||
|
|
||||||
<View>
|
<View>
|
||||||
|
|||||||
@@ -1,24 +1,45 @@
|
|||||||
import { AvatarCustom } from "@/components";
|
import { AvatarCustom, ClickableCustom } from "@/components";
|
||||||
import { AccentColor } from "@/constants/color-palet";
|
import { AccentColor } from "@/constants/color-palet";
|
||||||
import DUMMY_IMAGE from "@/constants/dummy-image-value";
|
import DUMMY_IMAGE from "@/constants/dummy-image-value";
|
||||||
import { View, ImageBackground, StyleSheet } from "react-native";
|
import { router } from "expo-router";
|
||||||
|
import { ImageBackground, StyleSheet, View } from "react-native";
|
||||||
|
|
||||||
const AvatarAndBackground = () => {
|
const AvatarAndBackground = ({
|
||||||
|
backgroundId,
|
||||||
|
imageId,
|
||||||
|
}: {
|
||||||
|
backgroundId: string;
|
||||||
|
imageId: string;
|
||||||
|
}) => {
|
||||||
return (
|
return (
|
||||||
<View style={styles.container}>
|
<View style={styles.container}>
|
||||||
|
{/* Background Image */}
|
||||||
|
<ClickableCustom
|
||||||
|
onPress={() => {
|
||||||
|
router.navigate(
|
||||||
|
`/(application)/(image)/preview-image/${backgroundId}`
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
>
|
||||||
<ImageBackground
|
<ImageBackground
|
||||||
source={DUMMY_IMAGE.background}
|
source={DUMMY_IMAGE.background}
|
||||||
style={styles.backgroundImage}
|
style={styles.backgroundImage}
|
||||||
resizeMode="contain"
|
resizeMode="cover"
|
||||||
/>
|
/>
|
||||||
{/* Background Image */}
|
</ClickableCustom>
|
||||||
|
|
||||||
{/* Avatar yang sedikit keluar */}
|
{/* Avatar yang sedikit keluar */}
|
||||||
|
|
||||||
<View style={styles.avatarOverlap}>
|
<View style={styles.avatarOverlap}>
|
||||||
<AvatarCustom
|
<ClickableCustom
|
||||||
source={DUMMY_IMAGE.avatar}
|
onPress={() => {
|
||||||
size="lg"
|
router.navigate(
|
||||||
/>
|
`/(application)/(image)/preview-image/${imageId}`
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<AvatarCustom source={DUMMY_IMAGE.avatar} size="lg" />
|
||||||
|
</ClickableCustom>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ export default function ProfilSection() {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<BaseBox>
|
<BaseBox>
|
||||||
<AvatarAndBackground />
|
<AvatarAndBackground backgroundId="test-background-id" imageId="test-image-id" />
|
||||||
<Spacing height={50} />
|
<Spacing height={50} />
|
||||||
|
|
||||||
<View style={{ alignItems: "center" }}>
|
<View style={{ alignItems: "center" }}>
|
||||||
|
|||||||
Reference in New Issue
Block a user