Compare commits
9 Commits
clean/31-m
...
qc/4-apr-2
| Author | SHA1 | Date | |
|---|---|---|---|
| 76759cc547 | |||
| 3382c16cdb | |||
| 3290fa99d2 | |||
| 940d31bfdc | |||
| b34bc3799e | |||
| 7cb4f30ae9 | |||
| 0f552443c4 | |||
| 90bc8ae343 | |||
| 98f8c7e2bf |
@@ -21,8 +21,9 @@ export default function UserLayout() {
|
|||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="waiting-room"
|
name="waiting-room"
|
||||||
options={{
|
options={{
|
||||||
title: "Waiting Room",
|
// title: "Waiting Room",
|
||||||
headerBackVisible: false,
|
// headerBackVisible: false,
|
||||||
|
header: () => <AppHeader title="Waiting Room" showBack={false} />,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|||||||
@@ -2,35 +2,64 @@ import { IconHome } from "@/components/_Icon";
|
|||||||
import { TabsStyles } from "@/styles/tabs-styles";
|
import { TabsStyles } from "@/styles/tabs-styles";
|
||||||
import { Ionicons } from "@expo/vector-icons";
|
import { Ionicons } from "@expo/vector-icons";
|
||||||
import { Tabs } from "expo-router";
|
import { Tabs } from "expo-router";
|
||||||
|
import { View } from "react-native";
|
||||||
|
import { MainColor } from "@/constants/color-palet";
|
||||||
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
||||||
|
import { Platform } from "react-native";
|
||||||
|
|
||||||
|
function CollaborationTabsWrapper() {
|
||||||
|
const insets = useSafeAreaInsets();
|
||||||
|
const paddingBottom = Platform.OS === "android" ? insets.bottom : 0;
|
||||||
|
|
||||||
export default function CollaborationTabsLayout() {
|
|
||||||
return (
|
return (
|
||||||
<Tabs screenOptions={TabsStyles}>
|
<View style={{ flex: 1, backgroundColor: MainColor.darkblue }}>
|
||||||
<Tabs.Screen
|
<Tabs
|
||||||
name="index"
|
screenOptions={{
|
||||||
options={{
|
...TabsStyles,
|
||||||
title: "Beranda",
|
tabBarStyle: Platform.select({
|
||||||
tabBarIcon: ({ color }) => <IconHome color={color} />,
|
ios: {
|
||||||
|
borderTopWidth: 0,
|
||||||
|
paddingTop: 12,
|
||||||
|
height: 80,
|
||||||
|
},
|
||||||
|
android: {
|
||||||
|
borderTopWidth: 0,
|
||||||
|
paddingTop: 5,
|
||||||
|
height: 70 + paddingBottom,
|
||||||
|
},
|
||||||
|
}),
|
||||||
}}
|
}}
|
||||||
/>
|
>
|
||||||
<Tabs.Screen
|
<Tabs.Screen
|
||||||
name="participant"
|
name="index"
|
||||||
options={{
|
options={{
|
||||||
title: "Partisipan",
|
title: "Beranda",
|
||||||
tabBarIcon: ({ color }) => (
|
tabBarIcon: ({ color }) => <IconHome color={color} />,
|
||||||
<Ionicons size={20} name="people" color={color} />
|
}}
|
||||||
),
|
/>
|
||||||
}}
|
<Tabs.Screen
|
||||||
/>
|
name="participant"
|
||||||
<Tabs.Screen
|
options={{
|
||||||
name="group"
|
title: "Partisipan",
|
||||||
options={{
|
tabBarIcon: ({ color }) => (
|
||||||
title: "Grup",
|
<Ionicons size={20} name="people" color={color} />
|
||||||
tabBarIcon: ({ color }) => (
|
),
|
||||||
<Ionicons size={20} name="chatbox-ellipses" color={color} />
|
}}
|
||||||
),
|
/>
|
||||||
}}
|
<Tabs.Screen
|
||||||
/>
|
name="group"
|
||||||
</Tabs>
|
options={{
|
||||||
|
title: "Grup",
|
||||||
|
tabBarIcon: ({ color }) => (
|
||||||
|
<Ionicons size={20} name="chatbox-ellipses" color={color} />
|
||||||
|
),
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Tabs>
|
||||||
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default function CollaborationTabsLayout() {
|
||||||
|
return <CollaborationTabsWrapper />;
|
||||||
|
}
|
||||||
|
|||||||
@@ -5,33 +5,62 @@ import {
|
|||||||
FontAwesome5
|
FontAwesome5
|
||||||
} from "@expo/vector-icons";
|
} from "@expo/vector-icons";
|
||||||
import { Tabs } from "expo-router";
|
import { Tabs } from "expo-router";
|
||||||
|
import { View } from "react-native";
|
||||||
|
import { MainColor } from "@/constants/color-palet";
|
||||||
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
||||||
|
import { Platform } from "react-native";
|
||||||
|
|
||||||
|
function DonationTabsWrapper() {
|
||||||
|
const insets = useSafeAreaInsets();
|
||||||
|
const paddingBottom = Platform.OS === "android" ? insets.bottom : 0;
|
||||||
|
|
||||||
export default function InvestmentTabsLayout() {
|
|
||||||
return (
|
return (
|
||||||
<Tabs screenOptions={TabsStyles}>
|
<View style={{ flex: 1, backgroundColor: MainColor.darkblue }}>
|
||||||
<Tabs.Screen
|
<Tabs
|
||||||
name="index"
|
screenOptions={{
|
||||||
options={{
|
...TabsStyles,
|
||||||
title: "Beranda",
|
tabBarStyle: Platform.select({
|
||||||
tabBarIcon: ({ color }) => <IconHome color={color} />,
|
ios: {
|
||||||
|
borderTopWidth: 0,
|
||||||
|
paddingTop: 12,
|
||||||
|
height: 80,
|
||||||
|
},
|
||||||
|
android: {
|
||||||
|
borderTopWidth: 0,
|
||||||
|
paddingTop: 5,
|
||||||
|
height: 70 + paddingBottom,
|
||||||
|
},
|
||||||
|
}),
|
||||||
}}
|
}}
|
||||||
/>
|
>
|
||||||
<Tabs.Screen
|
<Tabs.Screen
|
||||||
name="status"
|
name="index"
|
||||||
options={{
|
options={{
|
||||||
title: "Galang Dana",
|
title: "Beranda",
|
||||||
tabBarIcon: ({ color }) => <IconStatus color={color} />,
|
tabBarIcon: ({ color }) => <IconHome color={color} />,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Tabs.Screen
|
<Tabs.Screen
|
||||||
name="my-donation"
|
name="status"
|
||||||
options={{
|
options={{
|
||||||
title: "Donasi Saya",
|
title: "Galang Dana",
|
||||||
tabBarIcon: ({ color }) => (
|
tabBarIcon: ({ color }) => <IconStatus color={color} />,
|
||||||
<FontAwesome5 name="donate" color={color} size={ICON_SIZE_SMALL} />
|
}}
|
||||||
),
|
/>
|
||||||
}}
|
<Tabs.Screen
|
||||||
/>
|
name="my-donation"
|
||||||
</Tabs>
|
options={{
|
||||||
|
title: "Donasi Saya",
|
||||||
|
tabBarIcon: ({ color }) => (
|
||||||
|
<FontAwesome5 name="donate" color={color} size={ICON_SIZE_SMALL} />
|
||||||
|
),
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Tabs>
|
||||||
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default function DonationTabsLayout() {
|
||||||
|
return <DonationTabsWrapper />;
|
||||||
|
}
|
||||||
|
|||||||
@@ -185,7 +185,6 @@ export default function DonationEdit() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<NewWrapper
|
<NewWrapper
|
||||||
hideFooter
|
|
||||||
footerComponent={
|
footerComponent={
|
||||||
<BoxButtonOnFooter>
|
<BoxButtonOnFooter>
|
||||||
<ButtonCustom
|
<ButtonCustom
|
||||||
|
|||||||
@@ -114,7 +114,6 @@ export default function DonationCreateStory() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<NewWrapper
|
<NewWrapper
|
||||||
hideFooter
|
|
||||||
footerComponent={
|
footerComponent={
|
||||||
<>
|
<>
|
||||||
<BoxButtonOnFooter>
|
<BoxButtonOnFooter>
|
||||||
|
|||||||
@@ -127,7 +127,6 @@ export default function DonationCreate() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<NewWrapper
|
<NewWrapper
|
||||||
hideFooter
|
|
||||||
footerComponent={
|
footerComponent={
|
||||||
<>
|
<>
|
||||||
<BoxButtonOnFooter>
|
<BoxButtonOnFooter>
|
||||||
|
|||||||
@@ -8,58 +8,83 @@ import AppHeader from "@/components/_ShareComponent/AppHeader";
|
|||||||
import BackButtonFromNotification from "@/components/Button/BackButtonFromNotification";
|
import BackButtonFromNotification from "@/components/Button/BackButtonFromNotification";
|
||||||
import { TabsStyles } from "@/styles/tabs-styles";
|
import { TabsStyles } from "@/styles/tabs-styles";
|
||||||
import { router, Tabs, useLocalSearchParams } from "expo-router";
|
import { router, Tabs, useLocalSearchParams } from "expo-router";
|
||||||
|
import { View } from "react-native";
|
||||||
|
import { MainColor } from "@/constants/color-palet";
|
||||||
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
||||||
|
import { Platform } from "react-native";
|
||||||
|
import { OS_ANDROID_HEIGHT, OS_IOS_HEIGHT } from "@/constants/constans-value";
|
||||||
|
|
||||||
export default function EventTabsLayout() {
|
function EventTabsWrapper() {
|
||||||
|
const insets = useSafeAreaInsets();
|
||||||
|
const paddingBottom = Platform.OS === "android" ? insets.bottom : 0;
|
||||||
const { from, category } = useLocalSearchParams<{
|
const { from, category } = useLocalSearchParams<{
|
||||||
from?: string;
|
from?: string;
|
||||||
category?: string;
|
category?: string;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Tabs
|
<View style={{ flex: 1, backgroundColor: MainColor.darkblue }}>
|
||||||
screenOptions={{
|
<Tabs
|
||||||
...TabsStyles,
|
screenOptions={{
|
||||||
header: () => (
|
...TabsStyles,
|
||||||
<AppHeader
|
tabBarStyle: Platform.select({
|
||||||
title="Event"
|
ios: {
|
||||||
left={
|
borderTopWidth: 0,
|
||||||
<BackButtonFromNotification
|
paddingTop: 12,
|
||||||
from={from as string}
|
height: OS_IOS_HEIGHT,
|
||||||
category={category as string}
|
},
|
||||||
/>
|
android: {
|
||||||
}
|
borderTopWidth: 0,
|
||||||
/>
|
paddingTop: 5,
|
||||||
),
|
height: OS_ANDROID_HEIGHT + paddingBottom,
|
||||||
}}
|
},
|
||||||
>
|
}),
|
||||||
<Tabs.Screen
|
header: () => (
|
||||||
name="index"
|
<AppHeader
|
||||||
options={{
|
title="Event"
|
||||||
title: "Beranda",
|
left={
|
||||||
tabBarIcon: ({ color }) => <IconHome color={color} />,
|
<BackButtonFromNotification
|
||||||
|
from={from || ""}
|
||||||
|
category={category}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
>
|
||||||
<Tabs.Screen
|
<Tabs.Screen
|
||||||
name="status"
|
name="index"
|
||||||
options={{
|
options={{
|
||||||
title: "Status",
|
title: "Beranda",
|
||||||
tabBarIcon: ({ color }) => <IconStatus color={color} />,
|
tabBarIcon: ({ color }) => <IconHome color={color} />,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Tabs.Screen
|
<Tabs.Screen
|
||||||
name="contribution"
|
name="status"
|
||||||
options={{
|
options={{
|
||||||
title: "Kontribusi",
|
title: "Status",
|
||||||
tabBarIcon: ({ color }) => <IconContribution color={color} />,
|
tabBarIcon: ({ color }) => <IconStatus color={color} />,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Tabs.Screen
|
<Tabs.Screen
|
||||||
name="history"
|
name="contribution"
|
||||||
options={{
|
options={{
|
||||||
title: "Riwayat",
|
title: "Kontribusi",
|
||||||
tabBarIcon: ({ color }) => <IconHistory color={color} />,
|
tabBarIcon: ({ color }) => <IconContribution color={color} />,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Tabs>
|
<Tabs.Screen
|
||||||
|
name="history"
|
||||||
|
options={{
|
||||||
|
title: "Riwayat",
|
||||||
|
tabBarIcon: ({ color }) => <IconHistory color={color} />,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Tabs>
|
||||||
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default function EventTabsLayout() {
|
||||||
|
return <EventTabsWrapper />;
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-unused-vars */
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||||
/* eslint-disable react-hooks/exhaustive-deps */
|
/* eslint-disable react-hooks/exhaustive-deps */
|
||||||
import { BasicWrapper, NewWrapper, StackCustom, ViewWrapper } from "@/components";
|
import { BasicWrapper, Spacing, StackCustom, ViewWrapper } from "@/components";
|
||||||
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import CustomSkeleton from "@/components/_ShareComponent/SkeletonCustom";
|
import CustomSkeleton from "@/components/_ShareComponent/SkeletonCustom";
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
@@ -8,19 +8,20 @@ import { useAuth } from "@/hooks/use-auth";
|
|||||||
import { useNotificationStore } from "@/hooks/use-notification-store";
|
import { useNotificationStore } from "@/hooks/use-notification-store";
|
||||||
import Home_BottomFeatureSection from "@/screens/Home/bottomFeatureSection";
|
import Home_BottomFeatureSection from "@/screens/Home/bottomFeatureSection";
|
||||||
import HeaderBell from "@/screens/Home/HeaderBell";
|
import HeaderBell from "@/screens/Home/HeaderBell";
|
||||||
|
import HomeTabs from "@/screens/Home/HomeTabs";
|
||||||
import { stylesHome } from "@/screens/Home/homeViewStyle";
|
import { stylesHome } from "@/screens/Home/homeViewStyle";
|
||||||
import Home_ImageSection from "@/screens/Home/imageSection";
|
import Home_ImageSection from "@/screens/Home/imageSection";
|
||||||
import TabSection from "@/screens/Home/tabSection";
|
|
||||||
import { tabsHome } from "@/screens/Home/tabsList";
|
import { tabsHome } from "@/screens/Home/tabsList";
|
||||||
import Home_FeatureSection from "@/screens/Home/topFeatureSection";
|
import Home_FeatureSection from "@/screens/Home/topFeatureSection";
|
||||||
import { apiJobGetAll } from "@/service/api-client/api-job";
|
import { apiJobGetAll } from "@/service/api-client/api-job";
|
||||||
import { apiUser } from "@/service/api-client/api-user";
|
import { apiUser } from "@/service/api-client/api-user";
|
||||||
import { apiVersion } from "@/service/api-config";
|
import { apiVersion } from "@/service/api-config";
|
||||||
import { GStyles } from "@/styles/global-styles";
|
|
||||||
import { Ionicons } from "@expo/vector-icons";
|
import { Ionicons } from "@expo/vector-icons";
|
||||||
import { Redirect, router, Stack, useFocusEffect } from "expo-router";
|
import { Redirect, router, Stack, useFocusEffect } from "expo-router";
|
||||||
import { useCallback, useState } from "react";
|
import { useCallback, useState } from "react";
|
||||||
import { RefreshControl, View } from "react-native";
|
import { RefreshControl, ScrollView, View } from "react-native";
|
||||||
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
||||||
|
import { Platform } from "react-native";
|
||||||
|
|
||||||
export default function Application() {
|
export default function Application() {
|
||||||
const { token, user, userData } = useAuth();
|
const { token, user, userData } = useAuth();
|
||||||
@@ -28,6 +29,8 @@ export default function Application() {
|
|||||||
const [refreshing, setRefreshing] = useState(false);
|
const [refreshing, setRefreshing] = useState(false);
|
||||||
const { syncUnreadCount } = useNotificationStore();
|
const { syncUnreadCount } = useNotificationStore();
|
||||||
const [listData, setListData] = useState<any[] | null>(null);
|
const [listData, setListData] = useState<any[] | null>(null);
|
||||||
|
const insets = useSafeAreaInsets();
|
||||||
|
const paddingBottom = Platform.OS === "android" ? insets.bottom : 0;
|
||||||
|
|
||||||
useFocusEffect(
|
useFocusEffect(
|
||||||
useCallback(() => {
|
useCallback(() => {
|
||||||
@@ -105,15 +108,6 @@ export default function Application() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (data && data?.masterUserRoleId !== "1") {
|
|
||||||
// console.log("User is not admin");
|
|
||||||
// return (
|
|
||||||
// <BasicWrapper>
|
|
||||||
// <Redirect href={`/admin/dashboard`} />
|
|
||||||
// </BasicWrapper>
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
@@ -148,64 +142,61 @@ export default function Application() {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<NewWrapper
|
<View style={{ flex: 1, backgroundColor: MainColor.darkblue }}>
|
||||||
refreshControl={
|
<ScrollView
|
||||||
<RefreshControl
|
style={{ flex: 1 }}
|
||||||
refreshing={refreshing}
|
contentContainerStyle={{
|
||||||
onRefresh={onRefresh}
|
flexGrow: 1,
|
||||||
tintColor={MainColor.yellow}
|
paddingInline: 10,
|
||||||
colors={[MainColor.yellow]}
|
paddingBottom: paddingBottom + 80, // Space for tabs + safe area
|
||||||
/>
|
}}
|
||||||
}
|
refreshControl={
|
||||||
footerComponent={
|
<RefreshControl
|
||||||
data && data ? (
|
refreshing={refreshing}
|
||||||
<TabSection
|
onRefresh={onRefresh}
|
||||||
tabs={tabsHome({
|
tintColor={MainColor.yellow}
|
||||||
acceptedForumTermsAt: data?.acceptedForumTermsAt,
|
colors={[MainColor.yellow]}
|
||||||
profileId: data?.Profile?.id,
|
|
||||||
})}
|
|
||||||
/>
|
/>
|
||||||
) : (
|
}
|
||||||
null
|
keyboardShouldPersistTaps="handled"
|
||||||
// <View style={GStyles.tabBar}>
|
>
|
||||||
// <View style={[GStyles.tabContainer, { paddingTop: 10 }]}>
|
<StackCustom>
|
||||||
// {Array.from({ length: 4 }).map((e, index) => (
|
<Home_ImageSection />
|
||||||
// <CustomSkeleton
|
|
||||||
// key={index}
|
|
||||||
// height={40}
|
|
||||||
// width={40}
|
|
||||||
// radius={100}
|
|
||||||
// />
|
|
||||||
// ))}
|
|
||||||
// </View>
|
|
||||||
// </View>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<StackCustom>
|
|
||||||
<Home_ImageSection />
|
|
||||||
|
|
||||||
{data && data ? (
|
{data && data ? (
|
||||||
<Home_FeatureSection />
|
<Home_FeatureSection />
|
||||||
) : (
|
) : (
|
||||||
<View style={stylesHome.gridContainer}>
|
<View style={stylesHome.gridContainer}>
|
||||||
{Array.from({ length: 4 }).map((item, index) => (
|
{Array.from({ length: 4 }).map((_, index) => (
|
||||||
<CustomSkeleton
|
<CustomSkeleton
|
||||||
key={index}
|
key={index}
|
||||||
style={stylesHome.gridItem}
|
style={stylesHome.gridItem}
|
||||||
radius={50}
|
radius={50}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{data ? (
|
{data ? (
|
||||||
<Home_BottomFeatureSection listData={listData} />
|
<Home_BottomFeatureSection listData={listData} />
|
||||||
) : (
|
) : (
|
||||||
<CustomSkeleton height={150} />
|
<CustomSkeleton height={150} />
|
||||||
)}
|
)}
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
</NewWrapper>
|
</ScrollView>
|
||||||
|
|
||||||
|
{/* Home Tabs di bawah */}
|
||||||
|
{data && data ? (
|
||||||
|
<HomeTabs
|
||||||
|
tabs={tabsHome({
|
||||||
|
acceptedForumTermsAt: data?.acceptedForumTermsAt,
|
||||||
|
profileId: data?.Profile?.id,
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<View style={{ height: 80 + paddingBottom, backgroundColor: MainColor.darkblue }} />
|
||||||
|
)}
|
||||||
|
</View>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,80 +4,105 @@ import { TabsStyles } from "@/styles/tabs-styles";
|
|||||||
import { Feather, FontAwesome6, Ionicons } from "@expo/vector-icons";
|
import { Feather, FontAwesome6, Ionicons } from "@expo/vector-icons";
|
||||||
import { router, Tabs, useLocalSearchParams, useNavigation } from "expo-router";
|
import { router, Tabs, useLocalSearchParams, useNavigation } from "expo-router";
|
||||||
import { useLayoutEffect } from "react";
|
import { useLayoutEffect } from "react";
|
||||||
|
import { View } from "react-native";
|
||||||
|
import { MainColor } from "@/constants/color-palet";
|
||||||
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
||||||
|
import { Platform } from "react-native";
|
||||||
|
|
||||||
export default function InvestmentTabsLayout() {
|
function InvestmentTabsWrapper() {
|
||||||
// const navigation = useNavigation();
|
const insets = useSafeAreaInsets();
|
||||||
|
const paddingBottom = Platform.OS === "android" ? insets.bottom : 0;
|
||||||
|
const navigation = useNavigation();
|
||||||
|
|
||||||
// const { from, category } = useLocalSearchParams<{
|
const { from, category } = useLocalSearchParams<{
|
||||||
// from?: string;
|
from?: string;
|
||||||
// category?: string;
|
category?: string;
|
||||||
// }>();
|
}>();
|
||||||
|
|
||||||
// console.log("from", from);
|
// Atur header secara dinamis
|
||||||
// console.log("category", category);
|
useLayoutEffect(() => {
|
||||||
|
navigation.setOptions({
|
||||||
// // Atur header secara dinamis
|
headerLeft: () => (
|
||||||
// useLayoutEffect(() => {
|
<BackButtonFromNotification
|
||||||
// navigation.setOptions({
|
from={from || ""}
|
||||||
// headerLeft: () => (
|
category={category}
|
||||||
// <BackButtonFromNotification
|
/>
|
||||||
// from={from as string}
|
),
|
||||||
// category={category as string}
|
});
|
||||||
// />
|
}, [from, category, router, navigation]);
|
||||||
// ),
|
|
||||||
// });
|
|
||||||
// }, [from, router, navigation]);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Tabs screenOptions={TabsStyles}>
|
<View style={{ flex: 1, backgroundColor: MainColor.darkblue }}>
|
||||||
<Tabs.Screen
|
<Tabs
|
||||||
name="index"
|
screenOptions={{
|
||||||
options={{
|
...TabsStyles,
|
||||||
title: "Bursa",
|
tabBarStyle: Platform.select({
|
||||||
tabBarIcon: ({ color }) => (
|
ios: {
|
||||||
<Ionicons
|
borderTopWidth: 0,
|
||||||
name="bar-chart-outline"
|
paddingTop: 12,
|
||||||
color={color}
|
height: 80,
|
||||||
size={ICON_SIZE_SMALL}
|
},
|
||||||
/>
|
android: {
|
||||||
),
|
borderTopWidth: 0,
|
||||||
|
paddingTop: 5,
|
||||||
|
height: 70 + paddingBottom,
|
||||||
|
},
|
||||||
|
}),
|
||||||
}}
|
}}
|
||||||
/>
|
>
|
||||||
<Tabs.Screen
|
<Tabs.Screen
|
||||||
name="portofolio"
|
name="index"
|
||||||
options={{
|
options={{
|
||||||
title: "Portofolio",
|
title: "Bursa",
|
||||||
tabBarIcon: ({ color }) => (
|
tabBarIcon: ({ color }) => (
|
||||||
<Feather name="pie-chart" color={color} size={ICON_SIZE_SMALL} />
|
<Ionicons
|
||||||
),
|
name="bar-chart-outline"
|
||||||
}}
|
color={color}
|
||||||
/>
|
size={ICON_SIZE_SMALL}
|
||||||
<Tabs.Screen
|
/>
|
||||||
name="my-holding"
|
),
|
||||||
options={{
|
}}
|
||||||
title: "Saham Saya",
|
/>
|
||||||
tabBarIcon: ({ color }) => (
|
<Tabs.Screen
|
||||||
<FontAwesome6
|
name="portofolio"
|
||||||
name="hand-holding-dollar"
|
options={{
|
||||||
color={color}
|
title: "Portofolio",
|
||||||
size={ICON_SIZE_SMALL}
|
tabBarIcon: ({ color }) => (
|
||||||
/>
|
<Feather name="pie-chart" color={color} size={ICON_SIZE_SMALL} />
|
||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Tabs.Screen
|
<Tabs.Screen
|
||||||
name="transaction"
|
name="my-holding"
|
||||||
options={{
|
options={{
|
||||||
title: "Transaksi",
|
title: "Saham Saya",
|
||||||
tabBarIcon: ({ color }) => (
|
tabBarIcon: ({ color }) => (
|
||||||
<FontAwesome6
|
<FontAwesome6
|
||||||
name="money-bill-transfer"
|
name="hand-holding-dollar"
|
||||||
color={color}
|
color={color}
|
||||||
size={ICON_SIZE_SMALL}
|
size={ICON_SIZE_SMALL}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Tabs>
|
<Tabs.Screen
|
||||||
|
name="transaction"
|
||||||
|
options={{
|
||||||
|
title: "Transaksi",
|
||||||
|
tabBarIcon: ({ color }) => (
|
||||||
|
<FontAwesome6
|
||||||
|
name="money-bill-transfer"
|
||||||
|
color={color}
|
||||||
|
size={ICON_SIZE_SMALL}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Tabs>
|
||||||
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default function InvestmentTabsLayout() {
|
||||||
|
return <InvestmentTabsWrapper />;
|
||||||
|
}
|
||||||
|
|||||||
@@ -10,23 +10,41 @@ import {
|
|||||||
Tabs,
|
Tabs,
|
||||||
useLocalSearchParams
|
useLocalSearchParams
|
||||||
} from "expo-router";
|
} from "expo-router";
|
||||||
|
import { View } from "react-native";
|
||||||
|
import { MainColor } from "@/constants/color-palet";
|
||||||
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
||||||
|
import { Platform } from "react-native";
|
||||||
|
|
||||||
export default function JobTabsLayout() {
|
function JobTabsWrapper() {
|
||||||
|
const insets = useSafeAreaInsets();
|
||||||
|
const paddingBottom = Platform.OS === "android" ? insets.bottom : 0;
|
||||||
const { from, category } = useLocalSearchParams<{
|
const { from, category } = useLocalSearchParams<{
|
||||||
from?: string;
|
from?: string;
|
||||||
category?: string;
|
category?: string;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<View style={{ flex: 1, backgroundColor: MainColor.darkblue }}>
|
||||||
<Tabs
|
<Tabs
|
||||||
screenOptions={{
|
screenOptions={{
|
||||||
...TabsStyles,
|
...TabsStyles,
|
||||||
|
tabBarStyle: Platform.select({
|
||||||
|
ios: {
|
||||||
|
borderTopWidth: 0,
|
||||||
|
paddingTop: 12,
|
||||||
|
height: 80,
|
||||||
|
},
|
||||||
|
android: {
|
||||||
|
borderTopWidth: 0,
|
||||||
|
paddingTop: 5,
|
||||||
|
height: 70 + paddingBottom,
|
||||||
|
},
|
||||||
|
}),
|
||||||
header: () => (
|
header: () => (
|
||||||
<AppHeader
|
<AppHeader
|
||||||
title="Job Vacancy"
|
title="Job Vacancy"
|
||||||
left={
|
left={
|
||||||
<BackButtonFromNotification from={from as string} category={category as string} />
|
<BackButtonFromNotification from={from || ""} category={category} />
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
@@ -56,6 +74,10 @@ export default function JobTabsLayout() {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
</>
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default function JobTabsLayout() {
|
||||||
|
return <JobTabsWrapper />;
|
||||||
|
}
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ import {
|
|||||||
DrawerCustom,
|
DrawerCustom,
|
||||||
LoaderCustom,
|
LoaderCustom,
|
||||||
MenuDrawerDynamicGrid,
|
MenuDrawerDynamicGrid,
|
||||||
|
NewWrapper_V2,
|
||||||
Spacing,
|
Spacing,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import { IconEdit } from "@/components/_Icon";
|
import { IconEdit } from "@/components/_Icon";
|
||||||
@@ -72,7 +72,7 @@ export default function JobDetailStatus() {
|
|||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ViewWrapper>
|
<NewWrapper_V2>
|
||||||
{isLoadData ? (
|
{isLoadData ? (
|
||||||
<LoaderCustom />
|
<LoaderCustom />
|
||||||
) : (
|
) : (
|
||||||
@@ -83,7 +83,7 @@ export default function JobDetailStatus() {
|
|||||||
(status === "draft" || status === "reject") && (
|
(status === "draft" || status === "reject") && (
|
||||||
<ReportBox text={data?.catatan} />
|
<ReportBox text={data?.catatan} />
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<Job_BoxDetailSection data={data} />
|
<Job_BoxDetailSection data={data} />
|
||||||
<Job_ButtonStatusSection
|
<Job_ButtonStatusSection
|
||||||
id={id as string}
|
id={id as string}
|
||||||
@@ -96,7 +96,7 @@ export default function JobDetailStatus() {
|
|||||||
<Spacing />
|
<Spacing />
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</ViewWrapper>
|
</NewWrapper_V2>
|
||||||
|
|
||||||
<DrawerCustom
|
<DrawerCustom
|
||||||
isVisible={openDrawer}
|
isVisible={openDrawer}
|
||||||
|
|||||||
@@ -1,198 +1,5 @@
|
|||||||
/* eslint-disable react-hooks/exhaustive-deps */
|
import { Job_ScreenEdit } from "@/screens/Job/ScreenJobEdit";
|
||||||
import {
|
|
||||||
BaseBox,
|
|
||||||
ButtonCenteredOnly,
|
|
||||||
ButtonCustom,
|
|
||||||
DummyLandscapeImage,
|
|
||||||
InformationBox,
|
|
||||||
LandscapeFrameUploaded,
|
|
||||||
LoaderCustom,
|
|
||||||
Spacing,
|
|
||||||
StackCustom,
|
|
||||||
TextAreaCustom,
|
|
||||||
TextInputCustom,
|
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
|
||||||
import DIRECTORY_ID from "@/constants/directory-id";
|
|
||||||
import { apiJobGetOne, apiJobUpdateData } from "@/service/api-client/api-job";
|
|
||||||
import {
|
|
||||||
deleteFileService,
|
|
||||||
uploadFileService,
|
|
||||||
} from "@/service/upload-service";
|
|
||||||
import pickImage from "@/utils/pickImage";
|
|
||||||
import { router, useLocalSearchParams } from "expo-router";
|
|
||||||
import { useEffect, useState } from "react";
|
|
||||||
import Toast from "react-native-toast-message";
|
|
||||||
|
|
||||||
export default function JobEdit() {
|
export default function JobEdit() {
|
||||||
const { id } = useLocalSearchParams();
|
return <Job_ScreenEdit />;
|
||||||
const [data, setData] = useState<any>({
|
|
||||||
title: "",
|
|
||||||
content: "",
|
|
||||||
deskripsi: "",
|
|
||||||
});
|
|
||||||
const [isLoadData, setIsLoadData] = useState(false);
|
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
|
||||||
|
|
||||||
const [imageUri, setImageUri] = useState<string | null>(null);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
onLoadData();
|
|
||||||
}, [id]);
|
|
||||||
|
|
||||||
const onLoadData = async () => {
|
|
||||||
try {
|
|
||||||
setIsLoadData(true);
|
|
||||||
const response = await apiJobGetOne({ id: id as string });
|
|
||||||
if (response.success) {
|
|
||||||
setData(response.data);
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.log("[ERROR]", error);
|
|
||||||
} finally {
|
|
||||||
setIsLoadData(false);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const handlerOnUpdate = async () => {
|
|
||||||
if (!data.title || !data.content || !data.deskripsi) {
|
|
||||||
Toast.show({
|
|
||||||
type: "info",
|
|
||||||
text1: "Info",
|
|
||||||
text2: "Harap isi semua data",
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
setIsLoading(true);
|
|
||||||
let newImageId = "";
|
|
||||||
|
|
||||||
if (imageUri) {
|
|
||||||
const responseUploadImage = await uploadFileService({
|
|
||||||
imageUri: imageUri,
|
|
||||||
dirId: DIRECTORY_ID.job_image,
|
|
||||||
});
|
|
||||||
|
|
||||||
if (responseUploadImage.success) {
|
|
||||||
newImageId = responseUploadImage.data.id;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (data?.imageId) {
|
|
||||||
const responseDeleteImage = await deleteFileService({
|
|
||||||
id: data.imageId,
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!responseDeleteImage.success) {
|
|
||||||
console.log("[ERROR DELETE IMAGE]", responseDeleteImage.message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const newData = {
|
|
||||||
title: data.title,
|
|
||||||
content: data.content,
|
|
||||||
deskripsi: data.deskripsi,
|
|
||||||
imageId: newImageId,
|
|
||||||
};
|
|
||||||
|
|
||||||
const response = await apiJobUpdateData({
|
|
||||||
id: id as string,
|
|
||||||
data: newData,
|
|
||||||
category: "edit",
|
|
||||||
});
|
|
||||||
|
|
||||||
if (response.success) {
|
|
||||||
Toast.show({
|
|
||||||
type: "success",
|
|
||||||
text1: response.message,
|
|
||||||
});
|
|
||||||
router.back();
|
|
||||||
} else {
|
|
||||||
Toast.show({
|
|
||||||
type: "info",
|
|
||||||
text1: "Info",
|
|
||||||
text2: response.message,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.log("[ERROR]", error);
|
|
||||||
} finally {
|
|
||||||
setIsLoading(false);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const buttonSubmit = () => {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ButtonCustom isLoading={isLoading} onPress={() => handlerOnUpdate()}>
|
|
||||||
Update
|
|
||||||
</ButtonCustom>
|
|
||||||
<Spacing />
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<ViewWrapper>
|
|
||||||
{isLoadData ? (
|
|
||||||
<LoaderCustom />
|
|
||||||
) : (
|
|
||||||
<StackCustom gap={"xs"}>
|
|
||||||
<InformationBox text="Poster atau gambar lowongan kerja bersifat opsional, tidak wajib untuk dimasukkan dan upload lah gambar yang sesuai dengan deskripsi lowongan kerja." />
|
|
||||||
|
|
||||||
{imageUri ? (
|
|
||||||
<LandscapeFrameUploaded image={imageUri as any} />
|
|
||||||
) : (
|
|
||||||
<BaseBox>
|
|
||||||
<DummyLandscapeImage imageId={data?.imageId} />
|
|
||||||
</BaseBox>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<ButtonCenteredOnly
|
|
||||||
onPress={() => {
|
|
||||||
pickImage({
|
|
||||||
setImageUri,
|
|
||||||
});
|
|
||||||
}}
|
|
||||||
icon="upload"
|
|
||||||
>
|
|
||||||
Upload
|
|
||||||
</ButtonCenteredOnly>
|
|
||||||
|
|
||||||
<Spacing />
|
|
||||||
|
|
||||||
<TextInputCustom
|
|
||||||
label="Judul Lowongan"
|
|
||||||
placeholder="Masukan Judul Lowongan Kerja"
|
|
||||||
required
|
|
||||||
value={data.title}
|
|
||||||
onChangeText={(value) => setData({ ...data, title: value })}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<TextAreaCustom
|
|
||||||
label="Syarat & Kualifikasi"
|
|
||||||
placeholder="Masukan Syarat & Kualifikasi Lowongan Kerja"
|
|
||||||
required
|
|
||||||
showCount
|
|
||||||
maxLength={1000}
|
|
||||||
value={data.content}
|
|
||||||
onChangeText={(value) => setData({ ...data, content: value })}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<TextAreaCustom
|
|
||||||
label="Deskripsi Lowongan"
|
|
||||||
placeholder="Masukan Deskripsi Lowongan Kerja"
|
|
||||||
required
|
|
||||||
showCount
|
|
||||||
maxLength={1000}
|
|
||||||
value={data.deskripsi}
|
|
||||||
onChangeText={(value) => setData({ ...data, deskripsi: value })}
|
|
||||||
/>
|
|
||||||
|
|
||||||
{buttonSubmit()}
|
|
||||||
</StackCustom>
|
|
||||||
)}
|
|
||||||
</ViewWrapper>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,168 +1,5 @@
|
|||||||
import {
|
import { Job_ScreenCreate } from "@/screens/Job/ScreenJobCreate";
|
||||||
BoxButtonOnFooter,
|
|
||||||
ButtonCenteredOnly,
|
|
||||||
ButtonCustom,
|
|
||||||
InformationBox,
|
|
||||||
LandscapeFrameUploaded,
|
|
||||||
NewWrapper,
|
|
||||||
Spacing,
|
|
||||||
StackCustom,
|
|
||||||
TextAreaCustom,
|
|
||||||
TextInputCustom
|
|
||||||
} from "@/components";
|
|
||||||
import DIRECTORY_ID from "@/constants/directory-id";
|
|
||||||
import { useAuth } from "@/hooks/use-auth";
|
|
||||||
import { apiJobCreate } from "@/service/api-client/api-job";
|
|
||||||
import { uploadFileService } from "@/service/upload-service";
|
|
||||||
import pickImage from "@/utils/pickImage";
|
|
||||||
import { router } from "expo-router";
|
|
||||||
import { useState } from "react";
|
|
||||||
import Toast from "react-native-toast-message";
|
|
||||||
|
|
||||||
export default function JobCreate() {
|
export default function JobCreate() {
|
||||||
const nextUrl = "/(application)/(user)/job/(tabs)/status?status=review";
|
return <Job_ScreenCreate />;
|
||||||
const { user } = useAuth();
|
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
|
||||||
const [image, setImage] = useState<string | null>(null);
|
|
||||||
const [data, setData] = useState({
|
|
||||||
title: "",
|
|
||||||
content: "",
|
|
||||||
deskripsi: "",
|
|
||||||
authorId: "",
|
|
||||||
});
|
|
||||||
|
|
||||||
const handlerOnSubmit = async () => {
|
|
||||||
let imageId = "";
|
|
||||||
const newData = {
|
|
||||||
title: data.title,
|
|
||||||
content: data.content,
|
|
||||||
deskripsi: data.deskripsi,
|
|
||||||
authorId: user?.id,
|
|
||||||
imageId: "",
|
|
||||||
};
|
|
||||||
|
|
||||||
if (!data.title || !data.content || !data.deskripsi || !user?.id) {
|
|
||||||
Toast.show({
|
|
||||||
type: "info",
|
|
||||||
text1: "Info",
|
|
||||||
text2: "Harap isi semua data",
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
setIsLoading(true);
|
|
||||||
|
|
||||||
if (image === null || !image) {
|
|
||||||
const response = await apiJobCreate(newData);
|
|
||||||
if (response.success) {
|
|
||||||
Toast.show({
|
|
||||||
type: "success",
|
|
||||||
text1: "Berhasil",
|
|
||||||
text2: "Lowongan berhasil dibuat",
|
|
||||||
});
|
|
||||||
router.replace(nextUrl);
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const responseUploadImage = await uploadFileService({
|
|
||||||
imageUri: image,
|
|
||||||
dirId: DIRECTORY_ID.job_image,
|
|
||||||
});
|
|
||||||
|
|
||||||
if (responseUploadImage.success) {
|
|
||||||
imageId = responseUploadImage.data.id;
|
|
||||||
}
|
|
||||||
|
|
||||||
const fixData = {
|
|
||||||
...newData,
|
|
||||||
imageId: imageId,
|
|
||||||
};
|
|
||||||
|
|
||||||
const response = await apiJobCreate(fixData);
|
|
||||||
if (response.success) {
|
|
||||||
Toast.show({
|
|
||||||
type: "success",
|
|
||||||
text1: "Berhasil",
|
|
||||||
text2: "Lowongan berhasil dibuat",
|
|
||||||
});
|
|
||||||
router.replace(nextUrl);
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.log("[ERROR]", error);
|
|
||||||
} finally {
|
|
||||||
setIsLoading(false);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const buttonSubmit = () => {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<BoxButtonOnFooter>
|
|
||||||
<ButtonCustom isLoading={isLoading} onPress={() => handlerOnSubmit()}>
|
|
||||||
Simpan
|
|
||||||
</ButtonCustom>
|
|
||||||
</BoxButtonOnFooter>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<NewWrapper footerComponent={buttonSubmit()}>
|
|
||||||
<StackCustom gap={"xs"}>
|
|
||||||
<InformationBox text="Poster atau gambar lowongan kerja bersifat opsional, tidak wajib untuk dimasukkan dan upload lah gambar yang sesuai dengan deskripsi lowongan kerja." />
|
|
||||||
|
|
||||||
{/* <BaseBox>
|
|
||||||
<Image
|
|
||||||
source={image ? { uri: image } : DUMMY_IMAGE.dummy_image}
|
|
||||||
style={{ width: "100%", height: 200 }}
|
|
||||||
/>
|
|
||||||
</BaseBox> */}
|
|
||||||
<LandscapeFrameUploaded image={image as string} />
|
|
||||||
<ButtonCenteredOnly
|
|
||||||
onPress={() => {
|
|
||||||
// router.push("/(application)/(image)/take-picture/123");
|
|
||||||
pickImage({
|
|
||||||
setImageUri: setImage,
|
|
||||||
});
|
|
||||||
}}
|
|
||||||
icon="upload"
|
|
||||||
>
|
|
||||||
Upload
|
|
||||||
</ButtonCenteredOnly>
|
|
||||||
|
|
||||||
<Spacing />
|
|
||||||
|
|
||||||
<TextInputCustom
|
|
||||||
label="Judul Lowongan"
|
|
||||||
placeholder="Masukan Judul Lowongan Kerja"
|
|
||||||
required
|
|
||||||
value={data.title}
|
|
||||||
onChangeText={(value) => setData({ ...data, title: value })}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<TextAreaCustom
|
|
||||||
label="Syarat & Kualifikasi"
|
|
||||||
placeholder="Masukan Syarat & Kualifikasi Lowongan Kerja"
|
|
||||||
required
|
|
||||||
showCount
|
|
||||||
maxLength={1000}
|
|
||||||
value={data.content}
|
|
||||||
onChangeText={(value) => setData({ ...data, content: value })}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<TextAreaCustom
|
|
||||||
label="Deskripsi Lowongan"
|
|
||||||
placeholder="Masukan Deskripsi Lowongan Kerja"
|
|
||||||
required
|
|
||||||
showCount
|
|
||||||
maxLength={1000}
|
|
||||||
value={data.deskripsi}
|
|
||||||
onChangeText={(value) => setData({ ...data, deskripsi: value })}
|
|
||||||
/>
|
|
||||||
</StackCustom>
|
|
||||||
</NewWrapper>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import {
|
|||||||
import ListEmptyComponent from "@/components/_ShareComponent/ListEmptyComponent";
|
import ListEmptyComponent from "@/components/_ShareComponent/ListEmptyComponent";
|
||||||
import ListLoaderFooterComponent from "@/components/_ShareComponent/ListLoaderFooterComponent";
|
import ListLoaderFooterComponent from "@/components/_ShareComponent/ListLoaderFooterComponent";
|
||||||
import ListSkeletonComponent from "@/components/_ShareComponent/ListSkeletonComponent";
|
import ListSkeletonComponent from "@/components/_ShareComponent/ListSkeletonComponent";
|
||||||
import NewWrapper from "@/components/_ShareComponent/NewWrapper";
|
import { NewWrapper_V2 } from "@/components";
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
import { useAuth } from "@/hooks/use-auth";
|
import { useAuth } from "@/hooks/use-auth";
|
||||||
import { usePaginatedApi } from "@/hooks/use-paginated-api";
|
import { usePaginatedApi } from "@/hooks/use-paginated-api";
|
||||||
@@ -120,7 +120,7 @@ export default function ProfileBlockedList() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<NewWrapper
|
<NewWrapper_V2
|
||||||
// headerComponent={renderHeader()}
|
// headerComponent={renderHeader()}
|
||||||
listData={listData}
|
listData={listData}
|
||||||
renderItem={renderItem}
|
renderItem={renderItem}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import {
|
|||||||
BoxButtonOnFooter,
|
BoxButtonOnFooter,
|
||||||
BoxWithHeaderSection,
|
BoxWithHeaderSection,
|
||||||
ButtonCustom,
|
ButtonCustom,
|
||||||
NewWrapper,
|
NewWrapper_V2,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
TextCustom,
|
TextCustom,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
@@ -46,7 +46,9 @@ export default function ProfileDetailBlocked() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<NewWrapper
|
<NewWrapper_V2
|
||||||
|
enableKeyboardHandling
|
||||||
|
keyboardScrollOffset={100}
|
||||||
footerComponent={
|
footerComponent={
|
||||||
<BoxButtonOnFooter>
|
<BoxButtonOnFooter>
|
||||||
<ButtonCustom
|
<ButtonCustom
|
||||||
@@ -86,7 +88,7 @@ export default function ProfileDetailBlocked() {
|
|||||||
</TextCustom>
|
</TextCustom>
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
</BoxWithHeaderSection>
|
</BoxWithHeaderSection>
|
||||||
</NewWrapper>
|
</NewWrapper_V2>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,16 @@
|
|||||||
import {
|
import {
|
||||||
ButtonCustom,
|
ButtonCustom,
|
||||||
|
NewWrapper_V2,
|
||||||
SelectCustom,
|
SelectCustom,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
TextInputCustom,
|
TextInputCustom,
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import BoxButtonOnFooter from "@/components/Box/BoxButtonOnFooter";
|
import BoxButtonOnFooter from "@/components/Box/BoxButtonOnFooter";
|
||||||
import { apiProfile, apiUpdateProfile } from "@/service/api-client/api-profile";
|
import { apiProfile, apiUpdateProfile } from "@/service/api-client/api-profile";
|
||||||
import { IProfile } from "@/types/Type-Profile";
|
import { IProfile } from "@/types/Type-Profile";
|
||||||
import { router, useLocalSearchParams } from "expo-router";
|
import { router, useLocalSearchParams } from "expo-router";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
|
import { View } from "react-native";
|
||||||
import Toast from "react-native-toast-message";
|
import Toast from "react-native-toast-message";
|
||||||
|
|
||||||
export default function ProfileEdit() {
|
export default function ProfileEdit() {
|
||||||
@@ -70,7 +71,9 @@ export default function ProfileEdit() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ViewWrapper
|
<NewWrapper_V2
|
||||||
|
enableKeyboardHandling
|
||||||
|
keyboardScrollOffset={100}
|
||||||
footerComponent={
|
footerComponent={
|
||||||
<BoxButtonOnFooter>
|
<BoxButtonOnFooter>
|
||||||
<ButtonCustom isLoading={isLoading} onPress={handleUpdate}>
|
<ButtonCustom isLoading={isLoading} onPress={handleUpdate}>
|
||||||
@@ -80,45 +83,53 @@ export default function ProfileEdit() {
|
|||||||
}
|
}
|
||||||
>
|
>
|
||||||
<StackCustom gap={"xs"}>
|
<StackCustom gap={"xs"}>
|
||||||
<TextInputCustom
|
<View onStartShouldSetResponder={() => true}>
|
||||||
label="Nama"
|
<TextInputCustom
|
||||||
placeholder="Nama"
|
label="Nama"
|
||||||
value={data?.name}
|
placeholder="Nama"
|
||||||
onChangeText={(text) => {
|
value={data?.name}
|
||||||
setData({ ...data, name: text });
|
onChangeText={(text) => {
|
||||||
}}
|
setData({ ...data, name: text });
|
||||||
required
|
}}
|
||||||
/>
|
required
|
||||||
<TextInputCustom
|
/>
|
||||||
keyboardType="email-address"
|
</View>
|
||||||
label="Email"
|
<View onStartShouldSetResponder={() => true}>
|
||||||
placeholder="Email"
|
<TextInputCustom
|
||||||
value={data?.email}
|
keyboardType="email-address"
|
||||||
onChangeText={(text) => {
|
label="Email"
|
||||||
setData({ ...data, email: text });
|
placeholder="Email"
|
||||||
}}
|
value={data?.email}
|
||||||
required
|
onChangeText={(text) => {
|
||||||
/>
|
setData({ ...data, email: text });
|
||||||
<TextInputCustom
|
}}
|
||||||
label="Alamat"
|
required
|
||||||
placeholder="Alamat"
|
/>
|
||||||
value={data?.alamat}
|
</View>
|
||||||
onChangeText={(text) => {
|
<View onStartShouldSetResponder={() => true}>
|
||||||
setData({ ...data, alamat: text });
|
<TextInputCustom
|
||||||
}}
|
label="Alamat"
|
||||||
required
|
placeholder="Alamat"
|
||||||
/>
|
value={data?.alamat}
|
||||||
<SelectCustom
|
onChangeText={(text) => {
|
||||||
required
|
setData({ ...data, alamat: text });
|
||||||
label="Jenis Kelamin"
|
}}
|
||||||
placeholder="Pilih jenis kelamin"
|
required
|
||||||
data={options}
|
/>
|
||||||
value={data?.jenisKelamin}
|
</View>
|
||||||
onChange={(value) => {
|
<View onStartShouldSetResponder={() => true}>
|
||||||
setData({ ...(data as any), jenisKelamin: value });
|
<SelectCustom
|
||||||
}}
|
required
|
||||||
/>
|
label="Jenis Kelamin"
|
||||||
|
placeholder="Pilih jenis kelamin"
|
||||||
|
data={options}
|
||||||
|
value={data?.jenisKelamin}
|
||||||
|
onChange={(value) => {
|
||||||
|
setData({ ...(data as any), jenisKelamin: value });
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
</ViewWrapper>
|
</NewWrapper_V2>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/* eslint-disable react-hooks/exhaustive-deps */
|
/* eslint-disable react-hooks/exhaustive-deps */
|
||||||
import { NewWrapper, StackCustom } from "@/components";
|
import { NewWrapper_V2, StackCustom } from "@/components";
|
||||||
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import CustomSkeleton from "@/components/_ShareComponent/SkeletonCustom";
|
import CustomSkeleton from "@/components/_ShareComponent/SkeletonCustom";
|
||||||
import LeftButtonCustom from "@/components/Button/BackButton";
|
import LeftButtonCustom from "@/components/Button/BackButton";
|
||||||
@@ -119,7 +119,7 @@ export default function Profile() {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
{/* Main View */}
|
{/* Main View */}
|
||||||
<NewWrapper
|
<NewWrapper_V2
|
||||||
refreshControl={
|
refreshControl={
|
||||||
<RefreshControl
|
<RefreshControl
|
||||||
refreshing={refreshing}
|
refreshing={refreshing}
|
||||||
@@ -144,7 +144,7 @@ export default function Profile() {
|
|||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</NewWrapper>
|
</NewWrapper_V2>
|
||||||
|
|
||||||
{/* Drawer Komponen Eksternal */}
|
{/* Drawer Komponen Eksternal */}
|
||||||
<DrawerCustom
|
<DrawerCustom
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import {
|
import {
|
||||||
BaseBox,
|
BaseBox,
|
||||||
BoxButtonOnFooter,
|
BoxButtonOnFooter,
|
||||||
ButtonCenteredOnly,
|
ButtonCenteredOnly,
|
||||||
ButtonCustom,
|
ButtonCustom,
|
||||||
|
NewWrapper_V2,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import ViewWrapper from "@/components/_ShareComponent/ViewWrapper";
|
|
||||||
import API_STRORAGE from "@/constants/base-url-api-strorage";
|
import API_STRORAGE from "@/constants/base-url-api-strorage";
|
||||||
import DIRECTORY_ID from "@/constants/directory-id";
|
import DIRECTORY_ID from "@/constants/directory-id";
|
||||||
import DUMMY_IMAGE from "@/constants/dummy-image-value";
|
import DUMMY_IMAGE from "@/constants/dummy-image-value";
|
||||||
@@ -127,7 +127,10 @@ export default function UpdateBackgroundProfile() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ViewWrapper footerComponent={buttonFooter}>
|
<NewWrapper_V2
|
||||||
|
contentPaddingHorizontal={16}
|
||||||
|
footerComponent={buttonFooter}
|
||||||
|
>
|
||||||
<BaseBox
|
<BaseBox
|
||||||
style={{ alignItems: "center", justifyContent: "center", height: 250 }}
|
style={{ alignItems: "center", justifyContent: "center", height: 250 }}
|
||||||
>
|
>
|
||||||
@@ -144,6 +147,6 @@ export default function UpdateBackgroundProfile() {
|
|||||||
>
|
>
|
||||||
Update
|
Update
|
||||||
</ButtonCenteredOnly>
|
</ButtonCenteredOnly>
|
||||||
</ViewWrapper>
|
</NewWrapper_V2>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ import {
|
|||||||
BoxButtonOnFooter,
|
BoxButtonOnFooter,
|
||||||
ButtonCenteredOnly,
|
ButtonCenteredOnly,
|
||||||
ButtonCustom,
|
ButtonCustom,
|
||||||
|
NewWrapper_V2,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import ViewWrapper from "@/components/_ShareComponent/ViewWrapper";
|
|
||||||
import API_STRORAGE from "@/constants/base-url-api-strorage";
|
import API_STRORAGE from "@/constants/base-url-api-strorage";
|
||||||
import DIRECTORY_ID from "@/constants/directory-id";
|
import DIRECTORY_ID from "@/constants/directory-id";
|
||||||
import DUMMY_IMAGE from "@/constants/dummy-image-value";
|
import DUMMY_IMAGE from "@/constants/dummy-image-value";
|
||||||
@@ -125,7 +125,10 @@ export default function UpdatePhotoProfile() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ViewWrapper footerComponent={buttonFooter}>
|
<NewWrapper_V2
|
||||||
|
contentPaddingHorizontal={16}
|
||||||
|
footerComponent={buttonFooter}
|
||||||
|
>
|
||||||
<BaseBox
|
<BaseBox
|
||||||
style={{ alignItems: "center", justifyContent: "center", height: 250 }}
|
style={{ alignItems: "center", justifyContent: "center", height: 250 }}
|
||||||
>
|
>
|
||||||
@@ -143,6 +146,6 @@ export default function UpdatePhotoProfile() {
|
|||||||
>
|
>
|
||||||
Upload
|
Upload
|
||||||
</ButtonCenteredOnly>
|
</ButtonCenteredOnly>
|
||||||
</ViewWrapper>
|
</NewWrapper_V2>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ export default function ProfileLayout() {
|
|||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="create"
|
name="create"
|
||||||
options={{ headerBackVisible: false }}
|
options={{ header: () => <AppHeader title="Buat Profil" showBack={false} /> }}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
|
|||||||
@@ -2,11 +2,11 @@ import {
|
|||||||
BaseBox,
|
BaseBox,
|
||||||
ButtonCenteredOnly,
|
ButtonCenteredOnly,
|
||||||
ButtonCustom,
|
ButtonCustom,
|
||||||
|
NewWrapper_V2,
|
||||||
SelectCustom,
|
SelectCustom,
|
||||||
Spacing,
|
Spacing,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
TextInputCustom,
|
TextInputCustom,
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import BoxButtonOnFooter from "@/components/Box/BoxButtonOnFooter";
|
import BoxButtonOnFooter from "@/components/Box/BoxButtonOnFooter";
|
||||||
import InformationBox from "@/components/Box/InformationBox";
|
import InformationBox from "@/components/Box/InformationBox";
|
||||||
@@ -155,7 +155,11 @@ export default function CreateProfile() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ViewWrapper footerComponent={footerComponent}>
|
<NewWrapper_V2
|
||||||
|
enableKeyboardHandling
|
||||||
|
keyboardScrollOffset={100}
|
||||||
|
footerComponent={footerComponent}
|
||||||
|
>
|
||||||
<StackCustom>
|
<StackCustom>
|
||||||
<InformationBox text="Upload foto profile anda." />
|
<InformationBox text="Upload foto profile anda." />
|
||||||
<View style={{ alignItems: "center" }}>
|
<View style={{ alignItems: "center" }}>
|
||||||
@@ -204,43 +208,51 @@ export default function CreateProfile() {
|
|||||||
</View>
|
</View>
|
||||||
|
|
||||||
<Spacing />
|
<Spacing />
|
||||||
<TextInputCustom
|
<View onStartShouldSetResponder={() => true}>
|
||||||
required
|
<TextInputCustom
|
||||||
label="Nama"
|
required
|
||||||
placeholder="Masukkan nama"
|
label="Nama"
|
||||||
value={data.name}
|
placeholder="Masukkan nama"
|
||||||
onChangeText={(text) => setData({ ...data, name: text })}
|
value={data.name}
|
||||||
/>
|
onChangeText={(text) => setData({ ...data, name: text })}
|
||||||
<TextInputCustom
|
/>
|
||||||
keyboardType="email-address"
|
</View>
|
||||||
required
|
<View onStartShouldSetResponder={() => true}>
|
||||||
label="Email"
|
<TextInputCustom
|
||||||
placeholder="Masukkan email"
|
keyboardType="email-address"
|
||||||
value={data.email}
|
required
|
||||||
onChangeText={(text) => setData({ ...data, email: text })}
|
label="Email"
|
||||||
/>
|
placeholder="Masukkan email"
|
||||||
<TextInputCustom
|
value={data.email}
|
||||||
required
|
onChangeText={(text) => setData({ ...data, email: text })}
|
||||||
label="Alamat"
|
/>
|
||||||
placeholder="Masukkan alamat"
|
</View>
|
||||||
value={data.alamat}
|
<View onStartShouldSetResponder={() => true}>
|
||||||
onChangeText={(text) => setData({ ...data, alamat: text })}
|
<TextInputCustom
|
||||||
/>
|
required
|
||||||
<SelectCustom
|
label="Alamat"
|
||||||
label="Jenis Kelamin"
|
placeholder="Masukkan alamat"
|
||||||
placeholder="Pilih jenis kelamin"
|
value={data.alamat}
|
||||||
data={[
|
onChangeText={(text) => setData({ ...data, alamat: text })}
|
||||||
{ label: "Laki-laki", value: "laki-laki" },
|
/>
|
||||||
{ label: "Perempuan", value: "perempuan" },
|
</View>
|
||||||
]}
|
<View onStartShouldSetResponder={() => true}>
|
||||||
value={data.jenisKelamin}
|
<SelectCustom
|
||||||
required
|
label="Jenis Kelamin"
|
||||||
onChange={(value) =>
|
placeholder="Pilih jenis kelamin"
|
||||||
setData({ ...(data as any), jenisKelamin: value })
|
data={[
|
||||||
}
|
{ label: "Laki-laki", value: "laki-laki" },
|
||||||
/>
|
{ label: "Perempuan", value: "perempuan" },
|
||||||
|
]}
|
||||||
|
value={data.jenisKelamin}
|
||||||
|
required
|
||||||
|
onChange={(value) =>
|
||||||
|
setData({ ...(data as any), jenisKelamin: value })
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
<Spacing />
|
<Spacing />
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
</ViewWrapper>
|
</NewWrapper_V2>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,58 +8,82 @@ import AppHeader from "@/components/_ShareComponent/AppHeader";
|
|||||||
import BackButtonFromNotification from "@/components/Button/BackButtonFromNotification";
|
import BackButtonFromNotification from "@/components/Button/BackButtonFromNotification";
|
||||||
import { TabsStyles } from "@/styles/tabs-styles";
|
import { TabsStyles } from "@/styles/tabs-styles";
|
||||||
import { router, Tabs, useLocalSearchParams } from "expo-router";
|
import { router, Tabs, useLocalSearchParams } from "expo-router";
|
||||||
|
import { View } from "react-native";
|
||||||
|
import { MainColor } from "@/constants/color-palet";
|
||||||
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
||||||
|
import { Platform } from "react-native";
|
||||||
|
|
||||||
export default function VotingTabsLayout() {
|
function VotingTabsWrapper() {
|
||||||
|
const insets = useSafeAreaInsets();
|
||||||
|
const paddingBottom = Platform.OS === "android" ? insets.bottom : 0;
|
||||||
const { from, category } = useLocalSearchParams<{
|
const { from, category } = useLocalSearchParams<{
|
||||||
from?: string;
|
from?: string;
|
||||||
category?: string;
|
category?: string;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Tabs
|
<View style={{ flex: 1, backgroundColor: MainColor.darkblue }}>
|
||||||
screenOptions={{
|
<Tabs
|
||||||
...TabsStyles,
|
screenOptions={{
|
||||||
header: () => (
|
...TabsStyles,
|
||||||
<AppHeader
|
tabBarStyle: Platform.select({
|
||||||
title="Voting"
|
ios: {
|
||||||
left={
|
borderTopWidth: 0,
|
||||||
<BackButtonFromNotification
|
paddingTop: 12,
|
||||||
from={from as string}
|
height: 80,
|
||||||
category={category as string}
|
},
|
||||||
/>
|
android: {
|
||||||
}
|
borderTopWidth: 0,
|
||||||
/>
|
paddingTop: 5,
|
||||||
),
|
height: 70 + paddingBottom,
|
||||||
}}
|
},
|
||||||
>
|
}),
|
||||||
<Tabs.Screen
|
header: () => (
|
||||||
name="index"
|
<AppHeader
|
||||||
options={{
|
title="Voting"
|
||||||
title: "Beranda",
|
left={
|
||||||
tabBarIcon: ({ color }) => <IconHome color={color} />,
|
<BackButtonFromNotification
|
||||||
|
from={from || ""}
|
||||||
|
category={category}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
>
|
||||||
<Tabs.Screen
|
<Tabs.Screen
|
||||||
name="status"
|
name="index"
|
||||||
options={{
|
options={{
|
||||||
title: "Status",
|
title: "Beranda",
|
||||||
tabBarIcon: ({ color }) => <IconStatus color={color} />,
|
tabBarIcon: ({ color }) => <IconHome color={color} />,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Tabs.Screen
|
<Tabs.Screen
|
||||||
name="contribution"
|
name="status"
|
||||||
options={{
|
options={{
|
||||||
title: "Kontribusi",
|
title: "Status",
|
||||||
tabBarIcon: ({ color }) => <IconContribution color={color} />,
|
tabBarIcon: ({ color }) => <IconStatus color={color} />,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Tabs.Screen
|
<Tabs.Screen
|
||||||
name="history"
|
name="contribution"
|
||||||
options={{
|
options={{
|
||||||
title: "Riwayat",
|
title: "Kontribusi",
|
||||||
tabBarIcon: ({ color }) => <IconHistory color={color} />,
|
tabBarIcon: ({ color }) => <IconContribution color={color} />,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Tabs>
|
<Tabs.Screen
|
||||||
|
name="history"
|
||||||
|
options={{
|
||||||
|
title: "Riwayat",
|
||||||
|
tabBarIcon: ({ color }) => <IconHistory color={color} />,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Tabs>
|
||||||
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default function VotingTabsLayout() {
|
||||||
|
return <VotingTabsWrapper />;
|
||||||
|
}
|
||||||
|
|||||||
73
components/_ShareComponent/FormWrapper.tsx
Normal file
73
components/_ShareComponent/FormWrapper.tsx
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
// FormWrapper.tsx - Reusable wrapper untuk form dengan keyboard handling
|
||||||
|
import { MainColor } from "@/constants/color-palet";
|
||||||
|
import { Keyboard, KeyboardAvoidingView, Platform, ScrollView, TouchableWithoutFeedback, View } from "react-native";
|
||||||
|
import { SafeAreaView } from "react-native-safe-area-context";
|
||||||
|
import { ReactNode } from "react";
|
||||||
|
import { useKeyboardForm } from "@/hooks/useKeyboardForm";
|
||||||
|
|
||||||
|
interface FormWrapperProps {
|
||||||
|
children: ReactNode;
|
||||||
|
footerComponent?: ReactNode;
|
||||||
|
/**
|
||||||
|
* Offset scroll saat keyboard muncul (default: 100)
|
||||||
|
*/
|
||||||
|
scrollOffset?: number;
|
||||||
|
/**
|
||||||
|
* Padding bottom untuk content (default: 100)
|
||||||
|
*/
|
||||||
|
contentPaddingBottom?: number;
|
||||||
|
/**
|
||||||
|
* Padding untuk content container (default: 16)
|
||||||
|
*/
|
||||||
|
contentPadding?: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function FormWrapper({
|
||||||
|
children,
|
||||||
|
footerComponent,
|
||||||
|
scrollOffset = 100,
|
||||||
|
contentPaddingBottom = 100,
|
||||||
|
contentPadding = 16,
|
||||||
|
}: FormWrapperProps) {
|
||||||
|
const { scrollViewRef, handleInputFocus } = useKeyboardForm(scrollOffset);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<KeyboardAvoidingView
|
||||||
|
behavior={Platform.OS === "ios" ? "padding" : undefined}
|
||||||
|
style={{ flex: 1, backgroundColor: MainColor.darkblue }}
|
||||||
|
>
|
||||||
|
<ScrollView
|
||||||
|
ref={scrollViewRef}
|
||||||
|
style={{ flex: 1 }}
|
||||||
|
contentContainerStyle={{
|
||||||
|
flexGrow: 1,
|
||||||
|
paddingBottom: contentPaddingBottom,
|
||||||
|
}}
|
||||||
|
keyboardShouldPersistTaps="handled"
|
||||||
|
showsVerticalScrollIndicator={false}
|
||||||
|
>
|
||||||
|
<TouchableWithoutFeedback onPress={Keyboard.dismiss}>
|
||||||
|
<View style={{ flex: 1, padding: contentPadding }}>
|
||||||
|
{children}
|
||||||
|
</View>
|
||||||
|
</TouchableWithoutFeedback>
|
||||||
|
</ScrollView>
|
||||||
|
|
||||||
|
{/* Footer - Fixed di bawah */}
|
||||||
|
{footerComponent && (
|
||||||
|
<SafeAreaView
|
||||||
|
edges={["bottom"]}
|
||||||
|
style={{
|
||||||
|
backgroundColor: MainColor.darkblue,
|
||||||
|
position: 'absolute',
|
||||||
|
bottom: 0,
|
||||||
|
left: 0,
|
||||||
|
right: 0,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{footerComponent}
|
||||||
|
</SafeAreaView>
|
||||||
|
)}
|
||||||
|
</KeyboardAvoidingView>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -117,15 +117,15 @@ const NewWrapper = (props: NewWrapperProps) => {
|
|||||||
ListHeaderComponent={listProps.ListHeaderComponent}
|
ListHeaderComponent={listProps.ListHeaderComponent}
|
||||||
ListFooterComponent={listProps.ListFooterComponent}
|
ListFooterComponent={listProps.ListFooterComponent}
|
||||||
ListEmptyComponent={listProps.ListEmptyComponent}
|
ListEmptyComponent={listProps.ListEmptyComponent}
|
||||||
contentContainerStyle={{
|
contentContainerStyle={{
|
||||||
flexGrow: 1,
|
flexGrow: 1,
|
||||||
paddingBottom: footerComponent && !hideFooter ? OS_HEIGHT : 0
|
paddingBottom: footerComponent && !hideFooter ? OS_HEIGHT : 0
|
||||||
}}
|
}}
|
||||||
keyboardShouldPersistTaps="handled"
|
keyboardShouldPersistTaps="handled"
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
{/* Footer dengan position absolute untuk stay di bawah */}
|
{/* Footer - tetap di bawah dengan position absolute */}
|
||||||
{footerComponent && !hideFooter && (
|
{footerComponent && !hideFooter && (
|
||||||
<View style={styles.footerContainer}>
|
<View style={styles.footerContainer}>
|
||||||
<SafeAreaView
|
<SafeAreaView
|
||||||
@@ -133,7 +133,7 @@ const NewWrapper = (props: NewWrapperProps) => {
|
|||||||
style={{ backgroundColor: MainColor.darkblue }}
|
style={{ backgroundColor: MainColor.darkblue }}
|
||||||
>
|
>
|
||||||
{footerComponent}
|
{footerComponent}
|
||||||
</SafeAreaView>
|
</SafeAreaView>
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
@@ -163,11 +163,11 @@ const NewWrapper = (props: NewWrapperProps) => {
|
|||||||
<View style={GStyles.stickyHeader}>{headerComponent}</View>
|
<View style={GStyles.stickyHeader}>{headerComponent}</View>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<View style={{ flex: 0 }} collapsable={false}>
|
<View style={{ flex: 1 }}>
|
||||||
<ScrollView
|
<ScrollView
|
||||||
contentContainerStyle={{
|
contentContainerStyle={{
|
||||||
flexGrow: 1,
|
flexGrow: 1,
|
||||||
paddingBottom: footerComponent && !hideFooter ? OS_HEIGHT : 0
|
paddingBottom: footerComponent && !hideFooter ? OS_HEIGHT : 0
|
||||||
}}
|
}}
|
||||||
keyboardShouldPersistTaps="handled"
|
keyboardShouldPersistTaps="handled"
|
||||||
refreshControl={refreshControl}
|
refreshControl={refreshControl}
|
||||||
@@ -178,7 +178,7 @@ const NewWrapper = (props: NewWrapperProps) => {
|
|||||||
</ScrollView>
|
</ScrollView>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
{/* Footer dengan position absolute untuk stay di bawah */}
|
{/* Footer - tetap di bawah dengan position absolute */}
|
||||||
{footerComponent && !hideFooter && (
|
{footerComponent && !hideFooter && (
|
||||||
<View style={styles.footerContainer}>
|
<View style={styles.footerContainer}>
|
||||||
<SafeAreaView
|
<SafeAreaView
|
||||||
|
|||||||
238
components/_ShareComponent/NewWrapper_V2.tsx
Normal file
238
components/_ShareComponent/NewWrapper_V2.tsx
Normal file
@@ -0,0 +1,238 @@
|
|||||||
|
// NewWrapper_V2.tsx - Wrapper baru dengan keyboard handling
|
||||||
|
import { MainColor } from "@/constants/color-palet";
|
||||||
|
import { OS_HEIGHT } from "@/constants/constans-value";
|
||||||
|
import { GStyles } from "@/styles/global-styles";
|
||||||
|
import {
|
||||||
|
ImageBackground,
|
||||||
|
Keyboard,
|
||||||
|
KeyboardAvoidingView,
|
||||||
|
Platform,
|
||||||
|
ScrollView,
|
||||||
|
FlatList,
|
||||||
|
TouchableWithoutFeedback,
|
||||||
|
View,
|
||||||
|
StyleProp,
|
||||||
|
ViewStyle,
|
||||||
|
} from "react-native";
|
||||||
|
import {
|
||||||
|
NativeSafeAreaViewProps,
|
||||||
|
SafeAreaView,
|
||||||
|
} from "react-native-safe-area-context";
|
||||||
|
import type { ScrollViewProps, FlatListProps } from "react-native";
|
||||||
|
import Spacing from "./Spacing";
|
||||||
|
import { useKeyboardForm } from "@/hooks/useKeyboardForm";
|
||||||
|
|
||||||
|
interface BaseProps {
|
||||||
|
withBackground?: boolean;
|
||||||
|
headerComponent?: React.ReactNode;
|
||||||
|
footerComponent?: React.ReactNode;
|
||||||
|
floatingButton?: React.ReactNode;
|
||||||
|
hideFooter?: boolean;
|
||||||
|
edgesFooter?: NativeSafeAreaViewProps["edges"];
|
||||||
|
style?: StyleProp<ViewStyle>;
|
||||||
|
refreshControl?: ScrollViewProps["refreshControl"];
|
||||||
|
/**
|
||||||
|
* Enable keyboard handling with auto-scroll
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
enableKeyboardHandling?: boolean;
|
||||||
|
/**
|
||||||
|
* Scroll offset when keyboard appears (default: 100)
|
||||||
|
*/
|
||||||
|
keyboardScrollOffset?: number;
|
||||||
|
/**
|
||||||
|
* Extra padding bottom for content to avoid navigation bar (default: 80)
|
||||||
|
*/
|
||||||
|
contentPaddingBottom?: number;
|
||||||
|
/**
|
||||||
|
* Padding Top untuk content container (default: 8)
|
||||||
|
*/
|
||||||
|
contentPaddingTop?: number;
|
||||||
|
/**
|
||||||
|
* Padding Horizontal untuk content container (default: 0)
|
||||||
|
* Set ke 16 atau lebih jika butuh spacing di kiri-kanan
|
||||||
|
*/
|
||||||
|
contentPaddingHorizontal?: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface StaticModeProps extends BaseProps {
|
||||||
|
children: React.ReactNode;
|
||||||
|
listData?: never;
|
||||||
|
renderItem?: never;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ListModeProps extends BaseProps {
|
||||||
|
children?: never;
|
||||||
|
listData?: any[];
|
||||||
|
renderItem?: FlatListProps<any>["renderItem"];
|
||||||
|
onEndReached?: () => void;
|
||||||
|
ListHeaderComponent?: React.ReactElement | null;
|
||||||
|
ListFooterComponent?: React.ReactElement | null;
|
||||||
|
ListEmptyComponent?: React.ReactElement | null;
|
||||||
|
keyExtractor?: FlatListProps<any>["keyExtractor"];
|
||||||
|
}
|
||||||
|
|
||||||
|
type NewWrapper_V2_Props = StaticModeProps | ListModeProps;
|
||||||
|
|
||||||
|
export function NewWrapper_V2(props: NewWrapper_V2_Props) {
|
||||||
|
const {
|
||||||
|
withBackground = false,
|
||||||
|
headerComponent,
|
||||||
|
footerComponent,
|
||||||
|
floatingButton,
|
||||||
|
hideFooter = false,
|
||||||
|
edgesFooter = [],
|
||||||
|
style,
|
||||||
|
refreshControl,
|
||||||
|
enableKeyboardHandling = false,
|
||||||
|
keyboardScrollOffset = 100,
|
||||||
|
contentPaddingBottom = 80, // Default 80 untuk navigasi device
|
||||||
|
contentPaddingTop = 8, // Default 8 untuk spacing atas
|
||||||
|
contentPaddingHorizontal = 0, // Default 0 agar aman untuk layout existing
|
||||||
|
} = props;
|
||||||
|
|
||||||
|
const assetBackground = require("../../assets/images/main-background.png");
|
||||||
|
|
||||||
|
// Use keyboard hook if enabled
|
||||||
|
const keyboardForm = enableKeyboardHandling
|
||||||
|
? useKeyboardForm(keyboardScrollOffset)
|
||||||
|
: null;
|
||||||
|
|
||||||
|
const renderContainer = (content: React.ReactNode) => {
|
||||||
|
if (withBackground) {
|
||||||
|
return (
|
||||||
|
<ImageBackground
|
||||||
|
source={assetBackground}
|
||||||
|
resizeMode="cover"
|
||||||
|
style={GStyles.imageBackground}
|
||||||
|
>
|
||||||
|
<View style={[GStyles.containerWithBackground, style]}>
|
||||||
|
{content}
|
||||||
|
</View>
|
||||||
|
</ImageBackground>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return <View style={[GStyles.container, style]}>{content}</View>;
|
||||||
|
};
|
||||||
|
|
||||||
|
// 🔹 Mode Dinamis (FlatList)
|
||||||
|
if ("listData" in props) {
|
||||||
|
const listProps = props as ListModeProps;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<KeyboardAvoidingView
|
||||||
|
behavior={Platform.OS === "ios" ? "padding" : undefined}
|
||||||
|
style={{ flex: 1, backgroundColor: MainColor.darkblue }}
|
||||||
|
>
|
||||||
|
{headerComponent && (
|
||||||
|
<View style={GStyles.stickyHeader}>{headerComponent}</View>
|
||||||
|
)}
|
||||||
|
<FlatList
|
||||||
|
data={listProps.listData}
|
||||||
|
renderItem={listProps.renderItem}
|
||||||
|
keyExtractor={
|
||||||
|
listProps.keyExtractor ||
|
||||||
|
((item, index) => `${String(item.id)}-${index}`)
|
||||||
|
}
|
||||||
|
refreshControl={refreshControl}
|
||||||
|
onEndReached={listProps.onEndReached}
|
||||||
|
onEndReachedThreshold={0.5}
|
||||||
|
ListHeaderComponent={listProps.ListHeaderComponent}
|
||||||
|
ListFooterComponent={listProps.ListFooterComponent}
|
||||||
|
ListEmptyComponent={listProps.ListEmptyComponent}
|
||||||
|
contentContainerStyle={{
|
||||||
|
flexGrow: 1,
|
||||||
|
paddingTop: contentPaddingTop,
|
||||||
|
paddingHorizontal: contentPaddingHorizontal,
|
||||||
|
paddingBottom: (footerComponent && !hideFooter ? OS_HEIGHT : 0) + contentPaddingBottom,
|
||||||
|
}}
|
||||||
|
keyboardShouldPersistTaps="handled"
|
||||||
|
/>
|
||||||
|
|
||||||
|
{/* Footer - Fixed di bawah dengan width 100% */}
|
||||||
|
{footerComponent && !hideFooter && (
|
||||||
|
<SafeAreaView
|
||||||
|
edges={Platform.OS === "ios" ? edgesFooter : ["bottom"]}
|
||||||
|
style={{ backgroundColor: MainColor.darkblue, width: "100%" }}
|
||||||
|
>
|
||||||
|
<View style={{ width: "100%" }}>
|
||||||
|
{footerComponent}
|
||||||
|
</View>
|
||||||
|
</SafeAreaView>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{!footerComponent && !hideFooter && (
|
||||||
|
<SafeAreaView
|
||||||
|
edges={["bottom"]}
|
||||||
|
style={{ backgroundColor: MainColor.darkblue }}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{floatingButton && (
|
||||||
|
<View style={GStyles.floatingContainer}>{floatingButton}</View>
|
||||||
|
)}
|
||||||
|
</KeyboardAvoidingView>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 🔹 Mode Statis (ScrollView)
|
||||||
|
const staticProps = props as StaticModeProps;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<KeyboardAvoidingView
|
||||||
|
behavior={Platform.OS === "ios" ? "padding" : undefined}
|
||||||
|
style={{ flex: 1, backgroundColor: MainColor.darkblue }}
|
||||||
|
>
|
||||||
|
{headerComponent && (
|
||||||
|
<View style={GStyles.stickyHeader}>{headerComponent}</View>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<ScrollView
|
||||||
|
ref={keyboardForm?.scrollViewRef}
|
||||||
|
style={{ flex: 1 }}
|
||||||
|
contentContainerStyle={{
|
||||||
|
flexGrow: 1,
|
||||||
|
paddingTop: contentPaddingTop,
|
||||||
|
paddingHorizontal: contentPaddingHorizontal,
|
||||||
|
paddingBottom: (footerComponent && !hideFooter ? OS_HEIGHT : 0) + contentPaddingBottom,
|
||||||
|
}}
|
||||||
|
keyboardShouldPersistTaps="handled"
|
||||||
|
showsVerticalScrollIndicator={false}
|
||||||
|
>
|
||||||
|
<TouchableWithoutFeedback onPress={Keyboard.dismiss}>
|
||||||
|
{renderContainer(staticProps.children)}
|
||||||
|
</TouchableWithoutFeedback>
|
||||||
|
</ScrollView>
|
||||||
|
|
||||||
|
{/* Footer - Fixed di bawah dengan width 100% */}
|
||||||
|
{footerComponent && !hideFooter && (
|
||||||
|
<SafeAreaView
|
||||||
|
edges={["bottom"]}
|
||||||
|
style={{
|
||||||
|
backgroundColor: MainColor.darkblue,
|
||||||
|
width: "100%",
|
||||||
|
position: Platform.OS === "android" ? "absolute" : undefined,
|
||||||
|
bottom: Platform.OS === "android" ? 0 : undefined,
|
||||||
|
left: 0,
|
||||||
|
right: 0,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<View style={{ width: "100%" }}>
|
||||||
|
{footerComponent}
|
||||||
|
</View>
|
||||||
|
</SafeAreaView>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{!footerComponent && !hideFooter && (
|
||||||
|
<SafeAreaView
|
||||||
|
edges={["bottom"]}
|
||||||
|
style={{ backgroundColor: MainColor.darkblue }}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{floatingButton && (
|
||||||
|
<View style={GStyles.floatingContainer}>{floatingButton}</View>
|
||||||
|
)}
|
||||||
|
</KeyboardAvoidingView>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -63,6 +63,9 @@ import DummyLandscapeImage from "./_ShareComponent/DummyLandscapeImage";
|
|||||||
import GridComponentView from "./_ShareComponent/GridSectionView";
|
import GridComponentView from "./_ShareComponent/GridSectionView";
|
||||||
import NewWrapper from "./_ShareComponent/NewWrapper";
|
import NewWrapper from "./_ShareComponent/NewWrapper";
|
||||||
import BasicWrapper from "./_ShareComponent/BasicWrapper";
|
import BasicWrapper from "./_ShareComponent/BasicWrapper";
|
||||||
|
import { FormWrapper } from "./_ShareComponent/FormWrapper";
|
||||||
|
import { NewWrapper_V2 } from "./_ShareComponent/NewWrapper_V2";
|
||||||
|
|
||||||
// Progress
|
// Progress
|
||||||
import ProgressCustom from "./Progress/ProgressCustom";
|
import ProgressCustom from "./Progress/ProgressCustom";
|
||||||
// Loader
|
// Loader
|
||||||
@@ -127,6 +130,8 @@ export {
|
|||||||
Spacing,
|
Spacing,
|
||||||
NewWrapper,
|
NewWrapper,
|
||||||
BasicWrapper,
|
BasicWrapper,
|
||||||
|
FormWrapper,
|
||||||
|
NewWrapper_V2,
|
||||||
// Stack
|
// Stack
|
||||||
StackCustom,
|
StackCustom,
|
||||||
TabBarBackground,
|
TabBarBackground,
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ export {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// OS Height
|
// OS Height
|
||||||
const OS_ANDROID_HEIGHT = 70
|
const OS_ANDROID_HEIGHT = 65
|
||||||
const OS_IOS_HEIGHT = 80
|
const OS_IOS_HEIGHT = 80
|
||||||
const OS_HEIGHT = Platform.OS === "ios" ? OS_IOS_HEIGHT : OS_ANDROID_HEIGHT
|
const OS_HEIGHT = Platform.OS === "ios" ? OS_IOS_HEIGHT : OS_ANDROID_HEIGHT
|
||||||
|
|
||||||
|
|||||||
148
docs/KEYBOARD-BUG-TEST.md
Normal file
148
docs/KEYBOARD-BUG-TEST.md
Normal file
@@ -0,0 +1,148 @@
|
|||||||
|
# Keyboard Bug Investigation
|
||||||
|
|
||||||
|
## 🐛 Problem
|
||||||
|
|
||||||
|
Footer terangkat dan muncul area putih di bawah saat keyboard ditutup setelah input ke TextInput.
|
||||||
|
|
||||||
|
## 📋 Test Cases
|
||||||
|
|
||||||
|
### Test 1: Minimal Wrapper
|
||||||
|
**File**: `test-keyboard-bug.tsx`
|
||||||
|
|
||||||
|
Wrapper yang sangat sederhana:
|
||||||
|
```typescript
|
||||||
|
<KeyboardAvoidingView behavior="height">
|
||||||
|
<ScrollView>
|
||||||
|
<TextInput />
|
||||||
|
</ScrollView>
|
||||||
|
<SafeAreaView>Footer</SafeAreaView>
|
||||||
|
</KeyboardAvoidingView>
|
||||||
|
```
|
||||||
|
|
||||||
|
**Expected**: Footer tetap di bawah
|
||||||
|
**Actual**: ? (To be tested)
|
||||||
|
|
||||||
|
### Test 2: Original NewWrapper
|
||||||
|
**File**: `components/_ShareComponent/NewWrapper.tsx`
|
||||||
|
|
||||||
|
Wrapper yang digunakan di production:
|
||||||
|
```typescript
|
||||||
|
<KeyboardAvoidingView behavior="height">
|
||||||
|
<View flex={0}>
|
||||||
|
<ScrollView>
|
||||||
|
{content}
|
||||||
|
</ScrollView>
|
||||||
|
</View>
|
||||||
|
<View position="absolute">Footer</View>
|
||||||
|
</KeyboardAvoidingView>
|
||||||
|
```
|
||||||
|
|
||||||
|
**Expected**: Footer tetap di bawah
|
||||||
|
**Actual**: Footer terangkat, ada putih di bawah
|
||||||
|
|
||||||
|
## 🔍 Possible Causes
|
||||||
|
|
||||||
|
### 1. KeyboardAvoidingView Behavior
|
||||||
|
- **Android**: `behavior="height"` mengurangi height view saat keyboard muncul
|
||||||
|
- **Issue**: Saat keyboard close, height tidak kembali ke semula
|
||||||
|
|
||||||
|
### 2. View Wrapper dengan flex: 0
|
||||||
|
- NewWrapper menggunakan `<View style={{ flex: 0 }}>`
|
||||||
|
- Ini membuat ScrollView tidak expand dengan benar
|
||||||
|
- **Fix**: Coba `<View style={{ flex: 1 }}>`
|
||||||
|
|
||||||
|
### 3. Footer dengan position: absolute
|
||||||
|
- Footer "melayang" di atas konten
|
||||||
|
- Tidak ikut terdorong saat keyboard muncul
|
||||||
|
- Saat keyboard close, footer kembali tapi layout sudah berubah
|
||||||
|
|
||||||
|
### 4. SafeAreaView Insets
|
||||||
|
- Safe area insets berubah saat keyboard muncul
|
||||||
|
- Footer tidak handle insets dengan benar
|
||||||
|
|
||||||
|
## 🧪 Test Scenarios
|
||||||
|
|
||||||
|
1. **Test Input Focus**
|
||||||
|
- [ ] Tap Input 1 → Keyboard muncul
|
||||||
|
- [ ] Footer tetap di bawah?
|
||||||
|
|
||||||
|
2. **Test Input Blur**
|
||||||
|
- [ ] Tap Input 1 → Keyboard muncul
|
||||||
|
- [ ] Tap outside → Keyboard close
|
||||||
|
- [ ] Footer kembali ke posisi?
|
||||||
|
- [ ] Ada putih di bawah?
|
||||||
|
|
||||||
|
3. **Test Multiple Inputs**
|
||||||
|
- [ ] Tap Input 1 → Input 2 → Input 3
|
||||||
|
- [ ] Keyboard pindah dengan smooth
|
||||||
|
- [ ] Footer tetap di bawah?
|
||||||
|
|
||||||
|
4. **Test Scroll After Close**
|
||||||
|
- [ ] Input → Close keyboard
|
||||||
|
- [ ] Scroll ke bawah
|
||||||
|
- [ ] Footer terlihat?
|
||||||
|
- [ ] Ada putih di bawah?
|
||||||
|
|
||||||
|
## 🔧 Potential Fixes
|
||||||
|
|
||||||
|
### Fix 1: Remove position: absolute
|
||||||
|
```typescript
|
||||||
|
// Before
|
||||||
|
<View style={{ position: "absolute", bottom: 0 }}>
|
||||||
|
{footer}
|
||||||
|
</View>
|
||||||
|
|
||||||
|
// After
|
||||||
|
<SafeAreaView>
|
||||||
|
{footer}
|
||||||
|
</SafeAreaView>
|
||||||
|
```
|
||||||
|
|
||||||
|
### Fix 2: Use flex: 1 instead of flex: 0
|
||||||
|
```typescript
|
||||||
|
// Before
|
||||||
|
<View style={{ flex: 0 }}>
|
||||||
|
<ScrollView />
|
||||||
|
</View>
|
||||||
|
|
||||||
|
// After
|
||||||
|
<View style={{ flex: 1 }}>
|
||||||
|
<ScrollView />
|
||||||
|
</View>
|
||||||
|
```
|
||||||
|
|
||||||
|
### Fix 3: Use KeyboardAwareScrollView
|
||||||
|
```typescript
|
||||||
|
import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view'
|
||||||
|
|
||||||
|
<KeyboardAwareScrollView>
|
||||||
|
{content}
|
||||||
|
</KeyboardAwareScrollView>
|
||||||
|
```
|
||||||
|
|
||||||
|
### Fix 4: Manual keyboard handling
|
||||||
|
```typescript
|
||||||
|
const [keyboardVisible, setKeyboardVisible] = useState(false);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const show = Keyboard.addListener('keyboardDidShow', () => setKeyboardVisible(true));
|
||||||
|
const hide = Keyboard.addListener('keyboardDidHide', () => setKeyboardVisible(false));
|
||||||
|
return () => { show.remove(); hide.remove(); }
|
||||||
|
}, []);
|
||||||
|
```
|
||||||
|
|
||||||
|
## 📝 Test Results
|
||||||
|
|
||||||
|
| Test | Platform | Result | Notes |
|
||||||
|
|------|----------|--------|-------|
|
||||||
|
| Test 1 (Minimal) | Android | ? | TBD |
|
||||||
|
| Test 1 (Minimal) | iOS | ? | TBD |
|
||||||
|
| Test 2 (Original) | Android | ❌ Bug | Footer terangkat |
|
||||||
|
| Test 2 (Original) | iOS | ? | TBD |
|
||||||
|
|
||||||
|
## 🎯 Next Steps
|
||||||
|
|
||||||
|
1. Test dengan `TestWrapper` (minimal wrapper)
|
||||||
|
2. Identifikasi apakah bug dari wrapper atau React Native
|
||||||
|
3. Apply fix yang sesuai
|
||||||
|
4. Test di semua screen
|
||||||
346
docs/NEWWRAPPER-KEYBOARD-IMPLEMENTATION.md
Normal file
346
docs/NEWWRAPPER-KEYBOARD-IMPLEMENTATION.md
Normal file
@@ -0,0 +1,346 @@
|
|||||||
|
# NewWrapper Keyboard Handling Implementation
|
||||||
|
|
||||||
|
## 📋 Problem Statement
|
||||||
|
|
||||||
|
NewWrapper saat ini memiliki masalah keyboard handling pada Android:
|
||||||
|
- Footer terangkat saat keyboard close
|
||||||
|
- Muncul area putih di bawah
|
||||||
|
- Input terpotong saat keyboard muncul
|
||||||
|
- Tidak ada auto-scroll ke focused input
|
||||||
|
|
||||||
|
## 🔍 Root Cause Analysis
|
||||||
|
|
||||||
|
### Current NewWrapper Structure
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
<KeyboardAvoidingView behavior={Platform.OS === "ios" ? "padding" : "height"}>
|
||||||
|
<View style={{ flex: 0 }}> // ← MASALAH 1: flex: 0
|
||||||
|
<ScrollView>
|
||||||
|
{children}
|
||||||
|
</ScrollView>
|
||||||
|
</View>
|
||||||
|
<View style={{ position: "absolute" }}> // ← MASALAH 2: position absolute
|
||||||
|
{footerComponent}
|
||||||
|
</View>
|
||||||
|
</KeyboardAvoidingView>
|
||||||
|
```
|
||||||
|
|
||||||
|
### Issues Identified
|
||||||
|
|
||||||
|
| Issue | Impact | Severity |
|
||||||
|
|-------|--------|----------|
|
||||||
|
| `behavior="height"` di Android | View di-resize, content terpotong | 🔴 High |
|
||||||
|
| `flex: 0` pada View wrapper | ScrollView tidak expand dengan benar | 🔴 High |
|
||||||
|
| Footer dengan `position: absolute` | Footer tidak ikut layout flow | 🟡 Medium |
|
||||||
|
| Tidak ada keyboard event handling | Tidak ada auto-scroll ke input | 🟡 Medium |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 💡 Proposed Solutions
|
||||||
|
|
||||||
|
### Option A: Full Integration (Breaking Changes)
|
||||||
|
|
||||||
|
Replace entire KeyboardAvoidingView logic dengan keyboard handling baru.
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
// NewWrapper.tsx
|
||||||
|
export function NewWrapper({ children, footerComponent }: Props) {
|
||||||
|
const { scrollViewRef, createFocusHandler } = useKeyboardForm();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<KeyboardAvoidingView behavior={Platform.OS === "ios" ? "padding" : undefined}>
|
||||||
|
<ScrollView ref={scrollViewRef} style={{ flex: 1 }}>
|
||||||
|
{children}
|
||||||
|
</ScrollView>
|
||||||
|
<SafeAreaView style={{ position: 'absolute', bottom: 0 }}>
|
||||||
|
{footerComponent}
|
||||||
|
</SafeAreaView>
|
||||||
|
</KeyboardAvoidingView>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**Pros:**
|
||||||
|
- ✅ Clean implementation
|
||||||
|
- ✅ Consistent behavior across all screens
|
||||||
|
- ✅ Single source of truth
|
||||||
|
|
||||||
|
**Cons:**
|
||||||
|
- ❌ **Breaking changes** - Semua screen yang pakai NewWrapper akan affected
|
||||||
|
- ❌ **Need to add onFocus handlers** to all TextInput/TextArea components
|
||||||
|
- ❌ **High risk** - May break existing screens
|
||||||
|
- ❌ **Requires testing** all screens that use NewWrapper
|
||||||
|
|
||||||
|
**Impact:**
|
||||||
|
- All existing screens using NewWrapper will be affected
|
||||||
|
- Need to add `onFocus` handlers to all inputs
|
||||||
|
- Need to wrap inputs with `View onStartShouldSetResponder`
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Option B: Opt-in Feature (Recommended) ⭐
|
||||||
|
|
||||||
|
Add flag to enable keyboard handling optionally (backward compatible).
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
// NewWrapper.tsx
|
||||||
|
interface NewWrapperProps {
|
||||||
|
// ... existing props
|
||||||
|
enableKeyboardHandling?: boolean; // Default: false
|
||||||
|
keyboardScrollOffset?: number; // Default: 100
|
||||||
|
}
|
||||||
|
|
||||||
|
export function NewWrapper(props: NewWrapperProps) {
|
||||||
|
const {
|
||||||
|
enableKeyboardHandling = false,
|
||||||
|
keyboardScrollOffset = 100,
|
||||||
|
...rest
|
||||||
|
} = props;
|
||||||
|
|
||||||
|
// Use keyboard hook if enabled
|
||||||
|
const keyboardForm = enableKeyboardHandling
|
||||||
|
? useKeyboardForm(keyboardScrollOffset)
|
||||||
|
: null;
|
||||||
|
|
||||||
|
// Render different structure based on flag
|
||||||
|
if (enableKeyboardHandling && keyboardForm) {
|
||||||
|
return renderWithKeyboardHandling(rest, keyboardForm);
|
||||||
|
}
|
||||||
|
|
||||||
|
return renderOriginal(rest);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**Pros:**
|
||||||
|
- ✅ **Backward compatible** - No breaking changes
|
||||||
|
- ✅ **Opt-in** - Screens yang butuh bisa enable
|
||||||
|
- ✅ **Safe** - Existing screens tetap bekerja
|
||||||
|
- ✅ **Gradual migration** - Bisa migrate screen by screen
|
||||||
|
- ✅ **Low risk** - Can test with new screens first
|
||||||
|
|
||||||
|
**Cons:**
|
||||||
|
- ⚠️ More code (duplicate logic)
|
||||||
|
- ⚠️ Need to maintain 2 implementations temporarily
|
||||||
|
|
||||||
|
**Usage Example:**
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
// Existing screens - No changes needed!
|
||||||
|
<NewWrapper footerComponent={<Footer />}>
|
||||||
|
<Content />
|
||||||
|
</NewWrapper>
|
||||||
|
|
||||||
|
// New screens with forms - Enable keyboard handling
|
||||||
|
<NewWrapper
|
||||||
|
enableKeyboardHandling
|
||||||
|
keyboardScrollOffset={100}
|
||||||
|
footerComponent={<Footer />}
|
||||||
|
>
|
||||||
|
<View onStartShouldSetResponder={() => true}>
|
||||||
|
<TextInputCustom onFocus={keyboardForm.createFocusHandler()} />
|
||||||
|
</View>
|
||||||
|
</NewWrapper>
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Option C: Create New Component (Safest)
|
||||||
|
|
||||||
|
Keep NewWrapper as is, create separate component for forms.
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
// Keep NewWrapper unchanged
|
||||||
|
// Use FormWrapper for forms (already created!)
|
||||||
|
```
|
||||||
|
|
||||||
|
**Pros:**
|
||||||
|
- ✅ **Zero risk** - NewWrapper tidak berubah
|
||||||
|
- ✅ **Clear separation** - Old vs New
|
||||||
|
- ✅ **Safe for existing screens**
|
||||||
|
- ✅ **FormWrapper already exists!**
|
||||||
|
|
||||||
|
**Cons:**
|
||||||
|
- ⚠️ Multiple wrapper components
|
||||||
|
- ⚠️ Confusion which one to use
|
||||||
|
|
||||||
|
**Usage:**
|
||||||
|
```typescript
|
||||||
|
// For regular screens
|
||||||
|
<NewWrapper>{content}</NewWrapper>
|
||||||
|
|
||||||
|
// For form screens
|
||||||
|
<FormWrapper footerComponent={<Footer />}>
|
||||||
|
<TextInputCustom />
|
||||||
|
</FormWrapper>
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📊 Comparison Matrix
|
||||||
|
|
||||||
|
| Criteria | Option A | Option B | Option C |
|
||||||
|
|----------|----------|----------|----------|
|
||||||
|
| **Backward Compatible** | ❌ | ✅ | ✅ |
|
||||||
|
| **Implementation Effort** | High | Medium | Low |
|
||||||
|
| **Risk Level** | 🔴 High | 🟡 Medium | 🟢 Low |
|
||||||
|
| **Code Duplication** | None | Temporary | Permanent |
|
||||||
|
| **Migration Required** | Yes | Gradual | No |
|
||||||
|
| **Testing Required** | All screens | New screens only | New screens only |
|
||||||
|
| **Recommended For** | Greenfield projects | Existing projects | Conservative teams |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🎯 Recommended Approach: Option B (Opt-in)
|
||||||
|
|
||||||
|
### Implementation Plan
|
||||||
|
|
||||||
|
#### Phase 1: Add Keyboard Handling to NewWrapper (Week 1)
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
// Add to NewWrapper interface
|
||||||
|
interface NewWrapperProps {
|
||||||
|
enableKeyboardHandling?: boolean;
|
||||||
|
keyboardScrollOffset?: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Implement dual rendering logic
|
||||||
|
if (enableKeyboardHandling) {
|
||||||
|
return renderWithKeyboardHandling(props);
|
||||||
|
}
|
||||||
|
return renderOriginal(props);
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Phase 2: Test with New Screens (Week 2)
|
||||||
|
|
||||||
|
- Test with Job Create 2 screen
|
||||||
|
- Verify auto-scroll works
|
||||||
|
- Verify footer stays in place
|
||||||
|
- Test on iOS and Android
|
||||||
|
|
||||||
|
#### Phase 3: Gradual Migration (Week 3-4)
|
||||||
|
|
||||||
|
Migrate screens one by one:
|
||||||
|
1. Event Create
|
||||||
|
2. Donation Create
|
||||||
|
3. Investment Create
|
||||||
|
4. Voting Create
|
||||||
|
5. Profile Create/Edit
|
||||||
|
|
||||||
|
#### Phase 4: Make Default (Next Major Version)
|
||||||
|
|
||||||
|
After thorough testing:
|
||||||
|
- Make `enableKeyboardHandling` default to `true`
|
||||||
|
- Deprecate old behavior
|
||||||
|
- Remove old code in next major version
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📝 Technical Requirements
|
||||||
|
|
||||||
|
### For NewWrapper with Keyboard Handling
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
// 1. Import hook
|
||||||
|
import { useKeyboardForm } from "@/hooks/useKeyboardForm";
|
||||||
|
|
||||||
|
// 2. Use hook in component
|
||||||
|
const { scrollViewRef, createFocusHandler } = useKeyboardForm(100);
|
||||||
|
|
||||||
|
// 3. Pass ref to ScrollView
|
||||||
|
<ScrollView ref={scrollViewRef}>
|
||||||
|
|
||||||
|
// 4. Wrap inputs with View
|
||||||
|
<View onStartShouldSetResponder={() => true}>
|
||||||
|
<TextInputCustom onFocus={createFocusHandler()} />
|
||||||
|
</View>
|
||||||
|
```
|
||||||
|
|
||||||
|
### Required Changes per Screen
|
||||||
|
|
||||||
|
For each screen that enables keyboard handling:
|
||||||
|
|
||||||
|
1. **Add `enableKeyboardHandling` prop**
|
||||||
|
2. **Wrap all TextInput/TextArea with View**
|
||||||
|
3. **Add `onFocus` handler to inputs**
|
||||||
|
4. **Test thoroughly**
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🧪 Testing Checklist
|
||||||
|
|
||||||
|
### For Each Screen
|
||||||
|
|
||||||
|
- [ ] Tap Input 1 → Auto-scroll to input
|
||||||
|
- [ ] Tap Input 2 → Auto-scroll to input
|
||||||
|
- [ ] Tap Input 3 → Auto-scroll to input
|
||||||
|
- [ ] Dismiss keyboard → Footer returns to position
|
||||||
|
- [ ] No white area at bottom
|
||||||
|
- [ ] Footer not raised
|
||||||
|
- [ ] Smooth transitions
|
||||||
|
- [ ] iOS compatibility
|
||||||
|
- [ ] Android compatibility
|
||||||
|
|
||||||
|
### Platforms to Test
|
||||||
|
|
||||||
|
- [ ] Android with navigation buttons
|
||||||
|
- [ ] Android with gesture navigation
|
||||||
|
- [ ] iOS with home button
|
||||||
|
- [ ] iOS with gesture (notch)
|
||||||
|
- [ ] Various screen sizes
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📋 Decision Factors
|
||||||
|
|
||||||
|
### Choose Option A if:
|
||||||
|
- ✅ Project is new (few existing screens)
|
||||||
|
- ✅ Team has time for full migration
|
||||||
|
- ✅ Want clean codebase immediately
|
||||||
|
- ✅ Accept short-term disruption
|
||||||
|
|
||||||
|
### Choose Option B if: ⭐
|
||||||
|
- ✅ Existing project with many screens
|
||||||
|
- ✅ Want zero disruption to users
|
||||||
|
- ✅ Prefer gradual migration
|
||||||
|
- ✅ Want to test thoroughly first
|
||||||
|
|
||||||
|
### Choose Option C if:
|
||||||
|
- ✅ Very conservative team
|
||||||
|
- ✅ Cannot risk any changes to existing screens
|
||||||
|
- ✅ OK with multiple wrapper components
|
||||||
|
- ✅ FormWrapper is sufficient
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🚀 Next Steps
|
||||||
|
|
||||||
|
1. **Review this document** with team
|
||||||
|
2. **Decide on approach** (A, B, or C)
|
||||||
|
3. **Create implementation ticket**
|
||||||
|
4. **Start with Phase 1**
|
||||||
|
5. **Test thoroughly**
|
||||||
|
6. **Roll out gradually**
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📚 Related Files
|
||||||
|
|
||||||
|
- `components/_ShareComponent/NewWrapper.tsx` - Current wrapper
|
||||||
|
- `components/_ShareComponent/FormWrapper.tsx` - New form wrapper
|
||||||
|
- `hooks/useKeyboardForm.ts` - Keyboard handling hook
|
||||||
|
- `screens/Job/ScreenJobCreate2.tsx` - Example implementation
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📞 Discussion Points
|
||||||
|
|
||||||
|
1. **Which option do you prefer?** (A, B, or C)
|
||||||
|
2. **How many screens use NewWrapper?**
|
||||||
|
3. **Team capacity for migration?**
|
||||||
|
4. **Timeline for implementation?**
|
||||||
|
5. **Risk tolerance level?**
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Last Updated:** 2026-04-01
|
||||||
|
**Status:** 📝 Under Discussion
|
||||||
67
hooks/useKeyboardForm.ts
Normal file
67
hooks/useKeyboardForm.ts
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
// useKeyboardForm.ts - Hook untuk keyboard handling pada form
|
||||||
|
import { Keyboard, ScrollView } from "react-native";
|
||||||
|
import { useState, useEffect, useRef } from "react";
|
||||||
|
|
||||||
|
export function useKeyboardForm(scrollOffset = 100) {
|
||||||
|
const scrollViewRef = useRef<ScrollView>(null);
|
||||||
|
const [keyboardHeight, setKeyboardHeight] = useState(0);
|
||||||
|
const [focusedInputY, setFocusedInputY] = useState<number | null>(null);
|
||||||
|
|
||||||
|
// Listen to keyboard events
|
||||||
|
useEffect(() => {
|
||||||
|
const keyboardDidShowListener = Keyboard.addListener(
|
||||||
|
'keyboardDidShow',
|
||||||
|
(e) => {
|
||||||
|
setKeyboardHeight(e.endCoordinates.height);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
const keyboardDidHideListener = Keyboard.addListener(
|
||||||
|
'keyboardDidHide',
|
||||||
|
() => {
|
||||||
|
setKeyboardHeight(0);
|
||||||
|
setFocusedInputY(null);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
keyboardDidShowListener.remove();
|
||||||
|
keyboardDidHideListener.remove();
|
||||||
|
};
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
// Scroll ke focused input
|
||||||
|
useEffect(() => {
|
||||||
|
if (focusedInputY !== null && keyboardHeight > 0 && scrollViewRef.current) {
|
||||||
|
setTimeout(() => {
|
||||||
|
scrollViewRef.current?.scrollTo({
|
||||||
|
y: Math.max(0, focusedInputY - scrollOffset),
|
||||||
|
animated: true,
|
||||||
|
});
|
||||||
|
}, 100);
|
||||||
|
}
|
||||||
|
}, [focusedInputY, keyboardHeight, scrollOffset]);
|
||||||
|
|
||||||
|
// Handler untuk track focused input position
|
||||||
|
const handleInputFocus = (yPosition: number) => {
|
||||||
|
setFocusedInputY(yPosition);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Helper untuk create onFocus handler
|
||||||
|
const createFocusHandler = () => {
|
||||||
|
return (e: any) => {
|
||||||
|
e.target?.measure((x: number, y: number, width: number, height: number, pageX: number, pageY: number) => {
|
||||||
|
if (pageY !== null) {
|
||||||
|
handleInputFocus(pageY);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
return {
|
||||||
|
scrollViewRef,
|
||||||
|
keyboardHeight,
|
||||||
|
focusedInputY,
|
||||||
|
handleInputFocus,
|
||||||
|
createFocusHandler,
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -152,6 +152,10 @@
|
|||||||
4A22447E41944D3A9780867B /* Remove signature files (Xcode workaround) */,
|
4A22447E41944D3A9780867B /* Remove signature files (Xcode workaround) */,
|
||||||
D15DF02DDCF369B4F14B238B /* [CP] Embed Pods Frameworks */,
|
D15DF02DDCF369B4F14B238B /* [CP] Embed Pods Frameworks */,
|
||||||
3F53CC1C3B278545F11A1CAE /* [CP-User] [RNFB] Core Configuration */,
|
3F53CC1C3B278545F11A1CAE /* [CP-User] [RNFB] Core Configuration */,
|
||||||
|
46ED08049A384B869D77364E /* Remove signature files (Xcode workaround) */,
|
||||||
|
92A25C61F4E34FB6A36E415B /* Remove signature files (Xcode workaround) */,
|
||||||
|
6440E59133324659A2C60D0B /* Remove signature files (Xcode workaround) */,
|
||||||
|
35CC0495598542E6801662A3 /* Remove signature files (Xcode workaround) */,
|
||||||
);
|
);
|
||||||
buildRules = (
|
buildRules = (
|
||||||
);
|
);
|
||||||
@@ -429,6 +433,74 @@
|
|||||||
shellPath = /bin/sh;
|
shellPath = /bin/sh;
|
||||||
shellScript = "# This script configures Expo modules and generates the modules provider file.\nbash -l -c \"./Pods/Target\\ Support\\ Files/Pods-HIPMIBadungConnect/expo-configure-project.sh\"\n";
|
shellScript = "# This script configures Expo modules and generates the modules provider file.\nbash -l -c \"./Pods/Target\\ Support\\ Files/Pods-HIPMIBadungConnect/expo-configure-project.sh\"\n";
|
||||||
};
|
};
|
||||||
|
46ED08049A384B869D77364E /* Remove signature files (Xcode workaround) */ = {
|
||||||
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
name = "Remove signature files (Xcode workaround)";
|
||||||
|
inputPaths = (
|
||||||
|
);
|
||||||
|
outputPaths = (
|
||||||
|
);
|
||||||
|
shellPath = /bin/sh;
|
||||||
|
shellScript = "
|
||||||
|
echo \"Remove signature files (Xcode workaround)\";
|
||||||
|
rm -rf \"$CONFIGURATION_BUILD_DIR/MapLibre.xcframework-ios.signature\";
|
||||||
|
";
|
||||||
|
};
|
||||||
|
92A25C61F4E34FB6A36E415B /* Remove signature files (Xcode workaround) */ = {
|
||||||
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
name = "Remove signature files (Xcode workaround)";
|
||||||
|
inputPaths = (
|
||||||
|
);
|
||||||
|
outputPaths = (
|
||||||
|
);
|
||||||
|
shellPath = /bin/sh;
|
||||||
|
shellScript = "
|
||||||
|
echo \"Remove signature files (Xcode workaround)\";
|
||||||
|
rm -rf \"$CONFIGURATION_BUILD_DIR/MapLibre.xcframework-ios.signature\";
|
||||||
|
";
|
||||||
|
};
|
||||||
|
6440E59133324659A2C60D0B /* Remove signature files (Xcode workaround) */ = {
|
||||||
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
name = "Remove signature files (Xcode workaround)";
|
||||||
|
inputPaths = (
|
||||||
|
);
|
||||||
|
outputPaths = (
|
||||||
|
);
|
||||||
|
shellPath = /bin/sh;
|
||||||
|
shellScript = "
|
||||||
|
echo \"Remove signature files (Xcode workaround)\";
|
||||||
|
rm -rf \"$CONFIGURATION_BUILD_DIR/MapLibre.xcframework-ios.signature\";
|
||||||
|
";
|
||||||
|
};
|
||||||
|
35CC0495598542E6801662A3 /* Remove signature files (Xcode workaround) */ = {
|
||||||
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
name = "Remove signature files (Xcode workaround)";
|
||||||
|
inputPaths = (
|
||||||
|
);
|
||||||
|
outputPaths = (
|
||||||
|
);
|
||||||
|
shellPath = /bin/sh;
|
||||||
|
shellScript = "
|
||||||
|
echo \"Remove signature files (Xcode workaround)\";
|
||||||
|
rm -rf \"$CONFIGURATION_BUILD_DIR/MapLibre.xcframework-ios.signature\";
|
||||||
|
";
|
||||||
|
};
|
||||||
/* End PBXShellScriptBuildPhase section */
|
/* End PBXShellScriptBuildPhase section */
|
||||||
|
|
||||||
/* Begin PBXSourcesBuildPhase section */
|
/* Begin PBXSourcesBuildPhase section */
|
||||||
@@ -471,7 +543,7 @@
|
|||||||
);
|
);
|
||||||
OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_DEBUG";
|
OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_DEBUG";
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = "com.anonymous.hipmi-mobile";
|
PRODUCT_BUNDLE_IDENTIFIER = "com.anonymous.hipmi-mobile";
|
||||||
PRODUCT_NAME = HIPMIBadungConnect;
|
PRODUCT_NAME = "HIPMIBadungConnect";
|
||||||
SWIFT_OBJC_BRIDGING_HEADER = "HIPMIBadungConnect/HIPMIBadungConnect-Bridging-Header.h";
|
SWIFT_OBJC_BRIDGING_HEADER = "HIPMIBadungConnect/HIPMIBadungConnect-Bridging-Header.h";
|
||||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||||
SWIFT_VERSION = 5.0;
|
SWIFT_VERSION = 5.0;
|
||||||
@@ -502,7 +574,7 @@
|
|||||||
);
|
);
|
||||||
OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_RELEASE";
|
OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_RELEASE";
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = "com.anonymous.hipmi-mobile";
|
PRODUCT_BUNDLE_IDENTIFIER = "com.anonymous.hipmi-mobile";
|
||||||
PRODUCT_NAME = HIPMIBadungConnect;
|
PRODUCT_NAME = "HIPMIBadungConnect";
|
||||||
SWIFT_OBJC_BRIDGING_HEADER = "HIPMIBadungConnect/HIPMIBadungConnect-Bridging-Header.h";
|
SWIFT_OBJC_BRIDGING_HEADER = "HIPMIBadungConnect/HIPMIBadungConnect-Bridging-Header.h";
|
||||||
SWIFT_VERSION = 5.0;
|
SWIFT_VERSION = 5.0;
|
||||||
TARGETED_DEVICE_FAMILY = "1,2";
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"originHash" : "e70d3525c8e2819a8b34f22909815dab5c700c25a06c32388f3930f7b3627768",
|
||||||
|
"pins" : [
|
||||||
|
{
|
||||||
|
"identity" : "maplibre-gl-native-distribution",
|
||||||
|
"kind" : "remoteSourceControl",
|
||||||
|
"location" : "https://github.com/maplibre/maplibre-gl-native-distribution",
|
||||||
|
"state" : {
|
||||||
|
"revision" : "c68c970ff3ece56cfc3b36849db70167fa208beb",
|
||||||
|
"version" : "6.17.1"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"version" : 3
|
||||||
|
}
|
||||||
71
screens/Home/HomeTabs.tsx
Normal file
71
screens/Home/HomeTabs.tsx
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
import { ICustomTab, ITabs } from "@/components/_Interface/types";
|
||||||
|
import { GStyles } from "@/styles/global-styles";
|
||||||
|
import { Ionicons } from "@expo/vector-icons";
|
||||||
|
import { router } from "expo-router";
|
||||||
|
import React from "react";
|
||||||
|
import { Platform, Text, TouchableOpacity, View } from "react-native";
|
||||||
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
||||||
|
import { MainColor } from "@/constants/color-palet";
|
||||||
|
|
||||||
|
interface HomeTabsProps {
|
||||||
|
tabs: ITabs[];
|
||||||
|
}
|
||||||
|
|
||||||
|
const CustomTab = ({ icon, label, isActive, onPress }: ICustomTab) => (
|
||||||
|
<TouchableOpacity
|
||||||
|
style={[GStyles.tabItem, isActive && GStyles.activeTab]}
|
||||||
|
onPress={onPress}
|
||||||
|
activeOpacity={0.7}
|
||||||
|
>
|
||||||
|
<View
|
||||||
|
style={[GStyles.iconContainer, isActive && GStyles.activeIconContainer]}
|
||||||
|
>
|
||||||
|
<Ionicons
|
||||||
|
name={icon as any}
|
||||||
|
size={18}
|
||||||
|
color={isActive ? "#fff" : "#666"}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
<Text style={[GStyles.tabLabel, isActive && GStyles.activeTabLabel]}>
|
||||||
|
{label}
|
||||||
|
</Text>
|
||||||
|
</TouchableOpacity>
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Home Tabs Component dengan Safe Area handling
|
||||||
|
*
|
||||||
|
* Component ini menggunakan pattern yang sama dengan Expo Router Tabs
|
||||||
|
* untuk konsistensi safe area di Android
|
||||||
|
*/
|
||||||
|
export default function HomeTabs({ tabs }: HomeTabsProps) {
|
||||||
|
const insets = useSafeAreaInsets();
|
||||||
|
const paddingBottom = Platform.OS === "android" ? insets.bottom : 0;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<View style={{ backgroundColor: MainColor.darkblue }}>
|
||||||
|
{/* Tabs content */}
|
||||||
|
<View style={GStyles.tabBar}>
|
||||||
|
<View style={GStyles.tabContainer}>
|
||||||
|
{tabs.map((e) => (
|
||||||
|
<CustomTab
|
||||||
|
key={e.id}
|
||||||
|
icon={e.icon}
|
||||||
|
label={e.label}
|
||||||
|
isActive={e.isActive}
|
||||||
|
onPress={() => {
|
||||||
|
// eslint-disable-next-line no-unused-expressions
|
||||||
|
e.disabled ? console.log("disabled") : router.push(e.path);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
{/* Safe area padding untuk Android */}
|
||||||
|
{Platform.OS === "android" && paddingBottom > 0 && (
|
||||||
|
<View style={{ height: paddingBottom, backgroundColor: MainColor.darkblue }} />
|
||||||
|
)}
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
/* eslint-disable react-hooks/exhaustive-deps */
|
/* eslint-disable react-hooks/exhaustive-deps */
|
||||||
import { BaseBox, ScrollableCustom, TextCustom } from "@/components";
|
import { BaseBox, NewWrapper_V2, ScrollableCustom, TextCustom } from "@/components";
|
||||||
import NewWrapper from "@/components/_ShareComponent/NewWrapper";
|
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
import { PAGINATION_DEFAULT_TAKE } from "@/constants/constans-value";
|
import { PAGINATION_DEFAULT_TAKE } from "@/constants/constans-value";
|
||||||
import { createPaginationComponents } from "@/helpers/paginationHelpers";
|
import { createPaginationComponents } from "@/helpers/paginationHelpers";
|
||||||
@@ -87,7 +86,8 @@ export default function Job_MainViewStatus2() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<NewWrapper
|
<NewWrapper_V2
|
||||||
|
contentPaddingHorizontal={16}
|
||||||
headerComponent={<View style={{ paddingTop: 8 }}>{scrollComponent}</View>}
|
headerComponent={<View style={{ paddingTop: 8 }}>{scrollComponent}</View>}
|
||||||
listData={pagination.listData}
|
listData={pagination.listData}
|
||||||
renderItem={renderJobItem}
|
renderItem={renderJobItem}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/* eslint-disable react-hooks/exhaustive-deps */
|
/* eslint-disable react-hooks/exhaustive-deps */
|
||||||
import { BaseBox, TextCustom, ViewWrapper } from "@/components";
|
import { BaseBox, NewWrapper_V2, TextCustom, ViewWrapper } from "@/components";
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
import { createPaginationComponents } from "@/helpers/paginationHelpers";
|
import { createPaginationComponents } from "@/helpers/paginationHelpers";
|
||||||
import { useAuth } from "@/hooks/use-auth";
|
import { useAuth } from "@/hooks/use-auth";
|
||||||
@@ -9,7 +9,6 @@ import { useFocusEffect } from "expo-router";
|
|||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { RefreshControl } from "react-native";
|
import { RefreshControl } from "react-native";
|
||||||
import NewWrapper from "@/components/_ShareComponent/NewWrapper";
|
|
||||||
import { PAGINATION_DEFAULT_TAKE } from "@/constants/constans-value";
|
import { PAGINATION_DEFAULT_TAKE } from "@/constants/constans-value";
|
||||||
|
|
||||||
export default function Job_ScreenArchive2() {
|
export default function Job_ScreenArchive2() {
|
||||||
@@ -56,7 +55,8 @@ export default function Job_ScreenArchive2() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<NewWrapper
|
<NewWrapper_V2
|
||||||
|
contentPaddingHorizontal={16}
|
||||||
listData={pagination.listData}
|
listData={pagination.listData}
|
||||||
renderItem={renderJobItem}
|
renderItem={renderJobItem}
|
||||||
refreshControl={
|
refreshControl={
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import {
|
|||||||
AvatarUsernameAndOtherComponent,
|
AvatarUsernameAndOtherComponent,
|
||||||
BoxWithHeaderSection,
|
BoxWithHeaderSection,
|
||||||
FloatingButton,
|
FloatingButton,
|
||||||
|
NewWrapper_V2,
|
||||||
SearchInput,
|
SearchInput,
|
||||||
Spacing,
|
Spacing,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
@@ -16,7 +17,6 @@ import { router, useFocusEffect } from "expo-router";
|
|||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { RefreshControl, View } from "react-native";
|
import { RefreshControl, View } from "react-native";
|
||||||
import NewWrapper from "@/components/_ShareComponent/NewWrapper";
|
|
||||||
import { PAGINATION_DEFAULT_TAKE } from "@/constants/constans-value";
|
import { PAGINATION_DEFAULT_TAKE } from "@/constants/constans-value";
|
||||||
|
|
||||||
const PAGE_SIZE = 10;
|
const PAGE_SIZE = 10;
|
||||||
@@ -74,10 +74,11 @@ export default function Job_ScreenBeranda2() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<NewWrapper
|
<NewWrapper_V2
|
||||||
|
contentPaddingHorizontal={16}
|
||||||
hideFooter
|
hideFooter
|
||||||
headerComponent={
|
headerComponent={
|
||||||
<View style={{ paddingTop: 8 }}>
|
<View >
|
||||||
<SearchInput
|
<SearchInput
|
||||||
placeholder="Cari pekerjaan"
|
placeholder="Cari pekerjaan"
|
||||||
onChangeText={_.debounce((text) => setSearch(text), 500)}
|
onChangeText={_.debounce((text) => setSearch(text), 500)}
|
||||||
|
|||||||
180
screens/Job/ScreenJobCreate.tsx
Normal file
180
screens/Job/ScreenJobCreate.tsx
Normal file
@@ -0,0 +1,180 @@
|
|||||||
|
import {
|
||||||
|
BoxButtonOnFooter,
|
||||||
|
ButtonCenteredOnly,
|
||||||
|
ButtonCustom,
|
||||||
|
InformationBox,
|
||||||
|
LandscapeFrameUploaded,
|
||||||
|
NewWrapper_V2,
|
||||||
|
Spacing,
|
||||||
|
StackCustom,
|
||||||
|
TextAreaCustom,
|
||||||
|
TextInputCustom,
|
||||||
|
} from "@/components";
|
||||||
|
import DIRECTORY_ID from "@/constants/directory-id";
|
||||||
|
import { useAuth } from "@/hooks/use-auth";
|
||||||
|
import { apiJobCreate } from "@/service/api-client/api-job";
|
||||||
|
import { uploadFileService } from "@/service/upload-service";
|
||||||
|
import pickImage from "@/utils/pickImage";
|
||||||
|
import { router } from "expo-router";
|
||||||
|
import { useState } from "react";
|
||||||
|
import { View } from "react-native";
|
||||||
|
import Toast from "react-native-toast-message";
|
||||||
|
|
||||||
|
interface JobCreateData {
|
||||||
|
title: string;
|
||||||
|
content: string;
|
||||||
|
deskripsi: string;
|
||||||
|
authorId: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function Job_ScreenCreate() {
|
||||||
|
const nextUrl = "/(application)/(user)/job/(tabs)/status?status=review";
|
||||||
|
const { user } = useAuth();
|
||||||
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
|
const [image, setImage] = useState<string | null>(null);
|
||||||
|
const [data, setData] = useState<JobCreateData>({
|
||||||
|
title: "",
|
||||||
|
content: "",
|
||||||
|
deskripsi: "",
|
||||||
|
authorId: "",
|
||||||
|
});
|
||||||
|
|
||||||
|
const handlerOnSubmit = async () => {
|
||||||
|
let imageId = "";
|
||||||
|
const newData = {
|
||||||
|
title: data.title,
|
||||||
|
content: data.content,
|
||||||
|
deskripsi: data.deskripsi,
|
||||||
|
authorId: user?.id,
|
||||||
|
imageId: "",
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!data.title || !data.content || !data.deskripsi || !user?.id) {
|
||||||
|
Toast.show({
|
||||||
|
type: "info",
|
||||||
|
text1: "Info",
|
||||||
|
text2: "Harap isi semua data",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
setIsLoading(true);
|
||||||
|
|
||||||
|
if (image === null || !image) {
|
||||||
|
const response = await apiJobCreate(newData);
|
||||||
|
if (response.success) {
|
||||||
|
Toast.show({
|
||||||
|
type: "success",
|
||||||
|
text1: "Berhasil",
|
||||||
|
text2: "Lowongan berhasil dibuat",
|
||||||
|
});
|
||||||
|
router.replace(nextUrl);
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const responseUploadImage = await uploadFileService({
|
||||||
|
imageUri: image,
|
||||||
|
dirId: DIRECTORY_ID.job_image,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (responseUploadImage.success) {
|
||||||
|
imageId = responseUploadImage.data.id;
|
||||||
|
}
|
||||||
|
|
||||||
|
const fixData = {
|
||||||
|
...newData,
|
||||||
|
imageId: imageId,
|
||||||
|
};
|
||||||
|
|
||||||
|
const response = await apiJobCreate(fixData);
|
||||||
|
if (response.success) {
|
||||||
|
Toast.show({
|
||||||
|
type: "success",
|
||||||
|
text1: "Berhasil",
|
||||||
|
text2: "Lowongan berhasil dibuat",
|
||||||
|
});
|
||||||
|
router.replace(nextUrl);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR]", error);
|
||||||
|
} finally {
|
||||||
|
setIsLoading(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const buttonSubmit = () => {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<BoxButtonOnFooter>
|
||||||
|
<ButtonCustom isLoading={isLoading} onPress={() => handlerOnSubmit()}>
|
||||||
|
Simpan
|
||||||
|
</ButtonCustom>
|
||||||
|
</BoxButtonOnFooter>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<NewWrapper_V2
|
||||||
|
enableKeyboardHandling
|
||||||
|
keyboardScrollOffset={100}
|
||||||
|
contentPaddingHorizontal={16}
|
||||||
|
footerComponent={buttonSubmit()}
|
||||||
|
>
|
||||||
|
<StackCustom gap={"xs"}>
|
||||||
|
<InformationBox text="Poster atau gambar lowongan kerja bersifat opsional, tidak wajib untuk dimasukkan dan upload lah gambar yang sesuai dengan deskripsi lowongan kerja." />
|
||||||
|
|
||||||
|
<LandscapeFrameUploaded image={image as string} />
|
||||||
|
<ButtonCenteredOnly
|
||||||
|
onPress={() => {
|
||||||
|
pickImage({
|
||||||
|
setImageUri: setImage,
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
icon="upload"
|
||||||
|
>
|
||||||
|
Upload
|
||||||
|
</ButtonCenteredOnly>
|
||||||
|
|
||||||
|
<Spacing />
|
||||||
|
|
||||||
|
<View onStartShouldSetResponder={() => true}>
|
||||||
|
<TextInputCustom
|
||||||
|
label="Judul Lowongan"
|
||||||
|
placeholder="Masukan Judul Lowongan Kerja"
|
||||||
|
required
|
||||||
|
value={data.title}
|
||||||
|
onChangeText={(value) => setData({ ...data, title: value })}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<View onStartShouldSetResponder={() => true}>
|
||||||
|
<TextAreaCustom
|
||||||
|
label="Syarat & Kualifikasi"
|
||||||
|
placeholder="Masukan Syarat & Kualifikasi Lowongan Kerja"
|
||||||
|
required
|
||||||
|
showCount
|
||||||
|
maxLength={1000}
|
||||||
|
value={data.content}
|
||||||
|
onChangeText={(value) => setData({ ...data, content: value })}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<View onStartShouldSetResponder={() => true}>
|
||||||
|
<TextAreaCustom
|
||||||
|
label="Deskripsi Lowongan"
|
||||||
|
placeholder="Masukan Deskripsi Lowongan Kerja"
|
||||||
|
required
|
||||||
|
showCount
|
||||||
|
maxLength={1000}
|
||||||
|
value={data.deskripsi}
|
||||||
|
onChangeText={(value) => setData({ ...data, deskripsi: value })}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
</StackCustom>
|
||||||
|
</NewWrapper_V2>
|
||||||
|
);
|
||||||
|
}
|
||||||
207
screens/Job/ScreenJobEdit.tsx
Normal file
207
screens/Job/ScreenJobEdit.tsx
Normal file
@@ -0,0 +1,207 @@
|
|||||||
|
/* eslint-disable react-hooks/exhaustive-deps */
|
||||||
|
import {
|
||||||
|
BaseBox,
|
||||||
|
BoxButtonOnFooter,
|
||||||
|
ButtonCenteredOnly,
|
||||||
|
ButtonCustom,
|
||||||
|
DummyLandscapeImage,
|
||||||
|
InformationBox,
|
||||||
|
LandscapeFrameUploaded,
|
||||||
|
LoaderCustom,
|
||||||
|
NewWrapper_V2,
|
||||||
|
Spacing,
|
||||||
|
StackCustom,
|
||||||
|
TextAreaCustom,
|
||||||
|
TextInputCustom,
|
||||||
|
} from "@/components";
|
||||||
|
import DIRECTORY_ID from "@/constants/directory-id";
|
||||||
|
import { apiJobGetOne, apiJobUpdateData } from "@/service/api-client/api-job";
|
||||||
|
import { deleteFileService, uploadFileService } from "@/service/upload-service";
|
||||||
|
import pickImage from "@/utils/pickImage";
|
||||||
|
import { router, useLocalSearchParams } from "expo-router";
|
||||||
|
import { useEffect, useState } from "react";
|
||||||
|
import { View } from "react-native";
|
||||||
|
import Toast from "react-native-toast-message";
|
||||||
|
|
||||||
|
export function Job_ScreenEdit() {
|
||||||
|
const { id } = useLocalSearchParams();
|
||||||
|
const [data, setData] = useState<any>({
|
||||||
|
title: "",
|
||||||
|
content: "",
|
||||||
|
deskripsi: "",
|
||||||
|
});
|
||||||
|
const [isLoadData, setIsLoadData] = useState(false);
|
||||||
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
|
|
||||||
|
const [imageUri, setImageUri] = useState<string | null>(null);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
onLoadData();
|
||||||
|
}, [id]);
|
||||||
|
|
||||||
|
const onLoadData = async () => {
|
||||||
|
try {
|
||||||
|
setIsLoadData(true);
|
||||||
|
const response = await apiJobGetOne({ id: id as string });
|
||||||
|
if (response.success) {
|
||||||
|
setData(response.data);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR]", error);
|
||||||
|
} finally {
|
||||||
|
setIsLoadData(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handlerOnUpdate = async () => {
|
||||||
|
if (!data.title || !data.content || !data.deskripsi) {
|
||||||
|
Toast.show({
|
||||||
|
type: "info",
|
||||||
|
text1: "Info",
|
||||||
|
text2: "Harap isi semua data",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
setIsLoading(true);
|
||||||
|
let newImageId = "";
|
||||||
|
|
||||||
|
if (imageUri) {
|
||||||
|
const responseUploadImage = await uploadFileService({
|
||||||
|
imageUri: imageUri,
|
||||||
|
dirId: DIRECTORY_ID.job_image,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (responseUploadImage.success) {
|
||||||
|
newImageId = responseUploadImage.data.id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data?.imageId) {
|
||||||
|
const responseDeleteImage = await deleteFileService({
|
||||||
|
id: data.imageId,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!responseDeleteImage.success) {
|
||||||
|
console.log("[ERROR DELETE IMAGE]", responseDeleteImage.message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const newData = {
|
||||||
|
title: data.title,
|
||||||
|
content: data.content,
|
||||||
|
deskripsi: data.deskripsi,
|
||||||
|
imageId: newImageId,
|
||||||
|
};
|
||||||
|
|
||||||
|
const response = await apiJobUpdateData({
|
||||||
|
id: id as string,
|
||||||
|
data: newData,
|
||||||
|
category: "edit",
|
||||||
|
});
|
||||||
|
|
||||||
|
if (response.success) {
|
||||||
|
Toast.show({
|
||||||
|
type: "success",
|
||||||
|
text1: response.message,
|
||||||
|
});
|
||||||
|
router.back();
|
||||||
|
} else {
|
||||||
|
Toast.show({
|
||||||
|
type: "info",
|
||||||
|
text1: "Info",
|
||||||
|
text2: response.message,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR]", error);
|
||||||
|
} finally {
|
||||||
|
setIsLoading(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const buttonSubmit = () => {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<BoxButtonOnFooter>
|
||||||
|
<ButtonCustom isLoading={isLoading} onPress={() => handlerOnUpdate()}>
|
||||||
|
Update
|
||||||
|
</ButtonCustom>
|
||||||
|
</BoxButtonOnFooter>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<NewWrapper_V2
|
||||||
|
enableKeyboardHandling
|
||||||
|
keyboardScrollOffset={100}
|
||||||
|
// contentPaddingHorizontal={16}
|
||||||
|
footerComponent={buttonSubmit()}
|
||||||
|
>
|
||||||
|
{isLoadData ? (
|
||||||
|
<LoaderCustom />
|
||||||
|
) : (
|
||||||
|
<View>
|
||||||
|
<InformationBox text="Poster atau gambar lowongan kerja bersifat opsional, tidak wajib untuk dimasukkan dan upload lah gambar yang sesuai dengan deskripsi lowongan kerja." />
|
||||||
|
|
||||||
|
{imageUri ? (
|
||||||
|
<LandscapeFrameUploaded image={imageUri as any} />
|
||||||
|
) : (
|
||||||
|
<BaseBox>
|
||||||
|
<DummyLandscapeImage imageId={data?.imageId} />
|
||||||
|
</BaseBox>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<ButtonCenteredOnly
|
||||||
|
onPress={() => {
|
||||||
|
pickImage({
|
||||||
|
setImageUri,
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
icon="upload"
|
||||||
|
>
|
||||||
|
Upload
|
||||||
|
</ButtonCenteredOnly>
|
||||||
|
|
||||||
|
<Spacing />
|
||||||
|
|
||||||
|
<View onStartShouldSetResponder={() => true}>
|
||||||
|
<TextInputCustom
|
||||||
|
label="Judul Lowongan"
|
||||||
|
placeholder="Masukan Judul Lowongan Kerja"
|
||||||
|
required
|
||||||
|
value={data.title}
|
||||||
|
onChangeText={(value) => setData({ ...data, title: value })}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<View onStartShouldSetResponder={() => true}>
|
||||||
|
<TextAreaCustom
|
||||||
|
label="Syarat & Kualifikasi"
|
||||||
|
placeholder="Masukan Syarat & Kualifikasi Lowongan Kerja"
|
||||||
|
required
|
||||||
|
showCount
|
||||||
|
maxLength={1000}
|
||||||
|
value={data.content}
|
||||||
|
onChangeText={(value) => setData({ ...data, content: value })}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<View onStartShouldSetResponder={() => true}>
|
||||||
|
<TextAreaCustom
|
||||||
|
label="Deskripsi Lowongan"
|
||||||
|
placeholder="Masukan Deskripsi Lowongan Kerja"
|
||||||
|
required
|
||||||
|
showCount
|
||||||
|
maxLength={1000}
|
||||||
|
value={data.deskripsi}
|
||||||
|
onChangeText={(value) => setData({ ...data, deskripsi: value })}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
|
</NewWrapper_V2>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -2,7 +2,7 @@ import {
|
|||||||
AvatarComp,
|
AvatarComp,
|
||||||
ClickableCustom,
|
ClickableCustom,
|
||||||
Grid,
|
Grid,
|
||||||
NewWrapper,
|
NewWrapper_V2,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
TextCustom,
|
TextCustom,
|
||||||
TextInputCustom,
|
TextInputCustom,
|
||||||
@@ -140,7 +140,9 @@ export default function UserSearchMainView_V2() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<NewWrapper
|
<NewWrapper_V2
|
||||||
|
hideFooter
|
||||||
|
contentPaddingHorizontal={16}
|
||||||
headerComponent={renderHeader(search, setSearch)}
|
headerComponent={renderHeader(search, setSearch)}
|
||||||
listData={pagination.listData}
|
listData={pagination.listData}
|
||||||
renderItem={renderItem}
|
renderItem={renderItem}
|
||||||
|
|||||||
@@ -196,15 +196,15 @@ export const GStyles = StyleSheet.create({
|
|||||||
// =============== BOTTOM BAR =============== //
|
// =============== BOTTOM BAR =============== //
|
||||||
bottomBar: {
|
bottomBar: {
|
||||||
backgroundColor: MainColor.darkblue,
|
backgroundColor: MainColor.darkblue,
|
||||||
borderTopColor: AccentColor.blue,
|
borderTopColor: AccentColor.darkblue,
|
||||||
// borderTopWidth: 0.5,
|
borderTopWidth: 1,
|
||||||
height: "100%",
|
height: "100%",
|
||||||
justifyContent: "center",
|
justifyContent: "center",
|
||||||
shadowColor: AccentColor.blue,
|
shadowColor: AccentColor.blue,
|
||||||
shadowOffset: { width: 0, height: -5},
|
shadowOffset: { width: 0, height: -5},
|
||||||
shadowOpacity: 0.4,
|
shadowOpacity: 0.4,
|
||||||
shadowRadius: 40,
|
shadowRadius: 40,
|
||||||
elevation: 8, // untuk Android
|
// elevation: 8, // untuk Android
|
||||||
},
|
},
|
||||||
bottomBarContainer: {
|
bottomBarContainer: {
|
||||||
paddingHorizontal: 25,
|
paddingHorizontal: 25,
|
||||||
|
|||||||
58
tasks/README.md
Normal file
58
tasks/README.md
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
# Tasks Directory
|
||||||
|
|
||||||
|
Direktori ini berisi task list untuk development dan perbaikan aplikasi HIPMI Mobile.
|
||||||
|
|
||||||
|
## 📋 Task List
|
||||||
|
|
||||||
|
| Task ID | Judul | Status | Prioritas |
|
||||||
|
|---------|-------|--------|-----------|
|
||||||
|
| [TASK-001](./TASK-001-footer-tabs-consistency.md) | Footer/Tabs Consistency Fix | ⏳ Pending | High |
|
||||||
|
|
||||||
|
## 📝 Cara Menggunakan Tasks
|
||||||
|
|
||||||
|
1. **Lihat task yang tersedia** di daftar atas
|
||||||
|
2. **Review task** untuk memahami scope dan acceptance criteria
|
||||||
|
3. **Kerjakan task** sesuai sub-tasks yang terdaftar
|
||||||
|
4. **Update status** setelah selesai
|
||||||
|
|
||||||
|
## ✅ Task Status Legend
|
||||||
|
|
||||||
|
- ⏳ **Pending**: Task belum dimulai
|
||||||
|
- 🔄 **In Progress**: Task sedang dikerjakan
|
||||||
|
- ✅ **Completed**: Task selesai
|
||||||
|
- ❌ **Cancelled**: Task dibatalkan
|
||||||
|
- ⚠️ **Blocked**: Task terhambat dependency
|
||||||
|
|
||||||
|
## 📌 Task Template
|
||||||
|
|
||||||
|
Untuk membuat task baru, gunakan format berikut:
|
||||||
|
|
||||||
|
```markdown
|
||||||
|
# Task: [Judul Task]
|
||||||
|
|
||||||
|
## 📋 Deskripsi
|
||||||
|
[Jelaskan masalah/fitur]
|
||||||
|
|
||||||
|
## 🎯 Tujuan
|
||||||
|
[Tujuan yang ingin dicapai]
|
||||||
|
|
||||||
|
## 🔍 Analisis Masalah Saat Ini
|
||||||
|
[Analisis kondisi existing]
|
||||||
|
|
||||||
|
## 📝 Sub-Tasks
|
||||||
|
- [ ] Task 1
|
||||||
|
- [ ] Task 2
|
||||||
|
- [ ] Task 3
|
||||||
|
|
||||||
|
## ✅ Acceptance Criteria
|
||||||
|
1. [Criteria 1]
|
||||||
|
2. [Criteria 2]
|
||||||
|
|
||||||
|
## 📚 Referensi
|
||||||
|
[Link referensi]
|
||||||
|
|
||||||
|
## 🔄 Status
|
||||||
|
**Status**: ⏳ Pending
|
||||||
|
**Created**: YYYY-MM-DD
|
||||||
|
**Updated**: YYYY-MM-DD
|
||||||
|
```
|
||||||
159
tasks/TASK-001-footer-tabs-consistency.md
Normal file
159
tasks/TASK-001-footer-tabs-consistency.md
Normal file
@@ -0,0 +1,159 @@
|
|||||||
|
# Task: Footer/Tabs Consistency Fix
|
||||||
|
|
||||||
|
## 📋 Deskripsi
|
||||||
|
|
||||||
|
Memperbaiki masalah footer/tabs yang tidak konsisten di Android, terutama pada perangkat dengan navigasi button di bagian bawah.
|
||||||
|
|
||||||
|
## 🎯 Tujuan
|
||||||
|
|
||||||
|
Footer/tabs responsif dan konsisten di semua platform (iOS & Android) pada semua fitur aplikasi.
|
||||||
|
|
||||||
|
## 🔍 Analisis Masalah Saat Ini
|
||||||
|
|
||||||
|
### Pendekatan yang Berbeda di Aplikasi
|
||||||
|
|
||||||
|
| Fitur | Pendekatan | File Layout | Status |
|
||||||
|
|-------|-----------|-------------|--------|
|
||||||
|
| **Home** | Custom Tabs (NewWrapper + TabSection) | `app/(application)/(user)/home.tsx` | ✅ Bekerja baik |
|
||||||
|
| **Event** | Expo Router Tabs | `app/(application)/(user)/event/(tabs)/_layout.tsx` | ⚠️ Tidak konsisten |
|
||||||
|
| **Job** | Expo Router Tabs | `app/(application)/(user)/job/(tabs)/_layout.tsx` | ⚠️ Tidak konsisten |
|
||||||
|
| **Voting** | Expo Router Tabs | `app/(application)/(user)/voting/(tabs)/_layout.tsx` | ⚠️ Tidak konsisten |
|
||||||
|
| **Donation** | Expo Router Tabs | `app/(application)/(user)/donation/(tabs)/_layout.tsx` | ⚠️ Tidak konsisten |
|
||||||
|
| **Investment** | Expo Router Tabs | `app/(application)/(user)/investment/(tabs)/_layout.tsx` | ⚠️ Tidak konsisten |
|
||||||
|
| **Collaboration** | Expo Router Tabs | `app/(application)/(user)/collaboration/(tabs)/_layout.tsx` | ⚠️ Tidak konsisten |
|
||||||
|
|
||||||
|
### Gejala Masalah
|
||||||
|
|
||||||
|
- ❌ Tabs tertutup navigasi button Android pada beberapa device
|
||||||
|
- ❌ Height tabs tidak konsisten antara iOS dan Android
|
||||||
|
- ❌ Padding/spacing tidak sesuai di perangkat tertentu
|
||||||
|
|
||||||
|
## 📝 Sub-Tasks
|
||||||
|
|
||||||
|
### Task 1.1: Investigasi Mendalam
|
||||||
|
- [ ] Test di berbagai device Android (dengan navigasi buttons dan gesture)
|
||||||
|
- [ ] Test di berbagai device iOS (dengan home button dan gesture)
|
||||||
|
- [ ] Catat device mana saja yang mengalami masalah
|
||||||
|
- [ ] Screenshot perbandingan tampilan yang benar dan salah
|
||||||
|
|
||||||
|
### Task 1.2: Perbaikan NewWrapper Component
|
||||||
|
**File**: `components/_ShareComponent/NewWrapper.tsx`
|
||||||
|
|
||||||
|
- [ ] Tambah prop `useSafeAreaForFooter` (optional, default: false)
|
||||||
|
- [ ] Import `useSafeAreaInsets` dari `react-native-safe-area-context`
|
||||||
|
- [ ] Hitung footer height berdasarkan platform + safe area insets
|
||||||
|
- [ ] Sesuaikan `paddingBottom` di FlatList dan ScrollView
|
||||||
|
- [ ] Tambah padding di footer container saat `useSafeAreaForFooter={true}`
|
||||||
|
- [ ] Test tanpa merusak existing functionality
|
||||||
|
|
||||||
|
### Task 1.3: Perbaikan TabSection Component
|
||||||
|
**File**: `screens/Home/tabSection.tsx`
|
||||||
|
|
||||||
|
- [ ] Tambah prop `useSafeArea` (optional, default: false)
|
||||||
|
- [ ] Bungkus dengan `SafeAreaView` saat `useSafeArea={true}`
|
||||||
|
- [ ] Sesuaikan padding untuk iOS (12) dan Android (5)
|
||||||
|
- [ ] Test tanpa merusak existing functionality
|
||||||
|
|
||||||
|
### Task 1.4: Update Home Screen
|
||||||
|
**File**: `app/(application)/(user)/home.tsx`
|
||||||
|
|
||||||
|
- [ ] Tambah prop `useSafeAreaForFooter` di `NewWrapper`
|
||||||
|
- [ ] Tambah prop `useSafeArea` di `TabSection`
|
||||||
|
- [ ] Test di iOS dan Android
|
||||||
|
|
||||||
|
### Task 1.5: Review Expo Router Tabs Configuration
|
||||||
|
**File**: `styles/tabs-styles.ts`
|
||||||
|
|
||||||
|
- [ ] Cek apakah `TabsStyles` sudah benar untuk iOS dan Android
|
||||||
|
- [ ] Verifikasi height tabs (iOS: 80, Android: 70)
|
||||||
|
- [ ] Cek safe area handling di `TabBarBackground`
|
||||||
|
- [ ] Test semua fitur yang menggunakan Expo Router Tabs
|
||||||
|
|
||||||
|
### Task 1.6: Testing & Validasi
|
||||||
|
- [ ] Test Home screen di iOS
|
||||||
|
- [ ] Test Home screen di Android
|
||||||
|
- [ ] Test Event tabs di iOS
|
||||||
|
- [ ] Test Event tabs di Android
|
||||||
|
- [ ] Test Job tabs di iOS
|
||||||
|
- [ ] Test Job tabs di Android
|
||||||
|
- [ ] Test Voting tabs di iOS
|
||||||
|
- [ ] Test Voting tabs di Android
|
||||||
|
- [ ] Test Donation tabs di iOS
|
||||||
|
- [ ] Test Donation tabs di Android
|
||||||
|
- [ ] Test Investment tabs di iOS
|
||||||
|
- [ ] Test Investment tabs di Android
|
||||||
|
- [ ] Test Collaboration tabs di iOS
|
||||||
|
- [ ] Test Collaboration tabs di Android
|
||||||
|
|
||||||
|
## ✅ Acceptance Criteria
|
||||||
|
|
||||||
|
1. **Home Screen**:
|
||||||
|
- Tabs tidak tertutup navigasi Android
|
||||||
|
- Tabs terlihat jelas di semua device
|
||||||
|
- Pull-to-refresh berfungsi normal
|
||||||
|
|
||||||
|
2. **Expo Router Tabs** (Event, Job, Voting, Donation, Investment, Collaboration):
|
||||||
|
- Tabs tidak tertutup navigasi Android
|
||||||
|
- Height konsisten di semua device Android
|
||||||
|
- Height konsisten di semua device iOS
|
||||||
|
|
||||||
|
3. **General**:
|
||||||
|
- Tidak ada regression di fitur existing
|
||||||
|
- TypeScript compile tanpa error
|
||||||
|
- Lint passing
|
||||||
|
|
||||||
|
## 📚 Referensi
|
||||||
|
|
||||||
|
- [React Native Safe Area Context](https://github.com/th3rdwave/react-native-safe-area-context)
|
||||||
|
- [Expo Router Tabs Documentation](https://docs.expo.dev/router/reference/tabs/)
|
||||||
|
- [Android Navigation Patterns](https://developer.android.com/guide/navigation)
|
||||||
|
|
||||||
|
## 📝 Notes
|
||||||
|
|
||||||
|
- **Prioritas**: Task 1.2, 1.3, 1.4 (untuk Home screen)
|
||||||
|
- **Low Priority**: Task 1.5 (jika Expo Router Tabs sudah OK)
|
||||||
|
- **Jangan**: Mengubah struktur `<Tabs>` tanpa konfirmasi
|
||||||
|
- **Penting**: Test di device fisik, bukan hanya simulator
|
||||||
|
|
||||||
|
## 🔄 Status
|
||||||
|
|
||||||
|
**Status**: ✅ Completed
|
||||||
|
**Created**: 2026-04-01
|
||||||
|
**Updated**: 2026-04-01
|
||||||
|
**Completed**: 2026-04-01
|
||||||
|
|
||||||
|
## 📝 Implementation Summary
|
||||||
|
|
||||||
|
### Changes Made
|
||||||
|
|
||||||
|
1. **NewWrapper Component** (`components/_ShareComponent/NewWrapper.tsx`)
|
||||||
|
- Added `useSafeAreaForFooter` prop
|
||||||
|
- Added `useSafeAreaInsets()` hook
|
||||||
|
- Dynamic footer height calculation based on platform + safe area insets
|
||||||
|
- Applied safe area padding to footer container
|
||||||
|
|
||||||
|
2. **TabSection Component** (`screens/Home/tabSection.tsx`)
|
||||||
|
- Added `useSafeArea` prop
|
||||||
|
- Wrapped with `SafeAreaView` when `useSafeArea={true}`
|
||||||
|
- Platform-specific padding (iOS: 12, Android: 5)
|
||||||
|
|
||||||
|
3. **Home Screen** (`app/(application)/(user)/home.tsx`)
|
||||||
|
- Enabled `useSafeAreaForFooter` on `NewWrapper`
|
||||||
|
- Enabled `useSafeArea` on `TabSection`
|
||||||
|
|
||||||
|
4. **Expo Router Tabs** (`styles/tabs-styles.ts`)
|
||||||
|
- Reviewed - no changes needed (already configured correctly)
|
||||||
|
|
||||||
|
### Test Results
|
||||||
|
|
||||||
|
- ✅ TypeScript compilation: No errors
|
||||||
|
- ✅ Linting: No new errors (only pre-existing warnings)
|
||||||
|
- ✅ Code changes: 3 files, +77 insertions, -23 deletions
|
||||||
|
|
||||||
|
### Next Steps for User Testing
|
||||||
|
|
||||||
|
Test on physical devices:
|
||||||
|
- [ ] Android with navigation buttons
|
||||||
|
- [ ] Android with gesture navigation
|
||||||
|
- [ ] iOS with home button
|
||||||
|
- [ ] iOS with gesture (notch devices)
|
||||||
134
tasks/TASK-002-expo-router-tabs-safe-area.md
Normal file
134
tasks/TASK-002-expo-router-tabs-safe-area.md
Normal file
@@ -0,0 +1,134 @@
|
|||||||
|
# Task: TASK-002 - Expo Router Tabs Safe Area Fix
|
||||||
|
|
||||||
|
## 📋 Deskripsi
|
||||||
|
|
||||||
|
Expo Router Tabs di beberapa fitur (Event, Job, Voting, Donation, Investment) tertutup oleh navigation buttons Android pada device tertentu.
|
||||||
|
|
||||||
|
## 🎯 Tujuan
|
||||||
|
|
||||||
|
Tabs di semua fitur menggunakan Expo Router harus responsif dan tidak tertutup navigation buttons Android.
|
||||||
|
|
||||||
|
## 🔍 Analisis Masalah
|
||||||
|
|
||||||
|
### Fitur yang Terkena Dampak
|
||||||
|
|
||||||
|
| Fitur | Layout File | Status |
|
||||||
|
|-------|-------------|--------|
|
||||||
|
| Event | `app/(application)/(user)/event/(tabs)/_layout.tsx` | ❌ Tidak responsif |
|
||||||
|
| Job | `app/(application)/(user)/job/(tabs)/_layout.tsx` | ❌ Tidak responsif |
|
||||||
|
| Voting | `app/(application)/(user)/voting/(tabs)/_layout.tsx` | ❌ Tidak responsif |
|
||||||
|
| Donation | `app/(application)/(user)/donation/(tabs)/_layout.tsx` | ❌ Tidak responsif |
|
||||||
|
| Investment | `app/(application)/(user)/investment/(tabs)/_layout.tsx` | ❌ Tidak responsif |
|
||||||
|
| Collaboration | `app/(application)/(user)/collaboration/(tabs)/_layout.tsx` | ❌ Tidak responsif |
|
||||||
|
|
||||||
|
### Root Cause
|
||||||
|
|
||||||
|
`TabsStyles` di `styles/tabs-styles.ts` tidak menghormati safe area insets Android dengan benar.
|
||||||
|
|
||||||
|
## 📝 Solusi
|
||||||
|
|
||||||
|
### Opsi 1: Custom Tab Bar Component (RECOMMENDED)
|
||||||
|
|
||||||
|
Buat custom `tabBar` component yang menggunakan `SafeAreaView` untuk wrapping tab bar.
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
// styles/tabs-styles.ts
|
||||||
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
||||||
|
|
||||||
|
export function CustomTabBar(props: any) {
|
||||||
|
const insets = useSafeAreaInsets();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<View style={{
|
||||||
|
paddingBottom: insets.bottom,
|
||||||
|
backgroundColor: MainColor.darkblue
|
||||||
|
}}>
|
||||||
|
<BottomTabBar {...props} />
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Opsi 2: Update tabBarStyle dengan insets
|
||||||
|
|
||||||
|
Tambahkan dynamic height berdasarkan safe area insets.
|
||||||
|
|
||||||
|
## ✅ Acceptance Criteria
|
||||||
|
|
||||||
|
1. Tabs tidak tertutup navigation buttons Android
|
||||||
|
2. Tabs height konsisten di semua device
|
||||||
|
3. Tidak ada regression di iOS
|
||||||
|
4. Semua 6 fitur ter-fix
|
||||||
|
|
||||||
|
## 🔄 Status
|
||||||
|
|
||||||
|
**Status**: ✅ COMPLETED
|
||||||
|
**Created**: 2026-04-01
|
||||||
|
**Updated**: 2026-04-01
|
||||||
|
**Completed**: 2026-04-01
|
||||||
|
|
||||||
|
## 📝 Implementation Summary
|
||||||
|
|
||||||
|
### Changes Made
|
||||||
|
|
||||||
|
**Tabs Layout Wrappers** - Updated 6 layout files dengan safe area handling:
|
||||||
|
- ✅ `app/(application)/(user)/event/(tabs)/_layout.tsx`
|
||||||
|
- ✅ `app/(application)/(user)/job/(tabs)/_layout.tsx`
|
||||||
|
- ✅ `app/(application)/(user)/voting/(tabs)/_layout.tsx`
|
||||||
|
- ✅ `app/(application)/(user)/donation/(tabs)/_layout.tsx`
|
||||||
|
- ✅ `app/(application)/(user)/investment/(tabs)/_layout.tsx`
|
||||||
|
- ✅ `app/(application)/(user)/collaboration/(tabs)/_layout.tsx`
|
||||||
|
|
||||||
|
### Implementation Pattern
|
||||||
|
|
||||||
|
Setiap layout file menggunakan wrapper component pattern:
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
function TabsWrapper() {
|
||||||
|
const insets = useSafeAreaInsets();
|
||||||
|
const paddingBottom = Platform.OS === "android" ? insets.bottom : 0;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<View style={{ flex: 1, backgroundColor: MainColor.darkblue }}>
|
||||||
|
<Tabs screenOptions={TabsStyles}>
|
||||||
|
{/* Tabs content */}
|
||||||
|
</Tabs>
|
||||||
|
{/* Safe area padding untuk Android */}
|
||||||
|
{Platform.OS === "android" && paddingBottom > 0 && (
|
||||||
|
<View style={{ height: paddingBottom, backgroundColor: MainColor.darkblue }} />
|
||||||
|
)}
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Files Changed
|
||||||
|
- ✅ 6x Tabs layout files (Updated with safe area wrapper)
|
||||||
|
|
||||||
|
### Test Results
|
||||||
|
- ✅ TypeScript compilation: No errors
|
||||||
|
- ✅ All 6 tabs layouts: Safe area implemented
|
||||||
|
- ✅ Platform-specific: Android only (iOS unaffected)
|
||||||
|
- ✅ NewWrapper: Unchanged (original version preserved)
|
||||||
|
|
||||||
|
### Features Fixed
|
||||||
|
|
||||||
|
| Feature | Layout File | Status |
|
||||||
|
|---------|-------------|--------|
|
||||||
|
| Event | `app/(application)/(user)/event/(tabs)/_layout.tsx` | ✅ Fixed |
|
||||||
|
| Job | `app/(application)/(user)/job/(tabs)/_layout.tsx` | ✅ Fixed |
|
||||||
|
| Voting | `app/(application)/(user)/voting/(tabs)/_layout.tsx` | ✅ Fixed |
|
||||||
|
| Donation | `app/(application)/(user)/donation/(tabs)/_layout.tsx` | ✅ Fixed |
|
||||||
|
| Investment | `app/(application)/(user)/investment/(tabs)/_layout.tsx` | ✅ Fixed |
|
||||||
|
| Collaboration | `app/(application)/(user)/collaboration/(tabs)/_layout.tsx` | ✅ Fixed |
|
||||||
|
|
||||||
|
### Next Steps for User Testing
|
||||||
|
|
||||||
|
Test all 6 features on physical Android devices with:
|
||||||
|
- [ ] Navigation buttons (back, home, recent)
|
||||||
|
- [ ] Gesture navigation
|
||||||
|
- [ ] Various screen sizes
|
||||||
|
|
||||||
|
Test on iOS to ensure no regression:
|
||||||
|
- [ ] Home button devices
|
||||||
|
- [ ] Gesture devices (notch)
|
||||||
110
tasks/TASK-003-footer-terangkat-keyboard-close.md
Normal file
110
tasks/TASK-003-footer-terangkat-keyboard-close.md
Normal file
@@ -0,0 +1,110 @@
|
|||||||
|
# Task: TASK-003 - Footer Terangkat Saat Keyboard Close
|
||||||
|
|
||||||
|
## 📋 Deskripsi
|
||||||
|
|
||||||
|
Bug: Setelah input ke text input dan menutup keyboard, bagian bawah layar berwarna putih seakan footer terangkat.
|
||||||
|
|
||||||
|
## 🎯 Tujuan
|
||||||
|
|
||||||
|
Footer tetap di posisi yang benar setelah keyboard ditutup, tidak ada warna putih di bawah.
|
||||||
|
|
||||||
|
## 🔍 Analisis Masalah
|
||||||
|
|
||||||
|
### Gejala
|
||||||
|
- ✅ Terjadi di emulator dan device
|
||||||
|
- ✅ Setelah input ke text input
|
||||||
|
- ✅ Saat keyboard menutup (close)
|
||||||
|
- ✅ Bagian bawah berwarna putih
|
||||||
|
- ✅ Footer seperti terangkat
|
||||||
|
|
||||||
|
### Root Cause (Diduga)
|
||||||
|
|
||||||
|
1. **KeyboardAvoidingView behavior**
|
||||||
|
- `behavior={Platform.OS === "ios" ? "padding" : "height"}`
|
||||||
|
- Android menggunakan `height` yang bisa menyebabkan layout shift
|
||||||
|
|
||||||
|
2. **Keyboard listener tidak clean up**
|
||||||
|
- Event listener mungkin masih aktif setelah keyboard close
|
||||||
|
|
||||||
|
3. **Layout tidak re-render setelah keyboard close**
|
||||||
|
- Component tidak detect keyboard state change
|
||||||
|
|
||||||
|
## 📝 Sub-Tasks
|
||||||
|
|
||||||
|
### Task 3.1: Investigasi
|
||||||
|
- [ ] Identifikasi screen mana yang mengalami bug ini
|
||||||
|
- [ ] Test di berbagai screen dengan text input
|
||||||
|
- [ ] Catat pola kejadian bug
|
||||||
|
|
||||||
|
### Task 3.2: Perbaikan NewWrapper - Keyboard Handling
|
||||||
|
- [ ] Tambah keyboard event listener
|
||||||
|
- [ ] Handle keyboard show/hide events
|
||||||
|
- [ ] Force re-render saat keyboard close
|
||||||
|
- [ ] Test tanpa merusak existing functionality
|
||||||
|
|
||||||
|
### Task 3.3: Perbaikan KeyboardAvoidingView
|
||||||
|
- [ ] Evaluasi behavior untuk Android
|
||||||
|
- [ ] Coba gunakan `KeyboardAwareScrollView` jika perlu
|
||||||
|
- [ ] Test smooth keyboard transition
|
||||||
|
|
||||||
|
### Task 3.4: Testing & Validasi
|
||||||
|
- [ ] Test di emulator Android
|
||||||
|
- [ ] Test di device Android
|
||||||
|
- [ ] Test di emulator iOS
|
||||||
|
- [ ] Test di device iOS
|
||||||
|
- [ ] Pastikan tidak ada regression
|
||||||
|
|
||||||
|
## ✅ Acceptance Criteria
|
||||||
|
|
||||||
|
1. **Footer tetap di posisi** setelah keyboard close
|
||||||
|
2. **Tidak ada warna putih** di bagian bawah
|
||||||
|
3. **Keyboard transition smooth** (no lag)
|
||||||
|
4. **Input tetap berfungsi** normal
|
||||||
|
5. **No regression** di fitur lain
|
||||||
|
|
||||||
|
## 📚 Referensi
|
||||||
|
|
||||||
|
- [React Native KeyboardAvoidingView](https://reactnative.dev/docs/keyboardavoidingview)
|
||||||
|
- [React Native Keyboard](https://reactnative.dev/docs/keyboard)
|
||||||
|
- [KeyboardAwareScrollView](https://github.com/APSL/react-native-keyboard-aware-scroll-view)
|
||||||
|
|
||||||
|
## 🔄 Status
|
||||||
|
|
||||||
|
**Status**: ❌ Reverted
|
||||||
|
**Created**: 2026-04-01
|
||||||
|
**Updated**: 2026-04-01
|
||||||
|
**Completed**: -
|
||||||
|
|
||||||
|
## 📝 Notes
|
||||||
|
|
||||||
|
Implementation sudah dilakukan tetapi di-revert karena berefek pada tampilan lain.
|
||||||
|
Perlu pendekatan yang berbeda untuk fix bug ini.
|
||||||
|
|
||||||
|
### Root Cause (Identified)
|
||||||
|
|
||||||
|
1. **Footer menggunakan `position: absolute`** - Footer melayang di atas konten, tidak ikut layout flow
|
||||||
|
2. **`KeyboardAvoidingView` behavior** - Layout shift saat keyboard show/hide
|
||||||
|
3. **View wrapper dengan `flex: 0`** - ScrollView tidak expand dengan benar
|
||||||
|
|
||||||
|
### Implementation Attempted
|
||||||
|
|
||||||
|
**File**: `components/_ShareComponent/NewWrapper.tsx`
|
||||||
|
|
||||||
|
#### Perubahan yang dicoba:
|
||||||
|
- Hapus `View` wrapper dengan `flex: 1` di FlatList mode
|
||||||
|
- Hapus `View` wrapper dengan `flex: 0` di ScrollView mode
|
||||||
|
- Footer menggunakan `SafeAreaView` (normal flow, bukan position absolute)
|
||||||
|
- Hapus `styles.footerContainer` dengan `position: absolute`
|
||||||
|
|
||||||
|
### Why Reverted
|
||||||
|
|
||||||
|
❌ Berdampak pada tampilan lain (footer terangkat/berantakan)
|
||||||
|
❌ Perlu pendekatan yang lebih hati-hati
|
||||||
|
❌ Perlu test lebih menyeluruh di semua screen
|
||||||
|
|
||||||
|
### Next Steps
|
||||||
|
|
||||||
|
1. **Analisis lebih detail** - Cek screen mana saja yang affected
|
||||||
|
2. **Pendekatan bertahap** - Fix per screen atau per type
|
||||||
|
3. **Test menyeluruh** - Pastikan tidak ada regression
|
||||||
|
4. **Alternative solution** - Mungkin perlu custom keyboard handling
|
||||||
344
tasks/TASK-004-newwrapper-migration.md
Normal file
344
tasks/TASK-004-newwrapper-migration.md
Normal file
@@ -0,0 +1,344 @@
|
|||||||
|
# TASK-004: NewWrapper_V2 Gradual Migration
|
||||||
|
|
||||||
|
## 📋 Deskripsi
|
||||||
|
|
||||||
|
Migrasi bertahap dari `NewWrapper` ke `NewWrapper_V2` untuk memperbaiki bug keyboard handling (footer terangkat, area putih, input terpotong).
|
||||||
|
|
||||||
|
## 🎯 Tujuan
|
||||||
|
|
||||||
|
1. Replace `NewWrapper` → `NewWrapper_V2` secara bertahap
|
||||||
|
2. Fix keyboard handling issues di semua form screens
|
||||||
|
3. Zero breaking changes dengan gradual migration
|
||||||
|
4. Clean up test components yang tidak diperlukan
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📊 Migration Priority
|
||||||
|
|
||||||
|
### **Phase 1: Job Screens** (Week 1) - CURRENT
|
||||||
|
- [x] `screens/Job/ScreenJobCreate2.tsx` → Already using keyboard handling
|
||||||
|
- [ ] `screens/Job/ScreenJobCreate.tsx` → Migrate to NewWrapper_V2
|
||||||
|
- [ ] `screens/Job/ScreenJobEdit.tsx` → Migrate to NewWrapper_V2
|
||||||
|
- [ ] Delete test files after migration
|
||||||
|
|
||||||
|
### **Phase 2: Event & Profile Screens** (Week 2)
|
||||||
|
- [ ] `screens/Event/ScreenEventCreate.tsx`
|
||||||
|
- [ ] `screens/Event/ScreenEventEdit.tsx`
|
||||||
|
- [ ] `screens/Profile/ScreenProfileCreate.tsx`
|
||||||
|
- [ ] `screens/Profile/ScreenProfileEdit.tsx`
|
||||||
|
|
||||||
|
### **Phase 3: Other Form Screens** (Week 3)
|
||||||
|
- [ ] `screens/Donation/` - All create/edit screens
|
||||||
|
- [ ] `screens/Investment/` - All create/edit screens
|
||||||
|
- [ ] `screens/Voting/` - All create/edit screens
|
||||||
|
|
||||||
|
### **Phase 4: Complex Screens** (Week 4)
|
||||||
|
- [ ] `screens/Forum/` - Create/edit with rich text
|
||||||
|
- [ ] `screens/Collaboration/` - Complex forms
|
||||||
|
- [ ] Other complex forms
|
||||||
|
|
||||||
|
### **Phase 5: Cleanup** (Week 5)
|
||||||
|
- [ ] Remove old `NewWrapper.tsx` (or deprecate)
|
||||||
|
- [ ] Rename `NewWrapper_V2.tsx` → `NewWrapper.tsx`
|
||||||
|
- [ ] Update documentation
|
||||||
|
- [ ] Delete test components
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🔧 Task Details
|
||||||
|
|
||||||
|
### **Task 4.1: Job Screens Migration** ✅ IN PROGRESS
|
||||||
|
|
||||||
|
**Files to migrate:**
|
||||||
|
1. `screens/Job/ScreenJobCreate.tsx`
|
||||||
|
2. `screens/Job/ScreenJobEdit.tsx`
|
||||||
|
|
||||||
|
**Changes per file:**
|
||||||
|
```typescript
|
||||||
|
// BEFORE
|
||||||
|
import { NewWrapper } from "@/components";
|
||||||
|
|
||||||
|
<NewWrapper footerComponent={buttonSubmit()}>
|
||||||
|
<TextInputCustom label="..." />
|
||||||
|
</NewWrapper>
|
||||||
|
|
||||||
|
// AFTER
|
||||||
|
import { NewWrapper_V2 } from "@/components";
|
||||||
|
|
||||||
|
<NewWrapper_V2
|
||||||
|
enableKeyboardHandling
|
||||||
|
keyboardScrollOffset={100}
|
||||||
|
footerComponent={buttonSubmit()}
|
||||||
|
>
|
||||||
|
<View onStartShouldSetResponder={() => true}>
|
||||||
|
<TextInputCustom label="..." />
|
||||||
|
</View>
|
||||||
|
</NewWrapper_V2>
|
||||||
|
```
|
||||||
|
|
||||||
|
**Checklist per screen:**
|
||||||
|
- [ ] Replace `NewWrapper` → `NewWrapper_V2`
|
||||||
|
- [ ] Add `enableKeyboardHandling` prop
|
||||||
|
- [ ] Wrap all TextInput/TextArea with `View onStartShouldSetResponder`
|
||||||
|
- [ ] Test on Android (navigation buttons)
|
||||||
|
- [ ] Test on Android (gesture)
|
||||||
|
- [ ] Test on iOS
|
||||||
|
- [ ] Verify auto-scroll works
|
||||||
|
- [ ] Verify footer stays in place
|
||||||
|
- [ ] Verify no white area
|
||||||
|
|
||||||
|
**Cleanup after migration:**
|
||||||
|
- [ ] Delete `screens/Job/ScreenJobCreate2.tsx` (test file)
|
||||||
|
- [ ] Delete `screens/Job/ScreenJobEdit2.tsx` (test file)
|
||||||
|
- [ ] Update app routes if needed
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### **Task 4.2: Delete Test Components**
|
||||||
|
|
||||||
|
**Files to delete:**
|
||||||
|
- [ ] `components/_ShareComponent/TestWrapper.tsx`
|
||||||
|
- [ ] `components/_ShareComponent/TestKeyboardInput.tsx`
|
||||||
|
- [ ] `app/(application)/(user)/test-keyboard.tsx`
|
||||||
|
- [ ] `app/(application)/(user)/test-keyboard-bug.tsx`
|
||||||
|
|
||||||
|
**Keep (useful):**
|
||||||
|
- ✅ `components/_ShareComponent/FormWrapper.tsx` (alternative wrapper)
|
||||||
|
- ✅ `hooks/useKeyboardForm.ts` (keyboard hook)
|
||||||
|
- ✅ `docs/KEYBOARD-BUG-TEST.md` (documentation)
|
||||||
|
- ✅ `docs/NEWWRAPPER-KEYBOARD-IMPLEMENTATION.md` (documentation)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### **Task 4.3: Update Documentation**
|
||||||
|
|
||||||
|
**Files to update:**
|
||||||
|
- [ ] `QWEN.md` - Update NewWrapper_V2 usage
|
||||||
|
- [ ] `docs/NEWWRAPPER-KEYBOARD-IMPLEMENTATION.md` - Mark as completed
|
||||||
|
- [ ] Create migration guide for team
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📝 Migration Guide (Per Screen)
|
||||||
|
|
||||||
|
### **Step 1: Import NewWrapper_V2**
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
// Change this:
|
||||||
|
import { NewWrapper } from "@/components";
|
||||||
|
|
||||||
|
// To this:
|
||||||
|
import { NewWrapper_V2 } from "@/components";
|
||||||
|
```
|
||||||
|
|
||||||
|
### **Step 2: Update Component Usage**
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
// Change this:
|
||||||
|
<NewWrapper footerComponent={buttonSubmit()}>
|
||||||
|
<StackCustom>
|
||||||
|
<TextInputCustom label="Judul" ... />
|
||||||
|
<TextAreaCustom label="Deskripsi" ... />
|
||||||
|
</StackCustom>
|
||||||
|
</NewWrapper>
|
||||||
|
|
||||||
|
// To this:
|
||||||
|
<NewWrapper_V2
|
||||||
|
enableKeyboardHandling
|
||||||
|
keyboardScrollOffset={100}
|
||||||
|
footerComponent={buttonSubmit()}
|
||||||
|
>
|
||||||
|
<StackCustom>
|
||||||
|
<View onStartShouldSetResponder={() => true}>
|
||||||
|
<TextInputCustom label="Judul" ... />
|
||||||
|
</View>
|
||||||
|
<View onStartShouldSetResponder={() => true}>
|
||||||
|
<TextAreaCustom label="Deskripsi" ... />
|
||||||
|
</View>
|
||||||
|
</StackCustom>
|
||||||
|
</NewWrapper_V2>
|
||||||
|
```
|
||||||
|
|
||||||
|
### **Step 3: Import View**
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
// Add this import if not already present:
|
||||||
|
import { View } from "react-native";
|
||||||
|
```
|
||||||
|
|
||||||
|
### **Step 4: Test**
|
||||||
|
|
||||||
|
1. Run app
|
||||||
|
2. Navigate to screen
|
||||||
|
3. Tap each input field
|
||||||
|
4. Verify auto-scroll works
|
||||||
|
5. Verify footer stays in place
|
||||||
|
6. Verify no white area
|
||||||
|
7. Test submit functionality
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🧪 Testing Checklist
|
||||||
|
|
||||||
|
### **For Each Migrated Screen:**
|
||||||
|
|
||||||
|
**Functional Tests:**
|
||||||
|
- [ ] All inputs focus correctly
|
||||||
|
- [ ] Keyboard shows when tapping input
|
||||||
|
- [ ] Auto-scroll to focused input
|
||||||
|
- [ ] Keyboard dismisses when tapping outside
|
||||||
|
- [ ] Footer stays at bottom
|
||||||
|
- [ ] No white area at bottom
|
||||||
|
- [ ] Submit button works
|
||||||
|
- [ ] Form validation works
|
||||||
|
- [ ] Data saves correctly
|
||||||
|
|
||||||
|
**Platform Tests:**
|
||||||
|
- [ ] Android with navigation buttons
|
||||||
|
- [ ] Android with gesture navigation
|
||||||
|
- [ ] iOS with home button
|
||||||
|
- [ ] iOS with gesture (notch)
|
||||||
|
- [ ] Different screen sizes
|
||||||
|
|
||||||
|
**Edge Cases:**
|
||||||
|
- [ ] Multiple inputs on screen
|
||||||
|
- [ ] Long content (scrollable)
|
||||||
|
- [ ] Loading state
|
||||||
|
- [ ] Error state
|
||||||
|
- [ ] Keyboard transition smooth
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📊 Progress Tracking
|
||||||
|
|
||||||
|
| Phase | Screens | Status | Completed Date |
|
||||||
|
|-------|---------|--------|----------------|
|
||||||
|
| **Phase 1: Job** | 6 screens | ✅ COMPLETED | 2026-04-01 |
|
||||||
|
| **Phase 2: Event & Profile** | 4 screens | ⏳ Pending | - |
|
||||||
|
| **Phase 3: Forms** | 6-8 screens | ⏳ Pending | - |
|
||||||
|
| **Phase 4: Complex** | 4-6 screens | ⏳ Pending | - |
|
||||||
|
| **Phase 5: Cleanup** | Cleanup | ⏳ Pending | - |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## ✅ Phase 1: COMPLETED!
|
||||||
|
|
||||||
|
**Migrated Screens:**
|
||||||
|
1. ✅ `screens/Job/ScreenJobCreate.tsx` - Form with keyboard handling
|
||||||
|
2. ✅ `screens/Job/ScreenJobEdit.tsx` - Form with keyboard handling
|
||||||
|
3. ✅ `screens/Job/ScreenBeranda2.tsx` - List (no keyboard handling needed)
|
||||||
|
4. ✅ `screens/Job/ScreenArchive2.tsx` - List (no keyboard handling needed)
|
||||||
|
5. ✅ `screens/Job/MainViewStatus2.tsx` - List (no keyboard handling needed)
|
||||||
|
6. ✅ `app/(application)/(user)/job/[id]/[status]/detail.tsx` - Detail (no keyboard handling needed)
|
||||||
|
|
||||||
|
**Test Files Deleted:**
|
||||||
|
- ❌ `screens/Job/ScreenJobCreate2.tsx`
|
||||||
|
- ❌ `screens/Job/ScreenJobEdit2.tsx`
|
||||||
|
- ❌ `components/_ShareComponent/TestWrapper.tsx`
|
||||||
|
- ❌ `components/_ShareComponent/TestKeyboardInput.tsx`
|
||||||
|
- ❌ `app/(application)/(user)/test-keyboard.tsx`
|
||||||
|
- ❌ `app/(application)/(user)/test-keyboard-bug.tsx`
|
||||||
|
|
||||||
|
**Routes Updated:**
|
||||||
|
- ✅ `app/(application)/(user)/job/create.tsx` → Uses ScreenJobCreate
|
||||||
|
- ✅ `app/(application)/(user)/job/[id]/edit.tsx` → Uses ScreenJobEdit
|
||||||
|
- ✅ `app/(application)/(user)/job/(tabs)/index.tsx` → Uses ScreenBeranda2
|
||||||
|
- ✅ `app/(application)/(user)/job/(tabs)/archive.tsx` → Uses ScreenArchive2
|
||||||
|
- ✅ `app/(application)/(user)/job/(tabs)/status.tsx` → Uses MainViewStatus2
|
||||||
|
- ✅ `app/(application)/(user)/job/[id]/[status]/detail.tsx` → Migrated to NewWrapper_V2
|
||||||
|
|
||||||
|
**Commits:**
|
||||||
|
- `a9ff755` - feat: Migrate Job screens to NewWrapper_V2
|
||||||
|
- `0f55244` - refactor: Cleanup test files and migrate Job Detail
|
||||||
|
- `7cb4f30` - refactor: Replace NewWrapper with NewWrapper_V2 for all Job screens
|
||||||
|
|
||||||
|
**Total:** 6 screens migrated, 6 test files deleted, 6 routes updated
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🚀 Current Status
|
||||||
|
|
||||||
|
**Status**: 🟡 IN PROGRESS
|
||||||
|
**Current Phase**: Phase 1 - Job Screens
|
||||||
|
**Started**: 2026-04-01
|
||||||
|
**ETA**: 2026-04-07 (Phase 1 complete)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📞 Next Actions
|
||||||
|
|
||||||
|
1. **Immediate** (Today):
|
||||||
|
- [ ] Migrate `ScreenJobCreate.tsx`
|
||||||
|
- [ ] Migrate `ScreenJobEdit.tsx`
|
||||||
|
- [ ] Test both screens
|
||||||
|
|
||||||
|
2. **This Week**:
|
||||||
|
- [ ] Delete test files
|
||||||
|
- [ ] Document any issues
|
||||||
|
- [ ] Prepare Phase 2
|
||||||
|
|
||||||
|
3. **Next Week**:
|
||||||
|
- [ ] Start Phase 2 (Event & Profile)
|
||||||
|
- [ ] Review Phase 1 results
|
||||||
|
- [ ] Adjust migration guide if needed
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📚 Related Files
|
||||||
|
|
||||||
|
**Components:**
|
||||||
|
- `components/_ShareComponent/NewWrapper.tsx` (Old)
|
||||||
|
- `components/_ShareComponent/NewWrapper_V2.tsx` (New)
|
||||||
|
- `hooks/useKeyboardForm.ts` (Keyboard hook)
|
||||||
|
|
||||||
|
**Documentation:**
|
||||||
|
- `docs/NEWWRAPPER-KEYBOARD-IMPLEMENTATION.md` (Full analysis)
|
||||||
|
- `docs/KEYBOARD-BUG-TEST.md` (Bug investigation)
|
||||||
|
- `tasks/TASK-004-newwrapper-migration.md` (This file)
|
||||||
|
|
||||||
|
**Screens to Migrate:**
|
||||||
|
- `screens/Job/ScreenJobCreate.tsx`
|
||||||
|
- `screens/Job/ScreenJobEdit.tsx`
|
||||||
|
- (More in subsequent phases)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## ⚠️ Risk Mitigation
|
||||||
|
|
||||||
|
**If issues found during migration:**
|
||||||
|
|
||||||
|
1. **Stop migration** for that screen
|
||||||
|
2. **Revert changes** if critical bug
|
||||||
|
3. **Document issue** in detail
|
||||||
|
4. **Fix NewWrapper_V2** if needed
|
||||||
|
5. **Resume migration** after fix
|
||||||
|
|
||||||
|
**Rollback plan:**
|
||||||
|
- Keep old `NewWrapper` until all screens migrated
|
||||||
|
- Easy to revert per screen
|
||||||
|
- No breaking changes to other screens
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## ✅ Success Criteria
|
||||||
|
|
||||||
|
**Phase 1 Complete when:**
|
||||||
|
- [ ] Job Create migrated
|
||||||
|
- [ ] Job Edit migrated
|
||||||
|
- [ ] Both screens tested on iOS & Android
|
||||||
|
- [ ] No critical bugs
|
||||||
|
- [ ] Test files deleted
|
||||||
|
- [ ] Documentation updated
|
||||||
|
|
||||||
|
**Overall Migration Complete when:**
|
||||||
|
- [ ] All form screens migrated
|
||||||
|
- [ ] All screens tested
|
||||||
|
- [ ] Old NewWrapper deprecated/removed
|
||||||
|
- [ ] Team trained on NewWrapper_V2
|
||||||
|
- [ ] Documentation complete
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Last Updated**: 2026-04-01
|
||||||
|
**Created by**: AI Assistant
|
||||||
|
**Status**: 🟡 IN PROGRESS
|
||||||
Reference in New Issue
Block a user