Feature:
Add: - Component alert system - Page collaboration Id Fix: - Box base - Menu drawer dibuatkan interface # No Issue '
This commit is contained in:
@@ -114,7 +114,7 @@ export default function UserLayout() {
|
|||||||
name="collaboration/(tabs)"
|
name="collaboration/(tabs)"
|
||||||
options={{
|
options={{
|
||||||
title: "Collaboration",
|
title: "Collaboration",
|
||||||
headerLeft: () => <BackButton />,
|
headerLeft: () => <BackButton path="/home" />,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
@@ -124,6 +124,13 @@ export default function UserLayout() {
|
|||||||
headerLeft: () => <BackButton />,
|
headerLeft: () => <BackButton />,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
<Stack.Screen
|
||||||
|
name="collaboration/[id]/list-of-participants"
|
||||||
|
options={{
|
||||||
|
title: "Daftar Partisipan",
|
||||||
|
headerLeft: () => <BackButton />,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
|
||||||
{/* ========== End Collaboration Section ========= */}
|
{/* ========== End Collaboration Section ========= */}
|
||||||
|
|
||||||
|
|||||||
@@ -1,29 +1,28 @@
|
|||||||
import {
|
import { FloatingButton, ViewWrapper } from "@/components";
|
||||||
FloatingButton,
|
|
||||||
ViewWrapper
|
|
||||||
} from "@/components";
|
|
||||||
import Collaboration_BoxPublishSection from "@/screens/Collaboration/BoxPublishSection";
|
import Collaboration_BoxPublishSection from "@/screens/Collaboration/BoxPublishSection";
|
||||||
import { router } from "expo-router";
|
import { router } from "expo-router";
|
||||||
|
|
||||||
export default function CollaborationBeranda() {
|
export default function CollaborationBeranda() {
|
||||||
return (
|
return (
|
||||||
<ViewWrapper
|
<>
|
||||||
hideFooter
|
<ViewWrapper
|
||||||
floatingButton={
|
hideFooter
|
||||||
<FloatingButton
|
floatingButton={
|
||||||
onPress={() => {
|
<FloatingButton
|
||||||
router.push("/collaboration/create")
|
onPress={() => {
|
||||||
}}
|
router.push("/collaboration/create");
|
||||||
/>
|
}}
|
||||||
}
|
/>
|
||||||
>
|
}
|
||||||
{Array.from({ length: 10 }).map((_, index) => (
|
>
|
||||||
<Collaboration_BoxPublishSection
|
{Array.from({ length: 10 }).map((_, index) => (
|
||||||
key={index}
|
<Collaboration_BoxPublishSection
|
||||||
id={index.toString()}
|
key={index}
|
||||||
href={`/collaboration`}
|
id={index.toString()}
|
||||||
/>
|
href={`/collaboration/${index}`}
|
||||||
))}
|
/>
|
||||||
</ViewWrapper>
|
))}
|
||||||
|
</ViewWrapper>
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
136
app/(application)/(user)/collaboration/[id]/index.tsx
Normal file
136
app/(application)/(user)/collaboration/[id]/index.tsx
Normal file
@@ -0,0 +1,136 @@
|
|||||||
|
import {
|
||||||
|
AlertDefaultSystem,
|
||||||
|
AvatarUsernameAndOtherComponent,
|
||||||
|
BackButton,
|
||||||
|
BoxWithHeaderSection,
|
||||||
|
ButtonCustom,
|
||||||
|
DotButton,
|
||||||
|
DrawerCustom,
|
||||||
|
Grid,
|
||||||
|
MenuDrawerDynamicGrid,
|
||||||
|
Spacing,
|
||||||
|
StackCustom,
|
||||||
|
TextAreaCustom,
|
||||||
|
TextCustom,
|
||||||
|
ViewWrapper
|
||||||
|
} from "@/components";
|
||||||
|
import { Ionicons } from "@expo/vector-icons";
|
||||||
|
import { router, Stack, useLocalSearchParams } from "expo-router";
|
||||||
|
import { useState } from "react";
|
||||||
|
|
||||||
|
export default function CollaborationDetail() {
|
||||||
|
const { id } = useLocalSearchParams();
|
||||||
|
const [openDrawerPartisipasi, setOpenDrawerPartisipasi] = useState(false);
|
||||||
|
const [openDrawerMenu, setOpenDrawerMenu] = useState(false);
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Stack.Screen
|
||||||
|
options={{
|
||||||
|
title: "Detail Proyek",
|
||||||
|
headerLeft: () => <BackButton />,
|
||||||
|
headerRight: () => (
|
||||||
|
<DotButton onPress={() => setOpenDrawerMenu(true)} />
|
||||||
|
),
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<ViewWrapper>
|
||||||
|
<BoxWithHeaderSection>
|
||||||
|
<AvatarUsernameAndOtherComponent />
|
||||||
|
<Spacing />
|
||||||
|
<StackCustom>
|
||||||
|
<TextCustom align="center" bold size="large">
|
||||||
|
Judul Proyek {id}
|
||||||
|
</TextCustom>
|
||||||
|
<Spacing height={0} />
|
||||||
|
{listData.map((item, index) => (
|
||||||
|
<Grid key={index}>
|
||||||
|
<Grid.Col span={4}>
|
||||||
|
<TextCustom bold>{item.title}</TextCustom>
|
||||||
|
</Grid.Col>
|
||||||
|
<Grid.Col span={8}>
|
||||||
|
<TextCustom>{item.value}</TextCustom>
|
||||||
|
</Grid.Col>
|
||||||
|
</Grid>
|
||||||
|
))}
|
||||||
|
</StackCustom>
|
||||||
|
</BoxWithHeaderSection>
|
||||||
|
|
||||||
|
<ButtonCustom onPress={() => setOpenDrawerPartisipasi(true)}>
|
||||||
|
Partisipasi
|
||||||
|
</ButtonCustom>
|
||||||
|
</ViewWrapper>
|
||||||
|
|
||||||
|
{/* Drawer Partisipasi */}
|
||||||
|
<DrawerCustom
|
||||||
|
isVisible={openDrawerPartisipasi}
|
||||||
|
closeDrawer={() => setOpenDrawerPartisipasi(false)}
|
||||||
|
height={300}
|
||||||
|
>
|
||||||
|
<TextAreaCustom
|
||||||
|
label="Dekripsi diri"
|
||||||
|
placeholder="Masukan dekripsi diri"
|
||||||
|
required
|
||||||
|
showCount
|
||||||
|
maxLength={500}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<ButtonCustom
|
||||||
|
style={{ alignSelf: "flex-end" }}
|
||||||
|
onPress={() => {
|
||||||
|
AlertDefaultSystem({
|
||||||
|
title: "Simpan data deskripsi",
|
||||||
|
message: "Apakah anda sudah yakin ingin menyimpan data ini ?",
|
||||||
|
textLeft: "Batal",
|
||||||
|
textRight: "Simpan",
|
||||||
|
onPressRight: () => router.replace(`/collaboration/(tabs)/group`),
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Simpan
|
||||||
|
</ButtonCustom>
|
||||||
|
</DrawerCustom>
|
||||||
|
|
||||||
|
{/* Drawer Menu */}
|
||||||
|
<DrawerCustom
|
||||||
|
isVisible={openDrawerMenu}
|
||||||
|
closeDrawer={() => setOpenDrawerMenu(false)}
|
||||||
|
height={250}
|
||||||
|
>
|
||||||
|
<MenuDrawerDynamicGrid
|
||||||
|
data={[
|
||||||
|
{
|
||||||
|
icon: <Ionicons name="people" size={24} color="white" />,
|
||||||
|
label: "Daftar Partisipan",
|
||||||
|
path: `/collaboration/${id}/list-of-participants`,
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
onPressItem={(item) => {
|
||||||
|
router.push(item.path as any);
|
||||||
|
setOpenDrawerMenu(false);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</DrawerCustom>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const listData = [
|
||||||
|
{
|
||||||
|
title: "Industri",
|
||||||
|
value: "Pilihan Industri",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Deskripsi",
|
||||||
|
value: "Deskripsi Proyek",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Tujuan Proyek",
|
||||||
|
value:
|
||||||
|
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: "Keuntungan Proyek",
|
||||||
|
value:
|
||||||
|
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
|
||||||
|
},
|
||||||
|
];
|
||||||
@@ -0,0 +1,80 @@
|
|||||||
|
import {
|
||||||
|
AvatarUsernameAndOtherComponent,
|
||||||
|
BaseBox,
|
||||||
|
DrawerCustom,
|
||||||
|
Spacing,
|
||||||
|
StackCustom,
|
||||||
|
TextCustom,
|
||||||
|
ViewWrapper
|
||||||
|
} from "@/components";
|
||||||
|
import { Feather } from "@expo/vector-icons";
|
||||||
|
import { useLocalSearchParams } from "expo-router";
|
||||||
|
import { useState } from "react";
|
||||||
|
import { ScrollView } from "react-native";
|
||||||
|
|
||||||
|
export default function CollaborationListOfParticipants() {
|
||||||
|
const { id } = useLocalSearchParams();
|
||||||
|
const [openDrawer, setOpenDrawer] = useState(false);
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<ViewWrapper>
|
||||||
|
{Array.from({ length: 10 }).map((_, index) => (
|
||||||
|
<BaseBox key={index} paddingBlock={5}>
|
||||||
|
<AvatarUsernameAndOtherComponent
|
||||||
|
avatarHref={`/profile/${id}`}
|
||||||
|
rightComponent={
|
||||||
|
<Feather
|
||||||
|
name="chevron-right"
|
||||||
|
size={24}
|
||||||
|
color="white"
|
||||||
|
onPress={() => setOpenDrawer(true)}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</BaseBox>
|
||||||
|
))}
|
||||||
|
</ViewWrapper>
|
||||||
|
|
||||||
|
{/* Drawer */}
|
||||||
|
<DrawerCustom
|
||||||
|
isVisible={openDrawer}
|
||||||
|
closeDrawer={() => setOpenDrawer(false)}
|
||||||
|
>
|
||||||
|
<StackCustom>
|
||||||
|
<TextCustom bold>Deskripsi diri</TextCustom>
|
||||||
|
<ScrollView style={{ height: "80%" }}>
|
||||||
|
<TextCustom>
|
||||||
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
|
||||||
|
eiusmod tempor incididunt ut labore et dolore magna aliqua. Lorem
|
||||||
|
ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
|
||||||
|
tempor incididunt ut labore et dolore magna aliqua.Lorem ipsum
|
||||||
|
dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
|
||||||
|
incididunt ut labore et dolore magna aliqua.Lorem ipsum dolor sit
|
||||||
|
amet, consectetur adipiscing elit, sed do eiusmod tempor
|
||||||
|
incididunt ut labore et dolore magna aliqua.Lorem ipsum dolor sit
|
||||||
|
amet, consectetur adipiscing elit, sed do eiusmod tempor
|
||||||
|
incididunt ut iqua.Lorem ipsum dolor sit amet, consectetur
|
||||||
|
adipiscing elit, sed do eiusmod tempor incididunt ut labore et
|
||||||
|
dolore magna aliqua.Lorem ipsum dolor sit amet, consectetur
|
||||||
|
adipiscing elit, sed do eiusmod tempor incididunt ut labore et
|
||||||
|
dolore magna aliqua.Lorem ipsum dolor sit amet, consectetur
|
||||||
|
adipiscing elit, sed do eiusmod tempor incididunt ut labore et
|
||||||
|
dolore magna aliqua.Lorem ipsum dolor sit amet, consectetur
|
||||||
|
adipiscing elit, sed do eiusmod tempor incididunt ut labore et
|
||||||
|
dolore magna aliqua.Lorem ipsum dolor sit amet, consectetur
|
||||||
|
adipiscing elit, sed do eiusmod tempor incididunt ut labore et
|
||||||
|
dolore magna aliqua.Lorem ipsum dolor sit amet, consectetur
|
||||||
|
adipiscing elit, sed do eiusmod tempor incididunt ut labore et
|
||||||
|
dolore magna aliqua.Lorem ipsum dolor sit amet, consectetur
|
||||||
|
adipiscing elit, sed do eiusmod tempor incididunt ut labore et
|
||||||
|
dolore magna aliqua.Lorem ipsum dolor sit amet, consectetur
|
||||||
|
adipiscing elit, sed do eiusmod tempor incididunt ut labore et
|
||||||
|
dolore magna aliqua.
|
||||||
|
</TextCustom>
|
||||||
|
</ScrollView>
|
||||||
|
<Spacing />
|
||||||
|
</StackCustom>
|
||||||
|
</DrawerCustom>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
31
components/Alert/AlertDefaultSystem.ts
Normal file
31
components/Alert/AlertDefaultSystem.ts
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
import { Alert } from "react-native";
|
||||||
|
|
||||||
|
export default function AlertDefaultSystem({
|
||||||
|
title,
|
||||||
|
message,
|
||||||
|
textLeft,
|
||||||
|
textRight,
|
||||||
|
onPressLeft,
|
||||||
|
onPressRight,
|
||||||
|
}: {
|
||||||
|
title: string;
|
||||||
|
message: string;
|
||||||
|
textLeft: string;
|
||||||
|
textRight: string;
|
||||||
|
onPressLeft?: () => void;
|
||||||
|
onPressRight?: () => void;
|
||||||
|
}) {
|
||||||
|
return Alert.alert(title, message, [
|
||||||
|
{
|
||||||
|
style: "cancel",
|
||||||
|
text: textLeft,
|
||||||
|
onPress: () => onPressLeft?.(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
style: "default",
|
||||||
|
text: textRight,
|
||||||
|
isPreferred: true,
|
||||||
|
onPress: () => onPressRight?.(),
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
}
|
||||||
@@ -12,7 +12,7 @@ export default function BoxWithHeaderSection({
|
|||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<BaseBox href={href} onPress={onPress} paddingTop={5}>
|
<BaseBox href={href} onPress={onPress} style={{ paddingTop: 5 }}>
|
||||||
{children}
|
{children}
|
||||||
</BaseBox>
|
</BaseBox>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -2,13 +2,26 @@ import { AccentColor, MainColor } from "@/constants/color-palet";
|
|||||||
import { TEXT_SIZE_SMALL } from "@/constants/constans-value";
|
import { TEXT_SIZE_SMALL } from "@/constants/constans-value";
|
||||||
import { StyleSheet, Text, TouchableOpacity, View } from "react-native";
|
import { StyleSheet, Text, TouchableOpacity, View } from "react-native";
|
||||||
import { IMenuDrawerItem } from "../_Interface/types";
|
import { IMenuDrawerItem } from "../_Interface/types";
|
||||||
|
import { Href } from "expo-router";
|
||||||
|
|
||||||
const MenuDrawerDynamicGrid = ({ data, columns = 3, onPressItem }: any) => {
|
type IMenuDrawerItemProps = {
|
||||||
|
icon: React.ReactNode;
|
||||||
|
label: string;
|
||||||
|
path?: Href;
|
||||||
|
color?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface MenuDrawerDynamicGridProps {
|
||||||
|
data: IMenuDrawerItemProps[];
|
||||||
|
columns?: number;
|
||||||
|
onPressItem?: (item: IMenuDrawerItemProps) => void;
|
||||||
|
}
|
||||||
|
const MenuDrawerDynamicGrid = ({ data, columns = 4, onPressItem }: MenuDrawerDynamicGridProps) => {
|
||||||
const numColumns = columns;
|
const numColumns = columns;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={styles.container}>
|
<View style={styles.container}>
|
||||||
{data.map((item: IMenuDrawerItem, index: any) => (
|
{data.map((item: IMenuDrawerItemProps, index: any) => (
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
key={index}
|
key={index}
|
||||||
style={[styles.itemContainer, { flexBasis: `${100 / numColumns}%` }]}
|
style={[styles.itemContainer, { flexBasis: `${100 / numColumns}%` }]}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
// Alert
|
// Alert
|
||||||
import AlertCustom from "./Alert/AlertCustom";
|
import AlertCustom from "./Alert/AlertCustom";
|
||||||
|
import AlertDefaultSystem from "./Alert/AlertDefaultSystem";
|
||||||
// Button
|
// Button
|
||||||
import LeftButtonCustom from "./Button/BackButton";
|
import LeftButtonCustom from "./Button/BackButton";
|
||||||
import ButtonCenteredOnly from "./Button/ButtonCenteredOnly";
|
import ButtonCenteredOnly from "./Button/ButtonCenteredOnly";
|
||||||
@@ -42,33 +43,31 @@ import ScrollableCustom from "./Scroll/ScrollCustom";
|
|||||||
// ShareComponent
|
// ShareComponent
|
||||||
import AvatarUsernameAndOtherComponent from "./_ShareComponent/AvataraAndOtherHeaderComponent";
|
import AvatarUsernameAndOtherComponent from "./_ShareComponent/AvataraAndOtherHeaderComponent";
|
||||||
import Spacing from "./_ShareComponent/Spacing";
|
import Spacing from "./_ShareComponent/Spacing";
|
||||||
import ViewWrapper from "./_ShareComponent/ViewWrapper";
|
|
||||||
import TabBarBackground from "./_ShareComponent/TabBarBackground";
|
import TabBarBackground from "./_ShareComponent/TabBarBackground";
|
||||||
|
import ViewWrapper from "./_ShareComponent/ViewWrapper";
|
||||||
|
|
||||||
export {
|
export {
|
||||||
AlertCustom,
|
AlertCustom,
|
||||||
|
AlertDefaultSystem,
|
||||||
// Image
|
// Image
|
||||||
AvatarCustom,
|
AvatarCustom,
|
||||||
// ShareComponent
|
// ShareComponent
|
||||||
AvatarUsernameAndOtherComponent,
|
AvatarUsernameAndOtherComponent,
|
||||||
|
// Button
|
||||||
|
LeftButtonCustom as BackButton,
|
||||||
// Box
|
// Box
|
||||||
BaseBox,
|
BaseBox,
|
||||||
BoxButtonOnFooter,
|
BoxButtonOnFooter,
|
||||||
BoxWithHeaderSection,
|
BoxWithHeaderSection, ButtonCenteredOnly,
|
||||||
// Button
|
|
||||||
LeftButtonCustom as BackButton,
|
|
||||||
ButtonCenteredOnly,
|
|
||||||
ButtonCustom,
|
ButtonCustom,
|
||||||
FloatingButton,
|
|
||||||
DotButton,
|
|
||||||
// Center
|
// Center
|
||||||
CenterCustom,
|
CenterCustom,
|
||||||
// Clickable
|
// Clickable
|
||||||
ClickableCustom,
|
ClickableCustom,
|
||||||
// Divider
|
// Divider
|
||||||
DividerCustom,
|
DividerCustom, DotButton,
|
||||||
// Drawer
|
// Drawer
|
||||||
DrawerCustom,
|
DrawerCustom, FloatingButton,
|
||||||
// Grid
|
// Grid
|
||||||
Grid,
|
Grid,
|
||||||
InformationBox,
|
InformationBox,
|
||||||
@@ -82,9 +81,8 @@ export {
|
|||||||
SelectCustom,
|
SelectCustom,
|
||||||
// ShareComponent
|
// ShareComponent
|
||||||
Spacing,
|
Spacing,
|
||||||
TabBarBackground,
|
|
||||||
// Stack
|
// Stack
|
||||||
StackCustom,
|
StackCustom, TabBarBackground,
|
||||||
// TextArea
|
// TextArea
|
||||||
TextAreaCustom,
|
TextAreaCustom,
|
||||||
// Text
|
// Text
|
||||||
@@ -92,5 +90,6 @@ export {
|
|||||||
// TextInput
|
// TextInput
|
||||||
TextInputCustom,
|
TextInputCustom,
|
||||||
// ViewWrapper
|
// ViewWrapper
|
||||||
ViewWrapper,
|
ViewWrapper
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user