Compare commits
43 Commits
resourcing
...
event/22-j
| Author | SHA1 | Date | |
|---|---|---|---|
| aa4ea9fb0c | |||
| 81d86885f4 | |||
| 814f261881 | |||
| 7889d25a44 | |||
| ce0e82e627 | |||
| 08dfd62bfd | |||
| c8cc0f0232 | |||
| b844a8151d | |||
| f9e96aa077 | |||
| b8b1efc71e | |||
| eaf0ebfb0a | |||
| e68d366d49 | |||
| 9999f78ed4 | |||
| 2be5afe5ca | |||
| 24913a9f97 | |||
| 3376336c55 | |||
| a0dad5618a | |||
| cce27c26f6 | |||
| 3211404397 | |||
| fbde2fd031 | |||
| ac9dae7c5b | |||
| 5183769a7c | |||
| 3301cf3d7a | |||
| 6913e9e4b5 | |||
| c5798b3127 | |||
| 2c94638e27 | |||
| b8ed577fea | |||
| e68a18bb89 | |||
| 862af44c03 | |||
| 71ea0ca5f2 | |||
| ee7efaef6a | |||
| bfb029058c | |||
| b7e774a556 | |||
| 2901d19db0 | |||
| 5c4dadbe7c | |||
| 6ac122c631 | |||
| 16559b94fe | |||
| 0698e14d36 | |||
| 3d9672154c | |||
| 55b4b1fa8d | |||
| b80968999e | |||
| 6bac89c536 | |||
| b9af7e0ca7 |
2
app.json
2
app.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"expo": {
|
||||
"name": "hipmi-mobile",
|
||||
"name": "HIPMI BADUNG",
|
||||
"slug": "hipmi-mobile",
|
||||
"version": "1.0.0",
|
||||
"orientation": "portrait",
|
||||
|
||||
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>
|
||||
);
|
||||
}
|
||||
@@ -67,7 +67,7 @@ export default function TakePicture() {
|
||||
/>
|
||||
<Spacing />
|
||||
|
||||
<StackCustom>
|
||||
<StackCustom >
|
||||
<ButtonCustom onPress={() => setUri(null)} title="Foto ulang" />
|
||||
<ButtonCustom
|
||||
onPress={() => {
|
||||
210
app/(application)/(user)/_layout.tsx
Normal file
210
app/(application)/(user)/_layout.tsx
Normal file
@@ -0,0 +1,210 @@
|
||||
import { BackButton } from "@/components";
|
||||
import LeftButtonCustom from "@/components/Button/BackButton";
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
import { HeaderStyles } from "@/styles/header-styles";
|
||||
import { Ionicons } from "@expo/vector-icons";
|
||||
import { router, Stack } from "expo-router";
|
||||
|
||||
export default function UserLayout() {
|
||||
return (
|
||||
<>
|
||||
<Stack screenOptions={HeaderStyles}>
|
||||
<Stack.Screen
|
||||
name="home"
|
||||
options={{
|
||||
title: "HIPMI",
|
||||
headerLeft: () => (
|
||||
<Ionicons
|
||||
name="search"
|
||||
size={20}
|
||||
color={MainColor.yellow}
|
||||
onPress={() => router.push("/user-search")}
|
||||
/>
|
||||
),
|
||||
headerRight: () => (
|
||||
<Ionicons
|
||||
name="notifications"
|
||||
size={20}
|
||||
color={MainColor.yellow}
|
||||
onPress={() => router.push("/notifications")}
|
||||
/>
|
||||
),
|
||||
}}
|
||||
/>
|
||||
|
||||
{/* ========== Profile Section ========= */}
|
||||
<Stack.Screen
|
||||
name="profile"
|
||||
options={{
|
||||
headerShown: false,
|
||||
}}
|
||||
/>
|
||||
|
||||
{/* ========== Portofolio Section ========= */}
|
||||
<Stack.Screen
|
||||
name="portofolio"
|
||||
options={{
|
||||
headerShown: false,
|
||||
}}
|
||||
/>
|
||||
|
||||
{/* ========== User Search Section ========= */}
|
||||
<Stack.Screen
|
||||
name="user-search/index"
|
||||
options={{
|
||||
title: "Pencarian Pengguna",
|
||||
headerLeft: () => <BackButton />,
|
||||
}}
|
||||
/>
|
||||
|
||||
{/* ========== Notification Section ========= */}
|
||||
<Stack.Screen
|
||||
name="notifications/index"
|
||||
options={{
|
||||
title: "Notifikasi",
|
||||
headerLeft: () => <BackButton />,
|
||||
}}
|
||||
/>
|
||||
|
||||
{/* ========== Event Section ========= */}
|
||||
<Stack.Screen
|
||||
name="event/(tabs)"
|
||||
options={{
|
||||
title: "Event",
|
||||
headerLeft: () => (
|
||||
<LeftButtonCustom path="/(application)/(user)/home" />
|
||||
),
|
||||
}}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="event/create"
|
||||
options={{
|
||||
title: "Tambah Event",
|
||||
headerLeft: () => <BackButton />,
|
||||
}}
|
||||
/>
|
||||
|
||||
<Stack.Screen
|
||||
name="event/detail/[id]"
|
||||
options={{
|
||||
title: "Event Detail",
|
||||
headerLeft: () => <LeftButtonCustom />,
|
||||
}}
|
||||
/>
|
||||
|
||||
<Stack.Screen
|
||||
name="event/[id]/edit"
|
||||
options={{
|
||||
title: "Edit Event",
|
||||
headerLeft: () => <BackButton />,
|
||||
}}
|
||||
/>
|
||||
|
||||
<Stack.Screen
|
||||
name="event/[id]/list-of-participants"
|
||||
options={{
|
||||
title: "Daftar peserta",
|
||||
headerLeft: () => <BackButton />,
|
||||
}}
|
||||
/>
|
||||
|
||||
{/* ========== Forum Section ========= */}
|
||||
<Stack.Screen
|
||||
name="forum/create"
|
||||
options={{
|
||||
title: "Tambah Diskusi",
|
||||
headerLeft: () => <BackButton />,
|
||||
}}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="forum/[id]/edit"
|
||||
options={{
|
||||
title: "Edit Diskusi",
|
||||
headerLeft: () => <BackButton />,
|
||||
}}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="forum/[id]/forumku"
|
||||
options={{
|
||||
title: "Forumku",
|
||||
headerLeft: () => <BackButton icon={'close'} />,
|
||||
}}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="forum/[id]/index"
|
||||
options={{
|
||||
title: "Detail",
|
||||
headerLeft: () => <BackButton />,
|
||||
}}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="forum/[id]/report-commentar"
|
||||
options={{
|
||||
title: "Laporkan Komentar",
|
||||
headerLeft: () => <BackButton />,
|
||||
}}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="forum/[id]/other-report-commentar"
|
||||
options={{
|
||||
title: "Laporkan Komentar",
|
||||
headerLeft: () => <BackButton />,
|
||||
}}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="forum/[id]/report-posting"
|
||||
options={{
|
||||
title: "Laporkan Diskusi",
|
||||
headerLeft: () => <BackButton />,
|
||||
}}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="forum/[id]/other-report-posting"
|
||||
options={{
|
||||
title: "Laporkan Diskusi",
|
||||
headerLeft: () => <BackButton />,
|
||||
}}
|
||||
/>
|
||||
|
||||
{/* ========== Maps Section ========= */}
|
||||
<Stack.Screen
|
||||
name="maps/index"
|
||||
options={{
|
||||
title: "Maps",
|
||||
headerLeft: () => <BackButton />,
|
||||
}}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="maps/create"
|
||||
options={{
|
||||
title: "Tambah Maps",
|
||||
headerLeft: () => <BackButton />,
|
||||
}}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="maps/[id]/edit"
|
||||
options={{
|
||||
title: "Edit Maps",
|
||||
headerLeft: () => <BackButton />,
|
||||
}}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="maps/[id]/custom-pin"
|
||||
options={{
|
||||
title: "Custom Pin Maps",
|
||||
headerLeft: () => <BackButton />,
|
||||
}}
|
||||
/>
|
||||
|
||||
{/* ========== Marketplace Section ========= */}
|
||||
<Stack.Screen
|
||||
name="marketplace/index"
|
||||
options={{
|
||||
title: "Market Place",
|
||||
headerLeft: () => <BackButton />,
|
||||
}}
|
||||
/>
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,32 +1,36 @@
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
import { AccentColor, MainColor } from "@/constants/color-palet";
|
||||
import { OS_IOS_HEIGHT, OS_ANDROID_HEIGHT } from "@/constants/constans-value";
|
||||
import { FontAwesome5, Ionicons } from "@expo/vector-icons";
|
||||
import { Tabs } from "expo-router";
|
||||
import { Platform, View } from "react-native";
|
||||
|
||||
export default function EventLayout() {
|
||||
export default function EventTabsLayout() {
|
||||
return (
|
||||
<Tabs
|
||||
screenOptions={{
|
||||
headerShown: false,
|
||||
tabBarActiveTintColor: MainColor.yellow,
|
||||
tabBarInactiveTintColor: MainColor.white,
|
||||
tabBarStyle: {
|
||||
backgroundColor: MainColor.darkblue,
|
||||
},
|
||||
// tabBarButton: HapticTab,
|
||||
// tabBarBackground: BlurTabBarBackground,
|
||||
// tabBarStyle: Platform.select({
|
||||
// ios: {
|
||||
// // Use a transparent background on iOS to show the blur effect
|
||||
// position: "absolute",
|
||||
// },
|
||||
// default: {},
|
||||
// }),
|
||||
tabBarInactiveTintColor: MainColor.white_gray,
|
||||
tabBarBackground: CustomTabBarBackground,
|
||||
tabBarStyle: Platform.select({
|
||||
ios: {
|
||||
borderTopWidth: 0,
|
||||
paddingTop: 5,
|
||||
height: OS_IOS_HEIGHT,
|
||||
},
|
||||
android: {
|
||||
borderTopWidth: 0,
|
||||
paddingTop: 5,
|
||||
height: OS_ANDROID_HEIGHT,
|
||||
},
|
||||
default: {},
|
||||
}),
|
||||
}}
|
||||
>
|
||||
<Tabs.Screen
|
||||
name="index"
|
||||
options={{
|
||||
title: "Home",
|
||||
title: "Beranda",
|
||||
tabBarIcon: ({ color }) => (
|
||||
<Ionicons size={20} name="home" color={color} />
|
||||
),
|
||||
@@ -42,7 +46,7 @@ export default function EventLayout() {
|
||||
}}
|
||||
/>
|
||||
<Tabs.Screen
|
||||
name="kontribusi"
|
||||
name="contribution"
|
||||
options={{
|
||||
title: "Kontribusi",
|
||||
tabBarIcon: ({ color }) => (
|
||||
@@ -51,7 +55,7 @@ export default function EventLayout() {
|
||||
}}
|
||||
/>
|
||||
<Tabs.Screen
|
||||
name="riwayat"
|
||||
name="history"
|
||||
options={{
|
||||
title: "Riwayat",
|
||||
tabBarIcon: ({ color }) => (
|
||||
@@ -62,3 +66,16 @@ export default function EventLayout() {
|
||||
</Tabs>
|
||||
);
|
||||
}
|
||||
|
||||
function CustomTabBarBackground() {
|
||||
return (
|
||||
<View
|
||||
style={{
|
||||
flex: 1,
|
||||
backgroundColor: MainColor.darkblue,
|
||||
borderTopWidth: 1,
|
||||
borderTopColor: AccentColor.blue,
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
43
app/(application)/(user)/event/(tabs)/contribution.tsx
Normal file
43
app/(application)/(user)/event/(tabs)/contribution.tsx
Normal file
@@ -0,0 +1,43 @@
|
||||
import {
|
||||
AvatarCustom,
|
||||
AvatarUsernameAndOtherComponent,
|
||||
BoxWithHeaderSection,
|
||||
Grid,
|
||||
StackCustom,
|
||||
TextCustom,
|
||||
ViewWrapper
|
||||
} from "@/components";
|
||||
import React from "react";
|
||||
|
||||
export default function EventContribution() {
|
||||
return (
|
||||
<ViewWrapper hideFooter>
|
||||
{Array.from({ length: 10 }).map((_, index) => (
|
||||
<BoxWithHeaderSection key={index} href={`/event/${index}/contribution`}>
|
||||
<StackCustom>
|
||||
<AvatarUsernameAndOtherComponent
|
||||
avatarHref={`/profile/${index}`}
|
||||
rightComponent={
|
||||
<TextCustom truncate>
|
||||
{new Date().toLocaleDateString()}
|
||||
</TextCustom>
|
||||
}
|
||||
/>
|
||||
|
||||
<TextCustom bold align="center" size="xlarge">
|
||||
Judul Event Disini
|
||||
</TextCustom>
|
||||
|
||||
<Grid>
|
||||
{Array.from({ length: 4 }).map((_, index2) => (
|
||||
<Grid.Col span={3} key={index2}>
|
||||
<AvatarCustom size="sm" href={`/profile/${index2}`} />
|
||||
</Grid.Col>
|
||||
))}
|
||||
</Grid>
|
||||
</StackCustom>
|
||||
</BoxWithHeaderSection>
|
||||
))}
|
||||
</ViewWrapper>
|
||||
);
|
||||
}
|
||||
68
app/(application)/(user)/event/(tabs)/history.tsx
Normal file
68
app/(application)/(user)/event/(tabs)/history.tsx
Normal file
@@ -0,0 +1,68 @@
|
||||
import { ButtonCustom, Spacing, TextCustom } from "@/components";
|
||||
import ViewWrapper from "@/components/_ShareComponent/ViewWrapper";
|
||||
import { AccentColor, MainColor } from "@/constants/color-palet";
|
||||
import Event_BoxPublishSection from "@/screens/Event/BoxPublishSection";
|
||||
import { useState } from "react";
|
||||
import { View } from "react-native";
|
||||
|
||||
export default function EventHistory() {
|
||||
const [activeCategory, setActiveCategory] = useState<string | null>("all");
|
||||
|
||||
const handlePress = (item: any) => {
|
||||
setActiveCategory(item);
|
||||
// tambahkan logika lain seperti filter dsb.
|
||||
};
|
||||
|
||||
const headerComponent = (
|
||||
<View
|
||||
style={{
|
||||
flexDirection: "row",
|
||||
alignItems: "center",
|
||||
padding: 5,
|
||||
backgroundColor: MainColor.soft_darkblue,
|
||||
borderRadius: 50,
|
||||
width: "100%",
|
||||
}}
|
||||
>
|
||||
<ButtonCustom
|
||||
backgroundColor={
|
||||
activeCategory === "all" ? MainColor.yellow : AccentColor.blue
|
||||
}
|
||||
textColor={activeCategory === "all" ? MainColor.black : MainColor.white}
|
||||
style={{ width: "49%" }}
|
||||
onPress={() => handlePress("all")}
|
||||
>
|
||||
Semua Riwayat
|
||||
</ButtonCustom>
|
||||
<Spacing width={"2%"} />
|
||||
<ButtonCustom
|
||||
backgroundColor={
|
||||
activeCategory === "main" ? MainColor.yellow : AccentColor.blue
|
||||
}
|
||||
textColor={
|
||||
activeCategory === "main" ? MainColor.black : MainColor.white
|
||||
}
|
||||
style={{ width: "49%" }}
|
||||
onPress={() => handlePress("main")}
|
||||
>
|
||||
Riwayat Saya
|
||||
</ButtonCustom>
|
||||
</View>
|
||||
);
|
||||
|
||||
return (
|
||||
<ViewWrapper headerComponent={headerComponent} hideFooter>
|
||||
{Array.from({ length: 10 }).map((_, index) => (
|
||||
<Event_BoxPublishSection
|
||||
key={index.toString()}
|
||||
id={index.toString()}
|
||||
username={`Riwayat ${activeCategory === "main" ? "Saya" : "Semua"}`}
|
||||
rightComponentAvatar={
|
||||
<TextCustom>{new Date().toLocaleDateString()}</TextCustom>
|
||||
}
|
||||
href={`/event/${index}/history`}
|
||||
/>
|
||||
))}
|
||||
</ViewWrapper>
|
||||
);
|
||||
}
|
||||
23
app/(application)/(user)/event/(tabs)/index.tsx
Normal file
23
app/(application)/(user)/event/(tabs)/index.tsx
Normal file
@@ -0,0 +1,23 @@
|
||||
import ViewWrapper from "@/components/_ShareComponent/ViewWrapper";
|
||||
import FloatingButton from "@/components/Button/FloatingButton";
|
||||
import Event_BoxPublishSection from "@/screens/Event/BoxPublishSection";
|
||||
import { router } from "expo-router";
|
||||
|
||||
export default function EventBeranda() {
|
||||
return (
|
||||
<ViewWrapper
|
||||
hideFooter
|
||||
floatingButton={
|
||||
<FloatingButton onPress={() => router.push("/event/create")} />
|
||||
}
|
||||
>
|
||||
{Array.from({ length: 10 }).map((_, index) => (
|
||||
<Event_BoxPublishSection
|
||||
key={index}
|
||||
id={index.toString()}
|
||||
href={`/event/${index}/publish`}
|
||||
/>
|
||||
))}
|
||||
</ViewWrapper>
|
||||
);
|
||||
}
|
||||
63
app/(application)/(user)/event/(tabs)/status.tsx
Normal file
63
app/(application)/(user)/event/(tabs)/status.tsx
Normal file
@@ -0,0 +1,63 @@
|
||||
import {
|
||||
BoxWithHeaderSection,
|
||||
Grid,
|
||||
ScrollableCustom,
|
||||
StackCustom,
|
||||
TextCustom
|
||||
} from "@/components";
|
||||
import ViewWrapper from "@/components/_ShareComponent/ViewWrapper";
|
||||
import { masterStatus } from "@/lib/dummy-data/_master/status";
|
||||
import { useState } from "react";
|
||||
|
||||
export default function EventStatus() {
|
||||
const id = "test-id-event";
|
||||
|
||||
const [activeCategory, setActiveCategory] = useState<string | null>(
|
||||
"publish"
|
||||
);
|
||||
|
||||
const handlePress = (item: any) => {
|
||||
setActiveCategory(item.value);
|
||||
// tambahkan logika lain seperti filter dsb.
|
||||
};
|
||||
|
||||
const scrollComponent = (
|
||||
<ScrollableCustom
|
||||
data={masterStatus.map((e, i) => ({
|
||||
id: i,
|
||||
label: e.label,
|
||||
value: e.value,
|
||||
}))}
|
||||
onButtonPress={handlePress}
|
||||
activeId={activeCategory as any}
|
||||
/>
|
||||
);
|
||||
|
||||
return (
|
||||
<ViewWrapper headerComponent={scrollComponent}>
|
||||
<BoxWithHeaderSection href={`/event/${id}/${activeCategory}/detail-event`}>
|
||||
<StackCustom gap={"xs"}>
|
||||
<Grid>
|
||||
<Grid.Col span={8}>
|
||||
<TextCustom truncate bold>
|
||||
Lorem ipsum,{" "}
|
||||
<TextCustom color="green">{activeCategory}</TextCustom> dolor
|
||||
sit amet consectetur adipisicing elit.
|
||||
</TextCustom>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={4} style={{ alignItems: "flex-end" }}>
|
||||
<TextCustom>{new Date().toLocaleDateString()}</TextCustom>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
|
||||
<TextCustom truncate={2}>
|
||||
Lorem ipsum dolor sit amet consectetur adipisicing elit. Consectetur
|
||||
eveniet ab eum ducimus tempore a quia deserunt quisquam. Tempora,
|
||||
atque. Aperiam minima asperiores dicta perferendis quis adipisci,
|
||||
dolore optio porro!
|
||||
</TextCustom>
|
||||
</StackCustom>
|
||||
</BoxWithHeaderSection>
|
||||
</ViewWrapper>
|
||||
);
|
||||
}
|
||||
117
app/(application)/(user)/event/[id]/[status]/detail-event.tsx
Normal file
117
app/(application)/(user)/event/[id]/[status]/detail-event.tsx
Normal file
@@ -0,0 +1,117 @@
|
||||
import {
|
||||
BaseBox,
|
||||
DotButton,
|
||||
DrawerCustom,
|
||||
Grid,
|
||||
MenuDrawerDynamicGrid,
|
||||
Spacing,
|
||||
StackCustom,
|
||||
TextCustom,
|
||||
ViewWrapper,
|
||||
} from "@/components";
|
||||
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
||||
import LeftButtonCustom from "@/components/Button/BackButton";
|
||||
import Event_AlertButtonStatusSection from "@/screens/Event/AlertButtonStatusSection";
|
||||
import Event_ButtonStatusSection from "@/screens/Event/ButtonStatusSection";
|
||||
import { menuDrawerDraftEvent } from "@/screens/Event/menuDrawerDraft";
|
||||
import { router, Stack, useLocalSearchParams } from "expo-router";
|
||||
import { useState } from "react";
|
||||
|
||||
export default function EventDetailStatus() {
|
||||
const { id, status } = useLocalSearchParams();
|
||||
const [openDrawer, setOpenDrawer] = useState(false);
|
||||
const [openAlert, setOpenAlert] = useState(false);
|
||||
const [openDeleteAlert, setOpenDeleteAlert] = useState(false);
|
||||
|
||||
const handlePress = (item: IMenuDrawerItem) => {
|
||||
console.log("PATH >> ", item.path);
|
||||
router.navigate(item.path as any);
|
||||
setOpenDrawer(false);
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<Stack.Screen
|
||||
options={{
|
||||
title: `Detail ${status === "publish" ? "" : status}`,
|
||||
headerLeft: () => <LeftButtonCustom />,
|
||||
headerRight: () =>
|
||||
status === "draft" ? (
|
||||
<DotButton onPress={() => setOpenDrawer(true)} />
|
||||
) : null,
|
||||
}}
|
||||
/>
|
||||
<ViewWrapper>
|
||||
<BaseBox>
|
||||
<StackCustom>
|
||||
<TextCustom bold align="center" size="xlarge">
|
||||
Judul event {status}
|
||||
</TextCustom>
|
||||
{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>
|
||||
</BaseBox>
|
||||
<Event_ButtonStatusSection
|
||||
status={status as string}
|
||||
onOpenAlert={setOpenAlert}
|
||||
onOpenDeleteAlert={setOpenDeleteAlert}
|
||||
/>
|
||||
<Spacing />
|
||||
</ViewWrapper>
|
||||
|
||||
<DrawerCustom
|
||||
isVisible={openDrawer}
|
||||
closeDrawer={() => setOpenDrawer(false)}
|
||||
height={250}
|
||||
>
|
||||
<MenuDrawerDynamicGrid
|
||||
data={menuDrawerDraftEvent({ id: id as string })}
|
||||
columns={4}
|
||||
onPressItem={handlePress}
|
||||
/>
|
||||
</DrawerCustom>
|
||||
|
||||
<Event_AlertButtonStatusSection
|
||||
id={id as string}
|
||||
status={status as string}
|
||||
openAlert={openAlert}
|
||||
setOpenAlert={setOpenAlert}
|
||||
openDeleteAlert={openDeleteAlert}
|
||||
setOpenDeleteAlert={setOpenDeleteAlert}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
const listData = [
|
||||
{
|
||||
title: "Lokasi",
|
||||
value:
|
||||
"Lorem ipsum dolor sit amet consectetur adipisicing elit. Consectetur eveniet ab eum ducimus tempore a quia deserunt quisquam. Tempora, atque. Aperiam minima asperiores dicta perferendis quis adipisci, dolore optio porro!",
|
||||
},
|
||||
{
|
||||
title: "Tipe Acara",
|
||||
value: "Workshop",
|
||||
},
|
||||
{
|
||||
title: "Tanggal Mulai",
|
||||
value: "Senin, 18 Juli 2025, 10:00 WIB",
|
||||
},
|
||||
{
|
||||
title: "Tanggal Berakhir",
|
||||
value: "Selasa, 19 Juli 2025, 12:00 WIB",
|
||||
},
|
||||
{
|
||||
title: "Deskripsi",
|
||||
value:
|
||||
"Lorem ipsum dolor sit amet consectetur adipisicing elit. Consectetur eveniet ab eum ducimus tempore a quia deserunt quisquam. Tempora, atque. Aperiam minima asperiores dicta perferendis quis adipisci, dolore optio porro!",
|
||||
},
|
||||
];
|
||||
51
app/(application)/(user)/event/[id]/contribution.tsx
Normal file
51
app/(application)/(user)/event/[id]/contribution.tsx
Normal file
@@ -0,0 +1,51 @@
|
||||
import {
|
||||
DotButton,
|
||||
DrawerCustom,
|
||||
MenuDrawerDynamicGrid,
|
||||
ViewWrapper,
|
||||
Spacing,
|
||||
} from "@/components";
|
||||
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
||||
import LeftButtonCustom from "@/components/Button/BackButton";
|
||||
import Event_BoxDetailPublishSection from "@/screens/Event/BoxDetailPublishSection";
|
||||
import { menuDrawerPublishEvent } from "@/screens/Event/menuDrawerPublish";
|
||||
import { router, Stack, useLocalSearchParams } from "expo-router";
|
||||
import { useState } from "react";
|
||||
|
||||
export default function EventDetailContribution() {
|
||||
const { id } = useLocalSearchParams();
|
||||
const [openDrawer, setOpenDrawer] = useState(false);
|
||||
|
||||
const handlePress = (item: IMenuDrawerItem) => {
|
||||
console.log("PATH ", item.path);
|
||||
router.navigate(item.path as any);
|
||||
setOpenDrawer(false);
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<Stack.Screen
|
||||
options={{
|
||||
title: `Detail kontribusi`,
|
||||
headerLeft: () => <LeftButtonCustom />,
|
||||
headerRight: () => <DotButton onPress={() => setOpenDrawer(true)} />,
|
||||
}}
|
||||
/>
|
||||
<ViewWrapper>
|
||||
<Event_BoxDetailPublishSection />
|
||||
<Spacing />
|
||||
</ViewWrapper>
|
||||
<DrawerCustom
|
||||
isVisible={openDrawer}
|
||||
closeDrawer={() => setOpenDrawer(false)}
|
||||
height={250}
|
||||
>
|
||||
<MenuDrawerDynamicGrid
|
||||
data={menuDrawerPublishEvent({ id: id as string })}
|
||||
columns={4}
|
||||
onPressItem={handlePress}
|
||||
/>
|
||||
</DrawerCustom>
|
||||
</>
|
||||
);
|
||||
}
|
||||
107
app/(application)/(user)/event/[id]/edit.tsx
Normal file
107
app/(application)/(user)/event/[id]/edit.tsx
Normal file
@@ -0,0 +1,107 @@
|
||||
import {
|
||||
ButtonCustom,
|
||||
SelectCustom,
|
||||
StackCustom,
|
||||
TextAreaCustom,
|
||||
TextInputCustom,
|
||||
ViewWrapper,
|
||||
} from "@/components";
|
||||
import DateTimePickerCustom from "@/components/DateInput/DateTimePickerCustom";
|
||||
import { masterTypeEvent } from "@/lib/dummy-data/event/master-type-event";
|
||||
import { DateTimePickerEvent } from "@react-native-community/datetimepicker";
|
||||
import { router } from "expo-router";
|
||||
import React, { useState } from "react";
|
||||
import { Platform } from "react-native";
|
||||
|
||||
export default function EventEdit() {
|
||||
const [selectedDate, setSelectedDate] = useState<
|
||||
Date | DateTimePickerEvent | null
|
||||
>(null);
|
||||
|
||||
const [selectedEndDate, setSelectedEndDate] = useState<
|
||||
Date | DateTimePickerEvent | null
|
||||
>(null);
|
||||
|
||||
const handlerSubmit = () => {
|
||||
try {
|
||||
if (selectedDate) {
|
||||
console.log("Tanggal yang dipilih:", selectedDate);
|
||||
console.log(`ISO Format ${Platform.OS}:`, selectedDate.toString());
|
||||
// Kirim ke API atau proses lanjutan
|
||||
} else {
|
||||
console.log("Tanggal belum dipilih");
|
||||
}
|
||||
|
||||
if (selectedEndDate) {
|
||||
console.log("Tanggal yang dipilih:", selectedEndDate);
|
||||
console.log(`ISO Format ${Platform.OS}:`, selectedEndDate.toString());
|
||||
// Kirim ke API atau proses lanjutan
|
||||
} else {
|
||||
console.log("Tanggal berakhir belum dipilih");
|
||||
}
|
||||
|
||||
console.log("Data berhasil terupdate");
|
||||
router.back()
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
};
|
||||
|
||||
const buttonSubmit = (
|
||||
<ButtonCustom title="Update" onPress={handlerSubmit} />
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
<ViewWrapper>
|
||||
<StackCustom gap={"xs"}>
|
||||
<TextInputCustom
|
||||
placeholder="Masukkan nama event"
|
||||
label="Nama Event"
|
||||
required
|
||||
/>
|
||||
<SelectCustom
|
||||
label="Tipe Event"
|
||||
placeholder="Pilih tipe event"
|
||||
data={masterTypeEvent}
|
||||
onChange={(value) => console.log(value)}
|
||||
/>
|
||||
<TextInputCustom
|
||||
label="Lokasi"
|
||||
placeholder="Masukkan lokasi event"
|
||||
required
|
||||
/>
|
||||
|
||||
<DateTimePickerCustom
|
||||
label="Tanggal & Waktu Mulai"
|
||||
required
|
||||
onChange={(date: Date) => {
|
||||
setSelectedDate(date as any);
|
||||
}}
|
||||
value={selectedDate as any}
|
||||
minimumDate={new Date(Date.now())}
|
||||
/>
|
||||
|
||||
<DateTimePickerCustom
|
||||
label="Tanggal & Waktu Berakhir"
|
||||
required
|
||||
onChange={(date: Date) => {
|
||||
setSelectedEndDate(date as any);
|
||||
}}
|
||||
value={selectedEndDate as any}
|
||||
/>
|
||||
|
||||
<TextAreaCustom
|
||||
label="Deskripsi"
|
||||
placeholder="Masukkan deskripsi event"
|
||||
required
|
||||
showCount
|
||||
maxLength={100}
|
||||
/>
|
||||
|
||||
{buttonSubmit}
|
||||
</StackCustom>
|
||||
</ViewWrapper>
|
||||
</>
|
||||
);
|
||||
}
|
||||
51
app/(application)/(user)/event/[id]/history.tsx
Normal file
51
app/(application)/(user)/event/[id]/history.tsx
Normal file
@@ -0,0 +1,51 @@
|
||||
import {
|
||||
DotButton,
|
||||
DrawerCustom,
|
||||
MenuDrawerDynamicGrid,
|
||||
ViewWrapper,
|
||||
Spacing,
|
||||
} from "@/components";
|
||||
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
||||
import LeftButtonCustom from "@/components/Button/BackButton";
|
||||
import Event_BoxDetailPublishSection from "@/screens/Event/BoxDetailPublishSection";
|
||||
import { menuDrawerPublishEvent } from "@/screens/Event/menuDrawerPublish";
|
||||
import { router, Stack, useLocalSearchParams } from "expo-router";
|
||||
import { useState } from "react";
|
||||
|
||||
export default function EventDetailHistory() {
|
||||
const { id } = useLocalSearchParams();
|
||||
const [openDrawer, setOpenDrawer] = useState(false);
|
||||
|
||||
const handlePress = (item: IMenuDrawerItem) => {
|
||||
console.log("PATH ", item.path);
|
||||
router.navigate(item.path as any);
|
||||
setOpenDrawer(false);
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<Stack.Screen
|
||||
options={{
|
||||
title: `Detail riwayat`,
|
||||
headerLeft: () => <LeftButtonCustom />,
|
||||
headerRight: () => <DotButton onPress={() => setOpenDrawer(true)} />,
|
||||
}}
|
||||
/>
|
||||
<ViewWrapper>
|
||||
<Event_BoxDetailPublishSection />
|
||||
<Spacing />
|
||||
</ViewWrapper>
|
||||
<DrawerCustom
|
||||
isVisible={openDrawer}
|
||||
closeDrawer={() => setOpenDrawer(false)}
|
||||
height={250}
|
||||
>
|
||||
<MenuDrawerDynamicGrid
|
||||
data={menuDrawerPublishEvent({ id: id as string })}
|
||||
columns={4}
|
||||
onPressItem={handlePress}
|
||||
/>
|
||||
</DrawerCustom>
|
||||
</>
|
||||
);
|
||||
}
|
||||
17
app/(application)/(user)/event/[id]/list-of-participants.tsx
Normal file
17
app/(application)/(user)/event/[id]/list-of-participants.tsx
Normal file
@@ -0,0 +1,17 @@
|
||||
import {
|
||||
AvatarUsernameAndOtherComponent,
|
||||
BaseBox,
|
||||
ViewWrapper,
|
||||
} from "@/components";
|
||||
|
||||
export default function EventListOfParticipants() {
|
||||
return (
|
||||
<ViewWrapper>
|
||||
{Array.from({ length: 10 }).map((_, index) => (
|
||||
<BaseBox key={index} paddingBlock={0}>
|
||||
<AvatarUsernameAndOtherComponent avatarHref={`/profile/${index}`} />
|
||||
</BaseBox>
|
||||
))}
|
||||
</ViewWrapper>
|
||||
);
|
||||
}
|
||||
64
app/(application)/(user)/event/[id]/publish.tsx
Normal file
64
app/(application)/(user)/event/[id]/publish.tsx
Normal file
@@ -0,0 +1,64 @@
|
||||
import {
|
||||
ButtonCustom,
|
||||
DotButton,
|
||||
DrawerCustom,
|
||||
MenuDrawerDynamicGrid,
|
||||
Spacing,
|
||||
ViewWrapper
|
||||
} from "@/components";
|
||||
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
||||
import LeftButtonCustom from "@/components/Button/BackButton";
|
||||
import Event_BoxDetailPublishSection from "@/screens/Event/BoxDetailPublishSection";
|
||||
import { menuDrawerPublishEvent } from "@/screens/Event/menuDrawerPublish";
|
||||
import { router, Stack, useLocalSearchParams } from "expo-router";
|
||||
import { useState } from "react";
|
||||
import { Alert } from "react-native";
|
||||
|
||||
export default function EventDetailPublish() {
|
||||
const { id } = useLocalSearchParams();
|
||||
const [openDrawer, setOpenDrawer] = useState(false);
|
||||
|
||||
const handlePress = (item: IMenuDrawerItem) => {
|
||||
console.log("PATH ", item.path);
|
||||
router.navigate(item.path as any);
|
||||
setOpenDrawer(false);
|
||||
};
|
||||
|
||||
const footerButton = (
|
||||
<ButtonCustom
|
||||
backgroundColor="green"
|
||||
textColor="white"
|
||||
onPress={() => Alert.alert("Anda berhasil join event ini")}
|
||||
>
|
||||
Join
|
||||
</ButtonCustom>
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Stack.Screen
|
||||
options={{
|
||||
title: `Event publish`,
|
||||
headerLeft: () => <LeftButtonCustom />,
|
||||
headerRight: () => <DotButton onPress={() => setOpenDrawer(true)} />,
|
||||
}}
|
||||
/>
|
||||
<ViewWrapper>
|
||||
<Event_BoxDetailPublishSection footerButton={footerButton} />
|
||||
<Spacing />
|
||||
</ViewWrapper>
|
||||
|
||||
<DrawerCustom
|
||||
isVisible={openDrawer}
|
||||
closeDrawer={() => setOpenDrawer(false)}
|
||||
height={250}
|
||||
>
|
||||
<MenuDrawerDynamicGrid
|
||||
data={menuDrawerPublishEvent({ id: id as string })}
|
||||
columns={4}
|
||||
onPressItem={handlePress}
|
||||
/>
|
||||
</DrawerCustom>
|
||||
</>
|
||||
);
|
||||
}
|
||||
109
app/(application)/(user)/event/create.tsx
Normal file
109
app/(application)/(user)/event/create.tsx
Normal file
@@ -0,0 +1,109 @@
|
||||
import {
|
||||
ButtonCustom,
|
||||
SelectCustom,
|
||||
StackCustom,
|
||||
TextAreaCustom,
|
||||
TextInputCustom,
|
||||
ViewWrapper,
|
||||
} from "@/components";
|
||||
import DateTimePickerCustom from "@/components/DateInput/DateTimePickerCustom";
|
||||
import { masterTypeEvent } from "@/lib/dummy-data/event/master-type-event";
|
||||
import { DateTimePickerEvent } from "@react-native-community/datetimepicker";
|
||||
import { router } from "expo-router";
|
||||
import React, { useState } from "react";
|
||||
import { Platform } from "react-native";
|
||||
|
||||
export default function EventCreate() {
|
||||
const [selectedDate, setSelectedDate] = useState<
|
||||
Date | DateTimePickerEvent | null
|
||||
>(null);
|
||||
|
||||
const [selectedEndDate, setSelectedEndDate] = useState<
|
||||
Date | DateTimePickerEvent | null
|
||||
>(null);
|
||||
|
||||
const handlerSubmit = () => {
|
||||
try {
|
||||
if (selectedDate) {
|
||||
console.log("Tanggal yang dipilih:", selectedDate);
|
||||
console.log(`ISO Format ${Platform.OS}:`, selectedDate.toString());
|
||||
// Kirim ke API atau proses lanjutan
|
||||
} else {
|
||||
console.log("Tanggal belum dipilih");
|
||||
}
|
||||
|
||||
if (selectedEndDate) {
|
||||
console.log("Tanggal yang dipilih:", selectedEndDate);
|
||||
console.log(`ISO Format ${Platform.OS}:`, selectedEndDate.toString());
|
||||
// Kirim ke API atau proses lanjutan
|
||||
} else {
|
||||
console.log("Tanggal berakhir belum dipilih");
|
||||
}
|
||||
|
||||
console.log("Data berhasil disimpan");
|
||||
router.navigate("/event/status");
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
};
|
||||
|
||||
const buttonSubmit = (
|
||||
<ButtonCustom title="Simpan" onPress={handlerSubmit} />
|
||||
// <BoxButtonOnFooter>
|
||||
// </BoxButtonOnFooter>
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
<ViewWrapper>
|
||||
<StackCustom gap={"xs"}>
|
||||
<TextInputCustom
|
||||
placeholder="Masukkan nama event"
|
||||
label="Nama Event"
|
||||
required
|
||||
/>
|
||||
<SelectCustom
|
||||
label="Tipe Event"
|
||||
placeholder="Pilih tipe event"
|
||||
data={masterTypeEvent}
|
||||
onChange={(value) => console.log(value)}
|
||||
/>
|
||||
<TextInputCustom
|
||||
label="Lokasi"
|
||||
placeholder="Masukkan lokasi event"
|
||||
required
|
||||
/>
|
||||
|
||||
<DateTimePickerCustom
|
||||
label="Tanggal & Waktu Mulai"
|
||||
required
|
||||
onChange={(date: Date) => {
|
||||
setSelectedDate(date as any);
|
||||
}}
|
||||
value={selectedDate as any}
|
||||
minimumDate={new Date(Date.now())}
|
||||
/>
|
||||
|
||||
<DateTimePickerCustom
|
||||
label="Tanggal & Waktu Berakhir"
|
||||
required
|
||||
onChange={(date: Date) => {
|
||||
setSelectedEndDate(date as any);
|
||||
}}
|
||||
value={selectedEndDate as any}
|
||||
/>
|
||||
|
||||
<TextAreaCustom
|
||||
label="Deskripsi"
|
||||
placeholder="Masukkan deskripsi event"
|
||||
required
|
||||
showCount
|
||||
maxLength={100}
|
||||
/>
|
||||
|
||||
{buttonSubmit}
|
||||
</StackCustom>
|
||||
</ViewWrapper>
|
||||
</>
|
||||
);
|
||||
}
|
||||
37
app/(application)/(user)/forum/[id]/edit.tsx
Normal file
37
app/(application)/(user)/forum/[id]/edit.tsx
Normal file
@@ -0,0 +1,37 @@
|
||||
import {
|
||||
BoxButtonOnFooter,
|
||||
ButtonCustom,
|
||||
TextAreaCustom,
|
||||
ViewWrapper,
|
||||
} from "@/components";
|
||||
import { router } from "expo-router";
|
||||
import { useState } from "react";
|
||||
|
||||
export default function ForumEdit() {
|
||||
const [text, setText] = useState("");
|
||||
|
||||
const buttonFooter = (
|
||||
<BoxButtonOnFooter>
|
||||
<ButtonCustom
|
||||
onPress={() => {
|
||||
console.log("Posting", text);
|
||||
router.back();
|
||||
}}
|
||||
>
|
||||
Update
|
||||
</ButtonCustom>
|
||||
</BoxButtonOnFooter>
|
||||
);
|
||||
|
||||
return (
|
||||
<ViewWrapper footerComponent={buttonFooter}>
|
||||
<TextAreaCustom
|
||||
placeholder="Ketik diskusi anda..."
|
||||
maxLength={1000}
|
||||
showCount
|
||||
value={text}
|
||||
onChangeText={setText}
|
||||
/>
|
||||
</ViewWrapper>
|
||||
);
|
||||
}
|
||||
113
app/(application)/(user)/forum/[id]/forumku.tsx
Normal file
113
app/(application)/(user)/forum/[id]/forumku.tsx
Normal file
@@ -0,0 +1,113 @@
|
||||
import {
|
||||
AlertCustom,
|
||||
AvatarCustom,
|
||||
ButtonCustom,
|
||||
CenterCustom,
|
||||
DrawerCustom,
|
||||
Grid,
|
||||
StackCustom,
|
||||
TextCustom,
|
||||
ViewWrapper,
|
||||
} from "@/components";
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
import Forum_BoxDetailSection from "@/screens/Forum/DiscussionBoxSection";
|
||||
import { listDummyDiscussionForum } from "@/screens/Forum/list-data-dummy";
|
||||
import Forum_MenuDrawerBerandaSection from "@/screens/Forum/MenuDrawerSection.tsx/MenuBeranda";
|
||||
import { useLocalSearchParams } from "expo-router";
|
||||
import { useState } from "react";
|
||||
|
||||
export default function Forumku() {
|
||||
const { id } = useLocalSearchParams();
|
||||
const [openDrawer, setOpenDrawer] = useState(false);
|
||||
const [status, setStatus] = useState("");
|
||||
const [alertStatus, setAlertStatus] = useState(false);
|
||||
const [deleteAlert, setDeleteAlert] = useState(false);
|
||||
|
||||
return (
|
||||
<>
|
||||
<ViewWrapper>
|
||||
<StackCustom>
|
||||
<CenterCustom>
|
||||
<AvatarCustom
|
||||
href={`/(application)/(image)/preview-image/${id}`}
|
||||
size="xl"
|
||||
/>
|
||||
</CenterCustom>
|
||||
|
||||
<Grid>
|
||||
<Grid.Col span={6}>
|
||||
<TextCustom bold truncate>
|
||||
@bagas_banuna
|
||||
</TextCustom>
|
||||
<TextCustom>1 postingan</TextCustom>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={6} style={{ alignItems: "flex-end" }}>
|
||||
<ButtonCustom href={`/profile/${id}`}>
|
||||
Kunjungi Profile
|
||||
</ButtonCustom>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
{listDummyDiscussionForum.map((e, i) => (
|
||||
<Forum_BoxDetailSection
|
||||
key={i}
|
||||
data={e}
|
||||
setOpenDrawer={setOpenDrawer}
|
||||
setStatus={setStatus}
|
||||
isTruncate={true}
|
||||
href={`/forum/${id}`}
|
||||
/>
|
||||
))}
|
||||
</StackCustom>
|
||||
</ViewWrapper>
|
||||
|
||||
{/* Drawer Komponen Eksternal */}
|
||||
<DrawerCustom
|
||||
height={350}
|
||||
isVisible={openDrawer}
|
||||
closeDrawer={() => setOpenDrawer(false)}
|
||||
>
|
||||
<Forum_MenuDrawerBerandaSection
|
||||
id={id as string}
|
||||
status={status}
|
||||
setIsDrawerOpen={() => {
|
||||
setOpenDrawer(false);
|
||||
}}
|
||||
setShowDeleteAlert={setDeleteAlert}
|
||||
setShowAlertStatus={setAlertStatus}
|
||||
/>
|
||||
</DrawerCustom>
|
||||
|
||||
{/* Alert Komponen Eksternal */}
|
||||
<AlertCustom
|
||||
isVisible={alertStatus}
|
||||
onLeftPress={() => setAlertStatus(false)}
|
||||
onRightPress={() => {
|
||||
setOpenDrawer(false);
|
||||
setAlertStatus(false);
|
||||
console.log("Ubah status forum");
|
||||
}}
|
||||
title="Ubah Status Forum"
|
||||
message="Apakah Anda yakin ingin mengubah status forum ini?"
|
||||
textLeft="Batal"
|
||||
textRight="Ubah"
|
||||
colorRight={MainColor.green}
|
||||
/>
|
||||
|
||||
{/* Alert Delete */}
|
||||
<AlertCustom
|
||||
isVisible={deleteAlert}
|
||||
onLeftPress={() => setDeleteAlert(false)}
|
||||
onRightPress={() => {
|
||||
setOpenDrawer(false);
|
||||
setDeleteAlert(false);
|
||||
console.log("Hapus forum");
|
||||
}}
|
||||
title="Hapus Forum"
|
||||
message="Apakah Anda yakin ingin menghapus forum ini?"
|
||||
textLeft="Batal"
|
||||
textRight="Hapus"
|
||||
colorRight={MainColor.red}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
176
app/(application)/(user)/forum/[id]/index.tsx
Normal file
176
app/(application)/(user)/forum/[id]/index.tsx
Normal file
@@ -0,0 +1,176 @@
|
||||
import {
|
||||
AlertCustom,
|
||||
ButtonCustom,
|
||||
DrawerCustom,
|
||||
Spacing,
|
||||
TextAreaCustom,
|
||||
ViewWrapper,
|
||||
} from "@/components";
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
import Forum_CommentarBoxSection from "@/screens/Forum/CommentarBoxSection";
|
||||
import Forum_BoxDetailSection from "@/screens/Forum/DiscussionBoxSection";
|
||||
import { listDummyCommentarForum } from "@/screens/Forum/list-data-dummy";
|
||||
import Forum_MenuDrawerBerandaSection from "@/screens/Forum/MenuDrawerSection.tsx/MenuBeranda";
|
||||
import Forum_MenuDrawerCommentar from "@/screens/Forum/MenuDrawerSection.tsx/MenuCommentar";
|
||||
import { router, useLocalSearchParams } from "expo-router";
|
||||
import { useState } from "react";
|
||||
|
||||
export default function ForumDetail() {
|
||||
const { id } = useLocalSearchParams();
|
||||
console.log(id);
|
||||
const [openDrawer, setOpenDrawer] = useState(false);
|
||||
const [status, setStatus] = useState("");
|
||||
const [alertStatus, setAlertStatus] = useState(false);
|
||||
const [deleteAlert, setDeleteAlert] = useState(false);
|
||||
const [text, setText] = useState("");
|
||||
|
||||
// Comentar
|
||||
const [openDrawerCommentar, setOpenDrawerCommentar] = useState(false);
|
||||
const [alertDeleteCommentar, setAlertDeleteCommentar] = useState(false);
|
||||
|
||||
const dataDummy = {
|
||||
name: "Bagas",
|
||||
status: "Open",
|
||||
date: "14/07/2025",
|
||||
deskripsi:
|
||||
"Lorem ipsum dolor sit amet consectetur adipisicing elit. Vitae inventore iure pariatur, libero omnis excepturi. Ullam ad officiis deleniti quos esse odit nesciunt, ipsam adipisci cumque aliquam corporis culpa fugit?",
|
||||
jumlahBalas: 2,
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<ViewWrapper>
|
||||
{/* <StackCustom>
|
||||
</StackCustom> */}
|
||||
<Forum_BoxDetailSection
|
||||
data={dataDummy}
|
||||
setOpenDrawer={setOpenDrawer}
|
||||
setStatus={setStatus}
|
||||
/>
|
||||
|
||||
<TextAreaCustom
|
||||
placeholder="Ketik diskusi anda..."
|
||||
maxLength={1000}
|
||||
showCount
|
||||
value={text}
|
||||
onChangeText={setText}
|
||||
style={{
|
||||
marginBottom: 0,
|
||||
}}
|
||||
/>
|
||||
<ButtonCustom
|
||||
style={{
|
||||
alignSelf: "flex-end",
|
||||
}}
|
||||
onPress={() => {
|
||||
console.log("Posting", text);
|
||||
router.back();
|
||||
}}
|
||||
>
|
||||
Balas
|
||||
</ButtonCustom>
|
||||
|
||||
<Spacing height={40} />
|
||||
|
||||
{listDummyCommentarForum.map((e, i) => (
|
||||
<Forum_CommentarBoxSection
|
||||
key={i}
|
||||
data={e}
|
||||
setOpenDrawer={setOpenDrawerCommentar}
|
||||
/>
|
||||
))}
|
||||
</ViewWrapper>
|
||||
|
||||
<DrawerCustom
|
||||
height={350}
|
||||
isVisible={openDrawer}
|
||||
closeDrawer={() => setOpenDrawer(false)}
|
||||
>
|
||||
<Forum_MenuDrawerBerandaSection
|
||||
id={id as string}
|
||||
status={status}
|
||||
setIsDrawerOpen={() => {
|
||||
setOpenDrawer(false);
|
||||
}}
|
||||
setShowDeleteAlert={setDeleteAlert}
|
||||
setShowAlertStatus={setAlertStatus}
|
||||
/>
|
||||
</DrawerCustom>
|
||||
|
||||
{/* Alert Status */}
|
||||
<AlertCustom
|
||||
isVisible={alertStatus}
|
||||
title="Ubah Status Forum"
|
||||
message="Apakah Anda yakin ingin mengubah status forum ini?"
|
||||
onLeftPress={() => {
|
||||
setOpenDrawer(false);
|
||||
setAlertStatus(false);
|
||||
console.log("Batal");
|
||||
}}
|
||||
onRightPress={() => {
|
||||
setOpenDrawer(false);
|
||||
setAlertStatus(false);
|
||||
console.log("Ubah status forum");
|
||||
}}
|
||||
textLeft="Batal"
|
||||
textRight="Ubah"
|
||||
colorRight={MainColor.green}
|
||||
/>
|
||||
|
||||
{/* Alert Delete */}
|
||||
<AlertCustom
|
||||
isVisible={deleteAlert}
|
||||
title="Hapus Forum"
|
||||
message="Apakah Anda yakin ingin menghapus forum ini?"
|
||||
onLeftPress={() => {
|
||||
setOpenDrawer(false);
|
||||
setDeleteAlert(false);
|
||||
console.log("Batal");
|
||||
}}
|
||||
onRightPress={() => {
|
||||
setOpenDrawer(false);
|
||||
setDeleteAlert(false);
|
||||
console.log("Hapus forum");
|
||||
}}
|
||||
textLeft="Batal"
|
||||
textRight="Hapus"
|
||||
colorRight={MainColor.red}
|
||||
/>
|
||||
|
||||
{/* Commentar */}
|
||||
<DrawerCustom
|
||||
height={350}
|
||||
isVisible={openDrawerCommentar}
|
||||
closeDrawer={() => setOpenDrawerCommentar(false)}
|
||||
>
|
||||
<Forum_MenuDrawerCommentar
|
||||
id={id as string}
|
||||
setIsDrawerOpen={() => {
|
||||
setOpenDrawerCommentar(false);
|
||||
}}
|
||||
setShowDeleteAlert={setAlertDeleteCommentar}
|
||||
/>
|
||||
</DrawerCustom>
|
||||
|
||||
{/* Alert Delete Commentar */}
|
||||
<AlertCustom
|
||||
isVisible={alertDeleteCommentar}
|
||||
title="Hapus Komentar"
|
||||
message="Apakah Anda yakin ingin menghapus komentar ini?"
|
||||
onLeftPress={() => {
|
||||
setOpenDrawerCommentar(false);
|
||||
setAlertDeleteCommentar(false);
|
||||
console.log("Batal");
|
||||
}}
|
||||
onRightPress={() => {
|
||||
setOpenDrawerCommentar(false);
|
||||
setAlertDeleteCommentar(false);
|
||||
console.log("Hapus commentar");
|
||||
}}
|
||||
textLeft="Batal"
|
||||
textRight="Hapus"
|
||||
colorRight={MainColor.red}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
import {
|
||||
BoxButtonOnFooter,
|
||||
ButtonCustom,
|
||||
TextAreaCustom,
|
||||
ViewWrapper,
|
||||
} from "@/components";
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
import { router } from "expo-router";
|
||||
|
||||
export default function ForumOtherReportCommentar() {
|
||||
const handleSubmit = (
|
||||
<BoxButtonOnFooter>
|
||||
<ButtonCustom
|
||||
backgroundColor={MainColor.red}
|
||||
textColor={MainColor.white}
|
||||
onPress={() => {
|
||||
console.log("Report lainnya");
|
||||
router.back();
|
||||
}}
|
||||
>
|
||||
Report
|
||||
</ButtonCustom>
|
||||
</BoxButtonOnFooter>
|
||||
);
|
||||
return (
|
||||
<>
|
||||
<ViewWrapper footerComponent={handleSubmit}>
|
||||
<TextAreaCustom placeholder="Laporkan Komentar" />
|
||||
</ViewWrapper>
|
||||
</>
|
||||
);
|
||||
}
|
||||
32
app/(application)/(user)/forum/[id]/other-report-posting.tsx
Normal file
32
app/(application)/(user)/forum/[id]/other-report-posting.tsx
Normal file
@@ -0,0 +1,32 @@
|
||||
import {
|
||||
BoxButtonOnFooter,
|
||||
ButtonCustom,
|
||||
TextAreaCustom,
|
||||
ViewWrapper,
|
||||
} from "@/components";
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
import { router } from "expo-router";
|
||||
|
||||
export default function ForumOtherReportPosting() {
|
||||
const handleSubmit = (
|
||||
<BoxButtonOnFooter>
|
||||
<ButtonCustom
|
||||
backgroundColor={MainColor.red}
|
||||
textColor={MainColor.white}
|
||||
onPress={() => {
|
||||
console.log("Report lainnya");
|
||||
router.back();
|
||||
}}
|
||||
>
|
||||
Report
|
||||
</ButtonCustom>
|
||||
</BoxButtonOnFooter>
|
||||
);
|
||||
return (
|
||||
<>
|
||||
<ViewWrapper footerComponent={handleSubmit}>
|
||||
<TextAreaCustom placeholder="Laporkan Diskusi" />
|
||||
</ViewWrapper>
|
||||
</>
|
||||
);
|
||||
}
|
||||
42
app/(application)/(user)/forum/[id]/report-commentar.tsx
Normal file
42
app/(application)/(user)/forum/[id]/report-commentar.tsx
Normal file
@@ -0,0 +1,42 @@
|
||||
import {
|
||||
ButtonCustom,
|
||||
Spacing,
|
||||
StackCustom,
|
||||
ViewWrapper
|
||||
} from "@/components";
|
||||
import { AccentColor, MainColor } from "@/constants/color-palet";
|
||||
import Forum_ReportListSection from "@/screens/Forum/ReportListSection";
|
||||
import { router } from "expo-router";
|
||||
|
||||
export default function ForumReportCommentar() {
|
||||
return (
|
||||
<>
|
||||
<ViewWrapper>
|
||||
<StackCustom>
|
||||
<Forum_ReportListSection />
|
||||
<ButtonCustom
|
||||
backgroundColor={MainColor.red}
|
||||
textColor={MainColor.white}
|
||||
onPress={() => {
|
||||
console.log("Report");
|
||||
router.back();
|
||||
}}
|
||||
>
|
||||
Report
|
||||
</ButtonCustom>
|
||||
<ButtonCustom
|
||||
backgroundColor={AccentColor.blue}
|
||||
textColor={MainColor.white}
|
||||
onPress={() => {
|
||||
console.log("Lainnya");
|
||||
router.replace("/forum/[id]/other-report-commentar");
|
||||
}}
|
||||
>
|
||||
Lainnya
|
||||
</ButtonCustom>
|
||||
<Spacing/>
|
||||
</StackCustom>
|
||||
</ViewWrapper>
|
||||
</>
|
||||
);
|
||||
}
|
||||
37
app/(application)/(user)/forum/[id]/report-posting.tsx
Normal file
37
app/(application)/(user)/forum/[id]/report-posting.tsx
Normal file
@@ -0,0 +1,37 @@
|
||||
import { ViewWrapper, StackCustom, ButtonCustom, Spacing } from "@/components";
|
||||
import { MainColor, AccentColor } from "@/constants/color-palet";
|
||||
import Forum_ReportListSection from "@/screens/Forum/ReportListSection";
|
||||
import { router } from "expo-router";
|
||||
|
||||
export default function ForumReportPosting() {
|
||||
return (
|
||||
<>
|
||||
<ViewWrapper>
|
||||
<StackCustom>
|
||||
<Forum_ReportListSection />
|
||||
<ButtonCustom
|
||||
backgroundColor={MainColor.red}
|
||||
textColor={MainColor.white}
|
||||
onPress={() => {
|
||||
console.log("Report");
|
||||
router.back();
|
||||
}}
|
||||
>
|
||||
Report
|
||||
</ButtonCustom>
|
||||
<ButtonCustom
|
||||
backgroundColor={AccentColor.blue}
|
||||
textColor={MainColor.white}
|
||||
onPress={() => {
|
||||
console.log("Lainnya");
|
||||
router.replace("/forum/[id]/other-report-posting");
|
||||
}}
|
||||
>
|
||||
Lainnya
|
||||
</ButtonCustom>
|
||||
<Spacing />
|
||||
</StackCustom>
|
||||
</ViewWrapper>
|
||||
</>
|
||||
);
|
||||
}
|
||||
37
app/(application)/(user)/forum/create.tsx
Normal file
37
app/(application)/(user)/forum/create.tsx
Normal file
@@ -0,0 +1,37 @@
|
||||
import {
|
||||
BoxButtonOnFooter,
|
||||
ButtonCustom,
|
||||
TextAreaCustom,
|
||||
ViewWrapper,
|
||||
} from "@/components";
|
||||
import { router } from "expo-router";
|
||||
import { useState } from "react";
|
||||
|
||||
export default function ForumCreate() {
|
||||
const [text, setText] = useState("");
|
||||
|
||||
const buttonFooter = (
|
||||
<BoxButtonOnFooter>
|
||||
<ButtonCustom
|
||||
onPress={() => {
|
||||
console.log("Posting", text);
|
||||
router.back();
|
||||
}}
|
||||
>
|
||||
Posting
|
||||
</ButtonCustom>
|
||||
</BoxButtonOnFooter>
|
||||
);
|
||||
|
||||
return (
|
||||
<ViewWrapper footerComponent={buttonFooter}>
|
||||
<TextAreaCustom
|
||||
placeholder="Ketik diskusi anda..."
|
||||
maxLength={1000}
|
||||
showCount
|
||||
value={text}
|
||||
onChangeText={setText}
|
||||
/>
|
||||
</ViewWrapper>
|
||||
);
|
||||
}
|
||||
128
app/(application)/(user)/forum/index.tsx
Normal file
128
app/(application)/(user)/forum/index.tsx
Normal file
@@ -0,0 +1,128 @@
|
||||
import {
|
||||
AlertCustom,
|
||||
AvatarCustom,
|
||||
BackButton,
|
||||
DrawerCustom,
|
||||
TextInputCustom,
|
||||
ViewWrapper,
|
||||
} from "@/components";
|
||||
import FloatingButton from "@/components/Button/FloatingButton";
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
import { ICON_SIZE_SMALL } from "@/constants/constans-value";
|
||||
import Forum_BoxDetailSection from "@/screens/Forum/DiscussionBoxSection";
|
||||
import { listDummyDiscussionForum } from "@/screens/Forum/list-data-dummy";
|
||||
import Forum_MenuDrawerBerandaSection from "@/screens/Forum/MenuDrawerSection.tsx/MenuBeranda";
|
||||
import { Ionicons } from "@expo/vector-icons";
|
||||
import { router, Stack } from "expo-router";
|
||||
import { useState } from "react";
|
||||
|
||||
export default function Forum() {
|
||||
const id = "test-id-forum";
|
||||
const [openDrawer, setOpenDrawer] = useState(false);
|
||||
const [status, setStatus] = useState("");
|
||||
const [alertStatus, setAlertStatus] = useState(false);
|
||||
const [deleteAlert, setDeleteAlert] = useState(false);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Stack.Screen
|
||||
options={{
|
||||
title: "Forum",
|
||||
headerLeft: () => <BackButton />,
|
||||
headerRight: () => <AvatarCustom href={`/forum/${id}/forumku`} />,
|
||||
}}
|
||||
/>
|
||||
|
||||
<ViewWrapper
|
||||
headerComponent={
|
||||
<TextInputCustom
|
||||
iconLeft={
|
||||
<Ionicons
|
||||
name="search-outline"
|
||||
size={ICON_SIZE_SMALL}
|
||||
color={MainColor.placeholder}
|
||||
/>
|
||||
}
|
||||
placeholder="Cari topik forum..."
|
||||
borderRadius={50}
|
||||
containerStyle={{ marginBottom: 0 }}
|
||||
/>
|
||||
}
|
||||
floatingButton={
|
||||
<FloatingButton
|
||||
onPress={() =>
|
||||
router.navigate("/(application)/(user)/forum/create")
|
||||
}
|
||||
/>
|
||||
}
|
||||
>
|
||||
{listDummyDiscussionForum.map((e, i) => (
|
||||
<Forum_BoxDetailSection
|
||||
key={i}
|
||||
data={e}
|
||||
setOpenDrawer={setOpenDrawer}
|
||||
setStatus={setStatus}
|
||||
isTruncate={true}
|
||||
href={`/forum/${id}`}
|
||||
/>
|
||||
))}
|
||||
</ViewWrapper>
|
||||
|
||||
<DrawerCustom
|
||||
height={350}
|
||||
isVisible={openDrawer}
|
||||
closeDrawer={() => setOpenDrawer(false)}
|
||||
>
|
||||
<Forum_MenuDrawerBerandaSection
|
||||
id={id}
|
||||
status={status}
|
||||
setIsDrawerOpen={() => {
|
||||
setOpenDrawer(false);
|
||||
}}
|
||||
setShowDeleteAlert={setDeleteAlert}
|
||||
setShowAlertStatus={setAlertStatus}
|
||||
/>
|
||||
</DrawerCustom>
|
||||
|
||||
{/* Alert Status */}
|
||||
<AlertCustom
|
||||
isVisible={alertStatus}
|
||||
title="Ubah Status Forum"
|
||||
message="Apakah Anda yakin ingin mengubah status forum ini?"
|
||||
onLeftPress={() => {
|
||||
setOpenDrawer(false);
|
||||
setAlertStatus(false);
|
||||
console.log("Batal");
|
||||
}}
|
||||
onRightPress={() => {
|
||||
setOpenDrawer(false);
|
||||
setAlertStatus(false);
|
||||
console.log("Ubah status forum");
|
||||
}}
|
||||
textLeft="Batal"
|
||||
textRight="Ubah"
|
||||
colorRight={MainColor.green}
|
||||
/>
|
||||
|
||||
{/* Alert Delete */}
|
||||
<AlertCustom
|
||||
isVisible={deleteAlert}
|
||||
title="Hapus Forum"
|
||||
message="Apakah Anda yakin ingin menghapus forum ini?"
|
||||
onLeftPress={() => {
|
||||
setOpenDrawer(false);
|
||||
setDeleteAlert(false);
|
||||
console.log("Batal");
|
||||
}}
|
||||
onRightPress={() => {
|
||||
setOpenDrawer(false);
|
||||
setDeleteAlert(false);
|
||||
console.log("Hapus forum");
|
||||
}}
|
||||
textLeft="Batal"
|
||||
textRight="Hapus"
|
||||
colorRight={MainColor.red}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
55
app/(application)/(user)/maps/[id]/custom-pin.tsx
Normal file
55
app/(application)/(user)/maps/[id]/custom-pin.tsx
Normal file
@@ -0,0 +1,55 @@
|
||||
import {
|
||||
AvatarCustom,
|
||||
BaseBox,
|
||||
BoxButtonOnFooter,
|
||||
ButtonCenteredOnly,
|
||||
ButtonCustom,
|
||||
InformationBox,
|
||||
MapCustom,
|
||||
Spacing,
|
||||
StackCustom,
|
||||
ViewWrapper,
|
||||
} from "@/components";
|
||||
import CenterCustom from "@/components/Center/CenterCustom";
|
||||
import { router, useLocalSearchParams } from "expo-router";
|
||||
|
||||
export default function MapsCustomPin() {
|
||||
const { id } = useLocalSearchParams();
|
||||
|
||||
const buttonFooter = (
|
||||
<BoxButtonOnFooter>
|
||||
<ButtonCustom
|
||||
onPress={() => {
|
||||
console.log(`Simpan maps ${id}`);
|
||||
router.back();
|
||||
}}
|
||||
>
|
||||
Simpan
|
||||
</ButtonCustom>
|
||||
</BoxButtonOnFooter>
|
||||
);
|
||||
return (
|
||||
<>
|
||||
<ViewWrapper footerComponent={buttonFooter}>
|
||||
<StackCustom>
|
||||
<InformationBox text="Pin map akan secara otomatis menampilkan logo pada porotofolio ini, jika anda ingin melakukan custom silahkan upload logo pin baru anda." />
|
||||
<CenterCustom>
|
||||
<AvatarCustom size="xl" />
|
||||
</CenterCustom>
|
||||
<ButtonCenteredOnly
|
||||
onPress={() => console.log("Upload")}
|
||||
icon="upload"
|
||||
>
|
||||
Upload
|
||||
</ButtonCenteredOnly>
|
||||
<Spacing />
|
||||
|
||||
<BaseBox>
|
||||
<MapCustom />
|
||||
</BaseBox>
|
||||
<Spacing />
|
||||
</StackCustom>
|
||||
</ViewWrapper>
|
||||
</>
|
||||
);
|
||||
}
|
||||
59
app/(application)/(user)/maps/[id]/edit.tsx
Normal file
59
app/(application)/(user)/maps/[id]/edit.tsx
Normal file
@@ -0,0 +1,59 @@
|
||||
import {
|
||||
BaseBox,
|
||||
BoxButtonOnFooter,
|
||||
ButtonCenteredOnly,
|
||||
ButtonCustom,
|
||||
InformationBox,
|
||||
LandscapeFrameUploaded,
|
||||
MapCustom,
|
||||
Spacing,
|
||||
TextInputCustom,
|
||||
ViewWrapper
|
||||
} from "@/components";
|
||||
import { router, useLocalSearchParams } from "expo-router";
|
||||
|
||||
export default function MapsEdit() {
|
||||
const { id } = useLocalSearchParams();
|
||||
const buttonFooter = (
|
||||
<BoxButtonOnFooter>
|
||||
<ButtonCustom
|
||||
onPress={() => {
|
||||
console.log(`Simpan maps ${id}`);
|
||||
router.back()
|
||||
}}
|
||||
>
|
||||
Simpan
|
||||
</ButtonCustom>
|
||||
</BoxButtonOnFooter>
|
||||
);
|
||||
return (
|
||||
<ViewWrapper footerComponent={buttonFooter}>
|
||||
<InformationBox text="Tentukan lokasi pin map dengan menekan pada map." />
|
||||
|
||||
<BaseBox>
|
||||
<MapCustom />
|
||||
</BaseBox>
|
||||
|
||||
<TextInputCustom
|
||||
required
|
||||
label="Nama Pin"
|
||||
placeholder="Masukkan nama pin maps"
|
||||
/>
|
||||
|
||||
<Spacing />
|
||||
|
||||
<InformationBox text="Upload foto lokasi bisnis anda untuk ditampilkan dalam detail maps." />
|
||||
<LandscapeFrameUploaded />
|
||||
<ButtonCenteredOnly
|
||||
icon="upload"
|
||||
onPress={() => {
|
||||
console.log("Upload foto ");
|
||||
router.navigate(`/take-picture/${id}`);
|
||||
}}
|
||||
>
|
||||
Upload
|
||||
</ButtonCenteredOnly>
|
||||
<Spacing height={50} />
|
||||
</ViewWrapper>
|
||||
);
|
||||
}
|
||||
59
app/(application)/(user)/maps/create.tsx
Normal file
59
app/(application)/(user)/maps/create.tsx
Normal file
@@ -0,0 +1,59 @@
|
||||
import {
|
||||
BaseBox,
|
||||
BoxButtonOnFooter,
|
||||
ButtonCenteredOnly,
|
||||
ButtonCustom,
|
||||
InformationBox,
|
||||
LandscapeFrameUploaded,
|
||||
Spacing,
|
||||
TextCustom,
|
||||
TextInputCustom,
|
||||
ViewWrapper,
|
||||
} from "@/components";
|
||||
import { router, useLocalSearchParams } from "expo-router";
|
||||
|
||||
export default function MapsCreate() {
|
||||
const { id } = useLocalSearchParams();
|
||||
const buttonFooter = (
|
||||
<BoxButtonOnFooter>
|
||||
<ButtonCustom
|
||||
onPress={() => {
|
||||
console.log(`Simpan maps ${id}`);
|
||||
router.replace(`/portofolio/${id}`);
|
||||
}}
|
||||
>
|
||||
Simpan
|
||||
</ButtonCustom>
|
||||
</BoxButtonOnFooter>
|
||||
);
|
||||
return (
|
||||
<ViewWrapper footerComponent={buttonFooter}>
|
||||
<InformationBox text="Tentukan lokasi pin map dengan menekan pada map." />
|
||||
|
||||
<BaseBox style={{ height: 400 }}>
|
||||
<TextCustom>Maps Her</TextCustom>
|
||||
</BaseBox>
|
||||
|
||||
<TextInputCustom
|
||||
required
|
||||
label="Nama Pin"
|
||||
placeholder="Masukkan nama pin maps"
|
||||
/>
|
||||
|
||||
<Spacing height={50} />
|
||||
|
||||
<InformationBox text="Upload foto lokasi bisnis anda untuk ditampilkan dalam detail maps." />
|
||||
<LandscapeFrameUploaded />
|
||||
<ButtonCenteredOnly
|
||||
icon="upload"
|
||||
onPress={() => {
|
||||
console.log("Upload foto ");
|
||||
router.navigate(`/take-picture/${id}`);
|
||||
}}
|
||||
>
|
||||
Upload
|
||||
</ButtonCenteredOnly>
|
||||
<Spacing height={50} />
|
||||
</ViewWrapper>
|
||||
);
|
||||
}
|
||||
9
app/(application)/(user)/maps/index.tsx
Normal file
9
app/(application)/(user)/maps/index.tsx
Normal file
@@ -0,0 +1,9 @@
|
||||
import { MapCustom, ViewWrapper } from "@/components";
|
||||
|
||||
export default function Maps() {
|
||||
return (
|
||||
<ViewWrapper style={{ paddingInline: 0, paddingBlock: 0 }}>
|
||||
<MapCustom height={"100%"} />
|
||||
</ViewWrapper>
|
||||
);
|
||||
}
|
||||
9
app/(application)/(user)/marketplace/index.tsx
Normal file
9
app/(application)/(user)/marketplace/index.tsx
Normal file
@@ -0,0 +1,9 @@
|
||||
import { TextCustom, ViewWrapper } from "@/components";
|
||||
|
||||
export default function Marketplace() {
|
||||
return (
|
||||
<ViewWrapper>
|
||||
<TextCustom>Marketplace</TextCustom>
|
||||
</ViewWrapper>
|
||||
);
|
||||
}
|
||||
111
app/(application)/(user)/notifications/index.tsx
Normal file
111
app/(application)/(user)/notifications/index.tsx
Normal file
@@ -0,0 +1,111 @@
|
||||
import {
|
||||
BaseBox,
|
||||
Grid,
|
||||
ScrollableCustom,
|
||||
StackCustom,
|
||||
TextCustom,
|
||||
ViewWrapper,
|
||||
} from "@/components";
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
import { useState } from "react";
|
||||
import { View } from "react-native";
|
||||
|
||||
const categories = [
|
||||
{ value: "all", label: "Semua" },
|
||||
{ value: "event", label: "Event" },
|
||||
{ value: "job", label: "Job" },
|
||||
{ value: "voting", label: "Voting" },
|
||||
{ value: "donasi", label: "Donasi" },
|
||||
{ value: "investasi", label: "Investasi" },
|
||||
{ value: "forum", label: "Forum" },
|
||||
{ value: "collaboration", label: "Collaboration" },
|
||||
];
|
||||
|
||||
const selectedCategory = (value: string) => {
|
||||
const category = categories.find((c) => c.value === value);
|
||||
return category?.label;
|
||||
};
|
||||
|
||||
const BoxNotification = ({
|
||||
index,
|
||||
activeCategory,
|
||||
}: {
|
||||
index: number;
|
||||
activeCategory: string | null;
|
||||
}) => {
|
||||
return (
|
||||
<>
|
||||
<BaseBox
|
||||
onPress={() =>
|
||||
console.log(
|
||||
"Notification >",
|
||||
selectedCategory(activeCategory as string)
|
||||
)
|
||||
}
|
||||
>
|
||||
<StackCustom>
|
||||
<TextCustom bold>
|
||||
# {selectedCategory(activeCategory as string)}
|
||||
</TextCustom>
|
||||
|
||||
<View
|
||||
style={{
|
||||
borderBottomColor: MainColor.white_gray,
|
||||
borderBottomWidth: 1,
|
||||
}}
|
||||
/>
|
||||
|
||||
<TextCustom truncate={2}>
|
||||
Lorem ipsum dolor sit amet consectetur adipisicing elit. Sint odio
|
||||
unde quidem voluptate quam culpa sequi molestias ipsa corrupti id,
|
||||
soluta, nostrum adipisci similique, et illo asperiores deleniti eum
|
||||
labore.
|
||||
</TextCustom>
|
||||
|
||||
<Grid>
|
||||
<Grid.Col span={6}>
|
||||
<TextCustom size="small" color="gray">
|
||||
{index + 1} Agustus 2025
|
||||
</TextCustom>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={6} style={{ alignItems: "flex-end" }}>
|
||||
<TextCustom size="small" color="gray">
|
||||
Belum lihat
|
||||
</TextCustom>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
</StackCustom>
|
||||
</BaseBox>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default function Notifications() {
|
||||
const [activeCategory, setActiveCategory] = useState<string | null>("all");
|
||||
|
||||
const handlePress = (item: any) => {
|
||||
setActiveCategory(item.value);
|
||||
// tambahkan logika lain seperti filter dsb.
|
||||
};
|
||||
return (
|
||||
<ViewWrapper
|
||||
headerComponent={
|
||||
<ScrollableCustom
|
||||
data={categories.map((e, i) => ({
|
||||
id: i,
|
||||
label: e.label,
|
||||
value: e.value,
|
||||
}))}
|
||||
onButtonPress={handlePress}
|
||||
activeId={activeCategory as string}
|
||||
/>
|
||||
}
|
||||
>
|
||||
{Array.from({ length: 20 }).map((e, i) => (
|
||||
<View key={i}>
|
||||
<BoxNotification index={i} activeCategory={activeCategory as any} />
|
||||
</View>
|
||||
))}
|
||||
</ViewWrapper>
|
||||
);
|
||||
}
|
||||
191
app/(application)/(user)/portofolio/[id]/create.tsx
Normal file
191
app/(application)/(user)/portofolio/[id]/create.tsx
Normal file
@@ -0,0 +1,191 @@
|
||||
import {
|
||||
BoxButtonOnFooter,
|
||||
ButtonCenteredOnly,
|
||||
ButtonCustom,
|
||||
Grid,
|
||||
InformationBox,
|
||||
LandscapeFrameUploaded,
|
||||
SelectCustom,
|
||||
Spacing,
|
||||
StackCustom,
|
||||
TextAreaCustom,
|
||||
TextCustom,
|
||||
TextInputCustom,
|
||||
ViewWrapper,
|
||||
} from "@/components";
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
import dummyMasterBidangBisnis from "@/lib/dummy-data/master-bidang-bisnis";
|
||||
import dummyMasterSubBidangBisnis from "@/lib/dummy-data/master-sub-bidang-bisnis";
|
||||
import { Ionicons } from "@expo/vector-icons";
|
||||
import { router, useLocalSearchParams } from "expo-router";
|
||||
import { useState } from "react";
|
||||
import { Text, TouchableOpacity, View } from "react-native";
|
||||
import PhoneInput, { ICountry } from "react-native-international-phone-number";
|
||||
|
||||
export default function PortofolioCreate() {
|
||||
const { id } = useLocalSearchParams();
|
||||
const [selectedCountry, setSelectedCountry] = useState<null | ICountry>(null);
|
||||
const [inputValue, setInputValue] = useState<string>("");
|
||||
const [data, setData] = useState({
|
||||
name: "",
|
||||
bidang_usaha: "",
|
||||
sub_bidang_usaha: "",
|
||||
alamat: "",
|
||||
nomor_telepon: "",
|
||||
deskripsi: "",
|
||||
});
|
||||
|
||||
function handleInputValue(phoneNumber: string) {
|
||||
setInputValue(phoneNumber);
|
||||
}
|
||||
|
||||
function handleSelectedCountry(country: ICountry) {
|
||||
setSelectedCountry(country);
|
||||
}
|
||||
|
||||
function handleSave() {
|
||||
console.log("Selanjutnya");
|
||||
router.replace(`/maps/create`);
|
||||
}
|
||||
|
||||
const buttonSave = (
|
||||
<BoxButtonOnFooter>
|
||||
<ButtonCustom onPress={handleSave}>Selanjutnya</ButtonCustom>
|
||||
</BoxButtonOnFooter>
|
||||
);
|
||||
|
||||
return (
|
||||
<ViewWrapper footerComponent={buttonSave}>
|
||||
{/* <TextCustom>Portofolio Create {id}</TextCustom> */}
|
||||
<StackCustom gap={"xs"}>
|
||||
<InformationBox text="Lengkapi data bisnis anda." />
|
||||
<TextInputCustom
|
||||
required
|
||||
label="Nama Bisnis"
|
||||
placeholder="Masukkan nama bisnis"
|
||||
|
||||
/>
|
||||
<SelectCustom
|
||||
label="Bidang Usaha"
|
||||
required
|
||||
data={dummyMasterBidangBisnis.map((item) => ({
|
||||
label: item.name,
|
||||
value: item.id,
|
||||
}))}
|
||||
value={data.bidang_usaha}
|
||||
onChange={(value) => {
|
||||
setData({ ...(data as any), bidang_usaha: value });
|
||||
}}
|
||||
/>
|
||||
|
||||
<Grid>
|
||||
<Grid.Col span={10}>
|
||||
<SelectCustom
|
||||
// disabled
|
||||
label="Sub Bidang Usaha"
|
||||
required
|
||||
data={dummyMasterSubBidangBisnis.map((item) => ({
|
||||
label: item.name,
|
||||
value: item.id,
|
||||
}))}
|
||||
value={data.sub_bidang_usaha}
|
||||
onChange={(value) => {
|
||||
setData({ ...(data as any), sub_bidang_usaha: value });
|
||||
}}
|
||||
/>
|
||||
</Grid.Col>
|
||||
<Grid.Col
|
||||
span={2}
|
||||
style={{ alignItems: "center", justifyContent: "center" }}
|
||||
>
|
||||
<TouchableOpacity onPress={() => console.log("delete")}>
|
||||
<Ionicons name="trash" size={24} color={MainColor.red} />
|
||||
</TouchableOpacity>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
|
||||
<ButtonCenteredOnly onPress={() => console.log("add")}>
|
||||
Tambah Pilihan
|
||||
</ButtonCenteredOnly>
|
||||
<Spacing />
|
||||
|
||||
<View>
|
||||
<View style={{ flexDirection: "row", alignItems: "center" }}>
|
||||
<TextCustom semiBold style={{ color: MainColor.white_gray }}>
|
||||
Nomor Telepon
|
||||
</TextCustom>
|
||||
<Text style={{ color: "red" }}> *</Text>
|
||||
</View>
|
||||
<Spacing height={5} />
|
||||
<PhoneInput
|
||||
value={inputValue}
|
||||
onChangePhoneNumber={handleInputValue}
|
||||
selectedCountry={selectedCountry}
|
||||
onChangeSelectedCountry={handleSelectedCountry}
|
||||
defaultCountry="ID"
|
||||
placeholder="xxx-xxx-xxx"
|
||||
/>
|
||||
</View>
|
||||
<Spacing />
|
||||
|
||||
<TextInputCustom
|
||||
required
|
||||
label="Alamat Bisnis"
|
||||
placeholder="Masukkan alamat bisnis"
|
||||
/>
|
||||
|
||||
<TextAreaCustom
|
||||
label="Deskripsi Bisnis"
|
||||
placeholder="Masukkan deskripsi bisnis"
|
||||
value={data.deskripsi}
|
||||
onChangeText={(value: any) => setData({ ...data, deskripsi: value })}
|
||||
autosize
|
||||
minRows={2}
|
||||
maxRows={5}
|
||||
required
|
||||
showCount
|
||||
maxLength={100}
|
||||
/>
|
||||
<Spacing />
|
||||
|
||||
{/* Logo */}
|
||||
<InformationBox text="Upload logo bisnis anda untuk di tampilaka pada portofolio." />
|
||||
<LandscapeFrameUploaded />
|
||||
<ButtonCenteredOnly
|
||||
icon="upload"
|
||||
onPress={() => {
|
||||
console.log("Upload logo >>", id);
|
||||
router.navigate(`/(application)/(image)/take-picture/${id}`);
|
||||
}}
|
||||
>
|
||||
Upload
|
||||
</ButtonCenteredOnly>
|
||||
<Spacing height={40} />
|
||||
|
||||
{/* Social Media */}
|
||||
<InformationBox text="Isi hanya pada sosial media yang anda miliki." />
|
||||
<TextInputCustom
|
||||
label="Tiktok"
|
||||
placeholder="Masukkan username tiktok"
|
||||
/>
|
||||
<TextInputCustom
|
||||
label="Facebook"
|
||||
placeholder="Masukkan username facebook"
|
||||
/>
|
||||
<TextInputCustom
|
||||
label="Instagram"
|
||||
placeholder="Masukkan username instagram"
|
||||
/>
|
||||
<TextInputCustom
|
||||
label="Twitter"
|
||||
placeholder="Masukkan username twitter"
|
||||
/>
|
||||
<TextInputCustom
|
||||
label="Youtube"
|
||||
placeholder="Masukkan username youtube"
|
||||
/>
|
||||
<Spacing />
|
||||
</StackCustom>
|
||||
</ViewWrapper>
|
||||
);
|
||||
}
|
||||
48
app/(application)/(user)/portofolio/[id]/edit-logo.tsx
Normal file
48
app/(application)/(user)/portofolio/[id]/edit-logo.tsx
Normal file
@@ -0,0 +1,48 @@
|
||||
import {
|
||||
AvatarCustom,
|
||||
BaseBox,
|
||||
BoxButtonOnFooter,
|
||||
ButtonCenteredOnly,
|
||||
ButtonCustom,
|
||||
ViewWrapper,
|
||||
} from "@/components";
|
||||
import { router, useLocalSearchParams } from "expo-router";
|
||||
|
||||
export default function PortofolioEditLogo() {
|
||||
const { id } = useLocalSearchParams();
|
||||
|
||||
const buttonFooter = (
|
||||
<BoxButtonOnFooter>
|
||||
<ButtonCustom
|
||||
onPress={() => {
|
||||
console.log("Simpan logo ");
|
||||
router.back();
|
||||
}}
|
||||
>
|
||||
Simpan
|
||||
</ButtonCustom>
|
||||
</BoxButtonOnFooter>
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
<ViewWrapper footerComponent={buttonFooter}>
|
||||
<BaseBox
|
||||
style={{
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
height: 250,
|
||||
}}
|
||||
>
|
||||
<AvatarCustom size="xl" />
|
||||
</BaseBox>
|
||||
<ButtonCenteredOnly
|
||||
icon="upload"
|
||||
onPress={() => router.navigate(`/take-picture/${id}`)}
|
||||
>
|
||||
Update
|
||||
</ButtonCenteredOnly>
|
||||
</ViewWrapper>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
import {
|
||||
BoxButtonOnFooter,
|
||||
ButtonCustom,
|
||||
TextInputCustom,
|
||||
ViewWrapper,
|
||||
} from "@/components";
|
||||
import { useLocalSearchParams, router } from "expo-router";
|
||||
|
||||
export default function PortofolioEditSocialMedia() {
|
||||
const { id } = useLocalSearchParams();
|
||||
|
||||
const buttonFooter = (
|
||||
<BoxButtonOnFooter>
|
||||
<ButtonCustom
|
||||
onPress={() => {
|
||||
console.log(`Simpan sosmed ${id}`);
|
||||
router.back();
|
||||
}}
|
||||
>
|
||||
Simpan
|
||||
</ButtonCustom>
|
||||
</BoxButtonOnFooter>
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
<ViewWrapper footerComponent={buttonFooter}>
|
||||
<TextInputCustom label="Tiktok" placeholder="Masukkan tiktok" />
|
||||
<TextInputCustom label="Instagram" placeholder="Masukkan instagram" />
|
||||
<TextInputCustom label="Facebook" placeholder="Masukkan facebook" />
|
||||
<TextInputCustom label="Twitter" placeholder="Masukkan twitter" />
|
||||
<TextInputCustom label="Youtube" placeholder="Masukkan youtube" />
|
||||
</ViewWrapper>
|
||||
</>
|
||||
);
|
||||
}
|
||||
151
app/(application)/(user)/portofolio/[id]/edit.tsx
Normal file
151
app/(application)/(user)/portofolio/[id]/edit.tsx
Normal file
@@ -0,0 +1,151 @@
|
||||
import {
|
||||
BoxButtonOnFooter,
|
||||
ButtonCenteredOnly,
|
||||
ButtonCustom,
|
||||
Grid,
|
||||
SelectCustom,
|
||||
Spacing,
|
||||
StackCustom,
|
||||
TextAreaCustom,
|
||||
TextCustom,
|
||||
TextInputCustom,
|
||||
ViewWrapper,
|
||||
} from "@/components";
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
import dummyMasterBidangBisnis from "@/lib/dummy-data/master-bidang-bisnis";
|
||||
import dummyMasterSubBidangBisnis from "@/lib/dummy-data/master-sub-bidang-bisnis";
|
||||
import { Ionicons } from "@expo/vector-icons";
|
||||
import { router, useLocalSearchParams } from "expo-router";
|
||||
import { useState } from "react";
|
||||
import { Text, TouchableOpacity, View } from "react-native";
|
||||
import PhoneInput, { ICountry } from "react-native-international-phone-number";
|
||||
|
||||
export default function PortofolioEdit() {
|
||||
const { id } = useLocalSearchParams();
|
||||
const [selectedCountry, setSelectedCountry] = useState<null | ICountry>(null);
|
||||
const [inputValue, setInputValue] = useState<string>("");
|
||||
|
||||
const [data, setData] = useState({
|
||||
name: "",
|
||||
bidang_usaha: "",
|
||||
sub_bidang_usaha: "",
|
||||
alamat: "",
|
||||
nomor_telepon: "",
|
||||
deskripsi: "",
|
||||
});
|
||||
|
||||
function handleInputValue(phoneNumber: string) {
|
||||
setInputValue(phoneNumber);
|
||||
}
|
||||
|
||||
function handleSelectedCountry(country: ICountry) {
|
||||
setSelectedCountry(country);
|
||||
}
|
||||
|
||||
function handleSave() {
|
||||
console.log(`Update portofolio berhasil ${id}`);
|
||||
router.back();
|
||||
}
|
||||
|
||||
const buttonUpdate = (
|
||||
<BoxButtonOnFooter>
|
||||
<ButtonCustom onPress={handleSave}>Simpan</ButtonCustom>
|
||||
</BoxButtonOnFooter>
|
||||
);
|
||||
return (
|
||||
<>
|
||||
<ViewWrapper footerComponent={buttonUpdate}>
|
||||
<StackCustom gap={"xs"}>
|
||||
<TextInputCustom
|
||||
required
|
||||
label="Nama Bisnis"
|
||||
placeholder="Masukkan nama bisnis"
|
||||
/>
|
||||
|
||||
<SelectCustom
|
||||
label="Bidang Usaha"
|
||||
required
|
||||
data={dummyMasterBidangBisnis.map((item) => ({
|
||||
label: item.name,
|
||||
value: item.id,
|
||||
}))}
|
||||
value={data.bidang_usaha}
|
||||
onChange={(value) => {
|
||||
setData({ ...(data as any), bidang_usaha: value });
|
||||
}}
|
||||
/>
|
||||
|
||||
<Grid>
|
||||
<Grid.Col span={10}>
|
||||
<SelectCustom
|
||||
// disabled
|
||||
label="Sub Bidang Usaha"
|
||||
required
|
||||
data={dummyMasterSubBidangBisnis.map((item) => ({
|
||||
label: item.name,
|
||||
value: item.id,
|
||||
}))}
|
||||
value={data.sub_bidang_usaha}
|
||||
onChange={(value) => {
|
||||
setData({ ...(data as any), sub_bidang_usaha: value });
|
||||
}}
|
||||
/>
|
||||
</Grid.Col>
|
||||
<Grid.Col
|
||||
span={2}
|
||||
style={{ alignItems: "center", justifyContent: "center" }}
|
||||
>
|
||||
<TouchableOpacity onPress={() => console.log("delete")}>
|
||||
<Ionicons name="trash" size={24} color={MainColor.red} />
|
||||
</TouchableOpacity>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
<ButtonCenteredOnly onPress={() => console.log("add")}>
|
||||
Tambah Pilihan
|
||||
</ButtonCenteredOnly>
|
||||
<Spacing />
|
||||
<View>
|
||||
<View style={{ flexDirection: "row", alignItems: "center" }}>
|
||||
<TextCustom semiBold style={{ color: MainColor.white_gray }}>
|
||||
Nomor Telepon
|
||||
</TextCustom>
|
||||
<Text style={{ color: "red" }}> *</Text>
|
||||
</View>
|
||||
<Spacing height={5} />
|
||||
<PhoneInput
|
||||
value={inputValue}
|
||||
onChangePhoneNumber={handleInputValue}
|
||||
selectedCountry={selectedCountry}
|
||||
onChangeSelectedCountry={handleSelectedCountry}
|
||||
defaultCountry="ID"
|
||||
placeholder="xxx-xxx-xxx"
|
||||
/>
|
||||
</View>
|
||||
<Spacing />
|
||||
|
||||
<TextInputCustom
|
||||
required
|
||||
label="Alamat Bisnis"
|
||||
placeholder="Masukkan alamat bisnis"
|
||||
/>
|
||||
|
||||
<TextAreaCustom
|
||||
label="Deskripsi Bisnis"
|
||||
placeholder="Masukkan deskripsi bisnis"
|
||||
value={data.deskripsi}
|
||||
onChangeText={(value: any) =>
|
||||
setData({ ...data, deskripsi: value })
|
||||
}
|
||||
autosize
|
||||
minRows={2}
|
||||
maxRows={5}
|
||||
required
|
||||
showCount
|
||||
maxLength={100}
|
||||
/>
|
||||
<Spacing />
|
||||
</StackCustom>
|
||||
</ViewWrapper>
|
||||
</>
|
||||
);
|
||||
}
|
||||
78
app/(application)/(user)/portofolio/[id]/index.tsx
Normal file
78
app/(application)/(user)/portofolio/[id]/index.tsx
Normal file
@@ -0,0 +1,78 @@
|
||||
import { AlertCustom, DrawerCustom } from "@/components";
|
||||
import LeftButtonCustom from "@/components/Button/BackButton";
|
||||
import ViewWrapper from "@/components/_ShareComponent/ViewWrapper";
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
import { drawerItemsPortofolio } from "@/screens/Portofolio/ListPage";
|
||||
import Portofolio_MenuDrawerSection from "@/screens/Portofolio/MenuDrawer";
|
||||
import PorfofolioSection from "@/screens/Portofolio/PorfofolioSection";
|
||||
import { GStyles } from "@/styles/global-styles";
|
||||
import { Ionicons } from "@expo/vector-icons";
|
||||
import { Stack, useLocalSearchParams, router } from "expo-router";
|
||||
import { useState } from "react";
|
||||
import { TouchableOpacity } from "react-native";
|
||||
|
||||
export default function Portofolio() {
|
||||
const { id } = useLocalSearchParams();
|
||||
const [isDrawerOpen, setIsDrawerOpen] = useState(false);
|
||||
const [deleteAlert, setDeleteAlert] = useState(false);
|
||||
|
||||
const openDrawer = () => {
|
||||
setIsDrawerOpen(true);
|
||||
};
|
||||
const closeDrawer = () => {
|
||||
setIsDrawerOpen(false);
|
||||
};
|
||||
return (
|
||||
<>
|
||||
<ViewWrapper>
|
||||
{/* Header */}
|
||||
<Stack.Screen
|
||||
options={{
|
||||
title: "Portofolio",
|
||||
headerLeft: () => <LeftButtonCustom />,
|
||||
headerRight: () => (
|
||||
<TouchableOpacity onPress={openDrawer}>
|
||||
<Ionicons
|
||||
name="ellipsis-vertical"
|
||||
size={20}
|
||||
color={MainColor.yellow}
|
||||
/>
|
||||
</TouchableOpacity>
|
||||
),
|
||||
headerStyle: GStyles.headerStyle,
|
||||
headerTitleStyle: GStyles.headerTitleStyle,
|
||||
}}
|
||||
/>
|
||||
<PorfofolioSection setShowDeleteAlert={setDeleteAlert} />
|
||||
</ViewWrapper>
|
||||
|
||||
{/* Drawer Komponen Eksternal */}
|
||||
<DrawerCustom
|
||||
isVisible={isDrawerOpen}
|
||||
closeDrawer={closeDrawer}
|
||||
height={350}
|
||||
>
|
||||
<Portofolio_MenuDrawerSection
|
||||
drawerItems={drawerItemsPortofolio({ id: id as string })}
|
||||
setIsDrawerOpen={setIsDrawerOpen}
|
||||
/>
|
||||
</DrawerCustom>
|
||||
|
||||
{/* Alert Delete */}
|
||||
<AlertCustom
|
||||
isVisible={deleteAlert}
|
||||
onLeftPress={() => setDeleteAlert(false)}
|
||||
onRightPress={() => {
|
||||
setDeleteAlert(false);
|
||||
console.log("Hapus portofolio");
|
||||
router.back();
|
||||
}}
|
||||
title="Hapus Portofolio"
|
||||
message="Apakah Anda yakin ingin menghapus portofolio ini?"
|
||||
textLeft="Batal"
|
||||
textRight="Hapus"
|
||||
colorRight={MainColor.red}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
47
app/(application)/(user)/portofolio/[id]/list.tsx
Normal file
47
app/(application)/(user)/portofolio/[id]/list.tsx
Normal file
@@ -0,0 +1,47 @@
|
||||
import { BaseBox, Grid, TextCustom, ViewWrapper } from "@/components";
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
import { ICON_SIZE_SMALL } from "@/constants/constans-value";
|
||||
import { Ionicons } from "@expo/vector-icons";
|
||||
import { router, useLocalSearchParams } from "expo-router";
|
||||
|
||||
export default function ListPortofolio() {
|
||||
const { id } = useLocalSearchParams();
|
||||
return (
|
||||
<ViewWrapper>
|
||||
{Array.from({ length: 10 }).map((_, index) => (
|
||||
<BaseBox
|
||||
key={index}
|
||||
style={{ backgroundColor: MainColor.darkblue }}
|
||||
onPress={() => {
|
||||
console.log("press to Portofolio");
|
||||
router.push(`/portofolio/${id}`);
|
||||
}}
|
||||
>
|
||||
<Grid>
|
||||
<Grid.Col
|
||||
span={10}
|
||||
style={{ justifyContent: "center", backgroundColor: "" }}
|
||||
>
|
||||
<TextCustom bold size="large" truncate={1}>
|
||||
Nama usaha portofolio
|
||||
</TextCustom>
|
||||
<TextCustom size="small" color="yellow">
|
||||
#id-porofolio12345
|
||||
</TextCustom>
|
||||
</Grid.Col>
|
||||
<Grid.Col
|
||||
span={2}
|
||||
style={{ alignItems: "flex-end", justifyContent: "center" }}
|
||||
>
|
||||
<Ionicons
|
||||
name="caret-forward"
|
||||
size={ICON_SIZE_SMALL}
|
||||
color="white"
|
||||
/>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
</BaseBox>
|
||||
))}
|
||||
</ViewWrapper>
|
||||
);
|
||||
}
|
||||
32
app/(application)/(user)/portofolio/_layout.tsx
Normal file
32
app/(application)/(user)/portofolio/_layout.tsx
Normal file
@@ -0,0 +1,32 @@
|
||||
import LeftButtonCustom from "@/components/Button/BackButton";
|
||||
import { HeaderStyles } from "@/styles/header-styles";
|
||||
import { Stack } from "expo-router";
|
||||
|
||||
export default function PortofolioLayout() {
|
||||
return (
|
||||
<>
|
||||
<Stack
|
||||
screenOptions={{
|
||||
...HeaderStyles,
|
||||
headerLeft: () => <LeftButtonCustom />,
|
||||
}}
|
||||
>
|
||||
{/* <Stack.Screen name="[id]/index" options={{ title: "Portofolio" }} /> */}
|
||||
<Stack.Screen
|
||||
name="[id]/create"
|
||||
options={{ title: "Tambah Portofolio" }}
|
||||
/>
|
||||
<Stack.Screen
|
||||
name="[id]/list"
|
||||
options={{ title: "Daftar Portofolio" }}
|
||||
/>
|
||||
<Stack.Screen name="[id]/edit" options={{ title: "Edit Portofolio" }} />
|
||||
<Stack.Screen name="[id]/edit-logo" options={{ title: "Edit Logo " }} />
|
||||
<Stack.Screen
|
||||
name="[id]/edit-social-media"
|
||||
options={{ title: "Edit Social Media" }}
|
||||
/>
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
import {
|
||||
AvatarCustom,
|
||||
ButtonCenteredOnly,
|
||||
ButtonCustom,
|
||||
SelectCustom,
|
||||
Spacing,
|
||||
@@ -7,14 +8,15 @@ import {
|
||||
TextInputCustom,
|
||||
ViewWrapper,
|
||||
} from "@/components";
|
||||
import BoxButtonOnFooter from "@/components/Box/BoxButtonOnFooter";
|
||||
import InformationBox from "@/components/Box/InformationBox";
|
||||
import ButtonUpload from "@/components/Button/ButtonUpload";
|
||||
import LandscapeFrameUploaded from "@/components/Image/LandscapeFrameUploaded";
|
||||
import { GStyles } from "@/styles/global-styles";
|
||||
import { router, useLocalSearchParams } from "expo-router";
|
||||
import { useState } from "react";
|
||||
import { View } from "react-native";
|
||||
|
||||
export default function CreateProfile() {
|
||||
const { id } = useLocalSearchParams();
|
||||
const [data, setData] = useState({
|
||||
name: "",
|
||||
email: "",
|
||||
@@ -24,20 +26,18 @@ export default function CreateProfile() {
|
||||
|
||||
const handlerSave = () => {
|
||||
console.log("data create profile >>", data);
|
||||
// router.back();
|
||||
router.back();
|
||||
};
|
||||
|
||||
const footerComponent = (
|
||||
<View style={GStyles.bottomBar}>
|
||||
<View style={GStyles.bottomBarContainer}>
|
||||
<ButtonCustom
|
||||
onPress={handlerSave}
|
||||
disabled={!data.name || !data.email || !data.address || !data.gender}
|
||||
>
|
||||
Simpan
|
||||
</ButtonCustom>
|
||||
</View>
|
||||
</View>
|
||||
<BoxButtonOnFooter>
|
||||
<ButtonCustom
|
||||
onPress={handlerSave}
|
||||
// disabled={!data.name || !data.email || !data.address || !data.gender}
|
||||
>
|
||||
Simpan
|
||||
</ButtonCustom>
|
||||
</BoxButtonOnFooter>
|
||||
);
|
||||
|
||||
return (
|
||||
@@ -47,7 +47,12 @@ export default function CreateProfile() {
|
||||
<View style={{ alignItems: "center" }}>
|
||||
<AvatarCustom size="xl" />
|
||||
<Spacing />
|
||||
<ButtonUpload onPress={() => console.log("pressed")} />
|
||||
<ButtonCenteredOnly
|
||||
icon="upload"
|
||||
onPress={() => router.navigate(`/take-picture/${id}`)}
|
||||
>
|
||||
Upload
|
||||
</ButtonCenteredOnly>
|
||||
</View>
|
||||
|
||||
<Spacing />
|
||||
@@ -56,7 +61,12 @@ export default function CreateProfile() {
|
||||
<InformationBox text="Upload foto latar belakang anda." />
|
||||
<LandscapeFrameUploaded />
|
||||
<Spacing />
|
||||
<ButtonUpload onPress={() => console.log("pressed")} />
|
||||
<ButtonCenteredOnly
|
||||
icon="upload"
|
||||
onPress={() => router.navigate(`/take-picture/${id}`)}
|
||||
>
|
||||
Upload
|
||||
</ButtonCenteredOnly>
|
||||
</View>
|
||||
|
||||
<Spacing />
|
||||
@@ -93,14 +103,7 @@ export default function CreateProfile() {
|
||||
required
|
||||
onChange={(value) => setData({ ...(data as any), gender: value })}
|
||||
/>
|
||||
<TextInputCustom
|
||||
required
|
||||
label="Alamat"
|
||||
placeholder="Masukkan alamat"
|
||||
value={data.address}
|
||||
onChangeText={(text) => setData({ ...data, address: text })}
|
||||
/>
|
||||
{/* <Spacing /> */}
|
||||
<Spacing />
|
||||
</StackCustom>
|
||||
</ViewWrapper>
|
||||
);
|
||||
@@ -6,6 +6,7 @@ import {
|
||||
TextInputCustom,
|
||||
ViewWrapper,
|
||||
} from "@/components";
|
||||
import BoxButtonOnFooter from "@/components/Box/BoxButtonOnFooter";
|
||||
import { router, useLocalSearchParams } from "expo-router";
|
||||
import { useState } from "react";
|
||||
import { StyleSheet } from "react-native";
|
||||
@@ -21,15 +22,8 @@ export default function ProfileEdit() {
|
||||
});
|
||||
|
||||
const options = [
|
||||
{ label: "React", value: "react" },
|
||||
{ label: "Vue", value: "vue" },
|
||||
{ label: "Angular", value: "angular" },
|
||||
{ label: "Svelte", value: "svelte" },
|
||||
{ label: "Next.js", value: "nextjs" },
|
||||
{ label: "Nuxt.js", value: "nuxtjs" },
|
||||
{ label: "Remix", value: "remix" },
|
||||
{ label: "Sapper", value: "sapper" },
|
||||
{ label: "SvelteKit", value: "sveltekit" },
|
||||
{ label: "Laki-laki", value: "laki-laki" },
|
||||
{ label: "Perempuan", value: "perempuan" },
|
||||
];
|
||||
|
||||
const handleSave = () => {
|
||||
@@ -44,28 +38,20 @@ export default function ProfileEdit() {
|
||||
|
||||
return (
|
||||
<ViewWrapper
|
||||
bottomBarComponent={
|
||||
<ButtonCustom
|
||||
disabled={
|
||||
!data.nama || !data.email || !data.alamat || !data.selectedValue
|
||||
}
|
||||
onPress={handleSave}
|
||||
>
|
||||
Simpan
|
||||
</ButtonCustom>
|
||||
footerComponent={
|
||||
<BoxButtonOnFooter>
|
||||
<ButtonCustom
|
||||
// disabled={
|
||||
// !data.nama || !data.email || !data.alamat || !data.selectedValue
|
||||
// }
|
||||
onPress={handleSave}
|
||||
>
|
||||
Simpan
|
||||
</ButtonCustom>
|
||||
</BoxButtonOnFooter>
|
||||
}
|
||||
>
|
||||
<StackCustom gap={"xs"}>
|
||||
<SelectCustom
|
||||
label="Framework"
|
||||
placeholder="Pilih framework favoritmu"
|
||||
data={options}
|
||||
value={data.selectedValue}
|
||||
onChange={(value) => {
|
||||
setData({ ...(data as any), selectedValue: value });
|
||||
}}
|
||||
/>
|
||||
|
||||
<TextInputCustom
|
||||
label="Nama"
|
||||
placeholder="Nama"
|
||||
@@ -93,6 +79,16 @@ export default function ProfileEdit() {
|
||||
}}
|
||||
required
|
||||
/>
|
||||
<SelectCustom
|
||||
required
|
||||
label="Jenis Kelamin"
|
||||
placeholder="Pilih jenis kelamin"
|
||||
data={options}
|
||||
value={data.selectedValue}
|
||||
onChange={(value) => {
|
||||
setData({ ...(data as any), selectedValue: value });
|
||||
}}
|
||||
/>
|
||||
</StackCustom>
|
||||
</ViewWrapper>
|
||||
);
|
||||
@@ -1,79 +1,28 @@
|
||||
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
||||
import ViewWrapper from "@/components/_ShareComponent/ViewWrapper";
|
||||
import AlertCustom from "@/components/Alert/AlertCustom";
|
||||
import BackButton from "@/components/Button/BackButton";
|
||||
import LeftButtonCustom from "@/components/Button/BackButton";
|
||||
import DrawerCustom from "@/components/Drawer/DrawerCustom";
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
import { DRAWER_HEIGHT } from "@/constants/constans-value";
|
||||
import Profile_MenuDrawerSection from "@/screens/Profile/MenuDrawerSection";
|
||||
import ProfilSection from "@/screens/Profile/ProfilSection";
|
||||
import { drawerItemsProfile } from "@/screens/Profile/ListPage";
|
||||
import Profile_MenuDrawerSection from "@/screens/Profile/menuDrawerSection";
|
||||
import ProfileSection from "@/screens/Profile/ProfileSection";
|
||||
import { GStyles } from "@/styles/global-styles";
|
||||
import { Ionicons } from "@expo/vector-icons";
|
||||
import { router, Stack, useLocalSearchParams } from "expo-router";
|
||||
import React, { useRef, useState } from "react";
|
||||
import { Animated, InteractionManager, TouchableOpacity } from "react-native";
|
||||
import React, { useState } from "react";
|
||||
import { TouchableOpacity } from "react-native";
|
||||
|
||||
export default function Profile() {
|
||||
const { id } = useLocalSearchParams();
|
||||
const [isDrawerOpen, setIsDrawerOpen] = useState(false);
|
||||
const [showLogoutAlert, setShowLogoutAlert] = useState(false);
|
||||
|
||||
const drawerItems: IMenuDrawerItem[] = [
|
||||
{
|
||||
icon: "create",
|
||||
label: "Edit profile",
|
||||
path: `/(application)/profile/${id}/edit`,
|
||||
},
|
||||
{
|
||||
icon: "camera",
|
||||
label: "Ubah foto profile",
|
||||
path: `/(application)/profile/${id}/update-photo`,
|
||||
},
|
||||
{
|
||||
icon: "image",
|
||||
label: "Ubah latar belakang",
|
||||
path: `/(application)/profile/${id}/update-background`,
|
||||
},
|
||||
{
|
||||
icon: "add-circle",
|
||||
label: "Tambah portofolio",
|
||||
path: `/(application)/portofolio/${id}/create`,
|
||||
},
|
||||
// {
|
||||
// icon: "settings",
|
||||
// label: "Dashboard Admin",
|
||||
// path: `/(application)/profile/dashboard-admin`,
|
||||
// },
|
||||
{ icon: "log-out", label: "Keluar", color: "red", path: "" },
|
||||
{
|
||||
icon: "create-outline",
|
||||
label: "Create profile",
|
||||
path: `/(application)/profile/${id}/create`,
|
||||
},
|
||||
];
|
||||
|
||||
// Animasi menggunakan translateY (lebih kompatibel)
|
||||
const drawerAnim = useRef(new Animated.Value(DRAWER_HEIGHT)).current; // mulai di luar bawah layar
|
||||
|
||||
const openDrawer = () => {
|
||||
setIsDrawerOpen(true);
|
||||
Animated.timing(drawerAnim, {
|
||||
toValue: 0,
|
||||
duration: 300,
|
||||
useNativeDriver: true,
|
||||
}).start();
|
||||
};
|
||||
|
||||
const closeDrawer = () => {
|
||||
Animated.timing(drawerAnim, {
|
||||
toValue: DRAWER_HEIGHT, // sesuaikan dengan tinggi drawer Anda
|
||||
duration: 300,
|
||||
useNativeDriver: true,
|
||||
}).start(() => {
|
||||
InteractionManager.runAfterInteractions(() => {
|
||||
setIsDrawerOpen(false); // baru ganti state setelah animasi selesai
|
||||
});
|
||||
});
|
||||
setIsDrawerOpen(false);
|
||||
};
|
||||
|
||||
const handleLogout = () => {
|
||||
@@ -89,7 +38,7 @@ export default function Profile() {
|
||||
<Stack.Screen
|
||||
options={{
|
||||
title: "Profile",
|
||||
headerLeft: () => <BackButton />,
|
||||
headerLeft: () => <LeftButtonCustom />,
|
||||
headerRight: () => (
|
||||
<TouchableOpacity onPress={openDrawer}>
|
||||
<Ionicons
|
||||
@@ -103,19 +52,17 @@ export default function Profile() {
|
||||
headerTitleStyle: GStyles.headerTitleStyle,
|
||||
}}
|
||||
/>
|
||||
<ProfilSection />
|
||||
|
||||
<ProfileSection />
|
||||
</ViewWrapper>
|
||||
|
||||
{/* Drawer Komponen Eksternal */}
|
||||
<DrawerCustom
|
||||
height={350}
|
||||
isVisible={isDrawerOpen}
|
||||
drawerAnim={drawerAnim}
|
||||
closeDrawer={closeDrawer}
|
||||
>
|
||||
<Profile_MenuDrawerSection
|
||||
drawerItems={drawerItems}
|
||||
drawerItems={drawerItemsProfile({ id: id as string })}
|
||||
setShowLogoutAlert={setShowLogoutAlert}
|
||||
setIsDrawerOpen={setIsDrawerOpen}
|
||||
/>
|
||||
@@ -1,25 +1,31 @@
|
||||
import { BaseBox, ButtonCustom } from "@/components";
|
||||
import {
|
||||
BaseBox,
|
||||
BoxButtonOnFooter,
|
||||
ButtonCenteredOnly,
|
||||
ButtonCustom,
|
||||
} from "@/components";
|
||||
import ViewWrapper from "@/components/_ShareComponent/ViewWrapper";
|
||||
import ButtonUpload from "@/components/Button/ButtonUpload";
|
||||
import DUMMY_IMAGE from "@/constants/dummy-image-value";
|
||||
import { router, useLocalSearchParams } from "expo-router";
|
||||
import { Image } from "react-native";
|
||||
|
||||
export default function UpdateBackgroundProfile() {
|
||||
const { id } = useLocalSearchParams();
|
||||
const buttonFooter = (
|
||||
<BoxButtonOnFooter>
|
||||
<ButtonCustom
|
||||
onPress={() => {
|
||||
console.log("Simpan foto background >>", id);
|
||||
router.back();
|
||||
}}
|
||||
>
|
||||
Simpan
|
||||
</ButtonCustom>
|
||||
</BoxButtonOnFooter>
|
||||
);
|
||||
|
||||
return (
|
||||
<ViewWrapper
|
||||
bottomBarComponent={
|
||||
<ButtonCustom
|
||||
onPress={() => {
|
||||
console.log("Simpan foto background >>", id);
|
||||
router.back();
|
||||
}}
|
||||
>
|
||||
Simpan
|
||||
</ButtonCustom>
|
||||
}
|
||||
>
|
||||
<ViewWrapper footerComponent={buttonFooter}>
|
||||
<BaseBox
|
||||
style={{ alignItems: "center", justifyContent: "center", height: 250 }}
|
||||
>
|
||||
@@ -30,12 +36,12 @@ export default function UpdateBackgroundProfile() {
|
||||
/>
|
||||
</BaseBox>
|
||||
|
||||
<ButtonUpload
|
||||
title="Update"
|
||||
onPress={() =>
|
||||
router.navigate(`/(application)/take-picture/${id}`)
|
||||
}
|
||||
/>
|
||||
<ButtonCenteredOnly
|
||||
icon="upload"
|
||||
onPress={() => router.navigate(`/(application)/take-picture/${id}`)}
|
||||
>
|
||||
Update
|
||||
</ButtonCenteredOnly>
|
||||
</ViewWrapper>
|
||||
);
|
||||
}
|
||||
47
app/(application)/(user)/profile/[id]/update-photo.tsx
Normal file
47
app/(application)/(user)/profile/[id]/update-photo.tsx
Normal file
@@ -0,0 +1,47 @@
|
||||
import {
|
||||
AvatarCustom,
|
||||
BaseBox,
|
||||
BoxButtonOnFooter,
|
||||
ButtonCenteredOnly,
|
||||
ButtonCustom,
|
||||
} from "@/components";
|
||||
import ViewWrapper from "@/components/_ShareComponent/ViewWrapper";
|
||||
import { router, useLocalSearchParams } from "expo-router";
|
||||
|
||||
export default function UpdatePhotoProfile() {
|
||||
const { id } = useLocalSearchParams();
|
||||
const buttonFooter = (
|
||||
<BoxButtonOnFooter>
|
||||
<ButtonCustom
|
||||
onPress={() => {
|
||||
console.log("Simpan foto profile >>", id);
|
||||
router.back();
|
||||
}}
|
||||
>
|
||||
Simpan
|
||||
</ButtonCustom>
|
||||
</BoxButtonOnFooter>
|
||||
);
|
||||
return (
|
||||
<ViewWrapper footerComponent={buttonFooter}>
|
||||
<BaseBox
|
||||
style={{ alignItems: "center", justifyContent: "center", height: 250 }}
|
||||
>
|
||||
<AvatarCustom size="xl" />
|
||||
</BaseBox>
|
||||
|
||||
<ButtonCenteredOnly
|
||||
icon="upload"
|
||||
onPress={() => {
|
||||
console.log("Update photo >>", id);
|
||||
router.navigate(`/(application)/take-picture/${id}`);
|
||||
}}
|
||||
>
|
||||
Update
|
||||
</ButtonCenteredOnly>
|
||||
|
||||
{/* <Spacing />
|
||||
<ButtonCustom>Test</ButtonCustom> */}
|
||||
</ViewWrapper>
|
||||
);
|
||||
}
|
||||
100
app/(application)/(user)/user-search/index.tsx
Normal file
100
app/(application)/(user)/user-search/index.tsx
Normal file
@@ -0,0 +1,100 @@
|
||||
import {
|
||||
AvatarCustom,
|
||||
ClickableCustom,
|
||||
Grid,
|
||||
Spacing,
|
||||
StackCustom,
|
||||
TextCustom,
|
||||
TextInputCustom,
|
||||
ViewWrapper,
|
||||
} from "@/components";
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
import { ICON_SIZE_SMALL } from "@/constants/constans-value";
|
||||
import { Ionicons } from "@expo/vector-icons";
|
||||
import { router } from "expo-router";
|
||||
|
||||
export default function UserSearch() {
|
||||
function generateRandomPhoneNumber(index: number) {
|
||||
let prefix;
|
||||
|
||||
// Menentukan prefix berdasarkan index genap atau ganjil
|
||||
if (index % 2 === 0) {
|
||||
const evenPrefixes = ["6288", "6289", "6281"];
|
||||
prefix = evenPrefixes[Math.floor(Math.random() * evenPrefixes.length)];
|
||||
} else {
|
||||
const oddPrefixes = ["6285", "6283"];
|
||||
prefix = oddPrefixes[Math.floor(Math.random() * oddPrefixes.length)];
|
||||
}
|
||||
|
||||
// Menghitung panjang sisa nomor acak (antara 10 - 12 digit)
|
||||
const remainingLength = Math.floor(Math.random() * 3) + 10; // 10, 11, atau 12
|
||||
|
||||
// Membuat sisa nomor acak
|
||||
let randomNumber = "";
|
||||
for (let i = 0; i < remainingLength; i++) {
|
||||
randomNumber += Math.floor(Math.random() * 10); // Digit acak antara 0-9
|
||||
}
|
||||
|
||||
// Menggabungkan prefix dan sisa nomor
|
||||
return prefix + randomNumber;
|
||||
}
|
||||
return (
|
||||
<>
|
||||
<ViewWrapper
|
||||
headerComponent={
|
||||
<TextInputCustom
|
||||
iconLeft={
|
||||
<Ionicons
|
||||
name="search"
|
||||
size={ICON_SIZE_SMALL}
|
||||
color={MainColor.placeholder}
|
||||
/>
|
||||
}
|
||||
placeholder="Cari Pengguna"
|
||||
borderRadius={50}
|
||||
containerStyle={{ marginBottom: 0 }}
|
||||
/>
|
||||
}
|
||||
>
|
||||
<StackCustom>
|
||||
{Array.from({ length: 20 }).map((e, index) => {
|
||||
return (
|
||||
<Grid key={index}>
|
||||
<Grid.Col span={2}>
|
||||
<AvatarCustom href={`/profile/${index}`}/>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={9}>
|
||||
<TextCustom size="large">Nama user {index}</TextCustom>
|
||||
<TextCustom size="small">
|
||||
+{generateRandomPhoneNumber(index)}
|
||||
</TextCustom>
|
||||
</Grid.Col>
|
||||
<Grid.Col
|
||||
span={1}
|
||||
style={{
|
||||
justifyContent: "center",
|
||||
alignItems: "flex-end",
|
||||
}}
|
||||
>
|
||||
<ClickableCustom
|
||||
onPress={() => {
|
||||
console.log("Ke Profile");
|
||||
router.push(`/profile/${index}`);
|
||||
}}
|
||||
>
|
||||
<Ionicons
|
||||
name="chevron-forward"
|
||||
size={ICON_SIZE_SMALL}
|
||||
color={MainColor.white}
|
||||
/>
|
||||
</ClickableCustom>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
);
|
||||
})}
|
||||
</StackCustom>
|
||||
<Spacing height={50} />
|
||||
</ViewWrapper>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,185 +1,28 @@
|
||||
import { AccentColor, MainColor } from "@/constants/color-palet";
|
||||
import { GStyles } from "@/styles/global-styles";
|
||||
import { Ionicons } from "@expo/vector-icons";
|
||||
import { router, Stack } from "expo-router";
|
||||
import { BackButton } from "@/components";
|
||||
import { HeaderStyles } from "@/styles/header-styles";
|
||||
import { Stack } from "expo-router";
|
||||
|
||||
export default function ApplicationLayout() {
|
||||
return (
|
||||
<>
|
||||
<Stack
|
||||
screenOptions={{
|
||||
headerStyle: GStyles.headerStyle,
|
||||
headerTitleStyle: GStyles.headerTitleStyle,
|
||||
headerTitleAlign: "center",
|
||||
contentStyle: {
|
||||
borderBottomColor: AccentColor.blue,
|
||||
borderBottomWidth: 2,
|
||||
},
|
||||
// headerLargeStyle: {
|
||||
// backgroundColor: MainColor.darkblue,
|
||||
// },
|
||||
}}
|
||||
>
|
||||
<Stack.Screen
|
||||
name="home"
|
||||
options={{
|
||||
title: "HIPMI",
|
||||
headerLeft: () => (
|
||||
<Ionicons
|
||||
name="search"
|
||||
size={20}
|
||||
color={MainColor.yellow}
|
||||
onPress={() => router.push("/(application)/user-search")}
|
||||
/>
|
||||
),
|
||||
headerRight: () => (
|
||||
<Ionicons
|
||||
name="notifications"
|
||||
size={20}
|
||||
color={MainColor.yellow}
|
||||
onPress={() => router.push("/(application)/notifications")}
|
||||
/>
|
||||
),
|
||||
}}
|
||||
/>
|
||||
|
||||
<Stack.Screen
|
||||
name="forum/index"
|
||||
options={{
|
||||
title: "Forum",
|
||||
headerLeft: () => (
|
||||
<Ionicons
|
||||
name="arrow-back"
|
||||
size={20}
|
||||
color={MainColor.yellow}
|
||||
onPress={() => router.back()}
|
||||
/>
|
||||
),
|
||||
}}
|
||||
/>
|
||||
|
||||
<Stack.Screen
|
||||
name="maps/index"
|
||||
options={{
|
||||
title: "Maps",
|
||||
headerLeft: () => (
|
||||
<Ionicons
|
||||
name="arrow-back"
|
||||
size={20}
|
||||
color={MainColor.yellow}
|
||||
onPress={() => router.back()}
|
||||
/>
|
||||
),
|
||||
}}
|
||||
/>
|
||||
|
||||
<Stack.Screen
|
||||
name="marketplace/index"
|
||||
options={{
|
||||
title: "Market Place",
|
||||
headerLeft: () => (
|
||||
<Ionicons
|
||||
name="arrow-back"
|
||||
size={20}
|
||||
color={MainColor.yellow}
|
||||
onPress={() => router.back()}
|
||||
/>
|
||||
),
|
||||
}}
|
||||
/>
|
||||
|
||||
{/* Profile */}
|
||||
<Stack.Screen
|
||||
name="profile"
|
||||
options={{
|
||||
headerShown: false,
|
||||
}}
|
||||
/>
|
||||
|
||||
{/* Portofolio */}
|
||||
<Stack.Screen
|
||||
name="portofolio"
|
||||
options={{
|
||||
headerShown: false,
|
||||
}}
|
||||
/>
|
||||
|
||||
{/* Event */}
|
||||
<Stack.Screen
|
||||
name="event/(tabs)"
|
||||
options={{
|
||||
title: "Event",
|
||||
headerLeft: () => (
|
||||
<Ionicons
|
||||
name="arrow-back"
|
||||
size={20}
|
||||
color={MainColor.yellow}
|
||||
onPress={() => router.push("/(application)/home")}
|
||||
/>
|
||||
),
|
||||
}}
|
||||
/>
|
||||
|
||||
<Stack.Screen
|
||||
name="event/detail/[id]"
|
||||
options={{
|
||||
title: "Detail",
|
||||
headerLeft: () => (
|
||||
<Ionicons
|
||||
name="arrow-back"
|
||||
size={20}
|
||||
color={MainColor.yellow}
|
||||
onPress={() => router.back()}
|
||||
/>
|
||||
),
|
||||
}}
|
||||
/>
|
||||
|
||||
{/* User Search */}
|
||||
<Stack.Screen
|
||||
name="user-search/index"
|
||||
options={{
|
||||
title: "Pencarian Pengguna",
|
||||
headerLeft: () => (
|
||||
<Ionicons
|
||||
name="arrow-back"
|
||||
size={20}
|
||||
color={MainColor.yellow}
|
||||
onPress={() => router.back()}
|
||||
/>
|
||||
),
|
||||
}}
|
||||
/>
|
||||
|
||||
{/* Notification */}
|
||||
<Stack.Screen
|
||||
name="notifications/index"
|
||||
options={{
|
||||
title: "Notifikasi",
|
||||
headerLeft: () => (
|
||||
<Ionicons
|
||||
name="arrow-back"
|
||||
size={20}
|
||||
color={MainColor.yellow}
|
||||
onPress={() => router.back()}
|
||||
/>
|
||||
),
|
||||
}}
|
||||
/>
|
||||
<Stack screenOptions={HeaderStyles}>
|
||||
<Stack.Screen name="(user)" options={{ headerShown: false }} />
|
||||
|
||||
{/* Take Picture */}
|
||||
<Stack.Screen
|
||||
name="take-picture/[id]/index"
|
||||
name="(image)/take-picture/[id]/index"
|
||||
options={{
|
||||
title: "Ambil Gambar",
|
||||
headerLeft: () => (
|
||||
<Ionicons
|
||||
name="arrow-back"
|
||||
size={20}
|
||||
color={MainColor.yellow}
|
||||
onPress={() => router.back()}
|
||||
/>
|
||||
),
|
||||
headerLeft: () => <BackButton />,
|
||||
}}
|
||||
/>
|
||||
|
||||
{/* Preview Image */}
|
||||
<Stack.Screen
|
||||
name="(image)/preview-image/[id]/index"
|
||||
options={{
|
||||
title: "Preview Gambar",
|
||||
headerLeft: () => <BackButton />,
|
||||
}}
|
||||
/>
|
||||
</Stack>
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
import ViewWrapper from "@/components/_ShareComponent/ViewWrapper";
|
||||
import { AccentColor, MainColor } from "@/constants/color-palet";
|
||||
import { GStyles } from "@/styles/global-styles";
|
||||
import { router } from "expo-router";
|
||||
import { Text, TouchableHighlight, View } from "react-native";
|
||||
|
||||
export default function Event() {
|
||||
return (
|
||||
<ViewWrapper>
|
||||
<TouchableHighlight onPress={() => router.push("/event/detail/1")}>
|
||||
<View
|
||||
style={{
|
||||
padding: 20,
|
||||
backgroundColor: MainColor.darkblue,
|
||||
borderRadius: 10,
|
||||
borderColor: AccentColor.blue,
|
||||
borderWidth: 1,
|
||||
}}
|
||||
>
|
||||
<Text style={GStyles.textLabel}>Event</Text>
|
||||
</View>
|
||||
</TouchableHighlight>
|
||||
</ViewWrapper>
|
||||
);
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
import ViewWrapper from "@/components/_ShareComponent/ViewWrapper";
|
||||
import { GStyles } from "@/styles/global-styles";
|
||||
import { Text } from "react-native";
|
||||
|
||||
export default function Kontribusi() {
|
||||
return (
|
||||
<ViewWrapper>
|
||||
<Text style={GStyles.textLabel}>Kontribusi</Text>
|
||||
</ViewWrapper>
|
||||
);
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
import ViewWrapper from "@/components/_ShareComponent/ViewWrapper";
|
||||
import { GStyles } from "@/styles/global-styles";
|
||||
import { Text } from "react-native";
|
||||
|
||||
export default function Riwayat() {
|
||||
return (
|
||||
<ViewWrapper>
|
||||
<Text style={GStyles.textLabel}>Riwayat</Text>
|
||||
</ViewWrapper>
|
||||
);
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
import ViewWrapper from "@/components/_ShareComponent/ViewWrapper";
|
||||
import { GStyles } from "@/styles/global-styles";
|
||||
import { Text } from "react-native";
|
||||
|
||||
export default function Status() {
|
||||
return (
|
||||
<ViewWrapper>
|
||||
<Text style={GStyles.textLabel}>Status</Text>
|
||||
</ViewWrapper>
|
||||
);
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
import { Text, View } from "react-native";
|
||||
|
||||
export default function Forum() {
|
||||
return (
|
||||
<>
|
||||
<View>
|
||||
<Text>Forum</Text>
|
||||
</View>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
import { Text, View } from "react-native";
|
||||
|
||||
export default function Maps() {
|
||||
return (
|
||||
<View>
|
||||
<Text>Maps</Text>
|
||||
</View>
|
||||
)
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
import { Text, View } from "react-native";
|
||||
|
||||
export default function MarketPlace() {
|
||||
return (
|
||||
<View>
|
||||
<Text>Market Place</Text>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
import { Text, View } from "react-native";
|
||||
|
||||
export default function Notifications() {
|
||||
return (
|
||||
<View>
|
||||
<Text>Notifications</Text>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
import { Text, View } from "react-native";
|
||||
import { useLocalSearchParams } from "expo-router";
|
||||
|
||||
export default function PortofolioCreate() {
|
||||
const { id } = useLocalSearchParams();
|
||||
return (
|
||||
<View>
|
||||
<Text>Portofolio Create {id}</Text>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
import BackButton from "@/components/Button/BackButton";
|
||||
import ViewWrapper from "@/components/_ShareComponent/ViewWrapper";
|
||||
import { GStyles } from "@/styles/global-styles";
|
||||
import { Stack, useLocalSearchParams } from "expo-router";
|
||||
import { Text } from "react-native";
|
||||
|
||||
export default function Portofolio() {
|
||||
const { id } = useLocalSearchParams();
|
||||
return (
|
||||
<ViewWrapper>
|
||||
{/* Header */}
|
||||
<Stack.Screen
|
||||
options={{
|
||||
title: "Portofolio",
|
||||
headerLeft: () => <BackButton />,
|
||||
// headerRight: () => (
|
||||
// <TouchableOpacity onPress={openDrawer}>
|
||||
// <Ionicons
|
||||
// name="ellipsis-vertical"
|
||||
// size={20}
|
||||
// color={MainColor.yellow}
|
||||
// />
|
||||
// </TouchableOpacity>
|
||||
// ),
|
||||
headerStyle: GStyles.headerStyle,
|
||||
headerTitleStyle: GStyles.headerTitleStyle,
|
||||
}}
|
||||
/>
|
||||
<Text style={GStyles.textLabel}>Portofolio {id}</Text>
|
||||
</ViewWrapper>
|
||||
);
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
|
||||
import BackButton from "@/components/Button/BackButton";
|
||||
import { GStyles } from "@/styles/global-styles";
|
||||
import { Stack } from "expo-router";
|
||||
|
||||
export default function PortofolioLayout() {
|
||||
return (
|
||||
<>
|
||||
<Stack
|
||||
screenOptions={{
|
||||
headerStyle: GStyles.headerStyle,
|
||||
headerTitleStyle: GStyles.headerTitleStyle,
|
||||
headerTitleAlign: "center",
|
||||
headerBackButtonDisplayMode: "minimal",
|
||||
headerLeft: () => <BackButton />,
|
||||
}}
|
||||
>
|
||||
{/* <Stack.Screen name="[id]/index" options={{ title: "Portofolio" }} /> */}
|
||||
<Stack.Screen
|
||||
name="[id]/create"
|
||||
options={{ title: "Tambah Portofolio" }}
|
||||
/>
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
import { BaseBox, ButtonCustom } from "@/components";
|
||||
import ViewWrapper from "@/components/_ShareComponent/ViewWrapper";
|
||||
import ButtonUpload from "@/components/Button/ButtonUpload";
|
||||
import DUMMY_IMAGE from "@/constants/dummy-image-value";
|
||||
import { router, useLocalSearchParams } from "expo-router";
|
||||
import { Image } from "react-native";
|
||||
|
||||
export default function UpdatePhotoProfile() {
|
||||
const { id } = useLocalSearchParams();
|
||||
return (
|
||||
<ViewWrapper
|
||||
bottomBarComponent={
|
||||
<ButtonCustom
|
||||
onPress={() => {
|
||||
console.log("Simpan foto profile >>", id);
|
||||
router.back();
|
||||
}}
|
||||
>
|
||||
Simpan
|
||||
</ButtonCustom>
|
||||
}
|
||||
>
|
||||
<BaseBox
|
||||
style={{ alignItems: "center", justifyContent: "center", height: 250 }}
|
||||
>
|
||||
<Image
|
||||
source={DUMMY_IMAGE.avatar}
|
||||
resizeMode="cover"
|
||||
style={{ width: 200, height: 200 }}
|
||||
/>
|
||||
</BaseBox>
|
||||
|
||||
<ButtonUpload
|
||||
title="Update"
|
||||
onPress={() => {
|
||||
console.log("Update photo >>", id);
|
||||
router.navigate(`/(application)/take-picture/${id}`);
|
||||
}}
|
||||
/>
|
||||
</ViewWrapper>
|
||||
);
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
import { Text, View } from "react-native";
|
||||
|
||||
export default function UserSearch() {
|
||||
return (
|
||||
<View>
|
||||
<Text>User Search</Text>
|
||||
</View>
|
||||
)
|
||||
}
|
||||
@@ -1,9 +1,16 @@
|
||||
import { Text, View } from "react-native";
|
||||
import { StackCustom, TextCustom, ViewWrapper } from "@/components";
|
||||
|
||||
export default function NotFoundScreen() {
|
||||
return (
|
||||
<View>
|
||||
<Text>Not Found</Text>
|
||||
</View>
|
||||
)
|
||||
<ViewWrapper>
|
||||
<StackCustom align="center" gap={0} style={{justifyContent: "center", alignItems: "center", flex: 1}}>
|
||||
<TextCustom size="large" bold style={{fontSize: 100}}>
|
||||
404
|
||||
</TextCustom>
|
||||
<TextCustom size="large" bold>
|
||||
Sorry, File Not Found
|
||||
</TextCustom>
|
||||
</StackCustom>
|
||||
</ViewWrapper>
|
||||
);
|
||||
}
|
||||
@@ -15,6 +15,7 @@ export default function RootLayout() {
|
||||
}}
|
||||
>
|
||||
<Stack.Screen name="index" options={{ title: "" }} />
|
||||
<Stack.Screen name="+not-found" options={{ title: "" }} />
|
||||
<Stack.Screen
|
||||
name="verification"
|
||||
options={{ title: "", headerBackVisible: false }}
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 40 KiB |
BIN
assets/images/dummy/dummy-user.png
Normal file
BIN
assets/images/dummy/dummy-user.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 395 KiB |
24
bun.lock
24
bun.lock
@@ -5,12 +5,14 @@
|
||||
"name": "hipmi-mobile",
|
||||
"dependencies": {
|
||||
"@expo/vector-icons": "^14.1.0",
|
||||
"@react-native-community/datetimepicker": "8.4.1",
|
||||
"@react-navigation/bottom-tabs": "^7.4.2",
|
||||
"@react-navigation/drawer": "^7.5.2",
|
||||
"@react-navigation/elements": "^2.3.8",
|
||||
"@react-navigation/native": "^7.1.6",
|
||||
"@react-navigation/native-stack": "^7.3.21",
|
||||
"@types/react-native-vector-icons": "^6.4.18",
|
||||
"dayjs": "^1.11.13",
|
||||
"expo": "53.0.17",
|
||||
"expo-blur": "~14.1.5",
|
||||
"expo-camera": "~16.1.10",
|
||||
@@ -31,7 +33,9 @@
|
||||
"react-native": "0.79.5",
|
||||
"react-native-gesture-handler": "~2.24.0",
|
||||
"react-native-international-phone-number": "^0.9.3",
|
||||
"react-native-maps": "1.20.1",
|
||||
"react-native-otp-entry": "^1.8.5",
|
||||
"react-native-paper": "^5.14.5",
|
||||
"react-native-reanimated": "~3.17.4",
|
||||
"react-native-safe-area-context": "5.4.0",
|
||||
"react-native-screens": "~4.11.1",
|
||||
@@ -237,6 +241,8 @@
|
||||
|
||||
"@babel/types": ["@babel/types@7.27.6", "", { "dependencies": { "@babel/helper-string-parser": "^7.27.1", "@babel/helper-validator-identifier": "^7.27.1" } }, "sha512-ETyHEk2VHHvl9b9jZP5IHPavHYk57EhanlRRuae9XCpb/j5bDCbPPMOBfCWhnl/7EDJz0jEMCi/RhccCE8r1+Q=="],
|
||||
|
||||
"@callstack/react-theme-provider": ["@callstack/react-theme-provider@3.0.9", "", { "dependencies": { "deepmerge": "^3.2.0", "hoist-non-react-statics": "^3.3.0" }, "peerDependencies": { "react": ">=16.3.0" } }, "sha512-tTQ0uDSCL0ypeMa8T/E9wAZRGKWj8kXP7+6RYgPTfOPs9N07C9xM8P02GJ3feETap4Ux5S69D9nteq9mEj86NA=="],
|
||||
|
||||
"@egjs/hammerjs": ["@egjs/hammerjs@2.0.17", "", { "dependencies": { "@types/hammerjs": "^2.0.36" } }, "sha512-XQsZgjm2EcVUiZQf11UBJQfmZeEmOW8DpI1gsFeln6w0ae0ii4dMQEQ0kjl6DspdWX1aGY1/loyXnP0JS06e/A=="],
|
||||
|
||||
"@emnapi/core": ["@emnapi/core@1.4.3", "", { "dependencies": { "@emnapi/wasi-threads": "1.0.2", "tslib": "^2.4.0" } }, "sha512-4m62DuCE07lw01soJwPiBGC0nAww0Q+RY70VZ+n49yDIO13yyinhbWCeNnaob0lakDtWQzSdtNWzJeOJt2ma+g=="],
|
||||
@@ -367,6 +373,8 @@
|
||||
|
||||
"@radix-ui/react-slot": ["@radix-ui/react-slot@1.2.0", "", { "dependencies": { "@radix-ui/react-compose-refs": "1.1.2" }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" } }, "sha512-ujc+V6r0HNDviYqIK3rW4ffgYiZ8g5DEHrGJVk4x7kTlLXRDILnKX9vAUYeIsLOoDpDJ0ujpqMkjH4w2ofuo6w=="],
|
||||
|
||||
"@react-native-community/datetimepicker": ["@react-native-community/datetimepicker@8.4.1", "", { "dependencies": { "invariant": "^2.2.4" }, "peerDependencies": { "expo": ">=52.0.0", "react": "*", "react-native": "*", "react-native-windows": "*" }, "optionalPeers": ["expo", "react-native-windows"] }, "sha512-DrK+CUS5fZnz8dhzBezirkzQTcNDdaXer3oDLh0z4nc2tbdIdnzwvXCvi8IEOIvleoc9L95xS5tKUl0/Xv71Mg=="],
|
||||
|
||||
"@react-native/assets-registry": ["@react-native/assets-registry@0.79.5", "", {}, "sha512-N4Kt1cKxO5zgM/BLiyzuuDNquZPiIgfktEQ6TqJ/4nKA8zr4e8KJgU6Tb2eleihDO4E24HmkvGc73naybKRz/w=="],
|
||||
|
||||
"@react-native/babel-plugin-codegen": ["@react-native/babel-plugin-codegen@0.79.5", "", { "dependencies": { "@babel/traverse": "^7.25.3", "@react-native/codegen": "0.79.5" } }, "sha512-Rt/imdfqXihD/sn0xnV4flxxb1aLLjPtMF1QleQjEhJsTUPpH4TFlfOpoCvsrXoDl4OIcB1k4FVM24Ez92zf5w=="],
|
||||
@@ -423,6 +431,8 @@
|
||||
|
||||
"@types/estree": ["@types/estree@1.0.8", "", {}, "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w=="],
|
||||
|
||||
"@types/geojson": ["@types/geojson@7946.0.16", "", {}, "sha512-6C8nqWur3j98U6+lXDfTUWIfgvZU+EumvpHKcYjujKH7woYyLj2sUmff0tRhrqM7BohUw7Pz3ZB1jj2gW9Fvmg=="],
|
||||
|
||||
"@types/graceful-fs": ["@types/graceful-fs@4.1.9", "", { "dependencies": { "@types/node": "*" } }, "sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ=="],
|
||||
|
||||
"@types/hammerjs": ["@types/hammerjs@2.0.46", "", {}, "sha512-ynRvcq6wvqexJ9brDMS4BnBLzmr0e14d6ZJTEShTBWKymQiHwlAyGu0ZPEFI2Fh1U53F7tN9ufClWM5KvqkKOw=="],
|
||||
@@ -697,6 +707,8 @@
|
||||
|
||||
"data-view-byte-offset": ["data-view-byte-offset@1.0.1", "", { "dependencies": { "call-bound": "^1.0.2", "es-errors": "^1.3.0", "is-data-view": "^1.0.1" } }, "sha512-BS8PfmtDGnrgYdOonGZQdLZslWIeCGFP9tpan0hi1Co2Zr2NKADsvGYA8XxuG/4UWgJ6Cjtv+YJnB6MM69QGlQ=="],
|
||||
|
||||
"dayjs": ["dayjs@1.11.13", "", {}, "sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg=="],
|
||||
|
||||
"debug": ["debug@4.4.1", "", { "dependencies": { "ms": "^2.1.3" } }, "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ=="],
|
||||
|
||||
"decode-uri-component": ["decode-uri-component@0.2.2", "", {}, "sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ=="],
|
||||
@@ -1373,8 +1385,12 @@
|
||||
|
||||
"react-native-is-edge-to-edge": ["react-native-is-edge-to-edge@1.1.7", "", { "peerDependencies": { "react": "*", "react-native": "*" } }, "sha512-EH6i7E8epJGIcu7KpfXYXiV2JFIYITtq+rVS8uEb+92naMRBdxhTuS8Wn2Q7j9sqyO0B+Xbaaf9VdipIAmGW4w=="],
|
||||
|
||||
"react-native-maps": ["react-native-maps@1.20.1", "", { "dependencies": { "@types/geojson": "^7946.0.13" }, "peerDependencies": { "react": ">= 17.0.1", "react-native": ">= 0.64.3", "react-native-web": ">= 0.11" }, "optionalPeers": ["react-native-web"] }, "sha512-NZI3B5Z6kxAb8gzb2Wxzu/+P2SlFIg1waHGIpQmazDSCRkNoHNY4g96g+xS0QPSaG/9xRBbDNnd2f2/OW6t6LQ=="],
|
||||
|
||||
"react-native-otp-entry": ["react-native-otp-entry@1.8.5", "", { "peerDependencies": { "react": "*", "react-native": "*" } }, "sha512-TZNkIuUzZKAAWrC8X/A22ZHJdycLysxUNysrGf0yTmDLRUyf4zLXwVFcDYUcRNe763Hjaf5qvtKGILb6lDGzoA=="],
|
||||
|
||||
"react-native-paper": ["react-native-paper@5.14.5", "", { "dependencies": { "@callstack/react-theme-provider": "^3.0.9", "color": "^3.1.2", "use-latest-callback": "^0.2.3" }, "peerDependencies": { "react": "*", "react-native": "*", "react-native-safe-area-context": "*" } }, "sha512-eaIH5bUQjJ/mYm4AkI6caaiyc7BcHDwX6CqNDi6RIxfxfWxROsHpll1oBuwn/cFvknvA8uEAkqLk/vzVihI3AQ=="],
|
||||
|
||||
"react-native-reanimated": ["react-native-reanimated@3.17.5", "", { "dependencies": { "@babel/plugin-transform-arrow-functions": "^7.0.0-0", "@babel/plugin-transform-class-properties": "^7.0.0-0", "@babel/plugin-transform-classes": "^7.0.0-0", "@babel/plugin-transform-nullish-coalescing-operator": "^7.0.0-0", "@babel/plugin-transform-optional-chaining": "^7.0.0-0", "@babel/plugin-transform-shorthand-properties": "^7.0.0-0", "@babel/plugin-transform-template-literals": "^7.0.0-0", "@babel/plugin-transform-unicode-regex": "^7.0.0-0", "@babel/preset-typescript": "^7.16.7", "convert-source-map": "^2.0.0", "invariant": "^2.2.4", "react-native-is-edge-to-edge": "1.1.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0", "react": "*", "react-native": "*" } }, "sha512-SxBK7wQfJ4UoWoJqQnmIC7ZjuNgVb9rcY5Xc67upXAFKftWg0rnkknTw6vgwnjRcvYThrjzUVti66XoZdDJGtw=="],
|
||||
|
||||
"react-native-safe-area-context": ["react-native-safe-area-context@5.4.0", "", { "peerDependencies": { "react": "*", "react-native": "*" } }, "sha512-JaEThVyJcLhA+vU0NU8bZ0a1ih6GiF4faZ+ArZLqpYbL6j7R3caRqj+mE3lEtKCuHgwjLg3bCxLL1GPUJZVqUA=="],
|
||||
@@ -1707,6 +1723,8 @@
|
||||
|
||||
"@babel/traverse--for-generate-function-map/globals": ["globals@11.12.0", "", {}, "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA=="],
|
||||
|
||||
"@callstack/react-theme-provider/deepmerge": ["deepmerge@3.3.0", "", {}, "sha512-GRQOafGHwMHpjPx9iCvTgpu9NojZ49q794EEL94JVEw6VaeA8XTUyBKvAkOOjBX9oJNiV6G3P+T+tihFjo2TqA=="],
|
||||
|
||||
"@eslint-community/eslint-utils/eslint-visitor-keys": ["eslint-visitor-keys@3.4.3", "", {}, "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag=="],
|
||||
|
||||
"@eslint/eslintrc/globals": ["globals@14.0.0", "", {}, "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ=="],
|
||||
@@ -1887,6 +1905,8 @@
|
||||
|
||||
"react-native/semver": ["semver@7.7.2", "", { "bin": "bin/semver.js" }, "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA=="],
|
||||
|
||||
"react-native-paper/color": ["color@3.2.1", "", { "dependencies": { "color-convert": "^1.9.3", "color-string": "^1.6.0" } }, "sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA=="],
|
||||
|
||||
"react-native-vector-icons/yargs": ["yargs@16.2.0", "", { "dependencies": { "cliui": "^7.0.2", "escalade": "^3.1.1", "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", "string-width": "^4.2.0", "y18n": "^5.0.5", "yargs-parser": "^20.2.2" } }, "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw=="],
|
||||
|
||||
"react-native-web/@react-native/normalize-colors": ["@react-native/normalize-colors@0.74.89", "", {}, "sha512-qoMMXddVKVhZ8PA1AbUCk83trpd6N+1nF2A6k1i6LsQObyS92fELuk8kU/lQs6M7BsMHwqyLCpQJ1uFgNvIQXg=="],
|
||||
@@ -2007,6 +2027,8 @@
|
||||
|
||||
"ora/chalk/supports-color": ["supports-color@5.5.0", "", { "dependencies": { "has-flag": "^3.0.0" } }, "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow=="],
|
||||
|
||||
"react-native-paper/color/color-convert": ["color-convert@1.9.3", "", { "dependencies": { "color-name": "1.1.3" } }, "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg=="],
|
||||
|
||||
"react-native-vector-icons/yargs/cliui": ["cliui@7.0.4", "", { "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.0", "wrap-ansi": "^7.0.0" } }, "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ=="],
|
||||
|
||||
"react-native-vector-icons/yargs/yargs-parser": ["yargs-parser@20.2.9", "", {}, "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w=="],
|
||||
@@ -2043,6 +2065,8 @@
|
||||
|
||||
"ora/chalk/supports-color/has-flag": ["has-flag@3.0.0", "", {}, "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw=="],
|
||||
|
||||
"react-native-paper/color/color-convert/color-name": ["color-name@1.1.3", "", {}, "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw=="],
|
||||
|
||||
"react-native-vector-icons/yargs/cliui/strip-ansi": ["strip-ansi@6.0.1", "", { "dependencies": { "ansi-regex": "^5.0.1" } }, "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A=="],
|
||||
|
||||
"serve-static/send/debug/ms": ["ms@2.0.0", "", {}, "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="],
|
||||
|
||||
@@ -95,12 +95,12 @@ const styles = StyleSheet.create({
|
||||
fontSize: TEXT_SIZE_LARGE,
|
||||
fontWeight: "bold",
|
||||
marginBottom: 20,
|
||||
color: MainColor.white,
|
||||
color: MainColor.white_gray,
|
||||
},
|
||||
alertMessage: {
|
||||
textAlign: "center",
|
||||
marginBottom: 20,
|
||||
color: MainColor.white,
|
||||
color: MainColor.white_gray,
|
||||
},
|
||||
alertButtons: {
|
||||
flexDirection: "row",
|
||||
|
||||
@@ -1,27 +1,47 @@
|
||||
import { AccentColor } from "@/constants/color-palet";
|
||||
import { StyleProp, TouchableHighlight, View, ViewStyle } from "react-native";
|
||||
import {
|
||||
PADDING_MEDIUM,
|
||||
PADDING_SMALL
|
||||
} from "@/constants/constans-value";
|
||||
import { Href, router } from "expo-router";
|
||||
import {
|
||||
StyleProp,
|
||||
TouchableOpacity,
|
||||
View,
|
||||
ViewStyle
|
||||
} from "react-native";
|
||||
|
||||
interface BaseBoxProps {
|
||||
children: React.ReactNode;
|
||||
style?: StyleProp<ViewStyle>;
|
||||
href?: Href;
|
||||
onPress?: () => void;
|
||||
marginBottom?: number;
|
||||
padding?: number;
|
||||
paddingTop?: number;
|
||||
paddingBottom?: number;
|
||||
paddingInline?: number;
|
||||
paddingBlock?: number;
|
||||
}
|
||||
|
||||
export default function BaseBox({
|
||||
children,
|
||||
style,
|
||||
href,
|
||||
onPress,
|
||||
marginBottom = 16,
|
||||
padding = 12,
|
||||
marginBottom = PADDING_MEDIUM,
|
||||
paddingBlock = PADDING_MEDIUM,
|
||||
paddingInline = PADDING_SMALL,
|
||||
paddingTop = PADDING_MEDIUM,
|
||||
paddingBottom = PADDING_MEDIUM,
|
||||
}: BaseBoxProps) {
|
||||
|
||||
return (
|
||||
<>
|
||||
{onPress ? (
|
||||
<TouchableHighlight
|
||||
onPress={onPress}
|
||||
{onPress || href ? (
|
||||
<TouchableOpacity
|
||||
activeOpacity={0.7}
|
||||
onPress={href ? () => router.navigate(href) : onPress}
|
||||
style={[
|
||||
{
|
||||
backgroundColor: AccentColor.darkblue,
|
||||
@@ -29,14 +49,16 @@ export default function BaseBox({
|
||||
borderWidth: 1,
|
||||
borderRadius: 10,
|
||||
marginBottom,
|
||||
padding,
|
||||
paddingBlock,
|
||||
paddingInline,
|
||||
paddingTop,
|
||||
paddingBottom,
|
||||
},
|
||||
style,
|
||||
]}
|
||||
// activeOpacity={0.7}
|
||||
>
|
||||
<View>{children}</View>
|
||||
</TouchableHighlight>
|
||||
</TouchableOpacity>
|
||||
) : (
|
||||
<View
|
||||
style={[
|
||||
@@ -46,7 +68,8 @@ export default function BaseBox({
|
||||
borderWidth: 1,
|
||||
borderRadius: 10,
|
||||
marginBottom,
|
||||
padding,
|
||||
paddingBlock,
|
||||
paddingInline,
|
||||
},
|
||||
style,
|
||||
]}
|
||||
|
||||
16
components/Box/BoxButtonOnFooter.tsx
Normal file
16
components/Box/BoxButtonOnFooter.tsx
Normal file
@@ -0,0 +1,16 @@
|
||||
import { GStyles } from "@/styles/global-styles";
|
||||
import { StyleProp, View, ViewStyle } from "react-native";
|
||||
|
||||
export default function BoxButtonOnFooter({
|
||||
children,
|
||||
style,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
style?: StyleProp<ViewStyle>;
|
||||
}) {
|
||||
return (
|
||||
<View style={GStyles.bottomBar}>
|
||||
<View style={[GStyles.bottomBarContainer, style]}>{children}</View>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
20
components/Box/BoxWithHeaderInformation.tsx
Normal file
20
components/Box/BoxWithHeaderInformation.tsx
Normal file
@@ -0,0 +1,20 @@
|
||||
import { Href } from "expo-router";
|
||||
import BaseBox from "./BaseBox";
|
||||
|
||||
export default function BoxWithHeaderSection({
|
||||
children,
|
||||
href,
|
||||
onPress,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
href?: Href;
|
||||
onPress?: () => void;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<BaseBox href={href} onPress={onPress} paddingTop={5}>
|
||||
{children}
|
||||
</BaseBox>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -16,7 +16,7 @@ export default function InformationBox({ text }: { text: string }) {
|
||||
<Ionicons
|
||||
name="information-circle-outline"
|
||||
size={24}
|
||||
color={MainColor.white}
|
||||
color={MainColor.white_gray}
|
||||
/>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={10} style={{ justifyContent: "center" }}>
|
||||
|
||||
@@ -1,16 +1,36 @@
|
||||
import { Ionicons } from "@expo/vector-icons";
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
import { router } from "expo-router";
|
||||
import { Ionicons } from "@expo/vector-icons";
|
||||
import { Href, router } from "expo-router";
|
||||
|
||||
const BackButton = () => {
|
||||
/**
|
||||
*
|
||||
* @param path - path to navigate to ?
|
||||
* @default router.back()
|
||||
* @returns if path : router.replace(path) else router.back()
|
||||
*/
|
||||
const LeftButtonCustom = ({
|
||||
path,
|
||||
icon = "arrow-back",
|
||||
iconCustom,
|
||||
}: {
|
||||
path?: Href;
|
||||
icon?: React.ReactNode | any;
|
||||
iconCustom?: React.ReactNode;
|
||||
}) => {
|
||||
return (
|
||||
<Ionicons
|
||||
name="arrow-back"
|
||||
size={20}
|
||||
color={MainColor.yellow}
|
||||
onPress={() => router.back()}
|
||||
/>
|
||||
<>
|
||||
{iconCustom ? (
|
||||
iconCustom
|
||||
) : (
|
||||
<Ionicons
|
||||
name={icon}
|
||||
size={20}
|
||||
color={MainColor.yellow}
|
||||
onPress={() => (path ? router.replace(path) : router.back())}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default BackButton;
|
||||
export default LeftButtonCustom;
|
||||
|
||||
29
components/Button/ButtonCenteredOnly.tsx
Normal file
29
components/Button/ButtonCenteredOnly.tsx
Normal file
@@ -0,0 +1,29 @@
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
import { ICON_SIZE_BUTTON } from "@/constants/constans-value";
|
||||
import { GStyles } from "@/styles/global-styles";
|
||||
import { Feather } from "@expo/vector-icons";
|
||||
import React from "react";
|
||||
import ButtonCustom from "./ButtonCustom";
|
||||
|
||||
interface ButtonCenteredOnlyProps {
|
||||
children?: React.ReactNode;
|
||||
icon?: "plus" | "upload";
|
||||
onPress: () => void;
|
||||
}
|
||||
export default function ButtonCenteredOnly({
|
||||
onPress,
|
||||
children,
|
||||
icon = "plus"
|
||||
}: ButtonCenteredOnlyProps) {
|
||||
return (
|
||||
<ButtonCustom
|
||||
onPress={onPress}
|
||||
iconLeft={
|
||||
<Feather name={icon} size={ICON_SIZE_BUTTON} color={MainColor.black} />
|
||||
}
|
||||
style={[GStyles.buttonCentered50Percent]}
|
||||
>
|
||||
{children}
|
||||
</ButtonCustom>
|
||||
);
|
||||
}
|
||||
@@ -2,18 +2,19 @@
|
||||
|
||||
import React from "react";
|
||||
import { StyleProp, Text, TouchableOpacity, ViewStyle } from "react-native";
|
||||
import buttonStyles from "./buttonCustomStyles";
|
||||
import { radiusMap } from "@/constants/radius-value";
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
import { stylesButton } from "./buttonCustomStyles";
|
||||
import { Href, router } from "expo-router";
|
||||
|
||||
// Import radiusMap
|
||||
|
||||
|
||||
// Definisi type untuk radius
|
||||
type RadiusType = keyof typeof radiusMap | number;
|
||||
|
||||
interface ButtonProps {
|
||||
children?: React.ReactNode;
|
||||
href?: Href;
|
||||
onPress?: () => void;
|
||||
title?: string;
|
||||
backgroundColor?: string;
|
||||
@@ -26,34 +27,41 @@ interface ButtonProps {
|
||||
|
||||
const ButtonCustom: React.FC<ButtonProps> = ({
|
||||
children,
|
||||
href,
|
||||
onPress,
|
||||
title = "Button",
|
||||
backgroundColor = MainColor.yellow,
|
||||
textColor = MainColor.black,
|
||||
radius = "full", // default md
|
||||
radius = 50, // default md
|
||||
disabled = false,
|
||||
iconLeft,
|
||||
style,
|
||||
}) => {
|
||||
const borderRadius =
|
||||
typeof radius === "number" ? radius : radiusMap[radius ?? "md"]; // fallback ke 'md'
|
||||
|
||||
const styles = buttonStyles({
|
||||
backgroundColor,
|
||||
textColor,
|
||||
borderRadius,
|
||||
});
|
||||
|
||||
return (
|
||||
<TouchableOpacity
|
||||
style={[styles.button, disabled && styles.disabled, style]}
|
||||
onPress={onPress}
|
||||
style={[
|
||||
stylesButton.button,
|
||||
{ borderRadius: radius },
|
||||
disabled
|
||||
? [stylesButton.disabled, { backgroundColor: MainColor.disabled }]
|
||||
: { backgroundColor },
|
||||
style,
|
||||
]}
|
||||
onPress={() => {
|
||||
if (href) {
|
||||
router.push(href);
|
||||
} else {
|
||||
onPress?.();
|
||||
}
|
||||
}}
|
||||
disabled={disabled}
|
||||
activeOpacity={0.8}
|
||||
>
|
||||
{/* Render icon jika tersedia */}
|
||||
{iconLeft && iconLeft}
|
||||
<Text style={styles.buttonText}>{children || title}</Text>
|
||||
<Text style={[stylesButton.buttonText, { color: textColor }]}>
|
||||
{children || title}
|
||||
</Text>
|
||||
</TouchableOpacity>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
import { GStyles } from "@/styles/global-styles";
|
||||
import { Feather } from "@expo/vector-icons";
|
||||
import React from "react";
|
||||
import ButtonCustom from "./ButtonCustom";
|
||||
|
||||
interface ButtonUploadProps {
|
||||
title?: string;
|
||||
onPress: () => void;
|
||||
}
|
||||
export default function ButtonUpload({ onPress, title = "Upload" }: ButtonUploadProps) {
|
||||
return (
|
||||
<ButtonCustom
|
||||
onPress={onPress}
|
||||
iconLeft={<Feather name="upload" size={20} color={MainColor.black} />}
|
||||
style={GStyles.buttonCentered50Percent}
|
||||
>
|
||||
{title}
|
||||
</ButtonCustom>
|
||||
);
|
||||
}
|
||||
13
components/Button/DotButton.tsx
Normal file
13
components/Button/DotButton.tsx
Normal file
@@ -0,0 +1,13 @@
|
||||
import { Ionicons } from "@expo/vector-icons";
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
|
||||
export default function DotButton({ onPress }: { onPress: () => void }) {
|
||||
return (
|
||||
<Ionicons
|
||||
onPress={onPress}
|
||||
name="ellipsis-vertical"
|
||||
size={20}
|
||||
color={MainColor.yellow}
|
||||
/>
|
||||
);
|
||||
}
|
||||
45
components/Button/FloatingButton.tsx
Normal file
45
components/Button/FloatingButton.tsx
Normal file
@@ -0,0 +1,45 @@
|
||||
// components/FloatingButton.tsx
|
||||
import { AccentColor, MainColor } from "@/constants/color-palet";
|
||||
import React from "react";
|
||||
import { StyleSheet, ViewStyle } from "react-native";
|
||||
import { FAB } from "react-native-paper";
|
||||
|
||||
// Props untuk komponen
|
||||
interface FloatingButtonProps {
|
||||
onPress: () => void;
|
||||
// label?: string;
|
||||
icon?: string; // MaterialCommunityIcons
|
||||
style?: ViewStyle;
|
||||
}
|
||||
|
||||
const FloatingButton: React.FC<FloatingButtonProps> = ({
|
||||
onPress,
|
||||
// label = "Buat",
|
||||
icon = "pencil-plus-outline",
|
||||
style,
|
||||
}) => {
|
||||
return (
|
||||
<FAB
|
||||
style={[styles.fab, style]}
|
||||
icon={icon}
|
||||
color={MainColor.white}
|
||||
// label={label}
|
||||
onPress={onPress}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
fab: {
|
||||
position: "absolute",
|
||||
margin: 16,
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
backgroundColor: AccentColor.softblue, // Warna Twitter biru
|
||||
borderRadius: 50,
|
||||
borderColor: AccentColor.blue,
|
||||
borderWidth: 1,
|
||||
},
|
||||
});
|
||||
|
||||
export default FloatingButton;
|
||||
@@ -1,31 +1,25 @@
|
||||
// components/Button/buttonStyles.js
|
||||
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
import { TEXT_SIZE_MEDIUM } from "@/constants/constans-value";
|
||||
import { StyleSheet } from "react-native";
|
||||
|
||||
export default function buttonStyles({
|
||||
backgroundColor = "#007AFF",
|
||||
textColor = "#FFFFFF",
|
||||
borderRadius = 8,
|
||||
}) {
|
||||
return StyleSheet.create({
|
||||
export const stylesButton = StyleSheet.create({
|
||||
button: {
|
||||
backgroundColor,
|
||||
paddingVertical: 12,
|
||||
backgroundColor: MainColor.yellow,
|
||||
paddingVertical: 10,
|
||||
paddingHorizontal: 20,
|
||||
borderRadius,
|
||||
flexDirection: "row", // 👈 Tambahkan baris ini
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
gap: 8,
|
||||
},
|
||||
buttonText: {
|
||||
color: textColor,
|
||||
fontSize: 16,
|
||||
color: MainColor.black,
|
||||
fontSize: TEXT_SIZE_MEDIUM,
|
||||
fontWeight: "600",
|
||||
},
|
||||
disabled: {
|
||||
backgroundColor: MainColor.disabled,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
51
components/Center/CenterCustom.tsx
Normal file
51
components/Center/CenterCustom.tsx
Normal file
@@ -0,0 +1,51 @@
|
||||
// Center.tsx
|
||||
import React from "react";
|
||||
import { View, StyleSheet, ViewStyle } from "react-native";
|
||||
|
||||
type JustifyContent =
|
||||
| "flex-start"
|
||||
| "flex-end"
|
||||
| "center"
|
||||
| "space-between"
|
||||
| "space-around"
|
||||
| "space-evenly";
|
||||
|
||||
type AlignItems = "flex-start" | "flex-end" | "center" | "stretch" | "baseline";
|
||||
|
||||
interface CenterProps {
|
||||
children: React.ReactNode;
|
||||
style?: ViewStyle;
|
||||
direction?: "row" | "column";
|
||||
justifyContent?: JustifyContent;
|
||||
alignItems?: AlignItems;
|
||||
}
|
||||
|
||||
const CenterCustom: React.FC<CenterProps> = ({
|
||||
children,
|
||||
style,
|
||||
direction = "column",
|
||||
justifyContent = "center",
|
||||
alignItems = "center",
|
||||
}) => {
|
||||
return (
|
||||
<View
|
||||
style={[
|
||||
styles.container,
|
||||
{ flexDirection: direction },
|
||||
{ justifyContent },
|
||||
{ alignItems },
|
||||
style,
|
||||
]}
|
||||
>
|
||||
{children}
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
flex: 1,
|
||||
},
|
||||
});
|
||||
|
||||
export default CenterCustom;
|
||||
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",
|
||||
},
|
||||
});
|
||||
205
components/DateInput/DataTimeAndroid.tsx
Normal file
205
components/DateInput/DataTimeAndroid.tsx
Normal file
@@ -0,0 +1,205 @@
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||
// DateTimeInput.tsx
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
import { GStyles } from "@/styles/global-styles";
|
||||
import { Ionicons } from "@expo/vector-icons";
|
||||
import DateTimePicker, {
|
||||
DateTimePickerEvent,
|
||||
} from "@react-native-community/datetimepicker";
|
||||
import React, { useCallback, useState } from "react";
|
||||
import { Pressable, StyleProp, Text, View, ViewStyle } from "react-native";
|
||||
import Grid from "../Grid/GridCustom";
|
||||
import TextCustom from "../Text/TextCustom";
|
||||
|
||||
interface DateTimeInputProps {
|
||||
// Main
|
||||
value?: DateTimePickerEvent;
|
||||
mode?: "date" | "time";
|
||||
onChange: (selectedDate: DateTimePickerEvent) => void;
|
||||
maximumDate?: Date;
|
||||
minimumDate?: Date;
|
||||
// Main
|
||||
label?: string;
|
||||
required?: boolean;
|
||||
disabled?: boolean;
|
||||
iconLeft?: React.ReactNode;
|
||||
style?: StyleProp<ViewStyle>;
|
||||
borderRadius?: number;
|
||||
externalError?: string;
|
||||
internalError?: string;
|
||||
containerStyle?: StyleProp<ViewStyle>;
|
||||
}
|
||||
|
||||
const DateTimeInput_Android: React.FC<DateTimeInputProps> = ({
|
||||
// Main
|
||||
value,
|
||||
mode,
|
||||
onChange,
|
||||
maximumDate,
|
||||
minimumDate,
|
||||
// Main
|
||||
label,
|
||||
required,
|
||||
disabled,
|
||||
iconLeft,
|
||||
style,
|
||||
borderRadius = 8,
|
||||
externalError,
|
||||
internalError,
|
||||
containerStyle,
|
||||
}) => {
|
||||
const [showDate, setShowDate] = useState(false);
|
||||
const [showTime, setShowTime] = useState(false);
|
||||
const [selectedDate, setSelectedDate] = useState<Date>(value as any);
|
||||
const [selectedTime, setSelectedTime] = useState<Date>(value as any);
|
||||
|
||||
// Fungsi untuk menggabungkan tanggal dan waktu
|
||||
const combineDateAndTime = useCallback((date: Date, time: Date): Date => {
|
||||
const combined = new Date(date);
|
||||
combined.setHours(
|
||||
time.getHours(),
|
||||
time.getMinutes(),
|
||||
time.getSeconds(),
|
||||
time.getMilliseconds()
|
||||
);
|
||||
return combined;
|
||||
}, []);
|
||||
|
||||
// Handler untuk tanggal
|
||||
const handleConfirmDate = (event: DateTimePickerEvent, date?: Date) => {
|
||||
if (event.type === "set" && date) {
|
||||
setSelectedDate(date);
|
||||
if (selectedTime) {
|
||||
const combined = combineDateAndTime(date, selectedTime);
|
||||
onChange?.(combined as any);
|
||||
}
|
||||
}
|
||||
setShowDate(false);
|
||||
};
|
||||
|
||||
// Handler untuk waktu
|
||||
const handleConfirmTime = (event: DateTimePickerEvent, time?: Date) => {
|
||||
if (event.type === "set" && time) {
|
||||
setSelectedTime(time);
|
||||
if (selectedDate) {
|
||||
const combined = combineDateAndTime(selectedDate, time);
|
||||
onChange?.(combined as any);
|
||||
}
|
||||
}
|
||||
setShowTime(false);
|
||||
};
|
||||
|
||||
const toggleDatePicker = () => {
|
||||
setShowDate(!showDate);
|
||||
};
|
||||
|
||||
const toggleTimePicker = () => {
|
||||
setShowTime(!showTime);
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<View style={[GStyles.inputContainerArea, containerStyle]}>
|
||||
{label && (
|
||||
<Text style={GStyles.inputLabel}>
|
||||
{label}
|
||||
{required && <Text style={GStyles.inputRequired}> *</Text>}
|
||||
</Text>
|
||||
)}
|
||||
<View
|
||||
style={[
|
||||
style,
|
||||
{ borderRadius },
|
||||
externalError || internalError ? GStyles.inputErrorBorder : null,
|
||||
GStyles.inputContainerInput,
|
||||
disabled && GStyles.disabledBox,
|
||||
]}
|
||||
>
|
||||
<View style={GStyles.inputIcon}>
|
||||
<Ionicons
|
||||
name="calendar-outline"
|
||||
size={20}
|
||||
color={MainColor.placeholder}
|
||||
/>
|
||||
</View>
|
||||
|
||||
<Grid
|
||||
containerStyle={{
|
||||
borderRadius: 8,
|
||||
justifyContent: "center",
|
||||
alignItems: "center",
|
||||
}}
|
||||
>
|
||||
<Grid.Col span={6} style={{}}>
|
||||
<Pressable onPress={toggleDatePicker}>
|
||||
<TextCustom color="gray">
|
||||
{selectedDate ? (
|
||||
<TextCustom color="black">
|
||||
{selectedDate.toLocaleDateString()}
|
||||
</TextCustom>
|
||||
) : (
|
||||
"Pilih tanggal"
|
||||
)}
|
||||
</TextCustom>
|
||||
</Pressable>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={1} style={{ alignItems: "center" }}>
|
||||
<TextCustom color="gray">|</TextCustom>
|
||||
</Grid.Col>
|
||||
|
||||
<Grid.Col span={5} style={{}}>
|
||||
<Pressable onPress={toggleTimePicker}>
|
||||
<TextCustom color="gray">
|
||||
{selectedTime ? (
|
||||
<TextCustom color="black">
|
||||
{selectedTime.toLocaleTimeString("id-ID", {
|
||||
minute: "2-digit",
|
||||
hour: "2-digit",
|
||||
})}
|
||||
</TextCustom>
|
||||
) : (
|
||||
"Pilih waktu"
|
||||
)}
|
||||
</TextCustom>
|
||||
</Pressable>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
</View>
|
||||
{externalError ||
|
||||
(internalError && (
|
||||
<Text style={GStyles.inputErrorMessage}>
|
||||
{externalError || internalError}
|
||||
</Text>
|
||||
))}
|
||||
</View>
|
||||
|
||||
{showDate && (
|
||||
<DateTimePicker
|
||||
testID="dateTimePicker"
|
||||
value={selectedDate || new Date()}
|
||||
mode="date"
|
||||
is24Hour={true}
|
||||
display="default"
|
||||
onChange={handleConfirmDate}
|
||||
minimumDate={minimumDate}
|
||||
maximumDate={maximumDate}
|
||||
/>
|
||||
)}
|
||||
|
||||
{showTime && (
|
||||
<DateTimePicker
|
||||
testID="dateTimePicker"
|
||||
value={selectedTime || new Date()}
|
||||
mode="time"
|
||||
is24Hour={true}
|
||||
display="default"
|
||||
onChange={handleConfirmTime}
|
||||
minimumDate={minimumDate}
|
||||
maximumDate={maximumDate}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default DateTimeInput_Android;
|
||||
161
components/DateInput/DateTimeIOS.tsx
Normal file
161
components/DateInput/DateTimeIOS.tsx
Normal file
@@ -0,0 +1,161 @@
|
||||
// DateTimeInput.tsx
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
import { GStyles } from "@/styles/global-styles";
|
||||
import { Ionicons } from "@expo/vector-icons";
|
||||
import DateTimePicker, {
|
||||
DateTimePickerEvent,
|
||||
} from "@react-native-community/datetimepicker";
|
||||
import dayjs from "dayjs";
|
||||
import React, { useState } from "react";
|
||||
import {
|
||||
StyleProp,
|
||||
Text,
|
||||
View,
|
||||
ViewStyle
|
||||
} from "react-native";
|
||||
import ClickableCustom from "../Clickable/ClickableCustom";
|
||||
import TextCustom from "../Text/TextCustom";
|
||||
|
||||
interface DateTimeInputProps {
|
||||
// Main
|
||||
value?: DateTimePickerEvent;
|
||||
mode?: "date" | "time";
|
||||
onChange: (selectedDate: DateTimePickerEvent) => void;
|
||||
maximumDate?: Date;
|
||||
minimumDate?: Date;
|
||||
// Main
|
||||
label?: string;
|
||||
required?: boolean;
|
||||
disabled?: boolean;
|
||||
iconLeft?: React.ReactNode;
|
||||
style?: StyleProp<ViewStyle>;
|
||||
borderRadius?: number;
|
||||
externalError?: string;
|
||||
internalError?: string;
|
||||
containerStyle?: StyleProp<ViewStyle>;
|
||||
}
|
||||
|
||||
const DateTimeInput_IOS: React.FC<DateTimeInputProps> = ({
|
||||
// Main
|
||||
value,
|
||||
mode,
|
||||
onChange,
|
||||
maximumDate,
|
||||
minimumDate,
|
||||
// Main
|
||||
label,
|
||||
required,
|
||||
disabled,
|
||||
iconLeft,
|
||||
style,
|
||||
borderRadius = 8,
|
||||
externalError,
|
||||
internalError,
|
||||
containerStyle,
|
||||
}) => {
|
||||
const [show, setShow] = useState(false);
|
||||
const [selectedDate, setSelectedDate] = useState<Date | undefined>(
|
||||
value as any
|
||||
);
|
||||
|
||||
const handleConfirm = (event: any, date?: Date) => {
|
||||
if (event.type === "set" && date !== undefined) {
|
||||
setSelectedDate(date);
|
||||
onChange(date as any);
|
||||
}
|
||||
};
|
||||
|
||||
const handlePress = () => {
|
||||
setShow(!show);
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<ClickableCustom
|
||||
activeOpacity={0.8}
|
||||
style={[GStyles.inputContainerArea, containerStyle]}
|
||||
onPress={handlePress}
|
||||
>
|
||||
{label && (
|
||||
<Text style={GStyles.inputLabel}>
|
||||
{label}
|
||||
{required && <Text style={GStyles.inputRequired}> *</Text>}
|
||||
</Text>
|
||||
)}
|
||||
<View
|
||||
style={[
|
||||
style,
|
||||
{ borderRadius },
|
||||
externalError || internalError ? GStyles.inputErrorBorder : null,
|
||||
GStyles.inputContainerInput,
|
||||
disabled && GStyles.disabledBox,
|
||||
]}
|
||||
>
|
||||
<View style={GStyles.inputIcon}>
|
||||
<Ionicons
|
||||
name="calendar-outline"
|
||||
size={20}
|
||||
color={MainColor.placeholder}
|
||||
/>
|
||||
</View>
|
||||
|
||||
<TextCustom color="gray">
|
||||
{selectedDate ? (
|
||||
<TextCustom color="black">
|
||||
{dayjs(selectedDate).format("DD-MM-YYYY HH:mm")}
|
||||
</TextCustom>
|
||||
) : (
|
||||
"Pilih tanggal"
|
||||
)}
|
||||
</TextCustom>
|
||||
</View>
|
||||
{externalError ||
|
||||
(internalError && (
|
||||
<Text style={GStyles.inputErrorMessage}>
|
||||
{externalError || internalError}
|
||||
</Text>
|
||||
))}
|
||||
</ClickableCustom>
|
||||
|
||||
{show && (
|
||||
<>
|
||||
<View
|
||||
style={{
|
||||
position: "absolute",
|
||||
zIndex: 15,
|
||||
backgroundColor: "white",
|
||||
borderRadius: 8,
|
||||
padding: 10,
|
||||
// top: 0,
|
||||
bottom: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
borderColor: "#ccc",
|
||||
borderWidth: 1,
|
||||
}}
|
||||
>
|
||||
<View style={{ alignItems: "flex-end" }}>
|
||||
<Ionicons
|
||||
name="close"
|
||||
size={20}
|
||||
color="black"
|
||||
onPress={() => setShow(false)}
|
||||
/>
|
||||
</View>
|
||||
|
||||
<DateTimePicker
|
||||
value={selectedDate || new Date()}
|
||||
mode={"datetime"}
|
||||
display="inline"
|
||||
onChange={handleConfirm}
|
||||
minimumDate={minimumDate}
|
||||
maximumDate={maximumDate}
|
||||
/>
|
||||
</View>
|
||||
</>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default DateTimeInput_IOS;
|
||||
54
components/DateInput/DateTimePickerCustom.tsx
Normal file
54
components/DateInput/DateTimePickerCustom.tsx
Normal file
@@ -0,0 +1,54 @@
|
||||
|
||||
import {
|
||||
DateTimePickerEvent,
|
||||
} from "@react-native-community/datetimepicker";
|
||||
import React from "react";
|
||||
import { Platform } from "react-native";
|
||||
import DateTimeInput_Android from "./DataTimeAndroid";
|
||||
import DateTimeInput_IOS from "./DateTimeIOS";
|
||||
|
||||
type Props = {
|
||||
value?: Date;
|
||||
onChange?: (date: Date) => void;
|
||||
label?: string;
|
||||
required?: boolean;
|
||||
maximumDate?: Date;
|
||||
minimumDate?: Date;
|
||||
};
|
||||
|
||||
const DateTimePickerCustom: React.FC<Props> = ({
|
||||
value,
|
||||
onChange,
|
||||
label,
|
||||
required,
|
||||
maximumDate,
|
||||
minimumDate,
|
||||
}) => {
|
||||
return (
|
||||
<>
|
||||
{Platform.OS === "ios" ? (
|
||||
<DateTimeInput_IOS
|
||||
label={label}
|
||||
onChange={(date: DateTimePickerEvent) => {
|
||||
onChange?.(date as any);
|
||||
}}
|
||||
required={required}
|
||||
maximumDate={maximumDate}
|
||||
minimumDate={minimumDate}
|
||||
/>
|
||||
) : (
|
||||
<DateTimeInput_Android
|
||||
label={label}
|
||||
onChange={(date: DateTimePickerEvent) => {
|
||||
onChange?.(date as any);
|
||||
}}
|
||||
required={required}
|
||||
maximumDate={maximumDate}
|
||||
minimumDate={minimumDate}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default DateTimePickerCustom;
|
||||
70
components/DateInput/DateTimeTry.tsx
Normal file
70
components/DateInput/DateTimeTry.tsx
Normal file
@@ -0,0 +1,70 @@
|
||||
import React, { useState } from "react";
|
||||
import { Pressable, Text, StyleSheet } from "react-native";
|
||||
import DateTimePicker, { Event } from "@react-native-community/datetimepicker";
|
||||
|
||||
type Props = {
|
||||
value?: Date;
|
||||
mode?: "date" | "time" | "datetime";
|
||||
onChange: (date: Date) => void;
|
||||
};
|
||||
|
||||
const DateTimePickerTry: React.FC<Props> = ({
|
||||
value = new Date(),
|
||||
mode = "date",
|
||||
onChange,
|
||||
}) => {
|
||||
const [show, setShow] = useState(false);
|
||||
|
||||
const toggleDatePicker = () => {
|
||||
setShow(!show);
|
||||
};
|
||||
|
||||
const handleConfirm = (event: Event, selectedDate?: Date) => {
|
||||
if (event.type === "set" && selectedDate !== undefined) {
|
||||
onChange(selectedDate);
|
||||
}
|
||||
setShow(false);
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<Pressable onPress={toggleDatePicker} style={styles.button}>
|
||||
<Text style={styles.buttonText}>
|
||||
{value ? value.toLocaleDateString() : "Pilih tanggal"}
|
||||
</Text>
|
||||
</Pressable>
|
||||
|
||||
{show && (
|
||||
<DateTimePicker
|
||||
// style={styles.button}
|
||||
textColor="white"
|
||||
testID="dateTimePicker"
|
||||
value={value}
|
||||
mode={mode}
|
||||
is24Hour={true}
|
||||
display="default"
|
||||
onChange={handleConfirm as any}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
button: {
|
||||
paddingVertical: 12,
|
||||
paddingHorizontal: 20,
|
||||
backgroundColor: "white",
|
||||
borderRadius: 8,
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
marginVertical: 10,
|
||||
},
|
||||
buttonText: {
|
||||
color: "white",
|
||||
fontSize: 16,
|
||||
fontWeight: "bold",
|
||||
},
|
||||
});
|
||||
|
||||
export default DateTimePickerTry;
|
||||
186
components/Divider/DividerCustom.tsx
Normal file
186
components/Divider/DividerCustom.tsx
Normal file
@@ -0,0 +1,186 @@
|
||||
import React from "react";
|
||||
import {
|
||||
StyleProp,
|
||||
StyleSheet,
|
||||
Text,
|
||||
TextStyle,
|
||||
View,
|
||||
ViewStyle,
|
||||
} from "react-native";
|
||||
|
||||
// Define types for props
|
||||
type Orientation = "horizontal" | "vertical";
|
||||
type HorizontalLabelPosition = "center" | "left" | "right";
|
||||
type VerticalLabelPosition = "center" | "top" | "bottom";
|
||||
type LabelPosition = HorizontalLabelPosition | VerticalLabelPosition;
|
||||
|
||||
type Size = number | "xs" | "sm" | "md" | "lg" | "xl";
|
||||
|
||||
interface DividerProps {
|
||||
orientation?: Orientation;
|
||||
color?: string;
|
||||
size?: Size;
|
||||
label?: React.ReactNode;
|
||||
labelPosition?: LabelPosition;
|
||||
labelStyle?: StyleProp<TextStyle>;
|
||||
style?: StyleProp<ViewStyle>;
|
||||
}
|
||||
|
||||
const DividerCustom: React.FC<DividerProps> = ({
|
||||
orientation = "horizontal",
|
||||
color = "#DADADA",
|
||||
size = "xs",
|
||||
label,
|
||||
labelPosition = "center",
|
||||
labelStyle,
|
||||
style,
|
||||
}) => {
|
||||
const isHorizontal = orientation === "horizontal";
|
||||
|
||||
// Convert size to actual dimensions
|
||||
const getSize = (): number => {
|
||||
if (typeof size === "number") return size;
|
||||
|
||||
switch (size) {
|
||||
case "xs":
|
||||
return 1;
|
||||
case "sm":
|
||||
return 2;
|
||||
case "md":
|
||||
return 3;
|
||||
case "lg":
|
||||
return 4;
|
||||
case "xl":
|
||||
return 5;
|
||||
default:
|
||||
return 1; // Default size
|
||||
}
|
||||
};
|
||||
|
||||
const thickness = getSize();
|
||||
|
||||
const capitalize = (str: string): string =>
|
||||
str.charAt(0).toUpperCase() + str.slice(1);
|
||||
|
||||
const renderLabel = () => {
|
||||
if (!label) return null;
|
||||
|
||||
return (
|
||||
<View
|
||||
style={[
|
||||
styles.labelContainer,
|
||||
isHorizontal
|
||||
? styles[
|
||||
`label${capitalize(
|
||||
labelPosition as string
|
||||
)}` as keyof typeof styles
|
||||
]
|
||||
: styles[
|
||||
`label${capitalize(
|
||||
labelPosition as string
|
||||
)}` as keyof typeof styles
|
||||
],
|
||||
]}
|
||||
>
|
||||
<Text style={[styles.labelText, labelStyle]}>{label}</Text>
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
<View
|
||||
style={[
|
||||
isHorizontal ? styles.horizontalDivider : styles.verticalDivider,
|
||||
{ backgroundColor: color },
|
||||
style,
|
||||
]}
|
||||
>
|
||||
{isHorizontal ? (
|
||||
labelPosition !== "center" ? (
|
||||
<View style={{ flex: 1, flexDirection: "row", alignItems: "center" }}>
|
||||
{labelPosition === "left" && renderLabel()}
|
||||
<View
|
||||
style={{ flex: 1, backgroundColor: color, height: thickness }}
|
||||
/>
|
||||
{labelPosition === "right" && renderLabel()}
|
||||
</View>
|
||||
) : (
|
||||
<>
|
||||
{renderLabel()}
|
||||
<View style={{ flex: 1 }} />
|
||||
</>
|
||||
)
|
||||
) : labelPosition !== "center" && !isHorizontal ? (
|
||||
<View
|
||||
style={{ flex: 1, flexDirection: "column", justifyContent: "center" }}
|
||||
>
|
||||
{labelPosition === "top" && renderLabel()}
|
||||
<View style={{ flex: 1, backgroundColor: color, width: thickness }} />
|
||||
{labelPosition === "bottom" && renderLabel()}
|
||||
</View>
|
||||
) : (
|
||||
<>
|
||||
{renderLabel()}
|
||||
<View style={{ flex: 1 }} />
|
||||
</>
|
||||
)}
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
horizontalDivider: {
|
||||
flexDirection: "row",
|
||||
alignItems: "center",
|
||||
marginVertical: 8,
|
||||
position: "relative",
|
||||
},
|
||||
verticalDivider: {
|
||||
flexDirection: "column",
|
||||
justifyContent: "center",
|
||||
marginHorizontal: 8,
|
||||
position: "relative",
|
||||
},
|
||||
labelText: {
|
||||
fontSize: 14,
|
||||
fontWeight: "500",
|
||||
color: "#666",
|
||||
marginHorizontal: 12,
|
||||
marginVertical: 4,
|
||||
backgroundColor: "white",
|
||||
paddingHorizontal: 8,
|
||||
},
|
||||
labelContainer: {
|
||||
position: "absolute",
|
||||
left: 0,
|
||||
right: 0,
|
||||
justifyContent: "center",
|
||||
alignItems: "center",
|
||||
},
|
||||
labelLeft: {
|
||||
left: 12,
|
||||
right: null,
|
||||
alignItems: "flex-start",
|
||||
},
|
||||
labelRight: {
|
||||
right: 12,
|
||||
left: null,
|
||||
alignItems: "flex-end",
|
||||
},
|
||||
labelCenter: {
|
||||
justifyContent: "center",
|
||||
alignItems: "center",
|
||||
},
|
||||
labelTop: {
|
||||
top: 12,
|
||||
bottom: null,
|
||||
justifyContent: "flex-start",
|
||||
},
|
||||
labelBottom: {
|
||||
bottom: 12,
|
||||
top: null,
|
||||
justifyContent: "flex-end",
|
||||
},
|
||||
});
|
||||
|
||||
export default DividerCustom;
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { useRef } from "react";
|
||||
import React, { useEffect, useRef } from "react";
|
||||
import {
|
||||
Animated,
|
||||
PanResponder,
|
||||
@@ -14,7 +14,7 @@ interface DrawerCustomProps {
|
||||
children?: React.ReactNode;
|
||||
height?: number;
|
||||
isVisible: boolean;
|
||||
drawerAnim: Animated.Value;
|
||||
drawerAnim?: Animated.Value;
|
||||
closeDrawer: () => void;
|
||||
// openLogoutAlert: () => void;
|
||||
}
|
||||
@@ -33,6 +33,26 @@ export default function DrawerCustom({
|
||||
closeDrawer,
|
||||
}: // openLogoutAlert,
|
||||
DrawerCustomProps) {
|
||||
const drawerAnima = useRef(
|
||||
new Animated.Value(height || DRAWER_HEIGHT)
|
||||
).current;
|
||||
// Efek untuk handle open/close drawer
|
||||
useEffect(() => {
|
||||
if (isVisible) {
|
||||
Animated.timing(drawerAnima, {
|
||||
toValue: 0,
|
||||
duration: 300,
|
||||
useNativeDriver: true,
|
||||
}).start();
|
||||
} else {
|
||||
Animated.timing(drawerAnima, {
|
||||
toValue: height || DRAWER_HEIGHT,
|
||||
duration: 300,
|
||||
useNativeDriver: true,
|
||||
}).start();
|
||||
}
|
||||
}, [isVisible, drawerAnim, height, closeDrawer, drawerAnima]);
|
||||
|
||||
const panResponder = useRef(
|
||||
PanResponder.create({
|
||||
onMoveShouldSetPanResponder: (_, gestureState) => {
|
||||
@@ -41,7 +61,7 @@ DrawerCustomProps) {
|
||||
onPanResponderMove: (_, gestureState) => {
|
||||
const offset = gestureState.dy;
|
||||
if (offset >= 0 && offset <= DRAWER_HEIGHT) {
|
||||
drawerAnim.setValue(offset);
|
||||
drawerAnima.setValue(offset);
|
||||
}
|
||||
},
|
||||
onPanResponderRelease: (_, gestureState) => {
|
||||
@@ -50,7 +70,7 @@ DrawerCustomProps) {
|
||||
closeDrawer();
|
||||
});
|
||||
} else {
|
||||
Animated.spring(drawerAnim, {
|
||||
Animated.spring(drawerAnima, {
|
||||
toValue: 0,
|
||||
useNativeDriver: true,
|
||||
}).start();
|
||||
@@ -80,7 +100,7 @@ DrawerCustomProps) {
|
||||
styles.drawer,
|
||||
{
|
||||
height: height || DRAWER_HEIGHT,
|
||||
transform: [{ translateY: drawerAnim }],
|
||||
transform: [{ translateY: drawerAnima }],
|
||||
},
|
||||
]}
|
||||
{...panResponder.panHandlers}
|
||||
|
||||
@@ -1,27 +1,37 @@
|
||||
import { AccentColor, MainColor } from "@/constants/color-palet";
|
||||
import { ICON_SIZE_MEDIUM, TEXT_SIZE_SMALL } from "@/constants/constans-value";
|
||||
import { Ionicons } from "@expo/vector-icons";
|
||||
import { View, TouchableOpacity, Text, StyleSheet } from "react-native";
|
||||
import { TEXT_SIZE_SMALL } from "@/constants/constans-value";
|
||||
import { StyleSheet, Text, TouchableOpacity, View } from "react-native";
|
||||
import { IMenuDrawerItem } from "../_Interface/types";
|
||||
|
||||
const MenuDrawerDynamicGrid = ({ data, columns = 3, onPressItem }: any) => {
|
||||
const numColumns = columns;
|
||||
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
{data.map((item: any, index: any) => (
|
||||
{data.map((item: IMenuDrawerItem, index: any) => (
|
||||
<TouchableOpacity
|
||||
key={index}
|
||||
style={[styles.itemContainer, { flexBasis: `${100 / numColumns}%` }]}
|
||||
onPress={() => onPressItem?.(item)}
|
||||
>
|
||||
<View style={styles.iconContainer}>
|
||||
<Ionicons
|
||||
<View
|
||||
style={[
|
||||
styles.iconContainer,
|
||||
{ backgroundColor: item.color || AccentColor.blue },
|
||||
]}
|
||||
>
|
||||
{item.icon}
|
||||
{/* <Ionicons
|
||||
name={item.icon}
|
||||
size={ICON_SIZE_MEDIUM}
|
||||
color={item.color || MainColor.white}
|
||||
/>
|
||||
color={item.color || MainColor.white_gray}
|
||||
/> */}
|
||||
</View>
|
||||
<Text style={styles.label}>{item.label}</Text>
|
||||
<Text
|
||||
style={[styles.label, { color: item.color || AccentColor.white }]}
|
||||
>
|
||||
{item.label}
|
||||
</Text>
|
||||
</TouchableOpacity>
|
||||
))}
|
||||
</View>
|
||||
@@ -52,6 +62,6 @@ const styles = StyleSheet.create({
|
||||
marginTop: 10,
|
||||
fontSize: TEXT_SIZE_SMALL,
|
||||
textAlign: "center",
|
||||
color: MainColor.white,
|
||||
color: MainColor.white_gray,
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
@@ -109,5 +109,6 @@ const styles = StyleSheet.create({
|
||||
flexDirection: "row",
|
||||
flexWrap: "wrap",
|
||||
justifyContent: "flex-start",
|
||||
marginInline: 0.1
|
||||
},
|
||||
});
|
||||
|
||||
@@ -1,12 +1,21 @@
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
import DUMMY_IMAGE from "@/constants/dummy-image-value";
|
||||
import { Image, ImageSourcePropType, StyleSheet } from "react-native";
|
||||
import { Href, router } from "expo-router";
|
||||
import {
|
||||
Image,
|
||||
ImageSourcePropType,
|
||||
StyleSheet,
|
||||
TouchableOpacity,
|
||||
} from "react-native";
|
||||
|
||||
type Size = "base" | "sm" | "md" | "lg" | "xl";
|
||||
|
||||
interface AvatarCustomProps {
|
||||
source?: ImageSourcePropType;
|
||||
size?: Size;
|
||||
onPress?: () => void;
|
||||
href?: Href | undefined;
|
||||
}
|
||||
|
||||
const sizeMap = {
|
||||
@@ -20,24 +29,42 @@ const sizeMap = {
|
||||
export default function AvatarCustom({
|
||||
source = DUMMY_IMAGE.avatar,
|
||||
size = "base",
|
||||
onPress,
|
||||
href,
|
||||
}: AvatarCustomProps) {
|
||||
const dimension = sizeMap[size];
|
||||
|
||||
const ImageView = ({source}: {source: ImageSourcePropType}) => {
|
||||
return (
|
||||
<Image
|
||||
source={source}
|
||||
style={[
|
||||
// styles.overlappingAvatar,
|
||||
{
|
||||
width: dimension,
|
||||
height: dimension,
|
||||
borderRadius: dimension / 2,
|
||||
},
|
||||
]}
|
||||
resizeMode="cover"
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<Image
|
||||
source={source}
|
||||
style={[
|
||||
styles.overlappingAvatar,
|
||||
{
|
||||
width: dimension,
|
||||
height: dimension,
|
||||
borderRadius: dimension / 2,
|
||||
},
|
||||
]}
|
||||
resizeMode="cover"
|
||||
/>
|
||||
<>
|
||||
{onPress || href ? (
|
||||
<TouchableOpacity
|
||||
onPress={href ? () => router.navigate(href as any) : onPress}
|
||||
>
|
||||
<ImageView source={source} />
|
||||
</TouchableOpacity>
|
||||
) : (
|
||||
<ImageView source={source} />
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
@@ -47,7 +74,7 @@ const styles = StyleSheet.create({
|
||||
overlappingAvatar: {
|
||||
borderWidth: 2,
|
||||
borderColor: "#fff",
|
||||
backgroundColor: MainColor.white,
|
||||
backgroundColor: MainColor.white_gray,
|
||||
// shadowColor: "#000",
|
||||
// shadowOffset: { width: 0, height: 2 },
|
||||
// shadowOpacity: 0.2,
|
||||
|
||||
61
components/Map/MapCustom.tsx
Normal file
61
components/Map/MapCustom.tsx
Normal file
@@ -0,0 +1,61 @@
|
||||
// components/MapComponent.js
|
||||
|
||||
import React from "react";
|
||||
import { DimensionValue, StyleSheet, View } from "react-native";
|
||||
import MapView, { Marker } from "react-native-maps";
|
||||
|
||||
interface MapComponentProps {
|
||||
latitude?: number;
|
||||
longitude?: number;
|
||||
latitudeDelta?: number;
|
||||
longitudeDelta?: number;
|
||||
height?: DimensionValue;
|
||||
}
|
||||
|
||||
const MapCustom = ({
|
||||
latitude = -8.737109,
|
||||
longitude = 115.1756897,
|
||||
latitudeDelta = 0.1,
|
||||
longitudeDelta = 0.1,
|
||||
height = 300,
|
||||
}: MapComponentProps) => {
|
||||
const initialRegion = {
|
||||
latitude,
|
||||
longitude, // Jakarta sebagai default lokasi
|
||||
latitudeDelta,
|
||||
longitudeDelta,
|
||||
};
|
||||
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
<MapView
|
||||
style={[styles.map, { height }]}
|
||||
initialRegion={initialRegion}
|
||||
showsUserLocation={true}
|
||||
loadingEnabled={true}
|
||||
>
|
||||
{/* Contoh marker */}
|
||||
<Marker
|
||||
coordinate={{
|
||||
latitude,
|
||||
longitude,
|
||||
}}
|
||||
title="Bali"
|
||||
description="Badung, Bali, Indonesia"
|
||||
/>
|
||||
</MapView>
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
flex: 1,
|
||||
borderRadius: 8,
|
||||
},
|
||||
map: {
|
||||
width: "100%",
|
||||
},
|
||||
});
|
||||
|
||||
export default MapCustom;
|
||||
132
components/Radio/RadioCustom.tsx
Normal file
132
components/Radio/RadioCustom.tsx
Normal file
@@ -0,0 +1,132 @@
|
||||
// components/Radio.tsx
|
||||
import { GStyles } from '@/styles/global-styles';
|
||||
import React, { createContext, useCallback, useContext } from 'react';
|
||||
import {
|
||||
StyleSheet,
|
||||
Text,
|
||||
TextStyle,
|
||||
TouchableOpacity,
|
||||
View,
|
||||
ViewStyle
|
||||
} from 'react-native';
|
||||
|
||||
// ========================
|
||||
// Types
|
||||
// ========================
|
||||
|
||||
type RadioContextType = {
|
||||
value: string;
|
||||
onChange: (value: string) => void;
|
||||
};
|
||||
|
||||
const RadioContext = createContext<RadioContextType | undefined>(undefined);
|
||||
|
||||
interface RadioGroupProps {
|
||||
value: string;
|
||||
onChange: (value: string) => void;
|
||||
children: React.ReactNode;
|
||||
style?: ViewStyle;
|
||||
}
|
||||
|
||||
interface RadioProps {
|
||||
label: string;
|
||||
value: string | number;
|
||||
disabled?: boolean;
|
||||
style?: ViewStyle;
|
||||
labelStyle?: TextStyle;
|
||||
}
|
||||
|
||||
// ========================
|
||||
// Components
|
||||
// ========================
|
||||
|
||||
export const RadioGroup: React.FC<RadioGroupProps> = ({ value, onChange, children, style }) => {
|
||||
const contextValue = {
|
||||
value,
|
||||
onChange,
|
||||
};
|
||||
|
||||
return <RadioContext.Provider value={contextValue}>{children}</RadioContext.Provider>;
|
||||
};
|
||||
|
||||
export const RadioCustom: React.FC<RadioProps> = ({ label, value, disabled = false, style, labelStyle }) => {
|
||||
const context = useContext(RadioContext);
|
||||
if (!context) {
|
||||
throw new Error('Radio must be used inside a RadioGroup');
|
||||
}
|
||||
|
||||
const { value: selectedValue, onChange } = context;
|
||||
|
||||
const handlePress = useCallback(() => {
|
||||
if (!disabled && selectedValue !== value) {
|
||||
onChange(value as any);
|
||||
}
|
||||
}, [disabled, selectedValue, value, onChange]);
|
||||
|
||||
const isSelected = selectedValue === value;
|
||||
|
||||
return (
|
||||
<TouchableOpacity
|
||||
style={[styles.radioContainer, style]}
|
||||
onPress={handlePress}
|
||||
disabled={disabled}
|
||||
>
|
||||
{/* Circle */}
|
||||
<View
|
||||
style={[styles.outerCircle, isSelected && styles.outerCircleChecked]}
|
||||
>
|
||||
<View
|
||||
style={[styles.innerCircle, isSelected && styles.innerCircleChecked]}
|
||||
/>
|
||||
</View>
|
||||
|
||||
{/* Label */}
|
||||
<Text
|
||||
style={[
|
||||
GStyles.textLabelBold,
|
||||
labelStyle,
|
||||
disabled && GStyles.inputTextDisabled,
|
||||
]}
|
||||
>
|
||||
{label}
|
||||
</Text>
|
||||
</TouchableOpacity>
|
||||
);
|
||||
};
|
||||
|
||||
// ========================
|
||||
// Styles
|
||||
// ========================
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
radioContainer: {
|
||||
flexDirection: 'row',
|
||||
alignItems: 'center',
|
||||
marginVertical: 8,
|
||||
},
|
||||
outerCircle: {
|
||||
height: 24,
|
||||
width: 24,
|
||||
borderRadius: 12,
|
||||
borderWidth: 2,
|
||||
borderColor: '#3B82F6',
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
marginRight: 10,
|
||||
},
|
||||
outerCircleChecked: {
|
||||
backgroundColor: '#3B82F6',
|
||||
},
|
||||
innerCircle: {
|
||||
height: 12,
|
||||
width: 12,
|
||||
borderRadius: 6,
|
||||
backgroundColor: 'transparent',
|
||||
},
|
||||
innerCircleChecked: {
|
||||
backgroundColor: 'white',
|
||||
borderColor: 'white',
|
||||
borderRadius: 6,
|
||||
},
|
||||
|
||||
});
|
||||
64
components/Scroll/ScrollCustom.tsx
Normal file
64
components/Scroll/ScrollCustom.tsx
Normal file
@@ -0,0 +1,64 @@
|
||||
import { AccentColor, MainColor } from "@/constants/color-palet";
|
||||
import React from "react";
|
||||
import { ScrollView, StyleSheet } from "react-native";
|
||||
import ButtonCustom from "../Button/ButtonCustom";
|
||||
|
||||
interface ButtonData {
|
||||
id: string | number;
|
||||
label: string;
|
||||
value: string;
|
||||
}
|
||||
|
||||
interface ScrollableCustomProps {
|
||||
data: ButtonData[];
|
||||
onButtonPress: (item: ButtonData) => void;
|
||||
activeId?: string | number;
|
||||
}
|
||||
|
||||
const ScrollableCustom = ({
|
||||
data,
|
||||
onButtonPress,
|
||||
activeId,
|
||||
}: ScrollableCustomProps) => {
|
||||
return (
|
||||
<ScrollView
|
||||
horizontal
|
||||
showsHorizontalScrollIndicator={false}
|
||||
contentContainerStyle={styles.buttonContainer}
|
||||
style={styles.scrollView}
|
||||
>
|
||||
{data.map((item) => {
|
||||
const isActive = activeId === item.value;
|
||||
|
||||
return (
|
||||
<ButtonCustom
|
||||
key={item.id}
|
||||
backgroundColor={isActive ? MainColor.yellow : AccentColor.blue}
|
||||
textColor={isActive ? MainColor.black : MainColor.white}
|
||||
onPress={() => onButtonPress(item)}
|
||||
>
|
||||
{item.label}
|
||||
</ButtonCustom>
|
||||
);
|
||||
})}
|
||||
</ScrollView>
|
||||
);
|
||||
};
|
||||
|
||||
export default ScrollableCustom;
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
scrollView: {
|
||||
backgroundColor: MainColor.soft_darkblue,
|
||||
borderRadius: 50,
|
||||
padding: 5,
|
||||
// maxHeight: 50,
|
||||
},
|
||||
buttonContainer: {
|
||||
flexDirection: "row",
|
||||
alignItems: "center",
|
||||
// paddingHorizontal: 16,
|
||||
// paddingVertical: 10,
|
||||
gap: 12,
|
||||
},
|
||||
});
|
||||
@@ -1,15 +1,13 @@
|
||||
// components/Select.tsx
|
||||
import { MainColor } from "@/constants/color-palet";
|
||||
import { TEXT_SIZE_MEDIUM } from "@/constants/constans-value";
|
||||
import { GStyles } from "@/styles/global-styles";
|
||||
import React, { useState } from "react";
|
||||
import {
|
||||
View,
|
||||
Text,
|
||||
Pressable,
|
||||
Modal,
|
||||
FlatList,
|
||||
StyleSheet,
|
||||
Modal,
|
||||
Pressable,
|
||||
Text,
|
||||
TouchableOpacity,
|
||||
View,
|
||||
} from "react-native";
|
||||
|
||||
type SelectItem = {
|
||||
@@ -23,7 +21,9 @@ type SelectProps = {
|
||||
data: SelectItem[];
|
||||
value?: string | number | null;
|
||||
required?: boolean; // <-- new prop
|
||||
disabled?: boolean; // <-- tambahkan prop disabled
|
||||
onChange: (value: string | number) => void;
|
||||
borderRadius?: number;
|
||||
};
|
||||
|
||||
const SelectCustom: React.FC<SelectProps> = ({
|
||||
@@ -32,7 +32,9 @@ const SelectCustom: React.FC<SelectProps> = ({
|
||||
data,
|
||||
value,
|
||||
required = false, // <-- default false
|
||||
disabled = false, // <-- default false
|
||||
onChange,
|
||||
borderRadius = 8,
|
||||
}) => {
|
||||
const [modalVisible, setModalVisible] = useState(false);
|
||||
|
||||
@@ -41,35 +43,50 @@ const SelectCustom: React.FC<SelectProps> = ({
|
||||
const hasError = required && value === null; // <-- check if empty and required
|
||||
|
||||
return (
|
||||
<View style={styles.container}>
|
||||
<View style={GStyles.inputContainerArea}>
|
||||
{label && (
|
||||
<Text style={styles.label}>
|
||||
<Text style={GStyles.inputLabel}>
|
||||
{label}
|
||||
{required && <Text style={styles.requiredIndicator}> *</Text>}
|
||||
{required && <Text style={GStyles.inputRequired}> *</Text>}
|
||||
</Text>
|
||||
)}
|
||||
<Pressable
|
||||
style={[styles.input, hasError ? styles.inputError : null]} // <-- add error style
|
||||
onPress={() => setModalVisible(true)}
|
||||
style={[
|
||||
{ borderRadius },
|
||||
hasError ? GStyles.inputErrorBorder : null,
|
||||
GStyles.inputContainerInput,
|
||||
disabled && GStyles.disabledBox,
|
||||
]} // <-- add error style
|
||||
onPress={() => !disabled && setModalVisible(true)}
|
||||
>
|
||||
<Text style={selectedItem ? styles.text : styles.placeholder}>
|
||||
<Text
|
||||
style={
|
||||
selectedItem
|
||||
? disabled
|
||||
? GStyles.inputTextDisabled
|
||||
: GStyles.inputText
|
||||
: disabled
|
||||
? GStyles.inputPlaceholderDisabled
|
||||
: GStyles.inputPlaceholder
|
||||
}
|
||||
>
|
||||
{selectedItem?.label || placeholder}
|
||||
</Text>
|
||||
</Pressable>
|
||||
|
||||
<Modal visible={modalVisible} transparent animationType="fade">
|
||||
<TouchableOpacity
|
||||
style={styles.modalOverlay}
|
||||
style={GStyles.selectModalOverlay}
|
||||
activeOpacity={1}
|
||||
onPressOut={() => setModalVisible(false)}
|
||||
>
|
||||
<View style={styles.modalContent}>
|
||||
<View style={GStyles.selectModalContent}>
|
||||
<FlatList
|
||||
data={data}
|
||||
keyExtractor={(item) => String(item.value)}
|
||||
renderItem={({ item }) => (
|
||||
<TouchableOpacity
|
||||
style={styles.option}
|
||||
style={GStyles.selectOption}
|
||||
onPress={() => {
|
||||
onChange(item.value);
|
||||
setModalVisible(false);
|
||||
@@ -85,68 +102,10 @@ const SelectCustom: React.FC<SelectProps> = ({
|
||||
|
||||
{/* Optional Error Message */}
|
||||
{hasError && (
|
||||
<Text style={styles.errorMessage}>Harap pilih salah satu</Text>
|
||||
<Text style={GStyles.inputErrorMessage}>Harap pilih salah satu</Text>
|
||||
)}
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
export default SelectCustom;
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
marginBottom: 16,
|
||||
},
|
||||
label: {
|
||||
fontSize: TEXT_SIZE_MEDIUM,
|
||||
marginBottom: 4,
|
||||
color: MainColor.white,
|
||||
fontWeight: "500",
|
||||
},
|
||||
requiredIndicator: {
|
||||
color: "red",
|
||||
fontWeight: "bold",
|
||||
},
|
||||
input: {
|
||||
borderWidth: 1,
|
||||
borderColor: "#ccc",
|
||||
padding: 12,
|
||||
borderRadius: 8,
|
||||
minHeight: 48,
|
||||
justifyContent: "center",
|
||||
backgroundColor: MainColor.white,
|
||||
},
|
||||
inputError: {
|
||||
borderColor: "red",
|
||||
},
|
||||
text: {
|
||||
fontSize: TEXT_SIZE_MEDIUM,
|
||||
},
|
||||
placeholder: {
|
||||
fontSize: TEXT_SIZE_MEDIUM,
|
||||
color: MainColor.placeholder,
|
||||
},
|
||||
modalOverlay: {
|
||||
flex: 1,
|
||||
backgroundColor: "rgba(0,0,0,0.3)",
|
||||
justifyContent: "center",
|
||||
alignItems: "center",
|
||||
},
|
||||
modalContent: {
|
||||
width: "80%",
|
||||
maxHeight: 300,
|
||||
backgroundColor: "white",
|
||||
borderRadius: 8,
|
||||
overflow: "hidden",
|
||||
},
|
||||
option: {
|
||||
padding: 16,
|
||||
borderBottomWidth: 1,
|
||||
borderBottomColor: "#eee",
|
||||
},
|
||||
errorMessage: {
|
||||
marginTop: 4,
|
||||
fontSize: 12,
|
||||
color: "red",
|
||||
},
|
||||
});
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||
// components/Stack.tsx
|
||||
|
||||
import React from "react";
|
||||
@@ -57,10 +58,10 @@ const convertToSpacing = (value: GapSizeType): number => {
|
||||
return sizes[value] || 16; // default md
|
||||
};
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
stack: {
|
||||
flex: 1,
|
||||
},
|
||||
});
|
||||
// const styles = StyleSheet.create({
|
||||
// stack: {
|
||||
// flex: 1,
|
||||
// },
|
||||
// });
|
||||
|
||||
export default StackCustom;
|
||||
|
||||
@@ -3,9 +3,16 @@ import {
|
||||
TEXT_SIZE_LARGE,
|
||||
TEXT_SIZE_MEDIUM,
|
||||
TEXT_SIZE_SMALL,
|
||||
TEXT_SIZE_XLARGE,
|
||||
} from "@/constants/constans-value";
|
||||
import React from "react";
|
||||
import { Text as RNText, StyleProp, StyleSheet, TextStyle } from "react-native";
|
||||
import {
|
||||
Text as RNText,
|
||||
StyleProp,
|
||||
StyleSheet,
|
||||
TextStyle,
|
||||
TouchableOpacity,
|
||||
} from "react-native";
|
||||
|
||||
// Tambahkan type TextAlignProps agar lebih type-safe
|
||||
type TextAlign = "left" | "center" | "right";
|
||||
@@ -15,10 +22,11 @@ interface TextCustomProps {
|
||||
style?: StyleProp<TextStyle>;
|
||||
bold?: boolean;
|
||||
semiBold?: boolean;
|
||||
size?: "default" | "large" | "small";
|
||||
color?: "default" | "yellow" | "red";
|
||||
size?: "default" | "large" | "small" | "xlarge";
|
||||
color?: "default" | "yellow" | "red" | "gray" | "green" | "black"
|
||||
align?: TextAlign; // Prop untuk alignment
|
||||
truncate?: boolean | number;
|
||||
onPress?: () => void;
|
||||
}
|
||||
|
||||
const TextCustom: React.FC<TextCustomProps> = ({
|
||||
@@ -30,6 +38,7 @@ const TextCustom: React.FC<TextCustomProps> = ({
|
||||
color = "default",
|
||||
align = "left", // Default alignment
|
||||
truncate = false,
|
||||
onPress,
|
||||
}) => {
|
||||
const getStyle = () => {
|
||||
let selectedStyles = [];
|
||||
@@ -43,11 +52,15 @@ const TextCustom: React.FC<TextCustomProps> = ({
|
||||
|
||||
// Size
|
||||
if (size === "large") selectedStyles.push(styles.large);
|
||||
else if (size === "xlarge") selectedStyles.push(styles.xlarge);
|
||||
else if (size === "small") selectedStyles.push(styles.small);
|
||||
|
||||
// Color
|
||||
if (color === "yellow") selectedStyles.push(styles.yellow);
|
||||
else if (color === "red") selectedStyles.push(styles.red);
|
||||
else if (color === "gray") selectedStyles.push(styles.gray);
|
||||
else if (color === "green") selectedStyles.push(styles.green);
|
||||
else if (color === "black") selectedStyles.push(styles.black);
|
||||
|
||||
// Alignment
|
||||
if (align) {
|
||||
@@ -60,7 +73,19 @@ const TextCustom: React.FC<TextCustomProps> = ({
|
||||
return selectedStyles;
|
||||
};
|
||||
|
||||
return (
|
||||
return onPress ? (
|
||||
<TouchableOpacity onPress={onPress}>
|
||||
<RNText
|
||||
numberOfLines={
|
||||
typeof truncate === "number" ? truncate : truncate ? 1 : undefined
|
||||
}
|
||||
ellipsizeMode="tail"
|
||||
style={getStyle()}
|
||||
>
|
||||
{children}
|
||||
</RNText>
|
||||
</TouchableOpacity>
|
||||
) : (
|
||||
<RNText
|
||||
numberOfLines={
|
||||
typeof truncate === "number" ? truncate : truncate ? 1 : undefined
|
||||
@@ -80,6 +105,7 @@ export const styles = StyleSheet.create({
|
||||
fontSize: TEXT_SIZE_MEDIUM,
|
||||
color: MainColor.white,
|
||||
fontFamily: "Poppins-Regular",
|
||||
lineHeight: 20,
|
||||
},
|
||||
bold: {
|
||||
fontFamily: "Poppins-Bold",
|
||||
@@ -89,11 +115,14 @@ export const styles = StyleSheet.create({
|
||||
fontFamily: "Poppins-SemiBold",
|
||||
fontWeight: "500",
|
||||
},
|
||||
small: {
|
||||
fontSize: TEXT_SIZE_SMALL,
|
||||
},
|
||||
large: {
|
||||
fontSize: TEXT_SIZE_LARGE,
|
||||
},
|
||||
small: {
|
||||
fontSize: TEXT_SIZE_SMALL,
|
||||
xlarge: {
|
||||
fontSize: TEXT_SIZE_XLARGE,
|
||||
},
|
||||
yellow: {
|
||||
color: MainColor.yellow,
|
||||
@@ -101,4 +130,13 @@ export const styles = StyleSheet.create({
|
||||
red: {
|
||||
color: MainColor.red,
|
||||
},
|
||||
gray: {
|
||||
color: MainColor.placeholder,
|
||||
},
|
||||
green: {
|
||||
color: MainColor.green,
|
||||
},
|
||||
black: {
|
||||
color: MainColor.black,
|
||||
},
|
||||
});
|
||||
|
||||
146
components/TextArea/TextAreaCustom.tsx
Normal file
146
components/TextArea/TextAreaCustom.tsx
Normal file
@@ -0,0 +1,146 @@
|
||||
import { GStyles } from "@/styles/global-styles";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import {
|
||||
TextInput as RNTextInput,
|
||||
StyleProp,
|
||||
Text,
|
||||
View,
|
||||
ViewStyle,
|
||||
} from "react-native";
|
||||
|
||||
type IconType = React.ReactNode | string;
|
||||
|
||||
type BaseProps = {
|
||||
iconLeft?: IconType;
|
||||
iconRight?: IconType;
|
||||
label?: string;
|
||||
required?: boolean;
|
||||
error?: string;
|
||||
fontColor?: string;
|
||||
disabled?: boolean;
|
||||
borderRadius?: number;
|
||||
autosize?: boolean;
|
||||
minRows?: number;
|
||||
maxRows?: number;
|
||||
showCount?: boolean;
|
||||
maxLength?: number;
|
||||
height?: number;
|
||||
style?: StyleProp<ViewStyle>;
|
||||
};
|
||||
|
||||
type NativeTextInputProps = Omit<
|
||||
React.ComponentProps<typeof RNTextInput>,
|
||||
"style"
|
||||
>;
|
||||
|
||||
export type TextAreaCustomProps = BaseProps & NativeTextInputProps;
|
||||
|
||||
const TextAreaCustom: React.FC<TextAreaCustomProps> = ({
|
||||
iconLeft,
|
||||
iconRight,
|
||||
label,
|
||||
required = false,
|
||||
error = "",
|
||||
fontColor = "#000",
|
||||
disabled = false,
|
||||
borderRadius = 8,
|
||||
autosize = false,
|
||||
minRows = 4,
|
||||
maxRows = 6,
|
||||
showCount = false,
|
||||
maxLength,
|
||||
value,
|
||||
onChangeText,
|
||||
height = 100,
|
||||
style,
|
||||
...rest
|
||||
}) => {
|
||||
const [numberOfLines, setNumberOfLines] = useState(minRows);
|
||||
|
||||
// Autosizing logic
|
||||
useEffect(() => {
|
||||
if (!autosize || !value) return;
|
||||
|
||||
const text = value as string;
|
||||
const lines = text.split("\n").length;
|
||||
const newLines = Math.max(minRows, Math.min(maxRows, lines));
|
||||
setNumberOfLines(newLines);
|
||||
}, [value, autosize, minRows, maxRows]);
|
||||
|
||||
const hasError = Boolean(error);
|
||||
|
||||
const renderIcon = (icon: IconType) => {
|
||||
if (!icon) return null;
|
||||
return typeof icon === "string" ? (
|
||||
<Text style={GStyles.inputIconText}>{icon}</Text>
|
||||
) : (
|
||||
icon
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
<View style={[GStyles.inputContainerArea]}>
|
||||
{label && (
|
||||
<Text style={GStyles.inputLabel}>
|
||||
{label}
|
||||
{required && <Text style={GStyles.inputRequired}> *</Text>}
|
||||
</Text>
|
||||
)}
|
||||
<View
|
||||
style={[
|
||||
GStyles.inputContainerInput,
|
||||
disabled && GStyles.disabledBox,
|
||||
hasError ? GStyles.inputErrorBorder : {},
|
||||
{ borderRadius },
|
||||
{ height },
|
||||
style,
|
||||
]}
|
||||
>
|
||||
{iconLeft && (
|
||||
<View style={GStyles.inputIcon}>{renderIcon(iconLeft)}</View>
|
||||
)}
|
||||
|
||||
<RNTextInput
|
||||
maxLength={maxLength}
|
||||
multiline
|
||||
numberOfLines={numberOfLines}
|
||||
style={[
|
||||
// GStyles.inputText,
|
||||
GStyles.textAreaInput,
|
||||
{ color: fontColor },
|
||||
]}
|
||||
editable={!disabled}
|
||||
value={value as string}
|
||||
onChangeText={onChangeText}
|
||||
{...rest}
|
||||
/>
|
||||
|
||||
{iconRight && (
|
||||
<View style={GStyles.inputIcon}>{renderIcon(iconRight)}</View>
|
||||
)}
|
||||
</View>
|
||||
|
||||
{/* Error Message atau Counter */}
|
||||
<View
|
||||
style={{
|
||||
flexDirection: "row",
|
||||
justifyContent: "space-between",
|
||||
marginTop: 4,
|
||||
minHeight: 16,
|
||||
}}
|
||||
>
|
||||
{hasError ? (
|
||||
<Text style={GStyles.inputErrorMessage}>{error}</Text>
|
||||
) : null}
|
||||
|
||||
{showCount && maxLength ? (
|
||||
<Text style={GStyles.inputMaxLength}>
|
||||
{(value as string)?.length || 0}/{maxLength}
|
||||
</Text>
|
||||
) : null}
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
export default TextAreaCustom;
|
||||
@@ -1,3 +1,4 @@
|
||||
import { GStyles } from "@/styles/global-styles";
|
||||
import Ionicons from "@expo/vector-icons/Ionicons";
|
||||
import React, { useState } from "react";
|
||||
import {
|
||||
@@ -8,7 +9,6 @@ import {
|
||||
View,
|
||||
ViewStyle,
|
||||
} from "react-native";
|
||||
import { textInputStyles } from "./textInputStyles";
|
||||
|
||||
type IconType = React.ReactNode | string;
|
||||
|
||||
@@ -23,9 +23,11 @@ type Props = {
|
||||
disabled?: boolean;
|
||||
borderRadius?: number;
|
||||
style?: StyleProp<ViewStyle>;
|
||||
maxLength?: number;
|
||||
containerStyle?: StyleProp<ViewStyle>;
|
||||
} & Omit<React.ComponentProps<typeof RNTextInput>, "style">;
|
||||
|
||||
export const TextInputCustom = ({
|
||||
const TextInputCustom = ({
|
||||
iconLeft,
|
||||
iconRight,
|
||||
label,
|
||||
@@ -38,6 +40,8 @@ export const TextInputCustom = ({
|
||||
style,
|
||||
keyboardType,
|
||||
onChangeText,
|
||||
maxLength,
|
||||
containerStyle,
|
||||
...rest
|
||||
}: Props) => {
|
||||
const [isPasswordVisible, setIsPasswordVisible] = useState(false);
|
||||
@@ -47,7 +51,7 @@ export const TextInputCustom = ({
|
||||
const renderIcon = (icon: IconType) => {
|
||||
if (!icon) return null;
|
||||
return typeof icon === "string" ? (
|
||||
<Text style={textInputStyles.iconText}>{icon}</Text>
|
||||
<Text style={GStyles.inputIconText}>{icon}</Text>
|
||||
) : (
|
||||
icon
|
||||
);
|
||||
@@ -71,37 +75,42 @@ export const TextInputCustom = ({
|
||||
};
|
||||
|
||||
return (
|
||||
<View style={textInputStyles.container}>
|
||||
<View style={[GStyles.inputContainerArea, containerStyle]}>
|
||||
{label && (
|
||||
<Text style={textInputStyles.label}>
|
||||
<Text style={GStyles.inputLabel}>
|
||||
{label}
|
||||
{required && <Text style={textInputStyles.required}> *</Text>}
|
||||
{required && <Text style={GStyles.inputRequired}> *</Text>}
|
||||
</Text>
|
||||
)}
|
||||
<View
|
||||
style={[
|
||||
textInputStyles.inputContainer,
|
||||
disabled && textInputStyles.disabled,
|
||||
{ borderRadius },
|
||||
externalError || internalError ? textInputStyles.errorBorder : null,
|
||||
style,
|
||||
{ borderRadius },
|
||||
externalError || internalError ? GStyles.inputErrorBorder : null,
|
||||
GStyles.inputContainerInput,
|
||||
disabled && GStyles.disabledBox,
|
||||
]}
|
||||
>
|
||||
{iconLeft && (
|
||||
<View style={textInputStyles.icon}>{renderIcon(iconLeft)}</View>
|
||||
<View style={GStyles.inputIcon}>{renderIcon(iconLeft)}</View>
|
||||
)}
|
||||
<RNTextInput
|
||||
style={[textInputStyles.input, { color: fontColor }]}
|
||||
style={[
|
||||
GStyles.inputText,
|
||||
{ color: fontColor },
|
||||
disabled && GStyles.inputPlaceholderDisabled, // <-- placeholder saat disabled
|
||||
]}
|
||||
editable={!disabled}
|
||||
secureTextEntry={secureTextEntry && !isPasswordVisible}
|
||||
keyboardType={keyboardType}
|
||||
onChangeText={handleTextChange}
|
||||
maxLength={maxLength}
|
||||
{...rest}
|
||||
/>
|
||||
{secureTextEntry && (
|
||||
<TouchableOpacity
|
||||
onPress={() => setIsPasswordVisible((prev) => !prev)}
|
||||
style={textInputStyles.icon}
|
||||
style={GStyles.inputIcon}
|
||||
>
|
||||
<Ionicons
|
||||
name={isPasswordVisible ? "eye-off" : "eye"}
|
||||
@@ -111,15 +120,17 @@ export const TextInputCustom = ({
|
||||
</TouchableOpacity>
|
||||
)}
|
||||
{iconRight && (
|
||||
<View style={textInputStyles.icon}>{renderIcon(iconRight)}</View>
|
||||
<View style={GStyles.inputIcon}>{renderIcon(iconRight)}</View>
|
||||
)}
|
||||
</View>
|
||||
{/* Prioritaskan error eksternal */}
|
||||
{externalError || internalError ? (
|
||||
<Text style={textInputStyles.errorMessage}>
|
||||
<Text style={GStyles.inputErrorMessage}>
|
||||
{externalError || internalError}
|
||||
</Text>
|
||||
) : null}
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
export default TextInputCustom;
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
import { TextInputCustom } from "./TextInputCustom";
|
||||
|
||||
export { TextInputCustom };
|
||||
@@ -1,71 +0,0 @@
|
||||
// components/text-input.styles.ts
|
||||
import { AccentColor, MainColor } from "@/constants/color-palet";
|
||||
import { StyleSheet } from "react-native";
|
||||
|
||||
export const textInputStyles = StyleSheet.create({
|
||||
// Container utama input (View luar)
|
||||
container: {
|
||||
marginBottom: 16,
|
||||
},
|
||||
|
||||
// Label di atas input
|
||||
label: {
|
||||
fontSize: 14,
|
||||
marginBottom: 6,
|
||||
fontWeight: "500",
|
||||
color: MainColor.white,
|
||||
},
|
||||
|
||||
// Tanda bintang merah untuk required
|
||||
required: {
|
||||
color: "red",
|
||||
},
|
||||
|
||||
// Pesan error di bawah input
|
||||
errorMessage: {
|
||||
marginTop: 4,
|
||||
fontSize: 12,
|
||||
color: MainColor.red,
|
||||
},
|
||||
|
||||
// Wrapper input (View pembungkus TextInput)
|
||||
inputContainer: {
|
||||
flexDirection: "row",
|
||||
alignItems: "center",
|
||||
borderWidth: 1,
|
||||
borderColor: AccentColor.white,
|
||||
backgroundColor: MainColor.white,
|
||||
paddingHorizontal: 12,
|
||||
height: 50,
|
||||
},
|
||||
|
||||
// Style saat disabled
|
||||
disabled: {
|
||||
backgroundColor: "#f9f9f9",
|
||||
borderColor: "#e0e0e0",
|
||||
},
|
||||
|
||||
// Input utama (TextInput)
|
||||
input: {
|
||||
flex: 1,
|
||||
fontSize: 16,
|
||||
paddingVertical: 0,
|
||||
},
|
||||
|
||||
// Ikon di kiri/kanan
|
||||
icon: {
|
||||
marginHorizontal: 4,
|
||||
justifyContent: "center",
|
||||
},
|
||||
|
||||
// Teks ikon jika berupa string
|
||||
iconText: {
|
||||
fontSize: 16,
|
||||
color: "#000",
|
||||
},
|
||||
|
||||
// Border merah jika ada error
|
||||
errorBorder: {
|
||||
borderColor: "red",
|
||||
},
|
||||
});
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user