Compare commits
24 Commits
fix-code/1
...
qc-wrapper
| Author | SHA1 | Date | |
|---|---|---|---|
| b8f8a361d6 | |||
| 1a5ca78041 | |||
| 502cd7bc65 | |||
| 44d9025afe | |||
| b34bc3799e | |||
| 7cb4f30ae9 | |||
| 0f552443c4 | |||
| 90bc8ae343 | |||
| 98f8c7e2bf | |||
| 81bbd8e6b0 | |||
| 57159d2c45 | |||
| 66373fa65b | |||
| 6d545f2af9 | |||
| eeb95336f2 | |||
| 6fb3b229c3 | |||
| 76deec9c53 | |||
| 31948f71db | |||
| 16decd89c8 | |||
| ecbcc12abf | |||
| 0cb734e790 | |||
| 0d2fef1878 | |||
| 2e58f8c7b4 | |||
| b6cd308b0b | |||
| f68deab8c0 |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -81,4 +81,7 @@ yarn-error.*
|
|||||||
# typescript
|
# typescript
|
||||||
*.tsbuildinfo
|
*.tsbuildinfo
|
||||||
|
|
||||||
|
# secrets
|
||||||
|
secrets/
|
||||||
|
|
||||||
# @end expo-cli
|
# @end expo-cli
|
||||||
8
.qwen/settings.json
Normal file
8
.qwen/settings.json
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"permissions": {
|
||||||
|
"allow": [
|
||||||
|
"Bash(git add *)"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"$version": 3
|
||||||
|
}
|
||||||
7
.qwen/settings.json.orig
Normal file
7
.qwen/settings.json.orig
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"permissions": {
|
||||||
|
"allow": [
|
||||||
|
"Bash(git add *)"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
2
QWEN.md
2
QWEN.md
@@ -387,7 +387,7 @@ apiConfig.interceptors.request.use(async (config) => {
|
|||||||
|
|
||||||
### Deep Linking
|
### Deep Linking
|
||||||
- Scheme: `hipmimobile://`
|
- Scheme: `hipmimobile://`
|
||||||
- HTTPS: `cld-dkr-staging-hipmi.wibudev.com`
|
- HTTPS: `cld-dkr-hipmi-stg.wibudev.com`
|
||||||
- Configured for both platforms
|
- Configured for both platforms
|
||||||
|
|
||||||
### Camera
|
### Camera
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ packagingOptions {
|
|||||||
applicationId 'com.bip.hipmimobileapp'
|
applicationId 'com.bip.hipmimobileapp'
|
||||||
minSdkVersion rootProject.ext.minSdkVersion
|
minSdkVersion rootProject.ext.minSdkVersion
|
||||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||||
versionCode 1
|
versionCode 5
|
||||||
versionName "1.0.2"
|
versionName "1.0.2"
|
||||||
|
|
||||||
buildConfigField "String", "REACT_NATIVE_RELEASE_LEVEL", "\"${findProperty('reactNativeReleaseLevel') ?: 'stable'}\""
|
buildConfigField "String", "REACT_NATIVE_RELEASE_LEVEL", "\"${findProperty('reactNativeReleaseLevel') ?: 'stable'}\""
|
||||||
|
|||||||
7
android/app/src/debugOptimized/AndroidManifest.xml
Normal file
7
android/app/src/debugOptimized/AndroidManifest.xml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
|
||||||
|
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
|
||||||
|
|
||||||
|
<application android:usesCleartextTraffic="true" tools:targetApi="28" tools:ignore="GoogleAppIndexingWarning" tools:replace="android:usesCleartextTraffic" />
|
||||||
|
</manifest>
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
</intent-filter>
|
</intent-filter>
|
||||||
<intent-filter android:autoVerify="true" data-generated="true">
|
<intent-filter android:autoVerify="true" data-generated="true">
|
||||||
<action android:name="android.intent.action.VIEW"/>
|
<action android:name="android.intent.action.VIEW"/>
|
||||||
<data android:scheme="https" android:host="cld-dkr-hipmi-stg.wibudev.com" android:pathPrefix="/"/>
|
<data android:scheme="https" android:host="hipmi.muku.id" android:pathPrefix="/"/>
|
||||||
<category android:name="android.intent.category.BROWSABLE"/>
|
<category android:name="android.intent.category.BROWSABLE"/>
|
||||||
<category android:name="android.intent.category.DEFAULT"/>
|
<category android:name="android.intent.category.DEFAULT"/>
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
|||||||
@@ -6,32 +6,17 @@ buildscript {
|
|||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.google.gms:google-services:4.4.1'
|
classpath 'com.google.gms:google-services:4.4.1'
|
||||||
classpath('com.android.tools.build:gradle')
|
classpath('com.android.tools.build:gradle')
|
||||||
classpath('com.facebook.react:react-native-gradle-plugin')
|
classpath('com.facebook.react:react-native-gradle-plugin')
|
||||||
classpath('org.jetbrains.kotlin:kotlin-gradle-plugin')
|
classpath('org.jetbrains.kotlin:kotlin-gradle-plugin')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
allprojects {
|
|
||||||
repositories {
|
|
||||||
google()
|
|
||||||
mavenCentral()
|
|
||||||
maven { url 'https://www.jitpack.io' }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
apply plugin: "expo-root-project"
|
|
||||||
apply plugin: "com.facebook.react.rootproject"
|
|
||||||
// @generated begin @rnmapbox/maps-v2-maven - expo prebuild (DO NOT MODIFY) sync-d4ccbfdff48fdba3138b02a8ba41b9722af001d8
|
|
||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
repositories {
|
repositories {
|
||||||
maven {
|
maven {
|
||||||
url 'https://api.mapbox.com/downloads/v2/releases/maven'
|
url 'https://api.mapbox.com/downloads/v2/releases/maven'
|
||||||
// Authentication is no longer required as per Mapbox's removal of download token requirement
|
|
||||||
// See: https://github.com/mapbox/mapbox-maps-flutter/issues/775
|
|
||||||
// Keeping this as optional for backward compatibility
|
|
||||||
def token = project.properties['MAPBOX_DOWNLOADS_TOKEN'] ?: System.getenv('RNMAPBOX_MAPS_DOWNLOAD_TOKEN')
|
def token = project.properties['MAPBOX_DOWNLOADS_TOKEN'] ?: System.getenv('RNMAPBOX_MAPS_DOWNLOAD_TOKEN')
|
||||||
if (token) {
|
if (token) {
|
||||||
authentication { basic(BasicAuthentication) }
|
authentication { basic(BasicAuthentication) }
|
||||||
@@ -41,7 +26,11 @@ allprojects {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
google()
|
||||||
|
mavenCentral()
|
||||||
|
maven { url 'https://www.jitpack.io' }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// @generated end @rnmapbox/maps-v2-maven
|
apply plugin: "expo-root-project"
|
||||||
|
apply plugin: "com.facebook.react.rootproject"
|
||||||
|
|||||||
@@ -25,27 +25,27 @@ export default {
|
|||||||
ios: {
|
ios: {
|
||||||
supportsTablet: true,
|
supportsTablet: true,
|
||||||
bundleIdentifier: "com.anonymous.hipmi-mobile",
|
bundleIdentifier: "com.anonymous.hipmi-mobile",
|
||||||
googleServicesFile: "./ios/HIPMIBadungConnect/GoogleService-Info.plist",
|
googleServicesFile: "./secrets/GoogleService-Info.plist",
|
||||||
infoPlist: {
|
infoPlist: {
|
||||||
ITSAppUsesNonExemptEncryption: false,
|
ITSAppUsesNonExemptEncryption: false,
|
||||||
NSLocationWhenInUseUsageDescription:
|
NSLocationWhenInUseUsageDescription:
|
||||||
"Aplikasi membutuhkan akses lokasi untuk menampilkan peta.",
|
"Aplikasi membutuhkan akses lokasi untuk menampilkan peta.",
|
||||||
},
|
},
|
||||||
associatedDomains: [
|
associatedDomains: [
|
||||||
"applinks:cld-dkr-hipmi-stg.wibudev.com",
|
"applinks:hipmi.muku.id",
|
||||||
],
|
],
|
||||||
buildNumber: "5",
|
buildNumber: "7",
|
||||||
},
|
},
|
||||||
|
|
||||||
android: {
|
android: {
|
||||||
googleServicesFile: "./google-services.json",
|
googleServicesFile: "./secrets/google-services.json",
|
||||||
adaptiveIcon: {
|
adaptiveIcon: {
|
||||||
foregroundImage: "./assets/images/splash-icon.png",
|
foregroundImage: "./assets/images/splash-icon.png",
|
||||||
backgroundColor: "#ffffff",
|
backgroundColor: "#ffffff",
|
||||||
},
|
},
|
||||||
edgeToEdgeEnabled: true,
|
edgeToEdgeEnabled: true,
|
||||||
package: "com.bip.hipmimobileapp",
|
package: "com.bip.hipmimobileapp",
|
||||||
versionCode: 1,
|
versionCode: 5,
|
||||||
// softwareKeyboardLayoutMode: 'resize', // option: untuk mengatur keyboard pada room chst collaboration
|
// softwareKeyboardLayoutMode: 'resize', // option: untuk mengatur keyboard pada room chst collaboration
|
||||||
intentFilters: [
|
intentFilters: [
|
||||||
{
|
{
|
||||||
@@ -54,7 +54,7 @@ export default {
|
|||||||
data: [
|
data: [
|
||||||
{
|
{
|
||||||
scheme: "https",
|
scheme: "https",
|
||||||
host: "cld-dkr-hipmi-stg.wibudev.com",
|
host: "hipmi.muku.id",
|
||||||
pathPrefix: "/",
|
pathPrefix: "/",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@@ -70,6 +70,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
plugins: [
|
plugins: [
|
||||||
|
"./plugins/withCustomConfig",
|
||||||
"expo-router",
|
"expo-router",
|
||||||
"expo-web-browser",
|
"expo-web-browser",
|
||||||
[
|
[
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { BackButton } from "@/components";
|
import { BackButton } from "@/components";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import PdfViewer from "@/components/_ShareComponent/PdfViewer";
|
import PdfViewer from "@/components/_ShareComponent/PdfViewer";
|
||||||
import API_STRORAGE from "@/constants/base-url-api-strorage";
|
import API_STRORAGE from "@/constants/base-url-api-strorage";
|
||||||
import { Stack, useLocalSearchParams } from "expo-router";
|
import { Stack, useLocalSearchParams } from "expo-router";
|
||||||
@@ -7,13 +8,12 @@ import { SafeAreaView } from "react-native-safe-area-context";
|
|||||||
export default function FileScreen() {
|
export default function FileScreen() {
|
||||||
const { id } = useLocalSearchParams();
|
const { id } = useLocalSearchParams();
|
||||||
const url = API_STRORAGE.GET({ fileId: id as string });
|
const url = API_STRORAGE.GET({ fileId: id as string });
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
title: "File",
|
header: () => <AppHeader title="File" left={<BackButton />} />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<SafeAreaView style={{ flex: 1 }} edges={["bottom"]}>
|
<SafeAreaView style={{ flex: 1 }} edges={["bottom"]}>
|
||||||
|
|||||||
@@ -1,29 +1,27 @@
|
|||||||
import { BackButton } from "@/components";
|
import { BackButton } from "@/components";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import { IconPlus } from "@/components/_Icon";
|
import { IconPlus } from "@/components/_Icon";
|
||||||
import { IconDot } from "@/components/_Icon/IconComponent";
|
import { IconDot } from "@/components/_Icon/IconComponent";
|
||||||
import LeftButtonCustom from "@/components/Button/BackButton";
|
import LeftButtonCustom from "@/components/Button/BackButton";
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
import { ICON_SIZE_SMALL } from "@/constants/constans-value";
|
import { ICON_SIZE_SMALL } from "@/constants/constans-value";
|
||||||
import { HeaderStyles } from "@/styles/header-styles";
|
|
||||||
import { Ionicons } from "@expo/vector-icons";
|
import { Ionicons } from "@expo/vector-icons";
|
||||||
import { router, Stack } from "expo-router";
|
import { router, Stack } from "expo-router";
|
||||||
|
|
||||||
export default function UserLayout() {
|
export default function UserLayout() {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack screenOptions={HeaderStyles}>
|
<Stack>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="delete-account"
|
name="delete-account"
|
||||||
options={{
|
options={{
|
||||||
title: "Hapus Akun",
|
header: () => <AppHeader title="Hapus Akun" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="waiting-room"
|
name="waiting-room"
|
||||||
options={{
|
options={{
|
||||||
title: "Waiting Room",
|
header: () => <AppHeader title="Waiting Room" />,
|
||||||
headerBackVisible: false,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@@ -47,8 +45,7 @@ export default function UserLayout() {
|
|||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="user-search/index"
|
name="user-search/index"
|
||||||
options={{
|
options={{
|
||||||
title: "Pencarian Pengguna",
|
header: () => <AppHeader title="Pencarian Pengguna" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@@ -71,10 +68,18 @@ export default function UserLayout() {
|
|||||||
|
|
||||||
{/* ========== Event Section ========= */}
|
{/* ========== Event Section ========= */}
|
||||||
|
|
||||||
|
{/* <Stack.Screen
|
||||||
|
name="event/(tabs)"
|
||||||
|
options={{
|
||||||
|
header: () => <AppHeader title="Event" left={<BackButton path="/home" />} />,
|
||||||
|
}}
|
||||||
|
/> */}
|
||||||
|
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="event/(tabs)"
|
name="event/(tabs)"
|
||||||
options={{
|
options={{
|
||||||
title: "Event",
|
title: "Event",
|
||||||
|
header: () => <AppHeader title="Event" left={<BackButton path="/home" />} />,
|
||||||
// NOTE: DIPINDAH DI FILE /Event/(Tabs)/_layout.tsx
|
// NOTE: DIPINDAH DI FILE /Event/(Tabs)/_layout.tsx
|
||||||
// headerLeft: () => (
|
// headerLeft: () => (
|
||||||
// <LeftButtonCustom path="/(application)/(user)/home" />
|
// <LeftButtonCustom path="/(application)/(user)/home" />
|
||||||
@@ -85,32 +90,28 @@ export default function UserLayout() {
|
|||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="event/create"
|
name="event/create"
|
||||||
options={{
|
options={{
|
||||||
title: "Tambah Event",
|
header: () => <AppHeader title="Tambah Event" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="event/detail/[id]"
|
name="event/detail/[id]"
|
||||||
options={{
|
options={{
|
||||||
title: "Event Detail",
|
header: () => <AppHeader title="Event Detail" left={<LeftButtonCustom />} />,
|
||||||
headerLeft: () => <LeftButtonCustom />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="event/[id]/edit"
|
name="event/[id]/edit"
|
||||||
options={{
|
options={{
|
||||||
title: "Edit Event",
|
header: () => <AppHeader title="Edit Event" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="event/[id]/list-of-participants"
|
name="event/[id]/list-of-participants"
|
||||||
options={{
|
options={{
|
||||||
title: "Daftar peserta",
|
header: () => <AppHeader title="Daftar peserta" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
{/* ========== End Event Section ========= */}
|
{/* ========== End Event Section ========= */}
|
||||||
@@ -119,22 +120,19 @@ export default function UserLayout() {
|
|||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="collaboration/(tabs)"
|
name="collaboration/(tabs)"
|
||||||
options={{
|
options={{
|
||||||
title: "Collaboration",
|
header: () => <AppHeader title="Collaboration" left={<BackButton path="/home" />} />,
|
||||||
headerLeft: () => <BackButton path="/home" />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="collaboration/create"
|
name="collaboration/create"
|
||||||
options={{
|
options={{
|
||||||
title: "Tambah Proyek",
|
header: () => <AppHeader title="Tambah Proyek" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="collaboration/[id]/list-of-participants"
|
name="collaboration/[id]/list-of-participants"
|
||||||
options={{
|
options={{
|
||||||
title: "Daftar Partisipan",
|
header: () => <AppHeader title="Daftar Partisipan" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
{/* <Stack.Screen
|
{/* <Stack.Screen
|
||||||
@@ -147,22 +145,19 @@ export default function UserLayout() {
|
|||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="collaboration/[id]/edit"
|
name="collaboration/[id]/edit"
|
||||||
options={{
|
options={{
|
||||||
title: "Edit Proyek",
|
header: () => <AppHeader title="Edit Proyek" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="collaboration/[id]/create-pacticipants"
|
name="collaboration/[id]/create-pacticipants"
|
||||||
options={{
|
options={{
|
||||||
title: "Ajukan Partisipasi",
|
header: () => <AppHeader title="Ajukan Partisipasi" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="collaboration/[id]/select-of-participants"
|
name="collaboration/[id]/select-of-participants"
|
||||||
options={{
|
options={{
|
||||||
title: "Pilih Partisipan",
|
header: () => <AppHeader title="Pilih Partisipan" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@@ -172,29 +167,25 @@ export default function UserLayout() {
|
|||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="voting/create"
|
name="voting/create"
|
||||||
options={{
|
options={{
|
||||||
title: "Tambah Voting",
|
header: () => <AppHeader title="Tambah Voting" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="voting/(tabs)"
|
name="voting/(tabs)"
|
||||||
options={{
|
options={{
|
||||||
title: "Voting",
|
header: () => <AppHeader title="Voting" left={<BackButton path="/home" />} />,
|
||||||
headerLeft: () => <BackButton path="/home" />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="voting/[id]/edit"
|
name="voting/[id]/edit"
|
||||||
options={{
|
options={{
|
||||||
title: "Edit Voting",
|
header: () => <AppHeader title="Edit Voting" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="voting/[id]/list-of-contributor"
|
name="voting/[id]/list-of-contributor"
|
||||||
options={{
|
options={{
|
||||||
title: "Daftar Kontributor",
|
header: () => <AppHeader title="Daftar Kontributor" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@@ -204,8 +195,7 @@ export default function UserLayout() {
|
|||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="crowdfunding/index"
|
name="crowdfunding/index"
|
||||||
options={{
|
options={{
|
||||||
title: "Crowdfunding",
|
header: () => <AppHeader title="Crowdfunding" left={<BackButton path="/home" />} />,
|
||||||
headerLeft: () => <BackButton path="/home" />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@@ -215,103 +205,95 @@ export default function UserLayout() {
|
|||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="investment/(tabs)"
|
name="investment/(tabs)"
|
||||||
options={{
|
options={{
|
||||||
title: "Investasi",
|
header: () => <AppHeader title="Investasi" left={<BackButton path="/crowdfunding" />} />,
|
||||||
headerLeft: () => <BackButton path="/crowdfunding" />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="investment/create"
|
name="investment/create"
|
||||||
options={{
|
options={{
|
||||||
title: "Tambah Investasi",
|
header: () => <AppHeader title="Tambah Investasi" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="investment/[id]/index"
|
name="investment/[id]/index"
|
||||||
options={{
|
options={{
|
||||||
title: "Detail Investasi",
|
header: () => <AppHeader title="Detail Investasi" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="investment/[id]/edit"
|
name="investment/[id]/edit"
|
||||||
options={{
|
options={{
|
||||||
title: "Edit Investasi",
|
header: () => <AppHeader title="Edit Investasi" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="investment/[id]/edit-prospectus"
|
name="investment/[id]/edit-prospectus"
|
||||||
options={{
|
options={{
|
||||||
title: "Edit Prospektus",
|
header: () => <AppHeader title="Edit Prospektus" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="investment/[id]/(document)/list-of-document"
|
name="investment/[id]/(document)/list-of-document"
|
||||||
options={{
|
options={{
|
||||||
title: "Daftar Dokumen",
|
header: () => <AppHeader title="Daftar Dokumen" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="investment/[id]/(document)/add-document"
|
name="investment/[id]/(document)/add-document"
|
||||||
options={{
|
options={{
|
||||||
title: "Tambah Dokumen",
|
header: () => <AppHeader title="Tambah Dokumen" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="investment/[id]/(document)/edit-document"
|
name="investment/[id]/(document)/edit-document"
|
||||||
options={{
|
options={{
|
||||||
title: "Edit Dokumen",
|
header: () => <AppHeader title="Edit Dokumen" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="investment/[id]/(news)/add-news"
|
name="investment/[id]/(news)/add-news"
|
||||||
options={{
|
options={{
|
||||||
title: "Tambah Berita",
|
header: () => <AppHeader title="Tambah Berita" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="investment/[id]/investor"
|
name="investment/[id]/investor"
|
||||||
options={{
|
options={{
|
||||||
title: "Investor",
|
header: () => <AppHeader title="Investor" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="investment/[id]/(transaction-flow)/index"
|
name="investment/[id]/(transaction-flow)/index"
|
||||||
options={{
|
options={{
|
||||||
title: "Pembelian Saham",
|
header: () => <AppHeader title="Pembelian Saham" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="investment/[id]/(transaction-flow)/select-bank"
|
name="investment/[id]/(transaction-flow)/select-bank"
|
||||||
options={{
|
options={{
|
||||||
title: "Pilih Bank",
|
header: () => <AppHeader title="Pilih Bank" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="investment/[id]/(transaction-flow)/invoice"
|
name="investment/[id]/(transaction-flow)/invoice"
|
||||||
options={{
|
options={{
|
||||||
title: "Invoice",
|
header: () => (
|
||||||
headerLeft: () => (
|
<AppHeader
|
||||||
<Ionicons
|
title="Invoice"
|
||||||
name="close"
|
left={
|
||||||
size={ICON_SIZE_SMALL}
|
<Ionicons
|
||||||
color={MainColor.yellow}
|
name="close"
|
||||||
onPress={() =>
|
size={ICON_SIZE_SMALL}
|
||||||
router.navigate(`/investment/(tabs)/transaction`)
|
color={MainColor.yellow}
|
||||||
|
onPress={() =>
|
||||||
|
router.navigate(`/investment/(tabs)/transaction`)
|
||||||
|
}
|
||||||
|
/>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
@@ -320,14 +302,18 @@ export default function UserLayout() {
|
|||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="investment/[id]/(transaction-flow)/process"
|
name="investment/[id]/(transaction-flow)/process"
|
||||||
options={{
|
options={{
|
||||||
title: "Proses",
|
header: () => (
|
||||||
headerLeft: () => (
|
<AppHeader
|
||||||
<Ionicons
|
title="Proses"
|
||||||
name="close"
|
left={
|
||||||
size={ICON_SIZE_SMALL}
|
<Ionicons
|
||||||
color={MainColor.yellow}
|
name="close"
|
||||||
onPress={() =>
|
size={ICON_SIZE_SMALL}
|
||||||
router.navigate(`/investment/(tabs)/transaction`)
|
color={MainColor.yellow}
|
||||||
|
onPress={() =>
|
||||||
|
router.navigate(`/investment/(tabs)/transaction`)
|
||||||
|
}
|
||||||
|
/>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
@@ -336,23 +322,20 @@ export default function UserLayout() {
|
|||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="investment/[id]/(transaction-flow)/success"
|
name="investment/[id]/(transaction-flow)/success"
|
||||||
options={{
|
options={{
|
||||||
title: "Transaksi Berhasil",
|
header: () => <AppHeader title="Transaksi Berhasil" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="investment/[id]/(transaction-flow)/failed"
|
name="investment/[id]/(transaction-flow)/failed"
|
||||||
options={{
|
options={{
|
||||||
title: "Transaksi Gagal",
|
header: () => <AppHeader title="Transaksi Gagal" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="investment/[id]/(my-holding)/[id]"
|
name="investment/[id]/(my-holding)/[id]"
|
||||||
options={{
|
options={{
|
||||||
title: "Detail Saham Saya",
|
header: () => <AppHeader title="Detail Saham Saya" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
{/* ========== End Investment Section ========= */}
|
{/* ========== End Investment Section ========= */}
|
||||||
@@ -361,122 +344,111 @@ export default function UserLayout() {
|
|||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="donation/(tabs)"
|
name="donation/(tabs)"
|
||||||
options={{
|
options={{
|
||||||
title: "Donasi",
|
header: () => <AppHeader title="Donasi" left={<BackButton path="/crowdfunding" />} />,
|
||||||
headerLeft: () => <BackButton path="/crowdfunding" />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="donation/create"
|
name="donation/create"
|
||||||
options={{
|
options={{
|
||||||
title: "Tambah Donasi",
|
header: () => <AppHeader title="Tambah Donasi" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="donation/create-story"
|
name="donation/create-story"
|
||||||
options={{
|
options={{
|
||||||
title: "Tambah Donasi",
|
header: () => <AppHeader title="Tambah Donasi" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="donation/[id]/edit"
|
name="donation/[id]/edit"
|
||||||
options={{
|
options={{
|
||||||
title: "Edit Donasi",
|
header: () => <AppHeader title="Edit Donasi" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="donation/[id]/edit-story"
|
name="donation/[id]/edit-story"
|
||||||
options={{
|
options={{
|
||||||
title: "Edit Donasi",
|
header: () => <AppHeader title="Edit Donasi" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="donation/[id]/edit-rekening"
|
name="donation/[id]/edit-rekening"
|
||||||
options={{
|
options={{
|
||||||
title: "Edit Rekening",
|
header: () => <AppHeader title="Edit Rekening" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="donation/[id]/detail-story"
|
name="donation/[id]/detail-story"
|
||||||
options={{
|
options={{
|
||||||
title: "Cerita Penggalang",
|
header: () => <AppHeader title="Cerita Penggalang" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="donation/[id]/infromation-fundrising"
|
name="donation/[id]/infromation-fundrising"
|
||||||
options={{
|
options={{
|
||||||
title: "Informasi Penggalang Dana",
|
header: () => <AppHeader title="Informasi Penggalang Dana" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="donation/[id]/list-of-donatur"
|
name="donation/[id]/list-of-donatur"
|
||||||
options={{
|
options={{
|
||||||
title: "Daftar Donatur",
|
header: () => <AppHeader title="Daftar Donatur" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="donation/[id]/fund-disbursement"
|
name="donation/[id]/fund-disbursement"
|
||||||
options={{
|
options={{
|
||||||
title: "Pencairan Dana",
|
header: () => <AppHeader title="Pencairan Dana" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="donation/[id]/(news)/recap-of-news"
|
name="donation/[id]/(news)/recap-of-news"
|
||||||
options={{
|
options={{
|
||||||
title: "Rekap Kabar",
|
header: () => <AppHeader title="Rekap Kabar" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="donation/[id]/(news)/add-news"
|
name="donation/[id]/(news)/add-news"
|
||||||
options={{
|
options={{
|
||||||
title: "Tambah Berita",
|
header: () => <AppHeader title="Tambah Berita" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="donation/[id]/(news)/[news]/edit-news"
|
name="donation/[id]/(news)/[news]/edit-news"
|
||||||
options={{
|
options={{
|
||||||
title: "Edit Berita",
|
header: () => <AppHeader title="Edit Berita" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="donation/[id]/(transaction-flow)/index"
|
name="donation/[id]/(transaction-flow)/index"
|
||||||
options={{
|
options={{
|
||||||
title: "Donasi",
|
header: () => <AppHeader title="Donasi" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="donation/[id]/(transaction-flow)/select-bank"
|
name="donation/[id]/(transaction-flow)/select-bank"
|
||||||
options={{
|
options={{
|
||||||
title: "Pilih Bank",
|
header: () => <AppHeader title="Pilih Bank" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="donation/[id]/(transaction-flow)/[invoiceId]/invoice"
|
name="donation/[id]/(transaction-flow)/[invoiceId]/invoice"
|
||||||
options={{
|
options={{
|
||||||
title: "Invoice",
|
header: () => (
|
||||||
headerLeft: () => (
|
<AppHeader
|
||||||
<Ionicons
|
title="Invoice"
|
||||||
name="close"
|
left={
|
||||||
size={ICON_SIZE_SMALL}
|
<Ionicons
|
||||||
color={MainColor.yellow}
|
name="close"
|
||||||
onPress={() => router.navigate(`/donation/(tabs)/my-donation`)}
|
size={ICON_SIZE_SMALL}
|
||||||
|
color={MainColor.yellow}
|
||||||
|
onPress={() => router.navigate(`/donation/(tabs)/my-donation`)}
|
||||||
|
/>
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
@@ -484,13 +456,17 @@ export default function UserLayout() {
|
|||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="donation/[id]/(transaction-flow)/[invoiceId]/process"
|
name="donation/[id]/(transaction-flow)/[invoiceId]/process"
|
||||||
options={{
|
options={{
|
||||||
title: "Proses",
|
header: () => (
|
||||||
headerLeft: () => (
|
<AppHeader
|
||||||
<Ionicons
|
title="Proses"
|
||||||
name="close"
|
left={
|
||||||
size={ICON_SIZE_SMALL}
|
<Ionicons
|
||||||
color={MainColor.yellow}
|
name="close"
|
||||||
onPress={() => router.navigate(`/donation/(tabs)/my-donation`)}
|
size={ICON_SIZE_SMALL}
|
||||||
|
color={MainColor.yellow}
|
||||||
|
onPress={() => router.navigate(`/donation/(tabs)/my-donation`)}
|
||||||
|
/>
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
@@ -498,55 +474,51 @@ export default function UserLayout() {
|
|||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="donation/[id]/(transaction-flow)/[invoiceId]/success"
|
name="donation/[id]/(transaction-flow)/[invoiceId]/success"
|
||||||
options={{
|
options={{
|
||||||
title: "Donasi Berhasil",
|
header: () => <AppHeader title="Donasi Berhasil" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="donation/[id]/(transaction-flow)/[invoiceId]/failed"
|
name="donation/[id]/(transaction-flow)/[invoiceId]/failed"
|
||||||
options={{
|
options={{
|
||||||
title: "Donasi Gagal",
|
header: () => <AppHeader title="Donasi Gagal" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{/* ========== End Donation Section ========= */}
|
{/* ========== End Donation Section ========= */}
|
||||||
|
|
||||||
{/* ========== Job Section ========= */}
|
{/* ========== Job Section ========= */}
|
||||||
|
|
||||||
|
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="job/create"
|
name="job/create"
|
||||||
options={{
|
options={{
|
||||||
title: "Tambah Job",
|
header: () => <AppHeader title="Tambah Job" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="job/(tabs)"
|
name="job/(tabs)"
|
||||||
options={{
|
options={{
|
||||||
title: "Job Vacancy",
|
title: "Job Vacancy",
|
||||||
// headerLeft: () => <BackButton path="/home" />,
|
|
||||||
// NOTE: headerLeft di pindahkan ke Tabs Layout
|
// NOTE: headerLeft di pindahkan ke Tabs Layout
|
||||||
|
header: () => <AppHeader title="Job Vacancy" left={<BackButton path="/home" />} />,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="job/[id]/index"
|
name="job/[id]/index"
|
||||||
options={{
|
options={{
|
||||||
title: "Detail Job",
|
header: () => <AppHeader title="Detail Job" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="job/[id]/edit"
|
name="job/[id]/edit"
|
||||||
options={{
|
options={{
|
||||||
title: "Edit Job",
|
header: () => <AppHeader title="Edit Job" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="job/[id]/archive"
|
name="job/[id]/archive"
|
||||||
options={{
|
options={{
|
||||||
title: "Arsip Job",
|
header: () => <AppHeader title="Arsip Job" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@@ -556,78 +528,67 @@ export default function UserLayout() {
|
|||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="forum/create"
|
name="forum/create"
|
||||||
options={{
|
options={{
|
||||||
title: "Tambah Diskusi",
|
header: () => <AppHeader title="Tambah Diskusi" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="forum/[id]/edit"
|
name="forum/[id]/edit"
|
||||||
options={{
|
options={{
|
||||||
title: "Edit Diskusi",
|
header: () => <AppHeader title="Edit Diskusi" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="forum/[id]/forumku"
|
name="forum/[id]/forumku"
|
||||||
options={{
|
options={{
|
||||||
title: "Forumku",
|
header: () => <AppHeader title="Forumku" left={<BackButton icon={"close"} />} />,
|
||||||
headerLeft: () => <BackButton icon={"close"} />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="forum/[id]/index"
|
name="forum/[id]/index"
|
||||||
options={{
|
options={{
|
||||||
title: "Detail",
|
header: () => <AppHeader title="Detail" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="forum/[id]/report-commentar"
|
name="forum/[id]/report-commentar"
|
||||||
options={{
|
options={{
|
||||||
title: "Laporkan Komentar",
|
header: () => <AppHeader title="Laporkan Komentar" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="forum/[id]/other-report-commentar"
|
name="forum/[id]/other-report-commentar"
|
||||||
options={{
|
options={{
|
||||||
title: "Laporkan Komentar",
|
header: () => <AppHeader title="Laporkan Komentar" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="forum/[id]/report-posting"
|
name="forum/[id]/report-posting"
|
||||||
options={{
|
options={{
|
||||||
title: "Laporkan Diskusi",
|
header: () => <AppHeader title="Laporkan Diskusi" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="forum/[id]/other-report-posting"
|
name="forum/[id]/other-report-posting"
|
||||||
options={{
|
options={{
|
||||||
title: "Laporkan Diskusi",
|
header: () => <AppHeader title="Laporkan Diskusi" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="forum/terms"
|
name="forum/terms"
|
||||||
options={{
|
options={{
|
||||||
title: "Syarat & Ketentuan Forum",
|
header: () => <AppHeader title="Syarat & Ketentuan Forum" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="forum/[id]/preview-report-posting"
|
name="forum/[id]/preview-report-posting"
|
||||||
options={{
|
options={{
|
||||||
title: "Laporan Postingan",
|
header: () => <AppHeader title="Laporan Postingan" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="forum/[id]/preview-report-comment"
|
name="forum/[id]/preview-report-comment"
|
||||||
options={{
|
options={{
|
||||||
title: "Laporan Komentar",
|
header: () => <AppHeader title="Laporan Komentar" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@@ -635,29 +596,25 @@ export default function UserLayout() {
|
|||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="maps/index"
|
name="maps/index"
|
||||||
options={{
|
options={{
|
||||||
title: "Maps",
|
header: () => <AppHeader title="Maps" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="maps/create"
|
name="maps/create"
|
||||||
options={{
|
options={{
|
||||||
title: "Tambah Maps",
|
header: () => <AppHeader title="Tambah Maps" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="maps/[id]/edit"
|
name="maps/[id]/edit"
|
||||||
options={{
|
options={{
|
||||||
title: "Edit Maps",
|
header: () => <AppHeader title="Edit Maps" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="maps/[id]/custom-pin"
|
name="maps/[id]/custom-pin"
|
||||||
options={{
|
options={{
|
||||||
title: "Custom Pin Maps",
|
header: () => <AppHeader title="Custom Pin Maps" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@@ -665,8 +622,7 @@ export default function UserLayout() {
|
|||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="marketplace/index"
|
name="marketplace/index"
|
||||||
options={{
|
options={{
|
||||||
title: "Market Place",
|
header: () => <AppHeader title="Market Place" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|||||||
@@ -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 />;
|
||||||
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import {
|
|||||||
TextCustom,
|
TextCustom,
|
||||||
ViewWrapper,
|
ViewWrapper,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import { apiCollaborationGroup } from "@/service/api-client/api-collaboration";
|
import { apiCollaborationGroup } from "@/service/api-client/api-collaboration";
|
||||||
import { Stack, useFocusEffect, useLocalSearchParams } from "expo-router";
|
import { Stack, useFocusEffect, useLocalSearchParams } from "expo-router";
|
||||||
import { useState, useCallback } from "react";
|
import { useState, useCallback } from "react";
|
||||||
@@ -40,8 +41,7 @@ export default function CollaborationRoomInfo() {
|
|||||||
<>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
title: `Info`,
|
header: () => <AppHeader title="Info" left={<BackButton />} />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { BackButton } from "@/components";
|
import { BackButton } from "@/components";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
import { ICON_SIZE_SMALL } from "@/constants/constans-value";
|
import { ICON_SIZE_SMALL } from "@/constants/constans-value";
|
||||||
import ChatScreen from "@/screens/Collaboration/GroupChatSection";
|
import ChatScreen from "@/screens/Collaboration/GroupChatSection";
|
||||||
@@ -12,14 +13,18 @@ export default function CollaborationRoomChat() {
|
|||||||
<>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
title: `Proyek ${detail}`,
|
header: () => (
|
||||||
headerLeft: () => <BackButton />,
|
<AppHeader
|
||||||
headerRight: () => (
|
title={`Proyek ${detail}`}
|
||||||
<Feather
|
left={<BackButton />}
|
||||||
name="info"
|
right={
|
||||||
size={ICON_SIZE_SMALL}
|
<Feather
|
||||||
color={MainColor.yellow}
|
name="info"
|
||||||
onPress={() => router.push(`/collaboration/${id}/${detail}/info`)}
|
size={ICON_SIZE_SMALL}
|
||||||
|
color={MainColor.yellow}
|
||||||
|
onPress={() => router.push(`/collaboration/${id}/${detail}/info`)}
|
||||||
|
/>
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import {
|
|||||||
MenuDrawerDynamicGrid,
|
MenuDrawerDynamicGrid,
|
||||||
ViewWrapper
|
ViewWrapper
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import Collaboration_BoxDetailSection from "@/screens/Collaboration/BoxDetailSection";
|
import Collaboration_BoxDetailSection from "@/screens/Collaboration/BoxDetailSection";
|
||||||
import { apiCollaborationGetOne } from "@/service/api-client/api-collaboration";
|
import { apiCollaborationGetOne } from "@/service/api-client/api-collaboration";
|
||||||
import { Ionicons } from "@expo/vector-icons";
|
import { Ionicons } from "@expo/vector-icons";
|
||||||
@@ -38,10 +39,14 @@ export default function CollaborationDetailParticipant() {
|
|||||||
<>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
title: "Detail Proyek",
|
header: () => (
|
||||||
headerLeft: () => <BackButton />,
|
<AppHeader
|
||||||
headerRight: () => (
|
title="Detail Proyek"
|
||||||
<DotButton onPress={() => setOpenDrawerParticipant(true)} />
|
left={<BackButton />}
|
||||||
|
right={
|
||||||
|
<DotButton onPress={() => setOpenDrawerParticipant(true)} />
|
||||||
|
}
|
||||||
|
/>
|
||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import {
|
|||||||
Spacing,
|
Spacing,
|
||||||
ViewWrapper
|
ViewWrapper
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import { IconEdit } from "@/components/_Icon";
|
import { IconEdit } from "@/components/_Icon";
|
||||||
import Collaboration_BoxDetailSection from "@/screens/Collaboration/BoxDetailSection";
|
import Collaboration_BoxDetailSection from "@/screens/Collaboration/BoxDetailSection";
|
||||||
import {
|
import {
|
||||||
@@ -66,9 +67,13 @@ export default function CollaborationDetailProjectMain() {
|
|||||||
<>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
title: "Proyek Saya",
|
header: () => (
|
||||||
headerLeft: () => <BackButton />,
|
<AppHeader
|
||||||
headerRight: () => <DotButton onPress={() => setOpenDrawer(true)} />,
|
title="Proyek Saya"
|
||||||
|
left={<BackButton />}
|
||||||
|
right={<DotButton onPress={() => setOpenDrawer(true)} />}
|
||||||
|
/>
|
||||||
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ViewWrapper>
|
<ViewWrapper>
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import {
|
|||||||
MenuDrawerDynamicGrid,
|
MenuDrawerDynamicGrid,
|
||||||
ViewWrapper,
|
ViewWrapper,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import { useAuth } from "@/hooks/use-auth";
|
import { useAuth } from "@/hooks/use-auth";
|
||||||
import Collaboration_BoxDetailSection from "@/screens/Collaboration/BoxDetailSection";
|
import Collaboration_BoxDetailSection from "@/screens/Collaboration/BoxDetailSection";
|
||||||
import {
|
import {
|
||||||
@@ -74,10 +75,14 @@ export default function CollaborationDetail() {
|
|||||||
<>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
title: "Detail Proyek",
|
header: () => (
|
||||||
headerLeft: () => <BackButton />,
|
<AppHeader
|
||||||
headerRight: () => (
|
title="Detail Proyek"
|
||||||
<DotButton onPress={() => setOpenDrawerMenu(true)} />
|
left={<BackButton />}
|
||||||
|
right={
|
||||||
|
<DotButton onPress={() => setOpenDrawerMenu(true)} />
|
||||||
|
}
|
||||||
|
/>
|
||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -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 />;
|
||||||
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import {
|
|||||||
TextCustom,
|
TextCustom,
|
||||||
ViewWrapper,
|
ViewWrapper,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import { IconEdit } from "@/components/_Icon";
|
import { IconEdit } from "@/components/_Icon";
|
||||||
import { IconTrash } from "@/components/_Icon/IconTrash";
|
import { IconTrash } from "@/components/_Icon/IconTrash";
|
||||||
import { useAuth } from "@/hooks/use-auth";
|
import { useAuth } from "@/hooks/use-auth";
|
||||||
@@ -57,12 +58,17 @@ export default function DonationNews() {
|
|||||||
<>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
title: "Detail Kabar",
|
header: () => (
|
||||||
headerLeft: () => <BackButton />,
|
<AppHeader
|
||||||
headerRight: () =>
|
title="Detail Kabar"
|
||||||
user?.id === data?.authorId && (
|
left={<BackButton />}
|
||||||
<DotButton onPress={() => setOpenDrawer(true)} />
|
right={
|
||||||
),
|
user?.id === data?.authorId && (
|
||||||
|
<DotButton onPress={() => setOpenDrawer(true)} />
|
||||||
|
)
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ViewWrapper>
|
<ViewWrapper>
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import {
|
|||||||
NewWrapper,
|
NewWrapper,
|
||||||
Spacing,
|
Spacing,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import { IconEdit, IconNews } from "@/components/_Icon";
|
import { IconEdit, IconNews } from "@/components/_Icon";
|
||||||
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
||||||
import CustomSkeleton from "@/components/_ShareComponent/SkeletonCustom";
|
import CustomSkeleton from "@/components/_ShareComponent/SkeletonCustom";
|
||||||
@@ -97,14 +98,19 @@ export default function DonasiDetailStatus() {
|
|||||||
<>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
title: `Detail ${_.startCase(status as string)}`,
|
header: () => (
|
||||||
headerLeft: () => <BackButton />,
|
<AppHeader
|
||||||
headerRight: () =>
|
title={`Detail ${_.startCase(status as string)}`}
|
||||||
status === "draft" ? (
|
left={<BackButton />}
|
||||||
<DotButton onPress={() => setOpenDrawer(true)} />
|
right={
|
||||||
) : status === "publish" ? (
|
status === "draft" ? (
|
||||||
<DotButton onPress={() => setOpenDrawerPublish(true)} />
|
<DotButton onPress={() => setOpenDrawer(true)} />
|
||||||
) : null,
|
) : status === "publish" ? (
|
||||||
|
<DotButton onPress={() => setOpenDrawerPublish(true)} />
|
||||||
|
) : null
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<NewWrapper
|
<NewWrapper
|
||||||
|
|||||||
@@ -185,7 +185,6 @@ export default function DonationEdit() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<NewWrapper
|
<NewWrapper
|
||||||
hideFooter
|
|
||||||
footerComponent={
|
footerComponent={
|
||||||
<BoxButtonOnFooter>
|
<BoxButtonOnFooter>
|
||||||
<ButtonCustom
|
<ButtonCustom
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import {
|
|||||||
StackCustom,
|
StackCustom,
|
||||||
ViewWrapper,
|
ViewWrapper,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import { IconNews } from "@/components/_Icon";
|
import { IconNews } from "@/components/_Icon";
|
||||||
import CustomSkeleton from "@/components/_ShareComponent/SkeletonCustom";
|
import CustomSkeleton from "@/components/_ShareComponent/SkeletonCustom";
|
||||||
import { useAuth } from "@/hooks/use-auth";
|
import { useAuth } from "@/hooks/use-auth";
|
||||||
@@ -90,12 +91,17 @@ export default function DonasiDetailBeranda() {
|
|||||||
<>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
title: `Detail Donasi`,
|
header: () => (
|
||||||
headerLeft: () => <BackButton />,
|
<AppHeader
|
||||||
headerRight: () =>
|
title="Detail Donasi"
|
||||||
user?.id === data?.Author?.id ? (
|
left={<BackButton />}
|
||||||
<DotButton onPress={() => setOpenDrawer(true)} />
|
right={
|
||||||
) : null,
|
user?.id === data?.Author?.id ? (
|
||||||
|
<DotButton onPress={() => setOpenDrawer(true)} />
|
||||||
|
) : null
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<NewWrapper footerComponent={buttonSection}>
|
<NewWrapper footerComponent={buttonSection}>
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -4,64 +4,87 @@ import {
|
|||||||
IconHome,
|
IconHome,
|
||||||
IconStatus,
|
IconStatus,
|
||||||
} from "@/components/_Icon";
|
} from "@/components/_Icon";
|
||||||
|
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, useNavigation } from "expo-router";
|
import { router, Tabs, useLocalSearchParams } from "expo-router";
|
||||||
import { useLayoutEffect } from "react";
|
import { View } from "react-native";
|
||||||
|
import { MainColor } from "@/constants/color-palet";
|
||||||
export default function EventTabsLayout() {
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
||||||
const navigation = useNavigation();
|
import { Platform } from "react-native";
|
||||||
|
import { OS_ANDROID_HEIGHT, OS_IOS_HEIGHT } from "@/constants/constans-value";
|
||||||
|
|
||||||
|
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;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
console.log("from", from);
|
|
||||||
console.log("category", category);
|
|
||||||
|
|
||||||
// Atur header secara dinamis
|
|
||||||
useLayoutEffect(() => {
|
|
||||||
navigation.setOptions({
|
|
||||||
headerLeft: () => (
|
|
||||||
<BackButtonFromNotification
|
|
||||||
from={from as string}
|
|
||||||
category={category as string}
|
|
||||||
/>
|
|
||||||
),
|
|
||||||
});
|
|
||||||
}, [from, router, navigation]);
|
|
||||||
|
|
||||||
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: OS_IOS_HEIGHT,
|
||||||
|
},
|
||||||
|
android: {
|
||||||
|
borderTopWidth: 0,
|
||||||
|
paddingTop: 5,
|
||||||
|
height: OS_ANDROID_HEIGHT + paddingBottom,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
header: () => (
|
||||||
|
<AppHeader
|
||||||
|
title="Event"
|
||||||
|
left={
|
||||||
|
<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 />;
|
||||||
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import {
|
|||||||
TextCustom,
|
TextCustom,
|
||||||
ViewWrapper,
|
ViewWrapper,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
||||||
import LeftButtonCustom from "@/components/Button/BackButton";
|
import LeftButtonCustom from "@/components/Button/BackButton";
|
||||||
import Event_ButtonStatusSection from "@/screens/Event/ButtonStatusSection";
|
import Event_ButtonStatusSection from "@/screens/Event/ButtonStatusSection";
|
||||||
@@ -81,12 +82,17 @@ export default function EventDetailStatus() {
|
|||||||
<>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
title: `Detail ${status === "publish" ? "" : status}`,
|
header: () => (
|
||||||
headerLeft: () => <LeftButtonCustom />,
|
<AppHeader
|
||||||
headerRight: () =>
|
title={`Detail ${status === "publish" ? "" : status}`}
|
||||||
status === "draft" ? (
|
left={<LeftButtonCustom />}
|
||||||
<DotButton onPress={() => setOpenDrawer(true)} />
|
right={
|
||||||
) : null,
|
status === "draft" ? (
|
||||||
|
<DotButton onPress={() => setOpenDrawer(true)} />
|
||||||
|
) : null
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ViewWrapper>
|
<ViewWrapper>
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import {
|
|||||||
TextCustom,
|
TextCustom,
|
||||||
ViewWrapper,
|
ViewWrapper,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
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 {
|
import {
|
||||||
@@ -265,13 +266,17 @@ export default function UserEventConfirmation() {
|
|||||||
<>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
title: "Konfirmasi Event",
|
header: () => (
|
||||||
headerLeft: () => (
|
<AppHeader
|
||||||
<Ionicons
|
title="Konfirmasi Event"
|
||||||
name="arrow-back"
|
left={
|
||||||
size={20}
|
<Ionicons
|
||||||
color={MainColor.yellow}
|
name="arrow-back"
|
||||||
onPress={() => router.navigate("/")}
|
size={20}
|
||||||
|
color={MainColor.yellow}
|
||||||
|
onPress={() => router.navigate("/")}
|
||||||
|
/>
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import {
|
|||||||
Spacing,
|
Spacing,
|
||||||
ViewWrapper,
|
ViewWrapper,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
||||||
import LeftButtonCustom from "@/components/Button/BackButton";
|
import LeftButtonCustom from "@/components/Button/BackButton";
|
||||||
import Event_BoxDetailPublishSection from "@/screens/Event/BoxDetailPublishSection";
|
import Event_BoxDetailPublishSection from "@/screens/Event/BoxDetailPublishSection";
|
||||||
@@ -49,9 +50,13 @@ export default function EventDetailContribution() {
|
|||||||
<>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
title: `Detail kontribusi`,
|
header: () => (
|
||||||
headerLeft: () => <LeftButtonCustom />,
|
<AppHeader
|
||||||
headerRight: () => <DotButton onPress={() => setOpenDrawer(true)} />,
|
title="Detail kontribusi"
|
||||||
|
left={<LeftButtonCustom />}
|
||||||
|
right={<DotButton onPress={() => setOpenDrawer(true)} />}
|
||||||
|
/>
|
||||||
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ViewWrapper>
|
<ViewWrapper>
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import {
|
|||||||
ViewWrapper,
|
ViewWrapper,
|
||||||
Spacing,
|
Spacing,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
||||||
import LeftButtonCustom from "@/components/Button/BackButton";
|
import LeftButtonCustom from "@/components/Button/BackButton";
|
||||||
import Event_BoxDetailPublishSection from "@/screens/Event/BoxDetailPublishSection";
|
import Event_BoxDetailPublishSection from "@/screens/Event/BoxDetailPublishSection";
|
||||||
@@ -44,9 +45,13 @@ export default function EventDetailHistory() {
|
|||||||
<>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
title: `Detail riwayat`,
|
header: () => (
|
||||||
headerLeft: () => <LeftButtonCustom />,
|
<AppHeader
|
||||||
headerRight: () => <DotButton onPress={() => setOpenDrawer(true)} />,
|
title="Detail riwayat"
|
||||||
|
left={<LeftButtonCustom />}
|
||||||
|
right={<DotButton onPress={() => setOpenDrawer(true)} />}
|
||||||
|
/>
|
||||||
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ViewWrapper>
|
<ViewWrapper>
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import {
|
|||||||
MenuDrawerDynamicGrid,
|
MenuDrawerDynamicGrid,
|
||||||
ViewWrapper,
|
ViewWrapper,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
||||||
import CustomSkeleton from "@/components/_ShareComponent/SkeletonCustom";
|
import CustomSkeleton from "@/components/_ShareComponent/SkeletonCustom";
|
||||||
import LeftButtonCustom from "@/components/Button/BackButton";
|
import LeftButtonCustom from "@/components/Button/BackButton";
|
||||||
@@ -156,9 +157,13 @@ export default function EventDetailPublish() {
|
|||||||
<>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
title: `Event Publish`,
|
header: () => (
|
||||||
headerLeft: () => <BackButton onPress={() => router.back()} />,
|
<AppHeader
|
||||||
headerRight: () => <DotButton onPress={() => setOpenDrawer(true)} />,
|
title="Event Publish"
|
||||||
|
left={<BackButton onPress={() => router.back()} />}
|
||||||
|
right={<DotButton onPress={() => setOpenDrawer(true)} />}
|
||||||
|
/>
|
||||||
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ViewWrapper>
|
<ViewWrapper>
|
||||||
|
|||||||
@@ -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, 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,63 +142,61 @@ export default function Application() {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<ViewWrapper
|
<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,
|
|
||||||
})}
|
|
||||||
/>
|
/>
|
||||||
) : (
|
}
|
||||||
<View style={GStyles.tabBar}>
|
keyboardShouldPersistTaps="handled"
|
||||||
<View style={[GStyles.tabContainer, { paddingTop: 10 }]}>
|
>
|
||||||
{Array.from({ length: 4 }).map((e, index) => (
|
<StackCustom>
|
||||||
|
<Home_ImageSection />
|
||||||
|
|
||||||
|
{data && data ? (
|
||||||
|
<Home_FeatureSection />
|
||||||
|
) : (
|
||||||
|
<View style={stylesHome.gridContainer}>
|
||||||
|
{Array.from({ length: 4 }).map((_, index) => (
|
||||||
<CustomSkeleton
|
<CustomSkeleton
|
||||||
key={index}
|
key={index}
|
||||||
height={40}
|
style={stylesHome.gridItem}
|
||||||
width={40}
|
radius={50}
|
||||||
radius={100}
|
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</View>
|
</View>
|
||||||
</View>
|
)}
|
||||||
)
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<StackCustom>
|
|
||||||
<Home_ImageSection />
|
|
||||||
|
|
||||||
{data && data ? (
|
{data ? (
|
||||||
<Home_FeatureSection />
|
<Home_BottomFeatureSection listData={listData} />
|
||||||
) : (
|
) : (
|
||||||
<View style={stylesHome.gridContainer}>
|
<CustomSkeleton height={150} />
|
||||||
{Array.from({ length: 4 }).map((item, index) => (
|
)}
|
||||||
<CustomSkeleton
|
</StackCustom>
|
||||||
key={index}
|
</ScrollView>
|
||||||
style={stylesHome.gridItem}
|
|
||||||
radius={50}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</View>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{data ? (
|
{/* Home Tabs di bawah */}
|
||||||
<Home_BottomFeatureSection listData={listData} />
|
{data && data ? (
|
||||||
) : (
|
<HomeTabs
|
||||||
<CustomSkeleton height={200} />
|
tabs={tabsHome({
|
||||||
)}
|
acceptedForumTermsAt: data?.acceptedForumTermsAt,
|
||||||
</StackCustom>
|
profileId: data?.Profile?.id,
|
||||||
</ViewWrapper>
|
})}
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<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,6 +10,7 @@ import {
|
|||||||
TextCustom,
|
TextCustom,
|
||||||
ViewWrapper,
|
ViewWrapper,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import { IconDocument, IconEdit, IconNews } from "@/components/_Icon";
|
import { IconDocument, IconEdit, IconNews } from "@/components/_Icon";
|
||||||
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
@@ -30,13 +31,13 @@ export default function InvestmentDetailHolding() {
|
|||||||
const [openDrawerDraft, setOpenDrawerDraft] = useState(false);
|
const [openDrawerDraft, setOpenDrawerDraft] = useState(false);
|
||||||
const [openDrawerPublish, setOpenDrawerPublish] = useState(false);
|
const [openDrawerPublish, setOpenDrawerPublish] = useState(false);
|
||||||
const [data, setData] = useState<any>(null);
|
const [data, setData] = useState<any>(null);
|
||||||
|
|
||||||
useFocusEffect(
|
useFocusEffect(
|
||||||
useCallback(() => {
|
useCallback(() => {
|
||||||
onLoadData();
|
onLoadData();
|
||||||
}, [id, status])
|
}, [id, status])
|
||||||
);
|
);
|
||||||
|
|
||||||
const onLoadData = async () => {
|
const onLoadData = async () => {
|
||||||
try {
|
try {
|
||||||
const response = await apiInvestmentGetInvoice({
|
const response = await apiInvestmentGetInvoice({
|
||||||
@@ -44,7 +45,7 @@ export default function InvestmentDetailHolding() {
|
|||||||
authorId: user?.id,
|
authorId: user?.id,
|
||||||
category: "invoice",
|
category: "invoice",
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log("[DATA]", JSON.stringify(response.data, null, 2));
|
console.log("[DATA]", JSON.stringify(response.data, null, 2));
|
||||||
setData(response.data);
|
setData(response.data);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -76,14 +77,19 @@ export default function InvestmentDetailHolding() {
|
|||||||
<>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
title: `Detail ${_.startCase(status as string)}`,
|
header: () => (
|
||||||
headerLeft: () => <BackButton />,
|
<AppHeader
|
||||||
headerRight: () =>
|
title={`Detail ${_.startCase(status as string)}`}
|
||||||
status === "draft" ? (
|
left={<BackButton />}
|
||||||
<DotButton onPress={() => setOpenDrawerDraft(true)} />
|
right={
|
||||||
) : status === "publish" ? (
|
status === "draft" ? (
|
||||||
<DotButton onPress={() => setOpenDrawerPublish(true)} />
|
<DotButton onPress={() => setOpenDrawerDraft(true)} />
|
||||||
) : null,
|
) : status === "publish" ? (
|
||||||
|
<DotButton onPress={() => setOpenDrawerPublish(true)} />
|
||||||
|
) : null
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import {
|
|||||||
TextCustom,
|
TextCustom,
|
||||||
ViewWrapper,
|
ViewWrapper,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import { IconTrash } from "@/components/_Icon/IconTrash";
|
import { IconTrash } from "@/components/_Icon/IconTrash";
|
||||||
import { useAuth } from "@/hooks/use-auth";
|
import { useAuth } from "@/hooks/use-auth";
|
||||||
import {
|
import {
|
||||||
@@ -56,12 +57,17 @@ export default function InvestmentNews() {
|
|||||||
<>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
title: "Detail Berita",
|
header: () => (
|
||||||
headerLeft: () => <BackButton />,
|
<AppHeader
|
||||||
headerRight: () =>
|
title="Detail Berita"
|
||||||
user?.id === data?.authorId && (
|
left={<BackButton />}
|
||||||
<DotButton onPress={() => setOpenDrawer(true)} />
|
right={
|
||||||
),
|
user?.id === data?.authorId && (
|
||||||
|
<DotButton onPress={() => setOpenDrawer(true)} />
|
||||||
|
)
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ViewWrapper>
|
<ViewWrapper>
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import {
|
|||||||
MenuDrawerDynamicGrid,
|
MenuDrawerDynamicGrid,
|
||||||
ViewWrapper,
|
ViewWrapper,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import { IconDocument, IconEdit, IconNews } from "@/components/_Icon";
|
import { IconDocument, IconEdit, IconNews } from "@/components/_Icon";
|
||||||
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
@@ -106,14 +107,19 @@ export default function InvestmentDetailStatus() {
|
|||||||
<>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
title: `Detail ${_.startCase(status as string)}`,
|
header: () => (
|
||||||
headerLeft: () => <BackButton />,
|
<AppHeader
|
||||||
headerRight: () =>
|
title={`Detail ${_.startCase(status as string)}`}
|
||||||
status === "draft" ? (
|
left={<BackButton />}
|
||||||
<DotButton onPress={() => setOpenDrawerDraft(true)} />
|
right={
|
||||||
) : status === "publish" ? (
|
status === "draft" ? (
|
||||||
<DotButton onPress={() => setOpenDrawerPublish(true)} />
|
<DotButton onPress={() => setOpenDrawerDraft(true)} />
|
||||||
) : null,
|
) : status === "publish" ? (
|
||||||
|
<DotButton onPress={() => setOpenDrawerPublish(true)} />
|
||||||
|
) : null
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import {
|
|||||||
MenuDrawerDynamicGrid,
|
MenuDrawerDynamicGrid,
|
||||||
ViewWrapper,
|
ViewWrapper,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import { IconDocument, IconEdit, IconNews } from "@/components/_Icon";
|
import { IconDocument, IconEdit, IconNews } from "@/components/_Icon";
|
||||||
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
@@ -105,14 +106,19 @@ export default function InvestmentDetail() {
|
|||||||
<>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
title: `Detail ${_.startCase(status as string)}`,
|
header: () => (
|
||||||
headerLeft: () => <BackButton />,
|
<AppHeader
|
||||||
headerRight: () =>
|
title={`Detail ${_.startCase(status as string)}`}
|
||||||
status === "draft" ? (
|
left={<BackButton />}
|
||||||
<DotButton onPress={() => setOpenDrawerDraft(true)} />
|
right={
|
||||||
) : status === "publish" ? (
|
status === "draft" ? (
|
||||||
<DotButton onPress={() => setOpenDrawerPublish(true)} />
|
<DotButton onPress={() => setOpenDrawerDraft(true)} />
|
||||||
) : null,
|
) : status === "publish" ? (
|
||||||
|
<DotButton onPress={() => setOpenDrawerPublish(true)} />
|
||||||
|
) : null
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|||||||
@@ -1,37 +1,60 @@
|
|||||||
/* eslint-disable react-hooks/exhaustive-deps */
|
/* eslint-disable react-hooks/exhaustive-deps */
|
||||||
import { BackButton } from "@/components";
|
import { BackButton } from "@/components";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import { IconHome, IconStatus } from "@/components/_Icon";
|
import { IconHome, IconStatus } from "@/components/_Icon";
|
||||||
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 { Ionicons } from "@expo/vector-icons";
|
import { Ionicons } from "@expo/vector-icons";
|
||||||
|
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 {
|
import {
|
||||||
router,
|
OS_ANDROID_HEIGHT,
|
||||||
Tabs,
|
OS_ANDROID_PADDING_TOP,
|
||||||
useLocalSearchParams,
|
OS_IOS_HEIGHT,
|
||||||
useNavigation
|
OS_IOS_PADDING_TOP,
|
||||||
} from "expo-router";
|
} from "@/constants/constans-value";
|
||||||
import { useLayoutEffect } from "react";
|
|
||||||
|
|
||||||
export default function JobTabsLayout() {
|
|
||||||
const navigation = useNavigation();
|
|
||||||
|
|
||||||
|
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;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
// Atur header secara dinamis
|
|
||||||
useLayoutEffect(() => {
|
|
||||||
navigation.setOptions({
|
|
||||||
headerLeft: () => (
|
|
||||||
<BackButtonFromNotification from={from as string} category={category as string} />
|
|
||||||
),
|
|
||||||
});
|
|
||||||
}, [from, router, navigation]);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<View style={{ flex: 1, backgroundColor: MainColor.darkblue }}>
|
||||||
<Tabs screenOptions={TabsStyles}>
|
<Tabs
|
||||||
|
screenOptions={{
|
||||||
|
...TabsStyles,
|
||||||
|
tabBarStyle: Platform.select({
|
||||||
|
ios: {
|
||||||
|
borderTopWidth: 0,
|
||||||
|
paddingTop: OS_IOS_PADDING_TOP,
|
||||||
|
height: OS_IOS_HEIGHT,
|
||||||
|
},
|
||||||
|
android: {
|
||||||
|
borderTopWidth: 0,
|
||||||
|
paddingTop: OS_ANDROID_PADDING_TOP,
|
||||||
|
height: OS_ANDROID_HEIGHT + paddingBottom,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
header: () => (
|
||||||
|
<AppHeader
|
||||||
|
title="Job Vacancy"
|
||||||
|
left={
|
||||||
|
<BackButtonFromNotification
|
||||||
|
from={from || ""}
|
||||||
|
category={category}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
}}
|
||||||
|
>
|
||||||
<Tabs.Screen
|
<Tabs.Screen
|
||||||
name="index"
|
name="index"
|
||||||
options={{
|
options={{
|
||||||
@@ -56,6 +79,10 @@ export default function JobTabsLayout() {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
</>
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default function JobTabsLayout() {
|
||||||
|
return <JobTabsWrapper />;
|
||||||
|
}
|
||||||
|
|||||||
@@ -5,10 +5,11 @@ import {
|
|||||||
DrawerCustom,
|
DrawerCustom,
|
||||||
LoaderCustom,
|
LoaderCustom,
|
||||||
MenuDrawerDynamicGrid,
|
MenuDrawerDynamicGrid,
|
||||||
|
OS_Wrapper,
|
||||||
Spacing,
|
Spacing,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import { IconEdit } from "@/components/_Icon";
|
import { IconEdit } from "@/components/_Icon";
|
||||||
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
||||||
import ReportBox from "@/components/Box/ReportBox";
|
import ReportBox from "@/components/Box/ReportBox";
|
||||||
@@ -22,6 +23,7 @@ import {
|
|||||||
useLocalSearchParams,
|
useLocalSearchParams,
|
||||||
} from "expo-router";
|
} from "expo-router";
|
||||||
import { useCallback, useState } from "react";
|
import { useCallback, useState } from "react";
|
||||||
|
import { PADDING_INLINE } from "@/constants/constans-value";
|
||||||
|
|
||||||
export default function JobDetailStatus() {
|
export default function JobDetailStatus() {
|
||||||
const { id, status } = useLocalSearchParams();
|
const { id, status } = useLocalSearchParams();
|
||||||
@@ -58,15 +60,20 @@ export default function JobDetailStatus() {
|
|||||||
<>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
title: `Detail`,
|
header: () => (
|
||||||
headerLeft: () => <BackButton />,
|
<AppHeader
|
||||||
headerRight: () =>
|
title="Detail"
|
||||||
status === "draft" ? (
|
left={<BackButton />}
|
||||||
<DotButton onPress={() => setOpenDrawer(true)} />
|
right={
|
||||||
) : null,
|
status === "draft" ? (
|
||||||
|
<DotButton onPress={() => setOpenDrawer(true)} />
|
||||||
|
) : null
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ViewWrapper>
|
<OS_Wrapper >
|
||||||
{isLoadData ? (
|
{isLoadData ? (
|
||||||
<LoaderCustom />
|
<LoaderCustom />
|
||||||
) : (
|
) : (
|
||||||
@@ -77,7 +84,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}
|
||||||
@@ -90,7 +97,7 @@ export default function JobDetailStatus() {
|
|||||||
<Spacing />
|
<Spacing />
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</ViewWrapper>
|
</OS_Wrapper>
|
||||||
|
|
||||||
<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>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Admin_ScreenPortofolioCreate } from "@/screens/Portofolio/ScreenPortofolioCreate";
|
import { ScreenPortofolioCreate } from "@/screens/Portofolio/ScreenPortofolioCreate";
|
||||||
|
|
||||||
export default function PortofolioCreate() {
|
export default function PortofolioCreate() {
|
||||||
return <Admin_ScreenPortofolioCreate />;
|
return <ScreenPortofolioCreate />;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import {
|
|||||||
ButtonCustom,
|
ButtonCustom,
|
||||||
CenterCustom,
|
CenterCustom,
|
||||||
NewWrapper,
|
NewWrapper,
|
||||||
|
PhoneInputCustom,
|
||||||
SelectCustom,
|
SelectCustom,
|
||||||
Spacing,
|
Spacing,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
@@ -15,6 +16,7 @@ import {
|
|||||||
import ListSkeletonComponent from "@/components/_ShareComponent/ListSkeletonComponent";
|
import ListSkeletonComponent from "@/components/_ShareComponent/ListSkeletonComponent";
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
import { ICON_SIZE_XLARGE } from "@/constants/constans-value";
|
import { ICON_SIZE_XLARGE } from "@/constants/constans-value";
|
||||||
|
import { DEFAULT_COUNTRY, type CountryData, COUNTRIES } from "@/constants/countries";
|
||||||
import {
|
import {
|
||||||
apiMasterBidangBisnis,
|
apiMasterBidangBisnis,
|
||||||
apiMasterSubBidangBisnis,
|
apiMasterSubBidangBisnis,
|
||||||
@@ -32,7 +34,6 @@ import { router, useLocalSearchParams } from "expo-router";
|
|||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { Text, View } from "react-native";
|
import { Text, View } from "react-native";
|
||||||
import PhoneInput, { ICountry } from "react-native-international-phone-number";
|
|
||||||
import { ActivityIndicator } from "react-native-paper";
|
import { ActivityIndicator } from "react-native-paper";
|
||||||
import Toast from "react-native-toast-message";
|
import Toast from "react-native-toast-message";
|
||||||
|
|
||||||
@@ -59,8 +60,8 @@ export default function PortofolioEdit() {
|
|||||||
const { id } = useLocalSearchParams();
|
const { id } = useLocalSearchParams();
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
const [data, setData] = useState<any>({});
|
const [data, setData] = useState<any>({});
|
||||||
|
const [phoneNumber, setPhoneNumber] = useState<string>("");
|
||||||
const [selectedCountry, setSelectedCountry] = useState<null | ICountry>(null);
|
const [selectedCountry, setSelectedCountry] = useState<CountryData>(DEFAULT_COUNTRY);
|
||||||
const [bidangBisnis, setBidangBisnis] = useState<
|
const [bidangBisnis, setBidangBisnis] = useState<
|
||||||
IMasterBidangBisnis[] | null
|
IMasterBidangBisnis[] | null
|
||||||
>(null);
|
>(null);
|
||||||
@@ -72,12 +73,42 @@ export default function PortofolioEdit() {
|
|||||||
IListSubBidangSelected[]
|
IListSubBidangSelected[]
|
||||||
>([]);
|
>([]);
|
||||||
|
|
||||||
function handleInputValue(phoneNumber: string) {
|
function handlePhoneChange(phone: string) {
|
||||||
setData({ ...data, tlpn: phoneNumber });
|
setPhoneNumber(phone);
|
||||||
|
|
||||||
|
// Format phone number for API
|
||||||
|
const callingCode = selectedCountry.callingCode;
|
||||||
|
let fixNumber = phone.replace(/\s+/g, "").replace(/^0+/, "");
|
||||||
|
|
||||||
|
// Remove country code if already present
|
||||||
|
if (fixNumber.startsWith(callingCode)) {
|
||||||
|
fixNumber = fixNumber.substring(callingCode.length);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remove leading zero
|
||||||
|
fixNumber = fixNumber.replace(/^0+/, "");
|
||||||
|
|
||||||
|
const realNumber = callingCode + fixNumber;
|
||||||
|
setData({ ...data, tlpn: realNumber });
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleSelectedCountry(country: ICountry) {
|
function handleCountryChange(country: CountryData) {
|
||||||
setSelectedCountry(country);
|
setSelectedCountry(country);
|
||||||
|
|
||||||
|
// Re-format with new country code
|
||||||
|
const callingCode = country.callingCode;
|
||||||
|
let fixNumber = phoneNumber.replace(/\s+/g, "").replace(/^0+/, "");
|
||||||
|
|
||||||
|
// Remove country code if already present
|
||||||
|
if (fixNumber.startsWith(callingCode)) {
|
||||||
|
fixNumber = fixNumber.substring(callingCode.length);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remove leading zero
|
||||||
|
fixNumber = fixNumber.replace(/^0+/, "");
|
||||||
|
|
||||||
|
const realNumber = callingCode + fixNumber;
|
||||||
|
setData({ ...data, tlpn: realNumber });
|
||||||
}
|
}
|
||||||
|
|
||||||
const onLoadMasterBidang = async () => {
|
const onLoadMasterBidang = async () => {
|
||||||
@@ -122,8 +153,27 @@ export default function PortofolioEdit() {
|
|||||||
const response = await apiGetOnePortofolio({ id: id });
|
const response = await apiGetOnePortofolio({ id: id });
|
||||||
|
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
const fixNumber = response.data.tlpn.replace("62", "");
|
// Extract phone number without country code for display
|
||||||
setData({ ...response.data, tlpn: fixNumber });
|
const fullNumber = response.data.tlpn;
|
||||||
|
let displayNumber = fullNumber;
|
||||||
|
let detectedCountry = DEFAULT_COUNTRY;
|
||||||
|
|
||||||
|
// Try to detect country from calling code
|
||||||
|
for (const country of COUNTRIES) {
|
||||||
|
if (fullNumber.startsWith(country.callingCode)) {
|
||||||
|
detectedCountry = country;
|
||||||
|
displayNumber = fullNumber.substring(country.callingCode.length);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
setSelectedCountry(detectedCountry);
|
||||||
|
|
||||||
|
// Remove leading zero if present
|
||||||
|
displayNumber = displayNumber.replace(/^0+/, "");
|
||||||
|
|
||||||
|
setPhoneNumber(displayNumber);
|
||||||
|
setData({ ...response.data, tlpn: displayNumber });
|
||||||
|
|
||||||
// Cek apakah ada sub bidang bisnis yang terpilih
|
// Cek apakah ada sub bidang bisnis yang terpilih
|
||||||
const prevSubBidang = response.data.Portofolio_BidangDanSubBidangBisnis;
|
const prevSubBidang = response.data.Portofolio_BidangDanSubBidangBisnis;
|
||||||
@@ -244,15 +294,11 @@ export default function PortofolioEdit() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handleSubmitUpdate = async () => {
|
const handleSubmitUpdate = async () => {
|
||||||
const callingCode = selectedCountry?.callingCode.replace(/^\+/, "") || "";
|
|
||||||
let fixNumber = data.tlpn.replace(/\s+/g, "").replace(/^0+/, "");
|
|
||||||
const realNumber = callingCode + fixNumber;
|
|
||||||
|
|
||||||
const newData: IFormData = {
|
const newData: IFormData = {
|
||||||
id_Portofolio: data.id_Portofolio,
|
id_Portofolio: data.id_Portofolio,
|
||||||
namaBisnis: data.namaBisnis,
|
namaBisnis: data.namaBisnis,
|
||||||
alamatKantor: data.alamatKantor,
|
alamatKantor: data.alamatKantor,
|
||||||
tlpn: realNumber,
|
tlpn: data.tlpn, // Already formatted by PhoneInputCustom
|
||||||
deskripsi: data.deskripsi,
|
deskripsi: data.deskripsi,
|
||||||
masterBidangBisnisId: data.masterBidangBisnisId,
|
masterBidangBisnisId: data.masterBidangBisnisId,
|
||||||
subBidang: listSubBidangSelected,
|
subBidang: listSubBidangSelected,
|
||||||
@@ -435,12 +481,11 @@ export default function PortofolioEdit() {
|
|||||||
<Text style={{ color: "red" }}> *</Text>
|
<Text style={{ color: "red" }}> *</Text>
|
||||||
</View>
|
</View>
|
||||||
<Spacing height={5} />
|
<Spacing height={5} />
|
||||||
<PhoneInput
|
<PhoneInputCustom
|
||||||
value={data.tlpn}
|
value={phoneNumber}
|
||||||
onChangePhoneNumber={handleInputValue}
|
onChangePhoneNumber={handlePhoneChange}
|
||||||
selectedCountry={selectedCountry}
|
selectedCountry={selectedCountry}
|
||||||
onChangeSelectedCountry={handleSelectedCountry}
|
onChangeCountry={handleCountryChange}
|
||||||
defaultCountry="ID"
|
|
||||||
placeholder="xxx-xxx-xxx"
|
placeholder="xxx-xxx-xxx"
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import {
|
|||||||
StackCustom,
|
StackCustom,
|
||||||
TextCustom,
|
TextCustom,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import LeftButtonCustom from "@/components/Button/BackButton";
|
import LeftButtonCustom from "@/components/Button/BackButton";
|
||||||
import GridTwoView from "@/components/_ShareComponent/GridTwoView";
|
import GridTwoView from "@/components/_ShareComponent/GridTwoView";
|
||||||
import CustomSkeleton from "@/components/_ShareComponent/SkeletonCustom";
|
import CustomSkeleton from "@/components/_ShareComponent/SkeletonCustom";
|
||||||
@@ -72,20 +73,23 @@ export default function Portofolio() {
|
|||||||
{/* Header */}
|
{/* Header */}
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
title: "Portofolio",
|
header: () => (
|
||||||
headerLeft: () => <LeftButtonCustom />,
|
<AppHeader
|
||||||
headerRight: () =>
|
title="Portofolio"
|
||||||
data?.Profile?.id !== profileId ? null : (
|
left={<LeftButtonCustom />}
|
||||||
<TouchableOpacity onPress={openDrawer}>
|
right={
|
||||||
<Ionicons
|
data?.Profile?.id !== profileId ? null : (
|
||||||
name="ellipsis-vertical"
|
<TouchableOpacity onPress={openDrawer}>
|
||||||
size={20}
|
<Ionicons
|
||||||
color={MainColor.yellow}
|
name="ellipsis-vertical"
|
||||||
/>
|
size={20}
|
||||||
</TouchableOpacity>
|
color={MainColor.yellow}
|
||||||
),
|
/>
|
||||||
headerStyle: GStyles.headerStyle,
|
</TouchableOpacity>
|
||||||
headerTitleStyle: GStyles.headerTitleStyle,
|
)
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ViewWrapper>
|
<ViewWrapper>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import LeftButtonCustom from "@/components/Button/BackButton";
|
import LeftButtonCustom from "@/components/Button/BackButton";
|
||||||
import { HeaderStyles } from "@/styles/header-styles";
|
|
||||||
import { Stack } from "expo-router";
|
import { Stack } from "expo-router";
|
||||||
|
|
||||||
export default function PortofolioLayout() {
|
export default function PortofolioLayout() {
|
||||||
@@ -7,8 +7,9 @@ export default function PortofolioLayout() {
|
|||||||
<>
|
<>
|
||||||
<Stack
|
<Stack
|
||||||
screenOptions={{
|
screenOptions={{
|
||||||
...HeaderStyles,
|
header: () => (
|
||||||
headerLeft: () => <LeftButtonCustom />,
|
<AppHeader title="Portofolio" left={<LeftButtonCustom />} />
|
||||||
|
),
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{/* <Stack.Screen name="[id]/index" options={{ title: "Portofolio" }} /> */}
|
{/* <Stack.Screen name="[id]/index" options={{ title: "Portofolio" }} /> */}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/* eslint-disable react-hooks/exhaustive-deps */
|
/* eslint-disable react-hooks/exhaustive-deps */
|
||||||
import { NewWrapper, StackCustom } from "@/components";
|
import { NewWrapper, StackCustom } from "@/components";
|
||||||
|
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";
|
||||||
import DrawerCustom from "@/components/Drawer/DrawerCustom";
|
import DrawerCustom from "@/components/Drawer/DrawerCustom";
|
||||||
@@ -101,18 +102,20 @@ export default function Profile() {
|
|||||||
<>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
title: `Profile`,
|
header: () => (
|
||||||
headerLeft: () => <LeftButtonCustom />,
|
<AppHeader
|
||||||
headerRight: () => (
|
title="Profile"
|
||||||
<ButtonnDot
|
left={<LeftButtonCustom />}
|
||||||
id={id as string}
|
right={
|
||||||
openDrawer={openDrawer}
|
<ButtonnDot
|
||||||
isUserCheck={isUserCheck()}
|
id={id as string}
|
||||||
logout={logout}
|
openDrawer={openDrawer}
|
||||||
|
isUserCheck={isUserCheck()}
|
||||||
|
logout={logout}
|
||||||
|
/>
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
headerStyle: GStyles.headerStyle,
|
|
||||||
headerTitleStyle: GStyles.headerTitleStyle,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
{/* Main View */}
|
{/* Main View */}
|
||||||
|
|||||||
@@ -1,47 +1,43 @@
|
|||||||
import { BackButton } from "@/components";
|
import { BackButton } from "@/components";
|
||||||
import { GStyles } from "@/styles/global-styles";
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import { Stack } from "expo-router";
|
import { Stack } from "expo-router";
|
||||||
|
|
||||||
export default function ProfileLayout() {
|
export default function ProfileLayout() {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack
|
<Stack>
|
||||||
screenOptions={{
|
|
||||||
headerStyle: GStyles.headerStyle,
|
|
||||||
headerTitleStyle: GStyles.headerTitleStyle,
|
|
||||||
headerTitleAlign: "center",
|
|
||||||
headerBackButtonDisplayMode: "minimal",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{/* <Stack.Screen name="[id]/index" options={{ headerShown: false }} /> */}
|
{/* <Stack.Screen name="[id]/index" options={{ headerShown: false }} /> */}
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="[id]/edit"
|
name="[id]/edit"
|
||||||
options={{ title: "Edit Profile", headerLeft: () => <BackButton /> }}
|
options={{ header: () => <AppHeader title="Edit Profile" /> }}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="[id]/update-photo"
|
name="[id]/update-photo"
|
||||||
options={{ title: "Update Foto", headerLeft: () => <BackButton /> }}
|
options={{ header: () => <AppHeader title="Update Foto" /> }}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="[id]/update-background"
|
name="[id]/update-background"
|
||||||
options={{
|
options={{
|
||||||
title: "Update Latar Belakang",
|
header: () => <AppHeader title="Update Latar Belakang" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="create"
|
name="create"
|
||||||
options={{ title: "Buat Profile", headerBackVisible: false }}
|
options={{
|
||||||
|
header: () => (
|
||||||
|
<AppHeader title="Tambah Profil" showBack={false} />
|
||||||
|
),
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="[id]/blocked-list"
|
name="[id]/blocked-list"
|
||||||
options={{ title: "Daftar Blokir", headerLeft: () => <BackButton /> }}
|
options={{ header: () => <AppHeader title="Daftar Blokir" /> }}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="[id]/detail-blocked"
|
name="[id]/detail-blocked"
|
||||||
options={{ title: "Detail Blokir", headerLeft: () => <BackButton /> }}
|
options={{ header: () => <AppHeader title="Detail Blokir" /> }}
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -4,64 +4,86 @@ import {
|
|||||||
IconHome,
|
IconHome,
|
||||||
IconStatus,
|
IconStatus,
|
||||||
} from "@/components/_Icon";
|
} from "@/components/_Icon";
|
||||||
|
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 { Tabs, useLocalSearchParams, useNavigation, router } from "expo-router";
|
import { router, Tabs, useLocalSearchParams } from "expo-router";
|
||||||
import { useLayoutEffect } from "react";
|
import { View } from "react-native";
|
||||||
|
import { MainColor } from "@/constants/color-palet";
|
||||||
export default function VotingTabsLayout() {
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
||||||
const navigation = useNavigation();
|
import { Platform } from "react-native";
|
||||||
|
|
||||||
|
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;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
console.log("from", from);
|
|
||||||
console.log("category", category);
|
|
||||||
|
|
||||||
// Atur header secara dinamis
|
|
||||||
useLayoutEffect(() => {
|
|
||||||
navigation.setOptions({
|
|
||||||
headerLeft: () => (
|
|
||||||
<BackButtonFromNotification
|
|
||||||
from={from as string}
|
|
||||||
category={category as string}
|
|
||||||
/>
|
|
||||||
),
|
|
||||||
});
|
|
||||||
}, [from, router, navigation]);
|
|
||||||
|
|
||||||
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,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
header: () => (
|
||||||
|
<AppHeader
|
||||||
|
title="Voting"
|
||||||
|
left={
|
||||||
|
<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 />;
|
||||||
|
}
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import {
|
|||||||
TextCustom,
|
TextCustom,
|
||||||
ViewWrapper,
|
ViewWrapper,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import { IconArchive, IconContribution, IconEdit } from "@/components/_Icon";
|
import { IconArchive, IconContribution, IconEdit } from "@/components/_Icon";
|
||||||
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
||||||
import ReportBox from "@/components/Box/ReportBox";
|
import ReportBox from "@/components/Box/ReportBox";
|
||||||
@@ -103,14 +104,19 @@ export default function VotingDetailStatus() {
|
|||||||
<>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
title: `Detail`,
|
header: () => (
|
||||||
headerLeft: () => <BackButton />,
|
<AppHeader
|
||||||
headerRight: () =>
|
title="Detail"
|
||||||
status === "draft" ? (
|
left={<BackButton />}
|
||||||
<DotButton onPress={() => setOpenDrawerDraft(true)} />
|
right={
|
||||||
) : status === "publish" ? (
|
status === "draft" ? (
|
||||||
<DotButton onPress={() => setOpenDrawerPublish(true)} />
|
<DotButton onPress={() => setOpenDrawerDraft(true)} />
|
||||||
) : null,
|
) : status === "publish" ? (
|
||||||
|
<DotButton onPress={() => setOpenDrawerPublish(true)} />
|
||||||
|
) : null
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ViewWrapper>
|
<ViewWrapper>
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import {
|
|||||||
Spacing,
|
Spacing,
|
||||||
ViewWrapper,
|
ViewWrapper,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import { IconContribution } from "@/components/_Icon";
|
import { IconContribution } from "@/components/_Icon";
|
||||||
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
||||||
import { useAuth } from "@/hooks/use-auth";
|
import { useAuth } from "@/hooks/use-auth";
|
||||||
@@ -81,10 +82,14 @@ export default function VotingDetailContribution() {
|
|||||||
<>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
title: "Detail Kontribusi",
|
header: () => (
|
||||||
headerLeft: () => <BackButton />,
|
<AppHeader
|
||||||
headerRight: () => (
|
title="Detail Kontribusi"
|
||||||
<DotButton onPress={() => setOpenDrawerPublish(true)} />
|
left={<BackButton />}
|
||||||
|
right={
|
||||||
|
<DotButton onPress={() => setOpenDrawerPublish(true)} />
|
||||||
|
}
|
||||||
|
/>
|
||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import {
|
|||||||
Spacing,
|
Spacing,
|
||||||
ViewWrapper,
|
ViewWrapper,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import { IconContribution } from "@/components/_Icon";
|
import { IconContribution } from "@/components/_Icon";
|
||||||
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
||||||
import { useAuth } from "@/hooks/use-auth";
|
import { useAuth } from "@/hooks/use-auth";
|
||||||
@@ -82,10 +83,14 @@ export default function VotingDetailHistory() {
|
|||||||
<>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
title: "Riwayat Voting",
|
header: () => (
|
||||||
headerLeft: () => <BackButton />,
|
<AppHeader
|
||||||
headerRight: () => (
|
title="Riwayat Voting"
|
||||||
<DotButton onPress={() => setOpenDrawerPublish(true)} />
|
left={<BackButton />}
|
||||||
|
right={
|
||||||
|
<DotButton onPress={() => setOpenDrawerPublish(true)} />
|
||||||
|
}
|
||||||
|
/>
|
||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import {
|
|||||||
StackCustom,
|
StackCustom,
|
||||||
ViewWrapper,
|
ViewWrapper,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import { IconArchive, IconContribution } from "@/components/_Icon";
|
import { IconArchive, IconContribution } from "@/components/_Icon";
|
||||||
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
||||||
import CustomSkeleton from "@/components/_ShareComponent/SkeletonCustom";
|
import CustomSkeleton from "@/components/_ShareComponent/SkeletonCustom";
|
||||||
@@ -142,10 +143,14 @@ export default function VotingDetail() {
|
|||||||
<>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
title: `Detail Voting`,
|
header: () => (
|
||||||
headerLeft: () => <BackButton />,
|
<AppHeader
|
||||||
headerRight: () => (
|
title="Detail Voting"
|
||||||
<DotButton onPress={() => setOpenDrawerPublish(true)} />
|
left={<BackButton />}
|
||||||
|
right={
|
||||||
|
<DotButton onPress={() => setOpenDrawerPublish(true)} />
|
||||||
|
}
|
||||||
|
/>
|
||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { BackButton } from "@/components";
|
import { BackButton } from "@/components";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import BackgroundNotificationHandler from "@/components/Notification/BackgroundNotificationHandler";
|
import BackgroundNotificationHandler from "@/components/Notification/BackgroundNotificationHandler";
|
||||||
import NotificationInitializer from "@/components/Notification/NotificationInitializer";
|
import NotificationInitializer from "@/components/Notification/NotificationInitializer";
|
||||||
import { NotificationProvider } from "@/hooks/use-notification-store";
|
import { NotificationProvider } from "@/hooks/use-notification-store";
|
||||||
import { HeaderStyles } from "@/styles/header-styles";
|
|
||||||
import { Stack } from "expo-router";
|
import { Stack } from "expo-router";
|
||||||
|
|
||||||
export default function ApplicationLayout() {
|
export default function ApplicationLayout() {
|
||||||
@@ -20,7 +20,7 @@ export default function ApplicationLayout() {
|
|||||||
function ApplicationStack() {
|
function ApplicationStack() {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack screenOptions={HeaderStyles}>
|
<Stack>
|
||||||
<Stack.Screen name="(user)" options={{ headerShown: false }} />
|
<Stack.Screen name="(user)" options={{ headerShown: false }} />
|
||||||
<Stack.Screen name="admin" options={{ headerShown: false }} />
|
<Stack.Screen name="admin" options={{ headerShown: false }} />
|
||||||
|
|
||||||
@@ -28,8 +28,7 @@ function ApplicationStack() {
|
|||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="(image)/take-picture/[id]/index"
|
name="(image)/take-picture/[id]/index"
|
||||||
options={{
|
options={{
|
||||||
title: "Ambil Gambar",
|
header: () => <AppHeader title="Ambil Gambar" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@@ -37,8 +36,7 @@ function ApplicationStack() {
|
|||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="(image)/preview-image/[id]/index"
|
name="(image)/preview-image/[id]/index"
|
||||||
options={{
|
options={{
|
||||||
title: "Preview Gambar",
|
header: () => <AppHeader title="Preview Gambar" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import {
|
|||||||
StackCustom,
|
StackCustom,
|
||||||
TextCustom,
|
TextCustom,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import DrawerAdmin from "@/components/Drawer/DrawerAdmin";
|
import DrawerAdmin from "@/components/Drawer/DrawerAdmin";
|
||||||
import NavbarMenu from "@/components/Drawer/NavbarMenu";
|
import NavbarMenu from "@/components/Drawer/NavbarMenu";
|
||||||
import NavbarMenu_V2 from "@/components/Drawer/NavbarMenu_V2";
|
import NavbarMenu_V2 from "@/components/Drawer/NavbarMenu_V2";
|
||||||
@@ -35,12 +36,28 @@ import { useState } from "react";
|
|||||||
export default function AdminLayout() {
|
export default function AdminLayout() {
|
||||||
const [openDrawerNavbar, setOpenDrawerNavbar] = useState(false);
|
const [openDrawerNavbar, setOpenDrawerNavbar] = useState(false);
|
||||||
const [openDrawerUser, setOpenDrawerUser] = useState(false);
|
const [openDrawerUser, setOpenDrawerUser] = useState(false);
|
||||||
// const [user, setUser] = useState(null);
|
|
||||||
|
|
||||||
const { logout, user } = useAuth();
|
const { logout, user } = useAuth();
|
||||||
|
|
||||||
console.log("[USER LAYOUT]", JSON.stringify(user, null, 2));
|
console.log("[USER LAYOUT]", JSON.stringify(user, null, 2));
|
||||||
|
|
||||||
|
const headerLeft = () => (
|
||||||
|
<Ionicons
|
||||||
|
name="menu"
|
||||||
|
size={ICON_SIZE_XLARGE}
|
||||||
|
color={MainColor.white}
|
||||||
|
onPress={() => setOpenDrawerNavbar(true)}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
|
||||||
|
const headerRight = () => (
|
||||||
|
<FontAwesome6
|
||||||
|
name="circle-user"
|
||||||
|
size={ICON_SIZE_MEDIUM}
|
||||||
|
color={MainColor.white}
|
||||||
|
onPress={() => setOpenDrawerUser(true)}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack
|
<Stack
|
||||||
@@ -52,20 +69,33 @@ export default function AdminLayout() {
|
|||||||
contentStyle: {
|
contentStyle: {
|
||||||
borderBottomColor: AccentColor.blue,
|
borderBottomColor: AccentColor.blue,
|
||||||
},
|
},
|
||||||
headerLeft: () => (
|
|
||||||
<Ionicons
|
// headerLeft: () => (
|
||||||
name="menu"
|
// <Ionicons
|
||||||
size={ICON_SIZE_XLARGE}
|
// name="menu"
|
||||||
color={MainColor.white}
|
// size={ICON_SIZE_XLARGE}
|
||||||
onPress={() => setOpenDrawerNavbar(true)}
|
// color={MainColor.white}
|
||||||
/>
|
// onPress={() => setOpenDrawerNavbar(true)}
|
||||||
),
|
// />
|
||||||
headerRight: () => (
|
// ),
|
||||||
<FontAwesome6
|
// headerRight: () => (
|
||||||
name="circle-user"
|
// <FontAwesome6
|
||||||
size={ICON_SIZE_MEDIUM}
|
// name="circle-user"
|
||||||
color={MainColor.white}
|
// size={ICON_SIZE_MEDIUM}
|
||||||
onPress={() => setOpenDrawerUser(true)}
|
// color={MainColor.white}
|
||||||
|
// onPress={() => setOpenDrawerUser(true)}
|
||||||
|
// />
|
||||||
|
// ),
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
header: () => (
|
||||||
|
<AppHeader
|
||||||
|
title="HIPMI DASHBOARD"
|
||||||
|
showBack={false}
|
||||||
|
left={headerLeft()}
|
||||||
|
right={headerRight()}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { BackButton, StackCustom, TextCustom, ViewWrapper } from "@/components";
|
import { BackButton, StackCustom, TextCustom, ViewWrapper } from "@/components";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import { router, Stack } from "expo-router";
|
import { router, Stack } from "expo-router";
|
||||||
|
|
||||||
export default function NotFoundScreen() {
|
export default function NotFoundScreen() {
|
||||||
@@ -15,7 +16,7 @@ export default function NotFoundScreen() {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{ headerShown: true, title: "", headerLeft: () => <BackButton onPress={() => handleBack()} /> }}
|
options={{ header: () => <AppHeader title="" left={<BackButton onPress={() => handleBack()} />} /> }}
|
||||||
/>
|
/>
|
||||||
<ViewWrapper>
|
<ViewWrapper>
|
||||||
<StackCustom
|
<StackCustom
|
||||||
|
|||||||
3
bun.lock
3
bun.lock
@@ -41,6 +41,7 @@
|
|||||||
"expo-symbols": "~1.0.7",
|
"expo-symbols": "~1.0.7",
|
||||||
"expo-system-ui": "~6.0.7",
|
"expo-system-ui": "~6.0.7",
|
||||||
"expo-web-browser": "~15.0.9",
|
"expo-web-browser": "~15.0.9",
|
||||||
|
"libphonenumber-js": "^1.12.40",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"moti": "^0.30.0",
|
"moti": "^0.30.0",
|
||||||
"react": "19.1.0",
|
"react": "19.1.0",
|
||||||
@@ -1772,6 +1773,8 @@
|
|||||||
|
|
||||||
"levn": ["levn@0.4.1", "", { "dependencies": { "prelude-ls": "^1.2.1", "type-check": "~0.4.0" } }, "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ=="],
|
"levn": ["levn@0.4.1", "", { "dependencies": { "prelude-ls": "^1.2.1", "type-check": "~0.4.0" } }, "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ=="],
|
||||||
|
|
||||||
|
"libphonenumber-js": ["libphonenumber-js@1.12.40", "", {}, "sha512-HKGs7GowShNls3Zh+7DTr6wYpPk5jC78l508yQQY3e8ZgJChM3A9JZghmMJZuK+5bogSfuTafpjksGSR3aMIEg=="],
|
||||||
|
|
||||||
"lighthouse-logger": ["lighthouse-logger@1.4.2", "", { "dependencies": { "debug": "^2.6.9", "marky": "^1.2.2" } }, "sha512-gPWxznF6TKmUHrOQjlVo2UbaL2EJ71mb2CCeRs/2qBpi4L/g4LUVc9+3lKQ6DTUZwJswfM7ainGrLO1+fOqa2g=="],
|
"lighthouse-logger": ["lighthouse-logger@1.4.2", "", { "dependencies": { "debug": "^2.6.9", "marky": "^1.2.2" } }, "sha512-gPWxznF6TKmUHrOQjlVo2UbaL2EJ71mb2CCeRs/2qBpi4L/g4LUVc9+3lKQ6DTUZwJswfM7ainGrLO1+fOqa2g=="],
|
||||||
|
|
||||||
"lightningcss": ["lightningcss@1.31.1", "", { "dependencies": { "detect-libc": "^2.0.3" }, "optionalDependencies": { "lightningcss-android-arm64": "1.31.1", "lightningcss-darwin-arm64": "1.31.1", "lightningcss-darwin-x64": "1.31.1", "lightningcss-freebsd-x64": "1.31.1", "lightningcss-linux-arm-gnueabihf": "1.31.1", "lightningcss-linux-arm64-gnu": "1.31.1", "lightningcss-linux-arm64-musl": "1.31.1", "lightningcss-linux-x64-gnu": "1.31.1", "lightningcss-linux-x64-musl": "1.31.1", "lightningcss-win32-arm64-msvc": "1.31.1", "lightningcss-win32-x64-msvc": "1.31.1" } }, "sha512-l51N2r93WmGUye3WuFoN5k10zyvrVs0qfKBhyC5ogUQ6Ew6JUSswh78mbSO+IU3nTWsyOArqPCcShdQSadghBQ=="],
|
"lightningcss": ["lightningcss@1.31.1", "", { "dependencies": { "detect-libc": "^2.0.3" }, "optionalDependencies": { "lightningcss-android-arm64": "1.31.1", "lightningcss-darwin-arm64": "1.31.1", "lightningcss-darwin-x64": "1.31.1", "lightningcss-freebsd-x64": "1.31.1", "lightningcss-linux-arm-gnueabihf": "1.31.1", "lightningcss-linux-arm64-gnu": "1.31.1", "lightningcss-linux-arm64-musl": "1.31.1", "lightningcss-linux-x64-gnu": "1.31.1", "lightningcss-linux-x64-musl": "1.31.1", "lightningcss-win32-arm64-msvc": "1.31.1", "lightningcss-win32-x64-msvc": "1.31.1" } }, "sha512-l51N2r93WmGUye3WuFoN5k10zyvrVs0qfKBhyC5ogUQ6Ew6JUSswh78mbSO+IU3nTWsyOArqPCcShdQSadghBQ=="],
|
||||||
|
|||||||
@@ -12,14 +12,15 @@ export default function BackButtonFromNotification({
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<BackButton
|
<BackButton
|
||||||
|
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
if (from === "notifications") {
|
if (from === "notifications") {
|
||||||
router.replace(`/notifications?category=${category}`);
|
router.push(`/notifications?category=${category}`);
|
||||||
} else {
|
} else {
|
||||||
if (from) {
|
if (from) {
|
||||||
router.replace(`/${from}` as any);
|
router.back();
|
||||||
} else {
|
} else {
|
||||||
router.navigate("/home");
|
router.back();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
|||||||
256
components/PhoneInput/PhoneInputCustom.tsx
Normal file
256
components/PhoneInput/PhoneInputCustom.tsx
Normal file
@@ -0,0 +1,256 @@
|
|||||||
|
import { MainColor } from "@/constants/color-palet";
|
||||||
|
import {
|
||||||
|
DEFAULT_COUNTRY,
|
||||||
|
searchCountries,
|
||||||
|
type CountryData,
|
||||||
|
} from "@/constants/countries";
|
||||||
|
import { useState } from "react";
|
||||||
|
import {
|
||||||
|
Modal,
|
||||||
|
ScrollView,
|
||||||
|
StyleSheet,
|
||||||
|
Text,
|
||||||
|
TextInput,
|
||||||
|
TouchableOpacity,
|
||||||
|
View,
|
||||||
|
} from "react-native";
|
||||||
|
|
||||||
|
interface PhoneInputProps {
|
||||||
|
value: string;
|
||||||
|
onChangePhoneNumber: (phone: string) => void;
|
||||||
|
selectedCountry?: CountryData;
|
||||||
|
onChangeCountry: (country: CountryData) => void;
|
||||||
|
placeholder?: string;
|
||||||
|
disabled?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function PhoneInputCustom({
|
||||||
|
value,
|
||||||
|
onChangePhoneNumber,
|
||||||
|
selectedCountry = DEFAULT_COUNTRY,
|
||||||
|
onChangeCountry,
|
||||||
|
placeholder = "Masukkan nomor",
|
||||||
|
disabled = false,
|
||||||
|
}: PhoneInputProps) {
|
||||||
|
const [countryPickerVisible, setCountryPickerVisible] = useState(false);
|
||||||
|
const [searchQuery, setSearchQuery] = useState("");
|
||||||
|
|
||||||
|
const filteredCountries = searchCountries(searchQuery);
|
||||||
|
|
||||||
|
const handleSelectCountry = (country: CountryData) => {
|
||||||
|
onChangeCountry(country);
|
||||||
|
setCountryPickerVisible(false);
|
||||||
|
setSearchQuery("");
|
||||||
|
};
|
||||||
|
|
||||||
|
const handlePhoneChange = (text: string) => {
|
||||||
|
// Only allow numbers and spaces
|
||||||
|
const cleaned = text.replace(/[^\d\s]/g, "");
|
||||||
|
onChangePhoneNumber(cleaned);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{/* Phone Input Field */}
|
||||||
|
<View style={styles.container}>
|
||||||
|
<TouchableOpacity
|
||||||
|
style={styles.countryPickerButton}
|
||||||
|
onPress={() => setCountryPickerVisible(true)}
|
||||||
|
disabled={disabled}
|
||||||
|
activeOpacity={0.7}
|
||||||
|
>
|
||||||
|
<Text style={styles.countryCodeText}>+{selectedCountry.callingCode}</Text>
|
||||||
|
</TouchableOpacity>
|
||||||
|
|
||||||
|
<View style={styles.divider} />
|
||||||
|
|
||||||
|
<TextInput
|
||||||
|
style={[styles.phoneInput, disabled && styles.disabledInput]}
|
||||||
|
placeholder={placeholder}
|
||||||
|
placeholderTextColor={MainColor.placeholder}
|
||||||
|
value={value}
|
||||||
|
onChangeText={handlePhoneChange}
|
||||||
|
keyboardType="phone-pad"
|
||||||
|
autoComplete="tel"
|
||||||
|
importantForAutofill="yes"
|
||||||
|
editable={!disabled}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
{/* Country Picker Modal */}
|
||||||
|
<Modal
|
||||||
|
visible={countryPickerVisible}
|
||||||
|
transparent
|
||||||
|
animationType="slide"
|
||||||
|
onRequestClose={() => setCountryPickerVisible(false)}
|
||||||
|
>
|
||||||
|
<View style={styles.modalOverlay}>
|
||||||
|
<View style={styles.modalContent}>
|
||||||
|
<View style={styles.modalHeader}>
|
||||||
|
<Text style={styles.modalTitle}>Pilih Negara</Text>
|
||||||
|
<TouchableOpacity onPress={() => setCountryPickerVisible(false)}>
|
||||||
|
<Text style={styles.modalClose}>✕</Text>
|
||||||
|
</TouchableOpacity>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<TextInput
|
||||||
|
style={styles.searchInput}
|
||||||
|
placeholder="Cari negara atau kode..."
|
||||||
|
placeholderTextColor={MainColor.placeholder}
|
||||||
|
value={searchQuery}
|
||||||
|
onChangeText={setSearchQuery}
|
||||||
|
autoFocus
|
||||||
|
/>
|
||||||
|
|
||||||
|
<ScrollView style={styles.countryList}>
|
||||||
|
{filteredCountries.map((country) => (
|
||||||
|
<TouchableOpacity
|
||||||
|
key={country.code}
|
||||||
|
style={[
|
||||||
|
styles.countryItem,
|
||||||
|
selectedCountry.code === country.code &&
|
||||||
|
styles.countryItemSelected,
|
||||||
|
]}
|
||||||
|
onPress={() => handleSelectCountry(country)}
|
||||||
|
activeOpacity={0.7}
|
||||||
|
>
|
||||||
|
<View style={styles.countryInfo}>
|
||||||
|
<Text style={styles.countryName}>{country.name}</Text>
|
||||||
|
<Text style={styles.countryCode}>+{country.callingCode}</Text>
|
||||||
|
</View>
|
||||||
|
{selectedCountry.code === country.code && (
|
||||||
|
<Text style={styles.checkmark}>✓</Text>
|
||||||
|
)}
|
||||||
|
</TouchableOpacity>
|
||||||
|
))}
|
||||||
|
</ScrollView>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
|
</Modal>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
// Container
|
||||||
|
container: {
|
||||||
|
flexDirection: "row",
|
||||||
|
backgroundColor: MainColor.white,
|
||||||
|
borderRadius: 8,
|
||||||
|
borderWidth: 1,
|
||||||
|
borderColor: MainColor.white_gray,
|
||||||
|
marginBottom: 16,
|
||||||
|
overflow: "hidden",
|
||||||
|
},
|
||||||
|
// Country Picker Button
|
||||||
|
countryPickerButton: {
|
||||||
|
flexDirection: "row",
|
||||||
|
alignItems: "center",
|
||||||
|
paddingHorizontal: 16,
|
||||||
|
paddingVertical: 14,
|
||||||
|
backgroundColor: MainColor.text_input,
|
||||||
|
borderRightWidth: 1,
|
||||||
|
borderRightColor: MainColor.white_gray,
|
||||||
|
},
|
||||||
|
countryCodeText: {
|
||||||
|
fontSize: 16,
|
||||||
|
color: MainColor.black,
|
||||||
|
fontWeight: "600",
|
||||||
|
},
|
||||||
|
dropdownIcon: {
|
||||||
|
fontSize: 18,
|
||||||
|
color: MainColor.placeholder,
|
||||||
|
marginLeft: 4,
|
||||||
|
},
|
||||||
|
// Divider
|
||||||
|
divider: {
|
||||||
|
width: 1,
|
||||||
|
backgroundColor: MainColor.white_gray,
|
||||||
|
},
|
||||||
|
// Phone Input
|
||||||
|
phoneInput: {
|
||||||
|
flex: 1,
|
||||||
|
paddingVertical: 14,
|
||||||
|
paddingHorizontal: 12,
|
||||||
|
fontSize: 16,
|
||||||
|
color: MainColor.black,
|
||||||
|
},
|
||||||
|
disabledInput: {
|
||||||
|
backgroundColor: MainColor.text_input,
|
||||||
|
color: MainColor.placeholder,
|
||||||
|
},
|
||||||
|
// Modal
|
||||||
|
modalOverlay: {
|
||||||
|
flex: 1,
|
||||||
|
backgroundColor: "rgba(0, 0, 0, 0.5)",
|
||||||
|
justifyContent: "flex-end",
|
||||||
|
},
|
||||||
|
modalContent: {
|
||||||
|
backgroundColor: MainColor.white,
|
||||||
|
borderTopLeftRadius: 20,
|
||||||
|
borderTopRightRadius: 20,
|
||||||
|
maxHeight: "80%",
|
||||||
|
paddingBottom: 34,
|
||||||
|
},
|
||||||
|
modalHeader: {
|
||||||
|
flexDirection: "row",
|
||||||
|
justifyContent: "space-between",
|
||||||
|
alignItems: "center",
|
||||||
|
padding: 20,
|
||||||
|
borderBottomWidth: 1,
|
||||||
|
borderBottomColor: MainColor.white_gray,
|
||||||
|
},
|
||||||
|
modalTitle: {
|
||||||
|
fontSize: 18,
|
||||||
|
fontWeight: "bold",
|
||||||
|
color: MainColor.black,
|
||||||
|
},
|
||||||
|
modalClose: {
|
||||||
|
fontSize: 24,
|
||||||
|
color: MainColor.placeholder,
|
||||||
|
padding: 5,
|
||||||
|
},
|
||||||
|
// Search Input
|
||||||
|
searchInput: {
|
||||||
|
backgroundColor: MainColor.text_input,
|
||||||
|
margin: 16,
|
||||||
|
padding: 12,
|
||||||
|
borderRadius: 8,
|
||||||
|
fontSize: 16,
|
||||||
|
color: MainColor.black,
|
||||||
|
},
|
||||||
|
// Country List
|
||||||
|
countryList: {
|
||||||
|
paddingHorizontal: 16,
|
||||||
|
},
|
||||||
|
countryItem: {
|
||||||
|
flexDirection: "row",
|
||||||
|
justifyContent: "space-between",
|
||||||
|
alignItems: "center",
|
||||||
|
paddingVertical: 12,
|
||||||
|
paddingHorizontal: 12,
|
||||||
|
borderBottomWidth: 1,
|
||||||
|
borderBottomColor: MainColor.white_gray,
|
||||||
|
},
|
||||||
|
countryItemSelected: {
|
||||||
|
backgroundColor: MainColor.soft_darkblue + "15",
|
||||||
|
},
|
||||||
|
countryInfo: {
|
||||||
|
flex: 1,
|
||||||
|
},
|
||||||
|
countryName: {
|
||||||
|
fontSize: 16,
|
||||||
|
color: MainColor.black,
|
||||||
|
fontWeight: "500",
|
||||||
|
},
|
||||||
|
countryCode: {
|
||||||
|
fontSize: 14,
|
||||||
|
color: MainColor.placeholder,
|
||||||
|
marginTop: 2,
|
||||||
|
},
|
||||||
|
checkmark: {
|
||||||
|
fontSize: 20,
|
||||||
|
color: MainColor.green,
|
||||||
|
fontWeight: "bold",
|
||||||
|
},
|
||||||
|
});
|
||||||
245
components/_ShareComponent/AndroidWrapper.tsx
Normal file
245
components/_ShareComponent/AndroidWrapper.tsx
Normal file
@@ -0,0 +1,245 @@
|
|||||||
|
// @/components/AndroidWrapper.tsx
|
||||||
|
// Android Wrapper - Based on NewWrapper_V2 (with keyboard handling for Android)
|
||||||
|
import { MainColor } from "@/constants/color-palet";
|
||||||
|
import { OS_HEIGHT } from "@/constants/constans-value";
|
||||||
|
import { GStyles } from "@/styles/global-styles";
|
||||||
|
import {
|
||||||
|
ImageBackground,
|
||||||
|
Keyboard,
|
||||||
|
KeyboardAvoidingView,
|
||||||
|
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 { useKeyboardForm } from "@/hooks/useKeyboardForm";
|
||||||
|
|
||||||
|
// --- Base Props ---
|
||||||
|
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 (Android only)
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
enableKeyboardHandling?: boolean;
|
||||||
|
/**
|
||||||
|
* Scroll offset when keyboard appears (Android only)
|
||||||
|
* @default 100
|
||||||
|
*/
|
||||||
|
keyboardScrollOffset?: number;
|
||||||
|
/**
|
||||||
|
* Extra padding bottom for content to avoid navigation bar (Android only)
|
||||||
|
* @default 80
|
||||||
|
*/
|
||||||
|
contentPaddingBottom?: number;
|
||||||
|
/**
|
||||||
|
* Padding untuk content container (Android only)
|
||||||
|
* Set to 0 untuk tidak ada padding, atau custom value sesuai kebutuhan
|
||||||
|
* @default 16
|
||||||
|
*/
|
||||||
|
contentPadding?: 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 AndroidWrapperProps = StaticModeProps | ListModeProps;
|
||||||
|
|
||||||
|
export function AndroidWrapper(props: AndroidWrapperProps) {
|
||||||
|
const {
|
||||||
|
withBackground = false,
|
||||||
|
headerComponent,
|
||||||
|
footerComponent,
|
||||||
|
floatingButton,
|
||||||
|
hideFooter = false,
|
||||||
|
edgesFooter = [],
|
||||||
|
style,
|
||||||
|
refreshControl,
|
||||||
|
enableKeyboardHandling = false,
|
||||||
|
keyboardScrollOffset,
|
||||||
|
contentPaddingBottom,
|
||||||
|
contentPadding,
|
||||||
|
} = props;
|
||||||
|
|
||||||
|
// Default values (should be set by OS_Wrapper, but fallback for direct usage)
|
||||||
|
const finalKeyboardScrollOffset = keyboardScrollOffset ?? 100;
|
||||||
|
const finalContentPaddingBottom = contentPaddingBottom ?? 250;
|
||||||
|
const finalContentPadding = contentPadding ?? 0;
|
||||||
|
|
||||||
|
const assetBackground = require("../../assets/images/main-background.png");
|
||||||
|
|
||||||
|
// Use keyboard hook if enabled
|
||||||
|
const keyboardForm = enableKeyboardHandling
|
||||||
|
? useKeyboardForm(finalKeyboardScrollOffset)
|
||||||
|
: 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 (
|
||||||
|
<TouchableWithoutFeedback onPress={Keyboard.dismiss} style={{ flex: 1 }}>
|
||||||
|
<KeyboardAvoidingView
|
||||||
|
behavior={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,
|
||||||
|
paddingBottom:
|
||||||
|
(footerComponent && !hideFooter ? OS_HEIGHT : 0) +
|
||||||
|
finalContentPaddingBottom,
|
||||||
|
padding: finalContentPadding,
|
||||||
|
}}
|
||||||
|
keyboardShouldPersistTaps="handled"
|
||||||
|
/>
|
||||||
|
|
||||||
|
{/* Footer - Fixed di bawah dengan width 100% */}
|
||||||
|
{footerComponent && !hideFooter && (
|
||||||
|
<SafeAreaView
|
||||||
|
edges={["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>
|
||||||
|
</TouchableWithoutFeedback>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 🔹 Mode Statis (ScrollView)
|
||||||
|
const staticProps = props as StaticModeProps;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<KeyboardAvoidingView
|
||||||
|
behavior={undefined}
|
||||||
|
style={{ flex: 1, backgroundColor: MainColor.darkblue }}
|
||||||
|
>
|
||||||
|
{headerComponent && (
|
||||||
|
<View style={GStyles.stickyHeader}>{headerComponent}</View>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<ScrollView
|
||||||
|
ref={keyboardForm?.scrollViewRef}
|
||||||
|
onScroll={keyboardForm?.handleScroll}
|
||||||
|
scrollEventThrottle={16}
|
||||||
|
style={{ flex: 1 }}
|
||||||
|
contentContainerStyle={{
|
||||||
|
flexGrow: 1,
|
||||||
|
paddingBottom:
|
||||||
|
(footerComponent && !hideFooter ? OS_HEIGHT : 0) +
|
||||||
|
finalContentPaddingBottom,
|
||||||
|
padding: finalContentPadding,
|
||||||
|
}}
|
||||||
|
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: "absolute",
|
||||||
|
bottom: 0,
|
||||||
|
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>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default AndroidWrapper;
|
||||||
@@ -30,7 +30,7 @@ export default function AppHeader({
|
|||||||
? isIOS26Plus
|
? isIOS26Plus
|
||||||
? insets.top - 10
|
? insets.top - 10
|
||||||
: insets.top
|
: insets.top
|
||||||
: 10;
|
: 40;
|
||||||
|
|
||||||
const paddingBottom = Platform.OS === "ios" ? 8 : 13;
|
const paddingBottom = Platform.OS === "ios" ? 8 : 13;
|
||||||
|
|
||||||
@@ -43,9 +43,10 @@ export default function AppHeader({
|
|||||||
paddingBottom,
|
paddingBottom,
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
|
pointerEvents="box-none"
|
||||||
>
|
>
|
||||||
{/* Header Container dengan absolute positioning untuk title center */}
|
{/* Header Container dengan absolute positioning untuk title center */}
|
||||||
<View style={styles.headerApp}>
|
<View style={styles.headerApp} pointerEvents="box-none">
|
||||||
{/* Left Section - Absolute Left */}
|
{/* Left Section - Absolute Left */}
|
||||||
<View style={styles.headerLeft}>
|
<View style={styles.headerLeft}>
|
||||||
{showBack ? (
|
{showBack ? (
|
||||||
|
|||||||
75
components/_ShareComponent/FormWrapper.tsx
Normal file
75
components/_ShareComponent/FormWrapper.tsx
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
// 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, handleScroll } = useKeyboardForm(scrollOffset);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<KeyboardAvoidingView
|
||||||
|
behavior={Platform.OS === "ios" ? "padding" : undefined}
|
||||||
|
style={{ flex: 1, backgroundColor: MainColor.darkblue }}
|
||||||
|
>
|
||||||
|
<ScrollView
|
||||||
|
ref={scrollViewRef}
|
||||||
|
onScroll={handleScroll}
|
||||||
|
scrollEventThrottle={16}
|
||||||
|
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>
|
||||||
|
);
|
||||||
|
}
|
||||||
216
components/_ShareComponent/IOSWrapper.tsx
Normal file
216
components/_ShareComponent/IOSWrapper.tsx
Normal file
@@ -0,0 +1,216 @@
|
|||||||
|
// @/components/iOSWrapper.tsx
|
||||||
|
// iOS Wrapper - Based on NewWrapper (stable version for iOS)
|
||||||
|
import { MainColor } from "@/constants/color-palet";
|
||||||
|
import { OS_HEIGHT } from "@/constants/constans-value";
|
||||||
|
import { GStyles } from "@/styles/global-styles";
|
||||||
|
import {
|
||||||
|
ImageBackground,
|
||||||
|
Keyboard,
|
||||||
|
KeyboardAvoidingView,
|
||||||
|
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";
|
||||||
|
|
||||||
|
// --- Base Props ---
|
||||||
|
interface BaseProps {
|
||||||
|
withBackground?: boolean;
|
||||||
|
headerComponent?: React.ReactNode;
|
||||||
|
footerComponent?: React.ReactNode;
|
||||||
|
floatingButton?: React.ReactNode;
|
||||||
|
hideFooter?: boolean;
|
||||||
|
edgesFooter?: NativeSafeAreaViewProps["edges"];
|
||||||
|
style?: StyleProp<ViewStyle>;
|
||||||
|
refreshControl?: ScrollViewProps["refreshControl"];
|
||||||
|
}
|
||||||
|
|
||||||
|
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 iOSWrapperProps = StaticModeProps | ListModeProps;
|
||||||
|
|
||||||
|
const iOSWrapper = (props: iOSWrapperProps) => {
|
||||||
|
const {
|
||||||
|
withBackground = false,
|
||||||
|
headerComponent,
|
||||||
|
footerComponent,
|
||||||
|
floatingButton,
|
||||||
|
hideFooter = false,
|
||||||
|
edgesFooter = [],
|
||||||
|
style,
|
||||||
|
refreshControl,
|
||||||
|
} = props;
|
||||||
|
|
||||||
|
const assetBackground = require("../../assets/images/main-background.png");
|
||||||
|
|
||||||
|
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="padding"
|
||||||
|
style={{ flex: 1, backgroundColor: MainColor.darkblue }}
|
||||||
|
>
|
||||||
|
{headerComponent && (
|
||||||
|
<View style={GStyles.stickyHeader}>{headerComponent}</View>
|
||||||
|
)}
|
||||||
|
<View style={[GStyles.container, style, { flex: 1 }]}>
|
||||||
|
<FlatList
|
||||||
|
data={listProps.listData}
|
||||||
|
renderItem={listProps.renderItem}
|
||||||
|
keyExtractor={
|
||||||
|
listProps.keyExtractor ||
|
||||||
|
((item, index) => {
|
||||||
|
if (item.id == null) {
|
||||||
|
console.warn("Item tanpa 'id':", item);
|
||||||
|
return `fallback-${index}-${JSON.stringify(item)}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
return `${String(item.id)}-${index}`;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
refreshControl={refreshControl}
|
||||||
|
onEndReached={listProps.onEndReached}
|
||||||
|
onEndReachedThreshold={0.5}
|
||||||
|
ListHeaderComponent={listProps.ListHeaderComponent}
|
||||||
|
ListFooterComponent={listProps.ListFooterComponent}
|
||||||
|
ListEmptyComponent={listProps.ListEmptyComponent}
|
||||||
|
contentContainerStyle={{
|
||||||
|
flexGrow: 1,
|
||||||
|
paddingBottom: footerComponent && !hideFooter ? OS_HEIGHT : 0
|
||||||
|
}}
|
||||||
|
keyboardShouldPersistTaps="handled"
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
{/* Footer - tetap di bawah dengan position absolute */}
|
||||||
|
{footerComponent && !hideFooter && (
|
||||||
|
<View style={styles.footerContainer}>
|
||||||
|
<SafeAreaView
|
||||||
|
edges={edgesFooter}
|
||||||
|
style={{ backgroundColor: MainColor.darkblue }}
|
||||||
|
>
|
||||||
|
{footerComponent}
|
||||||
|
</SafeAreaView>
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{!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="padding"
|
||||||
|
style={{ flex: 1, backgroundColor: MainColor.darkblue }}
|
||||||
|
>
|
||||||
|
{headerComponent && (
|
||||||
|
<View style={GStyles.stickyHeader}>{headerComponent}</View>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<View style={{ flex: 1 }}>
|
||||||
|
<ScrollView
|
||||||
|
contentContainerStyle={{
|
||||||
|
flexGrow: 1,
|
||||||
|
paddingBottom: footerComponent && !hideFooter ? OS_HEIGHT : 0
|
||||||
|
}}
|
||||||
|
keyboardShouldPersistTaps="handled"
|
||||||
|
refreshControl={refreshControl}
|
||||||
|
>
|
||||||
|
<TouchableWithoutFeedback onPress={Keyboard.dismiss}>
|
||||||
|
{renderContainer(staticProps.children)}
|
||||||
|
</TouchableWithoutFeedback>
|
||||||
|
</ScrollView>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
{/* Footer - tetap di bawah dengan position absolute */}
|
||||||
|
{footerComponent && !hideFooter && (
|
||||||
|
<View style={styles.footerContainer}>
|
||||||
|
<SafeAreaView
|
||||||
|
edges={edgesFooter}
|
||||||
|
style={{ backgroundColor: MainColor.darkblue }}
|
||||||
|
>
|
||||||
|
{footerComponent}
|
||||||
|
</SafeAreaView>
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{!footerComponent && !hideFooter && (
|
||||||
|
<SafeAreaView
|
||||||
|
edges={["bottom"]}
|
||||||
|
style={{ backgroundColor: MainColor.darkblue }}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{floatingButton && (
|
||||||
|
<View style={GStyles.floatingContainer}>{floatingButton}</View>
|
||||||
|
)}
|
||||||
|
</KeyboardAvoidingView>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
// Styles untuk footer dengan position absolute
|
||||||
|
const styles = {
|
||||||
|
footerContainer: {
|
||||||
|
position: "absolute" as const,
|
||||||
|
bottom: 0,
|
||||||
|
left: 0,
|
||||||
|
right: 0,
|
||||||
|
backgroundColor: MainColor.darkblue,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default iOSWrapper;
|
||||||
@@ -19,6 +19,7 @@ import {
|
|||||||
SafeAreaView,
|
SafeAreaView,
|
||||||
} from "react-native-safe-area-context";
|
} from "react-native-safe-area-context";
|
||||||
import type { ScrollViewProps, FlatListProps } from "react-native";
|
import type { ScrollViewProps, FlatListProps } from "react-native";
|
||||||
|
import Spacing from "./Spacing";
|
||||||
|
|
||||||
// --- ✅ Tambahkan refreshControl ke BaseProps ---
|
// --- ✅ Tambahkan refreshControl ke BaseProps ---
|
||||||
interface BaseProps {
|
interface BaseProps {
|
||||||
@@ -83,7 +84,7 @@ const NewWrapper = (props: NewWrapperProps) => {
|
|||||||
return <View style={[GStyles.container, style]}>{content}</View>;
|
return <View style={[GStyles.container, style]}>{content}</View>;
|
||||||
};
|
};
|
||||||
|
|
||||||
// 🔹 Mode Dinamis
|
// 🔹 Mode Dinamis (FlatList)
|
||||||
if ("listData" in props) {
|
if ("listData" in props) {
|
||||||
const listProps = props as ListModeProps;
|
const listProps = props as ListModeProps;
|
||||||
|
|
||||||
@@ -95,7 +96,7 @@ const NewWrapper = (props: NewWrapperProps) => {
|
|||||||
{headerComponent && (
|
{headerComponent && (
|
||||||
<View style={GStyles.stickyHeader}>{headerComponent}</View>
|
<View style={GStyles.stickyHeader}>{headerComponent}</View>
|
||||||
)}
|
)}
|
||||||
<View style={[GStyles.container, style]}>
|
<View style={[GStyles.container, style, { flex: 1 }]}>
|
||||||
<FlatList
|
<FlatList
|
||||||
data={listProps.listData}
|
data={listProps.listData}
|
||||||
renderItem={listProps.renderItem}
|
renderItem={listProps.renderItem}
|
||||||
@@ -107,30 +108,36 @@ const NewWrapper = (props: NewWrapperProps) => {
|
|||||||
return `fallback-${index}-${JSON.stringify(item)}`;
|
return `fallback-${index}-${JSON.stringify(item)}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Gabungkan ID dengan indeks untuk mencegah duplikasi
|
|
||||||
return `${String(item.id)}-${index}`;
|
return `${String(item.id)}-${index}`;
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
refreshControl={refreshControl}
|
||||||
refreshControl={refreshControl} // ✅ dari BaseProps
|
|
||||||
onEndReached={listProps.onEndReached}
|
onEndReached={listProps.onEndReached}
|
||||||
onEndReachedThreshold={0.5}
|
onEndReachedThreshold={0.5}
|
||||||
ListHeaderComponent={listProps.ListHeaderComponent}
|
ListHeaderComponent={listProps.ListHeaderComponent}
|
||||||
ListFooterComponent={listProps.ListFooterComponent}
|
ListFooterComponent={listProps.ListFooterComponent}
|
||||||
ListEmptyComponent={listProps.ListEmptyComponent}
|
ListEmptyComponent={listProps.ListEmptyComponent}
|
||||||
contentContainerStyle={{ flexGrow: 1 }}
|
contentContainerStyle={{
|
||||||
|
flexGrow: 1,
|
||||||
|
paddingBottom: footerComponent && !hideFooter ? OS_HEIGHT : 0
|
||||||
|
}}
|
||||||
keyboardShouldPersistTaps="handled"
|
keyboardShouldPersistTaps="handled"
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
{footerComponent ? (
|
{/* Footer - tetap di bawah dengan position absolute */}
|
||||||
<SafeAreaView
|
{footerComponent && !hideFooter && (
|
||||||
edges={Platform.OS === "ios" ? edgesFooter : ["bottom"]}
|
<View style={styles.footerContainer}>
|
||||||
style={{ backgroundColor: MainColor.darkblue, height: OS_HEIGHT }}
|
<SafeAreaView
|
||||||
>
|
edges={Platform.OS === "ios" ? edgesFooter : ["bottom"]}
|
||||||
{footerComponent}
|
style={{ backgroundColor: MainColor.darkblue }}
|
||||||
</SafeAreaView>
|
>
|
||||||
) : hideFooter ? null : (
|
{footerComponent}
|
||||||
|
</SafeAreaView>
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{!footerComponent && !hideFooter && (
|
||||||
<SafeAreaView
|
<SafeAreaView
|
||||||
edges={["bottom"]}
|
edges={["bottom"]}
|
||||||
style={{ backgroundColor: MainColor.darkblue }}
|
style={{ backgroundColor: MainColor.darkblue }}
|
||||||
@@ -144,7 +151,7 @@ const NewWrapper = (props: NewWrapperProps) => {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 🔹 Mode Statis
|
// 🔹 Mode Statis (ScrollView)
|
||||||
const staticProps = props as StaticModeProps;
|
const staticProps = props as StaticModeProps;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -156,24 +163,34 @@ const NewWrapper = (props: NewWrapperProps) => {
|
|||||||
<View style={GStyles.stickyHeader}>{headerComponent}</View>
|
<View style={GStyles.stickyHeader}>{headerComponent}</View>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<ScrollView
|
<View style={{ flex: 1 }}>
|
||||||
contentContainerStyle={{ flexGrow: 1 }}
|
<ScrollView
|
||||||
keyboardShouldPersistTaps="handled"
|
contentContainerStyle={{
|
||||||
refreshControl={refreshControl} // ✅ sekarang valid
|
flexGrow: 1,
|
||||||
>
|
paddingBottom: footerComponent && !hideFooter ? OS_HEIGHT : 0
|
||||||
<TouchableWithoutFeedback onPress={Keyboard.dismiss}>
|
}}
|
||||||
{renderContainer(staticProps.children)}
|
keyboardShouldPersistTaps="handled"
|
||||||
</TouchableWithoutFeedback>
|
refreshControl={refreshControl}
|
||||||
</ScrollView>
|
|
||||||
|
|
||||||
{footerComponent ? (
|
|
||||||
<SafeAreaView
|
|
||||||
edges={Platform.OS === "ios" ? edgesFooter : ["bottom"]}
|
|
||||||
style={{ backgroundColor: MainColor.darkblue, height: OS_HEIGHT }}
|
|
||||||
>
|
>
|
||||||
{footerComponent}
|
<TouchableWithoutFeedback onPress={Keyboard.dismiss}>
|
||||||
</SafeAreaView>
|
{renderContainer(staticProps.children)}
|
||||||
) : hideFooter ? null : (
|
</TouchableWithoutFeedback>
|
||||||
|
</ScrollView>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
{/* Footer - tetap di bawah dengan position absolute */}
|
||||||
|
{footerComponent && !hideFooter && (
|
||||||
|
<View style={styles.footerContainer}>
|
||||||
|
<SafeAreaView
|
||||||
|
edges={Platform.OS === "ios" ? edgesFooter : ["bottom"]}
|
||||||
|
style={{ backgroundColor: MainColor.darkblue }}
|
||||||
|
>
|
||||||
|
{footerComponent}
|
||||||
|
</SafeAreaView>
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{!footerComponent && !hideFooter && (
|
||||||
<SafeAreaView
|
<SafeAreaView
|
||||||
edges={["bottom"]}
|
edges={["bottom"]}
|
||||||
style={{ backgroundColor: MainColor.darkblue }}
|
style={{ backgroundColor: MainColor.darkblue }}
|
||||||
@@ -187,4 +204,15 @@ const NewWrapper = (props: NewWrapperProps) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Styles untuk footer dengan position absolute
|
||||||
|
const styles = {
|
||||||
|
footerContainer: {
|
||||||
|
position: "absolute" as const,
|
||||||
|
bottom: 0,
|
||||||
|
left: 0,
|
||||||
|
right: 0,
|
||||||
|
backgroundColor: MainColor.darkblue,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
export default NewWrapper;
|
export default NewWrapper;
|
||||||
|
|||||||
231
components/_ShareComponent/NewWrapper_V2.tsx
Normal file
231
components/_ShareComponent/NewWrapper_V2.tsx
Normal file
@@ -0,0 +1,231 @@
|
|||||||
|
// 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 untuk content container (default: 16)
|
||||||
|
* Set to 0 untuk tidak ada padding, atau custom value sesuai kebutuhan
|
||||||
|
*/
|
||||||
|
contentPadding?: 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
|
||||||
|
contentPadding = 16, // Default 16 untuk padding konsisten
|
||||||
|
} = 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,
|
||||||
|
paddingBottom: (footerComponent && !hideFooter ? OS_HEIGHT : 0) + contentPaddingBottom,
|
||||||
|
padding: contentPadding,
|
||||||
|
}}
|
||||||
|
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,
|
||||||
|
paddingBottom: (footerComponent && !hideFooter ? OS_HEIGHT : 0) + contentPaddingBottom,
|
||||||
|
padding: contentPadding,
|
||||||
|
}}
|
||||||
|
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>
|
||||||
|
);
|
||||||
|
}
|
||||||
154
components/_ShareComponent/OS_Wrapper.tsx
Normal file
154
components/_ShareComponent/OS_Wrapper.tsx
Normal file
@@ -0,0 +1,154 @@
|
|||||||
|
// @/components/OS_Wrapper.tsx
|
||||||
|
// OS-Specific Wrapper - Automatically routes to iOSWrapper or AndroidWrapper
|
||||||
|
// iOS: Uses NewWrapper (stable for iOS)
|
||||||
|
// Android: Uses NewWrapper_V2 (with keyboard handling)
|
||||||
|
|
||||||
|
import { Platform } from "react-native";
|
||||||
|
import type { ScrollViewProps, FlatListProps } from "react-native";
|
||||||
|
import {
|
||||||
|
NativeSafeAreaViewProps,
|
||||||
|
} from "react-native-safe-area-context";
|
||||||
|
import type { StyleProp, ViewStyle } from "react-native";
|
||||||
|
import IOSWrapper from "./IOSWrapper";
|
||||||
|
import AndroidWrapper from "./AndroidWrapper";
|
||||||
|
|
||||||
|
// ========== Base Props ==========
|
||||||
|
interface BaseProps {
|
||||||
|
withBackground?: boolean;
|
||||||
|
headerComponent?: React.ReactNode;
|
||||||
|
footerComponent?: React.ReactNode;
|
||||||
|
floatingButton?: React.ReactNode;
|
||||||
|
hideFooter?: boolean;
|
||||||
|
edgesFooter?: NativeSafeAreaViewProps["edges"];
|
||||||
|
style?: StyleProp<ViewStyle>;
|
||||||
|
refreshControl?: ScrollViewProps["refreshControl"];
|
||||||
|
}
|
||||||
|
|
||||||
|
// ========== Static Mode Props ==========
|
||||||
|
interface StaticModeProps extends BaseProps {
|
||||||
|
children: React.ReactNode;
|
||||||
|
listData?: never;
|
||||||
|
renderItem?: never;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ========== List Mode Props ==========
|
||||||
|
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"];
|
||||||
|
}
|
||||||
|
|
||||||
|
// ========== Keyboard Handling Props (Android only) ==========
|
||||||
|
interface KeyboardHandlingProps {
|
||||||
|
/**
|
||||||
|
* Enable keyboard handling with auto-scroll (Android only)
|
||||||
|
* iOS ignores this prop
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
enableKeyboardHandling?: boolean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Scroll offset when keyboard appears (Android only)
|
||||||
|
* iOS ignores this prop
|
||||||
|
* @default 100
|
||||||
|
*/
|
||||||
|
keyboardScrollOffset?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Extra padding bottom for content (Android only)
|
||||||
|
* iOS ignores this prop
|
||||||
|
* @default 80
|
||||||
|
*/
|
||||||
|
contentPaddingBottom?: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Padding untuk content container (Android only)
|
||||||
|
* iOS ignores this prop
|
||||||
|
* @default 16
|
||||||
|
*/
|
||||||
|
contentPadding?: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ========== Final Props Types ==========
|
||||||
|
type OS_WrapperStaticProps = StaticModeProps & KeyboardHandlingProps;
|
||||||
|
type OS_WrapperListProps = ListModeProps & KeyboardHandlingProps;
|
||||||
|
|
||||||
|
type OS_WrapperProps = OS_WrapperStaticProps | OS_WrapperListProps;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OS_Wrapper - Automatically selects iOSWrapper or AndroidWrapper based on platform
|
||||||
|
*
|
||||||
|
* Features:
|
||||||
|
* - Auto platform detection
|
||||||
|
* - Optional keyboard handling for Android forms
|
||||||
|
* - Unified API for all use cases
|
||||||
|
*
|
||||||
|
* @example Static Mode (Simple Content)
|
||||||
|
* ```tsx
|
||||||
|
* <OS_Wrapper>
|
||||||
|
* <YourContent />
|
||||||
|
* </OS_Wrapper>
|
||||||
|
* ```
|
||||||
|
*
|
||||||
|
* @example List Mode (with pagination)
|
||||||
|
* ```tsx
|
||||||
|
* <OS_Wrapper
|
||||||
|
* listData={data}
|
||||||
|
* renderItem={({ item }) => <ItemCard item={item} />}
|
||||||
|
* ListEmptyComponent={<EmptyState />}
|
||||||
|
* onEndReached={loadMore}
|
||||||
|
* />
|
||||||
|
* ```
|
||||||
|
*
|
||||||
|
* @example Form Mode (with keyboard handling - Android only)
|
||||||
|
* ```tsx
|
||||||
|
* <OS_Wrapper
|
||||||
|
* enableKeyboardHandling
|
||||||
|
* keyboardScrollOffset={150}
|
||||||
|
* contentPaddingBottom={100}
|
||||||
|
* footerComponent={<SubmitButton />}
|
||||||
|
* >
|
||||||
|
* <FormContent />
|
||||||
|
* </OS_Wrapper>
|
||||||
|
* ```
|
||||||
|
*/
|
||||||
|
export function OS_Wrapper(props: OS_WrapperProps) {
|
||||||
|
const {
|
||||||
|
enableKeyboardHandling = false,
|
||||||
|
keyboardScrollOffset = 100,
|
||||||
|
contentPaddingBottom = 100,
|
||||||
|
contentPadding = 0,
|
||||||
|
...wrapperProps
|
||||||
|
} = props;
|
||||||
|
|
||||||
|
// iOS uses IOSWrapper (based on NewWrapper)
|
||||||
|
if (Platform.OS === "ios") {
|
||||||
|
// Keyboard handling props are ignored on iOS
|
||||||
|
return <IOSWrapper {...(wrapperProps as any)} />;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Android uses AndroidWrapper (with keyboard handling support)
|
||||||
|
return (
|
||||||
|
<AndroidWrapper
|
||||||
|
{...(wrapperProps as any)}
|
||||||
|
enableKeyboardHandling={enableKeyboardHandling}
|
||||||
|
keyboardScrollOffset={keyboardScrollOffset}
|
||||||
|
contentPaddingBottom={contentPaddingBottom}
|
||||||
|
contentPadding={contentPadding}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Re-export individual wrappers for direct usage if needed
|
||||||
|
export { default as IOSWrapper } from "./IOSWrapper";
|
||||||
|
export { default as AndroidWrapper } from "./AndroidWrapper";
|
||||||
|
|
||||||
|
// Legacy export untuk backward compatibility
|
||||||
|
export { IOSWrapper as iOSWrapper };
|
||||||
|
|
||||||
|
export default OS_Wrapper;
|
||||||
@@ -49,6 +49,8 @@ import MapCustom from "./Map/MapCustom";
|
|||||||
import CenterCustom from "./Center/CenterCustom";
|
import CenterCustom from "./Center/CenterCustom";
|
||||||
// Clickable
|
// Clickable
|
||||||
import ClickableCustom from "./Clickable/ClickableCustom";
|
import ClickableCustom from "./Clickable/ClickableCustom";
|
||||||
|
// PhoneInput
|
||||||
|
import PhoneInputCustom from "./PhoneInput/PhoneInputCustom";
|
||||||
// Scroll
|
// Scroll
|
||||||
import ScrollableCustom from "./Scroll/ScrollCustom";
|
import ScrollableCustom from "./Scroll/ScrollCustom";
|
||||||
// ShareComponent
|
// ShareComponent
|
||||||
@@ -61,6 +63,11 @@ 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";
|
||||||
|
// OS-Specific Wrappers
|
||||||
|
import OS_Wrapper, { IOSWrapper, AndroidWrapper } from "./_ShareComponent/OS_Wrapper";
|
||||||
|
|
||||||
// Progress
|
// Progress
|
||||||
import ProgressCustom from "./Progress/ProgressCustom";
|
import ProgressCustom from "./Progress/ProgressCustom";
|
||||||
// Loader
|
// Loader
|
||||||
@@ -95,6 +102,8 @@ export {
|
|||||||
CheckboxGroup,
|
CheckboxGroup,
|
||||||
// Clickable
|
// Clickable
|
||||||
ClickableCustom,
|
ClickableCustom,
|
||||||
|
// PhoneInput
|
||||||
|
PhoneInputCustom,
|
||||||
// Container
|
// Container
|
||||||
CircleContainer,
|
CircleContainer,
|
||||||
// Divider
|
// Divider
|
||||||
@@ -123,6 +132,12 @@ export {
|
|||||||
Spacing,
|
Spacing,
|
||||||
NewWrapper,
|
NewWrapper,
|
||||||
BasicWrapper,
|
BasicWrapper,
|
||||||
|
FormWrapper,
|
||||||
|
NewWrapper_V2,
|
||||||
|
// OS-Specific Wrappers
|
||||||
|
OS_Wrapper,
|
||||||
|
IOSWrapper,
|
||||||
|
AndroidWrapper,
|
||||||
// Stack
|
// Stack
|
||||||
StackCustom,
|
StackCustom,
|
||||||
TabBarBackground,
|
TabBarBackground,
|
||||||
|
|||||||
@@ -4,6 +4,10 @@ export {
|
|||||||
OS_ANDROID_HEIGHT,
|
OS_ANDROID_HEIGHT,
|
||||||
OS_IOS_HEIGHT,
|
OS_IOS_HEIGHT,
|
||||||
OS_HEIGHT,
|
OS_HEIGHT,
|
||||||
|
OS_ANDROID_PADDING_TOP,
|
||||||
|
OS_IOS_PADDING_TOP,
|
||||||
|
OS_PADDING_TOP,
|
||||||
|
PADDING_INLINE,
|
||||||
TEXT_SIZE_SMALL,
|
TEXT_SIZE_SMALL,
|
||||||
TEXT_SIZE_MEDIUM,
|
TEXT_SIZE_MEDIUM,
|
||||||
TEXT_SIZE_LARGE,
|
TEXT_SIZE_LARGE,
|
||||||
@@ -23,10 +27,15 @@ export {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// OS Height
|
// OS Height
|
||||||
const OS_ANDROID_HEIGHT = 115
|
const OS_ANDROID_HEIGHT = 60
|
||||||
const OS_IOS_HEIGHT = 90
|
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
|
||||||
|
|
||||||
|
// OS Padding Top
|
||||||
|
const OS_ANDROID_PADDING_TOP = 6
|
||||||
|
const OS_IOS_PADDING_TOP = 12
|
||||||
|
const OS_PADDING_TOP = Platform.OS === "ios" ? OS_IOS_PADDING_TOP : OS_ANDROID_PADDING_TOP
|
||||||
|
|
||||||
// Text Size
|
// Text Size
|
||||||
const TEXT_SIZE_SMALL = 12;
|
const TEXT_SIZE_SMALL = 12;
|
||||||
const TEXT_SIZE_MEDIUM = 14;
|
const TEXT_SIZE_MEDIUM = 14;
|
||||||
@@ -47,6 +56,7 @@ const DRAWER_HEIGHT = 500; // tinggi drawer5
|
|||||||
const RADIUS_BUTTON = 50
|
const RADIUS_BUTTON = 50
|
||||||
|
|
||||||
// Padding
|
// Padding
|
||||||
|
const PADDING_INLINE = 16
|
||||||
const PADDING_EXTRA_SMALL = 10
|
const PADDING_EXTRA_SMALL = 10
|
||||||
const PADDING_SMALL = 12
|
const PADDING_SMALL = 12
|
||||||
const PADDING_MEDIUM = 16
|
const PADDING_MEDIUM = 16
|
||||||
|
|||||||
89
constants/countries.ts
Normal file
89
constants/countries.ts
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
import { type CountryCode } from "libphonenumber-js";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Country data for phone number input
|
||||||
|
* Contains only country name and calling code (NO flags for maximum compatibility)
|
||||||
|
*/
|
||||||
|
export interface CountryData {
|
||||||
|
code: CountryCode;
|
||||||
|
name: string;
|
||||||
|
callingCode: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List of supported countries for phone number input
|
||||||
|
*
|
||||||
|
* @description
|
||||||
|
* This list includes major countries across different regions.
|
||||||
|
* Countries are ordered by likelihood of use (Indonesia first as default).
|
||||||
|
*
|
||||||
|
* @note
|
||||||
|
* NO emoji flags used - only text-based country name and calling code
|
||||||
|
* This ensures maximum compatibility across all platforms and iOS versions
|
||||||
|
*/
|
||||||
|
export const COUNTRIES: CountryData[] = [
|
||||||
|
// Asia Pacific (Primary markets)
|
||||||
|
{ code: "ID", name: "Indonesia", callingCode: "62" },
|
||||||
|
{ code: "SG", name: "Singapore", callingCode: "65" },
|
||||||
|
{ code: "MY", name: "Malaysia", callingCode: "60" },
|
||||||
|
{ code: "AU", name: "Australia", callingCode: "61" },
|
||||||
|
|
||||||
|
// Asia (Other)
|
||||||
|
{ code: "CN", name: "China", callingCode: "86" },
|
||||||
|
{ code: "JP", name: "Japan", callingCode: "81" },
|
||||||
|
{ code: "KR", name: "South Korea", callingCode: "82" },
|
||||||
|
{ code: "IN", name: "India", callingCode: "91" },
|
||||||
|
|
||||||
|
// Middle East
|
||||||
|
{ code: "AE", name: "United Arab Emirates", callingCode: "971" },
|
||||||
|
{ code: "SA", name: "Saudi Arabia", callingCode: "966" },
|
||||||
|
|
||||||
|
// Europe
|
||||||
|
{ code: "GB", name: "United Kingdom", callingCode: "44" },
|
||||||
|
{ code: "DE", name: "Germany", callingCode: "49" },
|
||||||
|
{ code: "FR", name: "France", callingCode: "33" },
|
||||||
|
{ code: "NL", name: "Netherlands", callingCode: "31" },
|
||||||
|
|
||||||
|
// Americas
|
||||||
|
{ code: "US", name: "United States", callingCode: "1" },
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default country for phone number input
|
||||||
|
* Used when no country is selected (Indonesia by default)
|
||||||
|
*/
|
||||||
|
export const DEFAULT_COUNTRY: CountryData = COUNTRIES[0];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get country by calling code
|
||||||
|
* @param callingCode - The calling code to search for (e.g., "62", "1")
|
||||||
|
* @returns The matching country data or undefined if not found
|
||||||
|
*/
|
||||||
|
export function getCountryByCallingCode(callingCode: string): CountryData | undefined {
|
||||||
|
return COUNTRIES.find((country) => country.callingCode === callingCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get country by country code (ISO 3166-1 alpha-2)
|
||||||
|
* @param code - The country code to search for (e.g., "ID", "US")
|
||||||
|
* @returns The matching country data or undefined if not found
|
||||||
|
*/
|
||||||
|
export function getCountryByCode(code: CountryCode): CountryData | undefined {
|
||||||
|
return COUNTRIES.find((country) => country.code === code);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Search countries by name or calling code
|
||||||
|
* @param query - The search query (case-insensitive)
|
||||||
|
* @returns Array of matching countries
|
||||||
|
*/
|
||||||
|
export function searchCountries(query: string): CountryData[] {
|
||||||
|
const normalizedQuery = query.toLowerCase().trim();
|
||||||
|
|
||||||
|
return COUNTRIES.filter(
|
||||||
|
(country) =>
|
||||||
|
country.name.toLowerCase().includes(normalizedQuery) ||
|
||||||
|
country.code.toLowerCase().includes(normalizedQuery) ||
|
||||||
|
country.callingCode.includes(normalizedQuery)
|
||||||
|
);
|
||||||
|
}
|
||||||
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
|
||||||
158
docs/OS-Wrapper-Quick-Reference.md
Normal file
158
docs/OS-Wrapper-Quick-Reference.md
Normal file
@@ -0,0 +1,158 @@
|
|||||||
|
# OS_Wrapper Quick Reference
|
||||||
|
|
||||||
|
## 📦 Import
|
||||||
|
```tsx
|
||||||
|
import { OS_Wrapper, IOSWrapper, AndroidWrapper } from "@/components";
|
||||||
|
```
|
||||||
|
|
||||||
|
## 🎯 Usage Examples
|
||||||
|
|
||||||
|
### 1. OS_Wrapper - List Mode (Most Common)
|
||||||
|
```tsx
|
||||||
|
<OS_Wrapper
|
||||||
|
listData={data}
|
||||||
|
renderItem={({ item }) => <Card item={item} />}
|
||||||
|
ListEmptyComponent={<EmptyState />}
|
||||||
|
ListFooterComponent={<LoadingFooter />}
|
||||||
|
onEndReached={loadMore}
|
||||||
|
refreshControl={
|
||||||
|
<RefreshControl
|
||||||
|
refreshing={refreshing}
|
||||||
|
onRefresh={onRefresh}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
```
|
||||||
|
|
||||||
|
### 2. OS_Wrapper - Static Mode
|
||||||
|
```tsx
|
||||||
|
<OS_Wrapper
|
||||||
|
headerComponent={<HeaderSection />}
|
||||||
|
footerComponent={<FooterSection />}
|
||||||
|
withBackground={true}
|
||||||
|
>
|
||||||
|
<YourContent />
|
||||||
|
</OS_Wrapper>
|
||||||
|
```
|
||||||
|
|
||||||
|
### 3. OS_Wrapper - Form dengan Keyboard Handling
|
||||||
|
```tsx
|
||||||
|
<OS_Wrapper
|
||||||
|
enableKeyboardHandling
|
||||||
|
keyboardScrollOffset={150}
|
||||||
|
contentPaddingBottom={100}
|
||||||
|
footerComponent={
|
||||||
|
<BoxButtonOnFooter>
|
||||||
|
<ButtonCustom isLoading={loading} onPress={handleSubmit}>
|
||||||
|
Submit
|
||||||
|
</ButtonCustom>
|
||||||
|
</BoxButtonOnFooter>
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<ScrollView>
|
||||||
|
<TextInputCustom />
|
||||||
|
<TextInputCustom />
|
||||||
|
</ScrollView>
|
||||||
|
</OS_Wrapper>
|
||||||
|
```
|
||||||
|
|
||||||
|
### 4. Platform-Specific (Rare Cases)
|
||||||
|
```tsx
|
||||||
|
// iOS only
|
||||||
|
<IOSWrapper>
|
||||||
|
<Content />
|
||||||
|
</IOSWrapper>
|
||||||
|
|
||||||
|
// Android only
|
||||||
|
<AndroidWrapper enableKeyboardHandling>
|
||||||
|
<Content />
|
||||||
|
</AndroidWrapper>
|
||||||
|
```
|
||||||
|
|
||||||
|
## 📋 Props Reference
|
||||||
|
|
||||||
|
### Common Props (iOS + Android)
|
||||||
|
| Prop | Type | Default | Description |
|
||||||
|
|------|------|---------|-------------|
|
||||||
|
| `withBackground` | boolean | false | Show background image |
|
||||||
|
| `headerComponent` | ReactNode | - | Sticky header component |
|
||||||
|
| `footerComponent` | ReactNode | - | Fixed footer component |
|
||||||
|
| `floatingButton` | ReactNode | - | Floating button |
|
||||||
|
| `hideFooter` | boolean | false | Hide footer section |
|
||||||
|
| `edgesFooter` | Edge[] | [] | Safe area edges |
|
||||||
|
| `style` | ViewStyle | - | Custom container style |
|
||||||
|
| `refreshControl` | RefreshControl | - | Pull to refresh control |
|
||||||
|
|
||||||
|
### Android-Only Props (Ignored on iOS)
|
||||||
|
| Prop | Type | Default | Description |
|
||||||
|
|------|------|---------|-------------|
|
||||||
|
| `enableKeyboardHandling` | boolean | false | Auto-scroll on input focus |
|
||||||
|
| `keyboardScrollOffset` | number | 100 | Scroll offset when keyboard appears |
|
||||||
|
| `contentPaddingBottom` | number | 80 | Extra bottom padding |
|
||||||
|
| `contentPadding` | number | 16 | Content padding (all sides) |
|
||||||
|
|
||||||
|
## 🔄 Migration Pattern
|
||||||
|
|
||||||
|
```diff
|
||||||
|
- import NewWrapper from "@/components/_ShareComponent/NewWrapper";
|
||||||
|
+ import { OS_Wrapper } from "@/components";
|
||||||
|
|
||||||
|
- <NewWrapper
|
||||||
|
+ <OS_Wrapper
|
||||||
|
listData={data}
|
||||||
|
renderItem={renderItem}
|
||||||
|
{...otherProps}
|
||||||
|
/>
|
||||||
|
```
|
||||||
|
|
||||||
|
```diff
|
||||||
|
- import { NewWrapper_V2 } from "@/components/_ShareComponent/NewWrapper_V2";
|
||||||
|
+ import { OS_Wrapper } from "@/components";
|
||||||
|
|
||||||
|
- <NewWrapper_V2 enableKeyboardHandling>
|
||||||
|
+ <OS_Wrapper enableKeyboardHandling>
|
||||||
|
<FormContent />
|
||||||
|
</NewWrapper_V2>
|
||||||
|
```
|
||||||
|
|
||||||
|
## 💡 Tips
|
||||||
|
|
||||||
|
1. **Pakai OS_Wrapper** untuk semua screen (list, detail, form)
|
||||||
|
2. **Tambahkan `enableKeyboardHandling`** untuk form dengan input fields
|
||||||
|
3. **Jangan mix** wrapper lama dan baru di screen yang sama
|
||||||
|
4. **Test di kedua platform** sebelum commit
|
||||||
|
5. **Keyboard handling** hanya bekerja di Android (iOS mengabaikan props ini)
|
||||||
|
|
||||||
|
## ⚠️ Common Mistakes
|
||||||
|
|
||||||
|
### ❌ Wrong
|
||||||
|
```tsx
|
||||||
|
// Jangan import langsung dari file
|
||||||
|
import OS_Wrapper from "@/components/_ShareComponent/OS_Wrapper";
|
||||||
|
|
||||||
|
// Jangan mix wrapper
|
||||||
|
<OS_Wrapper>
|
||||||
|
<NewWrapper>{content}</NewWrapper>
|
||||||
|
</OS_Wrapper>
|
||||||
|
|
||||||
|
// Jangan pakai PageWrapper (sudah tidak ada)
|
||||||
|
import { PageWrapper } from "@/components";
|
||||||
|
```
|
||||||
|
|
||||||
|
### ✅ Correct
|
||||||
|
```tsx
|
||||||
|
// Import dari @/components
|
||||||
|
import { OS_Wrapper } from "@/components";
|
||||||
|
|
||||||
|
// Simple content
|
||||||
|
<OS_Wrapper>{content}</OS_Wrapper>
|
||||||
|
|
||||||
|
// Form with keyboard handling
|
||||||
|
<OS_Wrapper enableKeyboardHandling keyboardScrollOffset={150}>
|
||||||
|
<FormContent />
|
||||||
|
</OS_Wrapper>
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Last updated: 2026-04-06
|
||||||
@@ -120,4 +120,9 @@ Buatkan file baru pada "Folder tujuan" dengan nama "Nama file utama" dan ubah na
|
|||||||
|
|
||||||
<!-- END Create Box -->
|
<!-- END Create Box -->
|
||||||
|
|
||||||
|
<!-- Random Prompt -->
|
||||||
|
Diskusi pada file screens/Authentication/LoginView.tsx , tentang penggunaan phone number input. Karena tidak berfungsi dengan baik pada versi ios 26 keatas
|
||||||
|
|
||||||
|
<!-- END Random Prompt -->
|
||||||
|
|
||||||
<!-- END Use Prompt Now -->
|
<!-- END Use Prompt Now -->
|
||||||
|
|||||||
71
hooks/useKeyboardForm.ts
Normal file
71
hooks/useKeyboardForm.ts
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
// useKeyboardForm.ts - Hook untuk keyboard handling pada form
|
||||||
|
import { Keyboard, ScrollView, Dimensions } from "react-native";
|
||||||
|
import { useState, useEffect, useRef } from "react";
|
||||||
|
import React from "react";
|
||||||
|
|
||||||
|
export function useKeyboardForm(scrollOffset = 100) {
|
||||||
|
const scrollViewRef = useRef<ScrollView>(null);
|
||||||
|
const [keyboardHeight, setKeyboardHeight] = useState(0);
|
||||||
|
const currentScrollY = useRef(0);
|
||||||
|
|
||||||
|
// Listen to keyboard events
|
||||||
|
useEffect(() => {
|
||||||
|
const keyboardDidShowListener = Keyboard.addListener(
|
||||||
|
'keyboardDidShow',
|
||||||
|
(e) => {
|
||||||
|
const kbHeight = e.endCoordinates.height;
|
||||||
|
setKeyboardHeight(kbHeight);
|
||||||
|
|
||||||
|
// Simple: scroll by keyboard height saat keyboard muncul
|
||||||
|
if (scrollViewRef.current) {
|
||||||
|
const targetY = currentScrollY.current + kbHeight - scrollOffset;
|
||||||
|
scrollViewRef.current.scrollTo({
|
||||||
|
y: Math.max(0, targetY),
|
||||||
|
animated: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
const keyboardDidHideListener = Keyboard.addListener(
|
||||||
|
'keyboardDidHide',
|
||||||
|
() => {
|
||||||
|
setKeyboardHeight(0);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
keyboardDidShowListener.remove();
|
||||||
|
keyboardDidHideListener.remove();
|
||||||
|
};
|
||||||
|
}, [scrollOffset]);
|
||||||
|
|
||||||
|
// Track scroll position
|
||||||
|
const handleScroll = (event: any) => {
|
||||||
|
currentScrollY.current = event.nativeEvent.contentOffset.y;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Dummy handlers (for API compatibility)
|
||||||
|
const createFocusHandler = () => {
|
||||||
|
return () => {};
|
||||||
|
};
|
||||||
|
|
||||||
|
const registerInputFocus = () => {};
|
||||||
|
|
||||||
|
return {
|
||||||
|
scrollViewRef,
|
||||||
|
keyboardHeight,
|
||||||
|
registerInputFocus,
|
||||||
|
createFocusHandler,
|
||||||
|
handleScroll,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Dummy helper (no-op, for API compatibility)
|
||||||
|
*/
|
||||||
|
export function cloneChildrenWithFocusHandler(
|
||||||
|
children: React.ReactNode,
|
||||||
|
_focusHandler: (inputRef: any) => void
|
||||||
|
): React.ReactNode {
|
||||||
|
return children;
|
||||||
|
}
|
||||||
File diff suppressed because one or more lines are too long
@@ -1,15 +0,0 @@
|
|||||||
{
|
|
||||||
"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
|
|
||||||
}
|
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
<string>development</string>
|
<string>development</string>
|
||||||
<key>com.apple.developer.associated-domains</key>
|
<key>com.apple.developer.associated-domains</key>
|
||||||
<array>
|
<array>
|
||||||
<string>applinks:cld-dkr-hipmi-stg.wibudev.com</string>
|
<string>applinks:hipmi.muku.id</string>
|
||||||
</array>
|
</array>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
@@ -39,7 +39,7 @@
|
|||||||
</dict>
|
</dict>
|
||||||
</array>
|
</array>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>5</string>
|
<string>7</string>
|
||||||
<key>ITSAppUsesNonExemptEncryption</key>
|
<key>ITSAppUsesNonExemptEncryption</key>
|
||||||
<false/>
|
<false/>
|
||||||
<key>LSMinimumSystemVersion</key>
|
<key>LSMinimumSystemVersion</key>
|
||||||
|
|||||||
39
ios/Podfile
39
ios/Podfile
@@ -1,15 +1,22 @@
|
|||||||
use_modular_headers!
|
|
||||||
|
|
||||||
require File.join(File.dirname(`node --print "require.resolve('expo/package.json')"`), "scripts/autolinking")
|
require File.join(File.dirname(`node --print "require.resolve('expo/package.json')"`), "scripts/autolinking")
|
||||||
require File.join(File.dirname(`node --print "require.resolve('react-native/package.json')"`), "scripts/react_native_pods")
|
require File.join(File.dirname(`node --print "require.resolve('react-native/package.json')"`), "scripts/react_native_pods")
|
||||||
|
|
||||||
require 'json'
|
require 'json'
|
||||||
podfile_properties = JSON.parse(File.read(File.join(__dir__, 'Podfile.properties.json'))) rescue {}
|
podfile_properties = JSON.parse(File.read(File.join(__dir__, 'Podfile.properties.json'))) rescue {}
|
||||||
|
|
||||||
|
def ccache_enabled?(podfile_properties)
|
||||||
|
# Environment variable takes precedence
|
||||||
|
return ENV['USE_CCACHE'] == '1' if ENV['USE_CCACHE']
|
||||||
|
|
||||||
|
# Fall back to Podfile properties
|
||||||
|
podfile_properties['apple.ccacheEnabled'] == 'true'
|
||||||
|
end
|
||||||
|
|
||||||
ENV['RCT_NEW_ARCH_ENABLED'] ||= '0' if podfile_properties['newArchEnabled'] == 'false'
|
ENV['RCT_NEW_ARCH_ENABLED'] ||= '0' if podfile_properties['newArchEnabled'] == 'false'
|
||||||
ENV['EX_DEV_CLIENT_NETWORK_INSPECTOR'] ||= podfile_properties['EX_DEV_CLIENT_NETWORK_INSPECTOR']
|
ENV['EX_DEV_CLIENT_NETWORK_INSPECTOR'] ||= podfile_properties['EX_DEV_CLIENT_NETWORK_INSPECTOR']
|
||||||
ENV['RCT_USE_RN_DEP'] ||= '1' if podfile_properties['ios.buildReactNativeFromSource'] != 'true' && podfile_properties['newArchEnabled'] != 'false'
|
ENV['RCT_USE_RN_DEP'] ||= '1' if podfile_properties['ios.buildReactNativeFromSource'] != 'true' && podfile_properties['newArchEnabled'] != 'false'
|
||||||
ENV['RCT_USE_PREBUILT_RNCORE'] ||= '1' if podfile_properties['ios.buildReactNativeFromSource'] != 'true' && podfile_properties['newArchEnabled'] != 'false'
|
ENV['RCT_USE_PREBUILT_RNCORE'] ||= '1' if podfile_properties['ios.buildReactNativeFromSource'] != 'true' && podfile_properties['newArchEnabled'] != 'false'
|
||||||
|
use_modular_headers!
|
||||||
platform :ios, podfile_properties['ios.deploymentTarget'] || '15.1'
|
platform :ios, podfile_properties['ios.deploymentTarget'] || '15.1'
|
||||||
|
|
||||||
prepare_react_native_project!
|
prepare_react_native_project!
|
||||||
@@ -21,7 +28,10 @@ target 'HIPMIBadungConnect' do
|
|||||||
config_command = ['node', '-e', "process.argv=['', '', 'config'];require('@react-native-community/cli').run()"];
|
config_command = ['node', '-e', "process.argv=['', '', 'config'];require('@react-native-community/cli').run()"];
|
||||||
else
|
else
|
||||||
config_command = [
|
config_command = [
|
||||||
'npx',
|
'node',
|
||||||
|
'--no-warnings',
|
||||||
|
'--eval',
|
||||||
|
'require(\'expo/bin/autolinking\')',
|
||||||
'expo-modules-autolinking',
|
'expo-modules-autolinking',
|
||||||
'react-native-config',
|
'react-native-config',
|
||||||
'--json',
|
'--json',
|
||||||
@@ -35,7 +45,6 @@ target 'HIPMIBadungConnect' do
|
|||||||
use_frameworks! :linkage => podfile_properties['ios.useFrameworks'].to_sym if podfile_properties['ios.useFrameworks']
|
use_frameworks! :linkage => podfile_properties['ios.useFrameworks'].to_sym if podfile_properties['ios.useFrameworks']
|
||||||
use_frameworks! :linkage => ENV['USE_FRAMEWORKS'].to_sym if ENV['USE_FRAMEWORKS']
|
use_frameworks! :linkage => ENV['USE_FRAMEWORKS'].to_sym if ENV['USE_FRAMEWORKS']
|
||||||
|
|
||||||
|
|
||||||
use_react_native!(
|
use_react_native!(
|
||||||
:path => config[:reactNativePath],
|
:path => config[:reactNativePath],
|
||||||
:hermes_enabled => podfile_properties['expo.jsEngine'] == nil || podfile_properties['expo.jsEngine'] == 'hermes',
|
:hermes_enabled => podfile_properties['expo.jsEngine'] == nil || podfile_properties['expo.jsEngine'] == 'hermes',
|
||||||
@@ -44,23 +53,12 @@ target 'HIPMIBadungConnect' do
|
|||||||
:privacy_file_aggregation_enabled => podfile_properties['apple.privacyManifestAggregationEnabled'] != 'false',
|
:privacy_file_aggregation_enabled => podfile_properties['apple.privacyManifestAggregationEnabled'] != 'false',
|
||||||
)
|
)
|
||||||
|
|
||||||
pod 'Firebase'
|
|
||||||
pod 'Firebase/Messaging'
|
|
||||||
|
|
||||||
# @generated begin post_installer - expo prebuild (DO NOT MODIFY) sync-4092f82b887b5b9edb84642c2a56984d69b9a403
|
|
||||||
post_install do |installer|
|
post_install do |installer|
|
||||||
# @generated begin @maplibre/maplibre-react-native:post-install - expo prebuild (DO NOT MODIFY) sync-6e76c80af0d70c0003d06822dd59b7c729fca472
|
|
||||||
$MLRN.post_install(installer)
|
|
||||||
# @generated end @maplibre/maplibre-react-native:post-install
|
|
||||||
|
|
||||||
# Fix all script phases with incorrect paths
|
# Fix all script phases with incorrect paths
|
||||||
installer.pods_project.targets.each do |target|
|
installer.pods_project.targets.each do |target|
|
||||||
target.build_phases.each do |phase|
|
target.build_phases.each do |phase|
|
||||||
next unless phase.respond_to?(:shell_script)
|
next unless phase.respond_to?(:shell_script)
|
||||||
|
|
||||||
# Fix duplicated path issue
|
|
||||||
if phase.shell_script.include?('with-environment.sh')
|
if phase.shell_script.include?('with-environment.sh')
|
||||||
# Remove any existing path and use proper relative path
|
|
||||||
phase.shell_script = phase.shell_script.gsub(
|
phase.shell_script = phase.shell_script.gsub(
|
||||||
%r{(/.*?/node_modules/react-native)+/scripts/xcode/with-environment.sh},
|
%r{(/.*?/node_modules/react-native)+/scripts/xcode/with-environment.sh},
|
||||||
'${PODS_ROOT}/../../node_modules/react-native/scripts/xcode/with-environment.sh'
|
'${PODS_ROOT}/../../node_modules/react-native/scripts/xcode/with-environment.sh'
|
||||||
@@ -68,15 +66,14 @@ target 'HIPMIBadungConnect' do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
# @generated begin @maplibre/maplibre-react-native:post-install - expo prebuild (DO NOT MODIFY) sync-6e76c80af0d70c0003d06822dd59b7c729fca472
|
||||||
# Standard React Native post install
|
$MLRN.post_install(installer)
|
||||||
|
# @generated end @maplibre/maplibre-react-native:post-install
|
||||||
react_native_post_install(
|
react_native_post_install(
|
||||||
installer,
|
installer,
|
||||||
config[:reactNativePath],
|
config[:reactNativePath],
|
||||||
:mac_catalyst_enabled => false,
|
:mac_catalyst_enabled => false,
|
||||||
:ccache_enabled => podfile_properties['apple.ccacheEnabled'] == 'true',
|
:ccache_enabled => ccache_enabled?(podfile_properties),
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
# @generated end post_installer
|
end
|
||||||
|
|
||||||
end
|
|
||||||
|
|||||||
@@ -279,34 +279,11 @@ PODS:
|
|||||||
- EXUpdatesInterface (2.0.0):
|
- EXUpdatesInterface (2.0.0):
|
||||||
- ExpoModulesCore
|
- ExpoModulesCore
|
||||||
- FBLazyVector (0.81.5)
|
- FBLazyVector (0.81.5)
|
||||||
- Firebase (12.8.0):
|
|
||||||
- Firebase/Core (= 12.8.0)
|
|
||||||
- Firebase/Core (12.8.0):
|
|
||||||
- Firebase/CoreOnly
|
|
||||||
- FirebaseAnalytics (~> 12.8.0)
|
|
||||||
- Firebase/CoreOnly (12.8.0):
|
- Firebase/CoreOnly (12.8.0):
|
||||||
- FirebaseCore (~> 12.8.0)
|
- FirebaseCore (~> 12.8.0)
|
||||||
- Firebase/Messaging (12.8.0):
|
- Firebase/Messaging (12.8.0):
|
||||||
- Firebase/CoreOnly
|
- Firebase/CoreOnly
|
||||||
- FirebaseMessaging (~> 12.8.0)
|
- FirebaseMessaging (~> 12.8.0)
|
||||||
- FirebaseAnalytics (12.8.0):
|
|
||||||
- FirebaseAnalytics/Default (= 12.8.0)
|
|
||||||
- FirebaseCore (~> 12.8.0)
|
|
||||||
- FirebaseInstallations (~> 12.8.0)
|
|
||||||
- GoogleUtilities/AppDelegateSwizzler (~> 8.1)
|
|
||||||
- GoogleUtilities/MethodSwizzler (~> 8.1)
|
|
||||||
- GoogleUtilities/Network (~> 8.1)
|
|
||||||
- "GoogleUtilities/NSData+zlib (~> 8.1)"
|
|
||||||
- nanopb (~> 3.30910.0)
|
|
||||||
- FirebaseAnalytics/Default (12.8.0):
|
|
||||||
- FirebaseCore (~> 12.8.0)
|
|
||||||
- FirebaseInstallations (~> 12.8.0)
|
|
||||||
- GoogleAppMeasurement/Default (= 12.8.0)
|
|
||||||
- GoogleUtilities/AppDelegateSwizzler (~> 8.1)
|
|
||||||
- GoogleUtilities/MethodSwizzler (~> 8.1)
|
|
||||||
- GoogleUtilities/Network (~> 8.1)
|
|
||||||
- "GoogleUtilities/NSData+zlib (~> 8.1)"
|
|
||||||
- nanopb (~> 3.30910.0)
|
|
||||||
- FirebaseCore (12.8.0):
|
- FirebaseCore (12.8.0):
|
||||||
- FirebaseCoreInternal (~> 12.8.0)
|
- FirebaseCoreInternal (~> 12.8.0)
|
||||||
- GoogleUtilities/Environment (~> 8.1)
|
- GoogleUtilities/Environment (~> 8.1)
|
||||||
@@ -329,33 +306,6 @@ PODS:
|
|||||||
- GoogleUtilities/Reachability (~> 8.1)
|
- GoogleUtilities/Reachability (~> 8.1)
|
||||||
- GoogleUtilities/UserDefaults (~> 8.1)
|
- GoogleUtilities/UserDefaults (~> 8.1)
|
||||||
- nanopb (~> 3.30910.0)
|
- nanopb (~> 3.30910.0)
|
||||||
- GoogleAdsOnDeviceConversion (3.2.0):
|
|
||||||
- GoogleUtilities/Environment (~> 8.1)
|
|
||||||
- GoogleUtilities/Logger (~> 8.1)
|
|
||||||
- GoogleUtilities/Network (~> 8.1)
|
|
||||||
- nanopb (~> 3.30910.0)
|
|
||||||
- GoogleAppMeasurement/Core (12.8.0):
|
|
||||||
- GoogleUtilities/AppDelegateSwizzler (~> 8.1)
|
|
||||||
- GoogleUtilities/MethodSwizzler (~> 8.1)
|
|
||||||
- GoogleUtilities/Network (~> 8.1)
|
|
||||||
- "GoogleUtilities/NSData+zlib (~> 8.1)"
|
|
||||||
- nanopb (~> 3.30910.0)
|
|
||||||
- GoogleAppMeasurement/Default (12.8.0):
|
|
||||||
- GoogleAdsOnDeviceConversion (~> 3.2.0)
|
|
||||||
- GoogleAppMeasurement/Core (= 12.8.0)
|
|
||||||
- GoogleAppMeasurement/IdentitySupport (= 12.8.0)
|
|
||||||
- GoogleUtilities/AppDelegateSwizzler (~> 8.1)
|
|
||||||
- GoogleUtilities/MethodSwizzler (~> 8.1)
|
|
||||||
- GoogleUtilities/Network (~> 8.1)
|
|
||||||
- "GoogleUtilities/NSData+zlib (~> 8.1)"
|
|
||||||
- nanopb (~> 3.30910.0)
|
|
||||||
- GoogleAppMeasurement/IdentitySupport (12.8.0):
|
|
||||||
- GoogleAppMeasurement/Core (= 12.8.0)
|
|
||||||
- GoogleUtilities/AppDelegateSwizzler (~> 8.1)
|
|
||||||
- GoogleUtilities/MethodSwizzler (~> 8.1)
|
|
||||||
- GoogleUtilities/Network (~> 8.1)
|
|
||||||
- "GoogleUtilities/NSData+zlib (~> 8.1)"
|
|
||||||
- nanopb (~> 3.30910.0)
|
|
||||||
- GoogleDataTransport (10.1.0):
|
- GoogleDataTransport (10.1.0):
|
||||||
- nanopb (~> 3.30910.0)
|
- nanopb (~> 3.30910.0)
|
||||||
- PromisesObjC (~> 2.4)
|
- PromisesObjC (~> 2.4)
|
||||||
@@ -369,9 +319,6 @@ PODS:
|
|||||||
- GoogleUtilities/Logger (8.1.0):
|
- GoogleUtilities/Logger (8.1.0):
|
||||||
- GoogleUtilities/Environment
|
- GoogleUtilities/Environment
|
||||||
- GoogleUtilities/Privacy
|
- GoogleUtilities/Privacy
|
||||||
- GoogleUtilities/MethodSwizzler (8.1.0):
|
|
||||||
- GoogleUtilities/Logger
|
|
||||||
- GoogleUtilities/Privacy
|
|
||||||
- GoogleUtilities/Network (8.1.0):
|
- GoogleUtilities/Network (8.1.0):
|
||||||
- GoogleUtilities/Logger
|
- GoogleUtilities/Logger
|
||||||
- "GoogleUtilities/NSData+zlib"
|
- "GoogleUtilities/NSData+zlib"
|
||||||
@@ -2581,9 +2528,9 @@ PODS:
|
|||||||
- ReactCommon/turbomodule/core
|
- ReactCommon/turbomodule/core
|
||||||
- ReactNativeDependencies
|
- ReactNativeDependencies
|
||||||
- Yoga
|
- Yoga
|
||||||
- SDWebImage (5.21.6):
|
- SDWebImage (5.21.7):
|
||||||
- SDWebImage/Core (= 5.21.6)
|
- SDWebImage/Core (= 5.21.7)
|
||||||
- SDWebImage/Core (5.21.6)
|
- SDWebImage/Core (5.21.7)
|
||||||
- SDWebImageAVIFCoder (0.11.1):
|
- SDWebImageAVIFCoder (0.11.1):
|
||||||
- libavif/core (>= 0.11.0)
|
- libavif/core (>= 0.11.0)
|
||||||
- SDWebImage (~> 5.10)
|
- SDWebImage (~> 5.10)
|
||||||
@@ -2633,8 +2580,6 @@ DEPENDENCIES:
|
|||||||
- ExpoWebBrowser (from `../node_modules/expo-web-browser/ios`)
|
- ExpoWebBrowser (from `../node_modules/expo-web-browser/ios`)
|
||||||
- EXUpdatesInterface (from `../node_modules/expo-updates-interface/ios`)
|
- EXUpdatesInterface (from `../node_modules/expo-updates-interface/ios`)
|
||||||
- FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`)
|
- FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`)
|
||||||
- Firebase
|
|
||||||
- Firebase/Messaging
|
|
||||||
- hermes-engine (from `../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec`)
|
- hermes-engine (from `../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec`)
|
||||||
- "maplibre-react-native (from `../node_modules/@maplibre/maplibre-react-native`)"
|
- "maplibre-react-native (from `../node_modules/@maplibre/maplibre-react-native`)"
|
||||||
- RCTDeprecation (from `../node_modules/react-native/ReactApple/Libraries/RCTFoundation/RCTDeprecation`)
|
- RCTDeprecation (from `../node_modules/react-native/ReactApple/Libraries/RCTFoundation/RCTDeprecation`)
|
||||||
@@ -2722,14 +2667,11 @@ DEPENDENCIES:
|
|||||||
SPEC REPOS:
|
SPEC REPOS:
|
||||||
trunk:
|
trunk:
|
||||||
- Firebase
|
- Firebase
|
||||||
- FirebaseAnalytics
|
|
||||||
- FirebaseCore
|
- FirebaseCore
|
||||||
- FirebaseCoreExtension
|
- FirebaseCoreExtension
|
||||||
- FirebaseCoreInternal
|
- FirebaseCoreInternal
|
||||||
- FirebaseInstallations
|
- FirebaseInstallations
|
||||||
- FirebaseMessaging
|
- FirebaseMessaging
|
||||||
- GoogleAdsOnDeviceConversion
|
|
||||||
- GoogleAppMeasurement
|
|
||||||
- GoogleDataTransport
|
- GoogleDataTransport
|
||||||
- GoogleUtilities
|
- GoogleUtilities
|
||||||
- libavif
|
- libavif
|
||||||
@@ -3011,14 +2953,11 @@ SPEC CHECKSUMS:
|
|||||||
EXUpdatesInterface: 5adf50cb41e079c861da6d9b4b954c3db9a50734
|
EXUpdatesInterface: 5adf50cb41e079c861da6d9b4b954c3db9a50734
|
||||||
FBLazyVector: e95a291ad2dadb88e42b06e0c5fb8262de53ec12
|
FBLazyVector: e95a291ad2dadb88e42b06e0c5fb8262de53ec12
|
||||||
Firebase: 9a58fdbc9d8655ed7b79a19cf9690bb007d3d46d
|
Firebase: 9a58fdbc9d8655ed7b79a19cf9690bb007d3d46d
|
||||||
FirebaseAnalytics: f20bbad8cb7f65d8a5eaefeb424ae8800a31bdfc
|
|
||||||
FirebaseCore: 0dbad74bda10b8fb9ca34ad8f375fb9dd3ebef7c
|
FirebaseCore: 0dbad74bda10b8fb9ca34ad8f375fb9dd3ebef7c
|
||||||
FirebaseCoreExtension: 6605938d51f765d8b18bfcafd2085276a252bee2
|
FirebaseCoreExtension: 6605938d51f765d8b18bfcafd2085276a252bee2
|
||||||
FirebaseCoreInternal: fe5fa466aeb314787093a7dce9f0beeaad5a2a21
|
FirebaseCoreInternal: fe5fa466aeb314787093a7dce9f0beeaad5a2a21
|
||||||
FirebaseInstallations: 6a14ab3d694ebd9f839c48d330da5547e9ca9dc0
|
FirebaseInstallations: 6a14ab3d694ebd9f839c48d330da5547e9ca9dc0
|
||||||
FirebaseMessaging: 7f42cfd10ec64181db4e01b305a613791c8e782c
|
FirebaseMessaging: 7f42cfd10ec64181db4e01b305a613791c8e782c
|
||||||
GoogleAdsOnDeviceConversion: d68c69dd9581a0f5da02617b6f377e5be483970f
|
|
||||||
GoogleAppMeasurement: 72c9a682fec6290327ea5e3c4b829b247fcb2c17
|
|
||||||
GoogleDataTransport: aae35b7ea0c09004c3797d53c8c41f66f219d6a7
|
GoogleDataTransport: aae35b7ea0c09004c3797d53c8c41f66f219d6a7
|
||||||
GoogleUtilities: 00c88b9a86066ef77f0da2fab05f65d7768ed8e1
|
GoogleUtilities: 00c88b9a86066ef77f0da2fab05f65d7768ed8e1
|
||||||
hermes-engine: 9f4dfe93326146a1c99eb535b1cb0b857a3cd172
|
hermes-engine: 9f4dfe93326146a1c99eb535b1cb0b857a3cd172
|
||||||
@@ -3107,13 +3046,13 @@ SPEC CHECKSUMS:
|
|||||||
RNSVG: 31d6639663c249b7d5abc9728dde2041eb2a3c34
|
RNSVG: 31d6639663c249b7d5abc9728dde2041eb2a3c34
|
||||||
RNVectorIcons: 4351544f100d4f12cac156a7c13399e60bab3e26
|
RNVectorIcons: 4351544f100d4f12cac156a7c13399e60bab3e26
|
||||||
RNWorklets: 43cd6af94c18f89cbca10ea83fee281b69d75da5
|
RNWorklets: 43cd6af94c18f89cbca10ea83fee281b69d75da5
|
||||||
SDWebImage: 1bb6a1b84b6fe87b972a102bdc77dd589df33477
|
SDWebImage: e9fc87c1aab89a8ab1bbd74eba378c6f53be8abf
|
||||||
SDWebImageAVIFCoder: afe194a084e851f70228e4be35ef651df0fc5c57
|
SDWebImageAVIFCoder: afe194a084e851f70228e4be35ef651df0fc5c57
|
||||||
SDWebImageSVGCoder: 15a300a97ec1c8ac958f009c02220ac0402e936c
|
SDWebImageSVGCoder: 15a300a97ec1c8ac958f009c02220ac0402e936c
|
||||||
SDWebImageWebPCoder: e38c0a70396191361d60c092933e22c20d5b1380
|
SDWebImageWebPCoder: e38c0a70396191361d60c092933e22c20d5b1380
|
||||||
Yoga: 5934998fbeaef7845dbf698f698518695ab4cd1a
|
Yoga: 5934998fbeaef7845dbf698f698518695ab4cd1a
|
||||||
ZXingObjC: 8898711ab495761b2dbbdec76d90164a6d7e14c5
|
ZXingObjC: 8898711ab495761b2dbbdec76d90164a6d7e14c5
|
||||||
|
|
||||||
PODFILE CHECKSUM: c099c57001b36661ca723fa0edfdb338496e8b9d
|
PODFILE CHECKSUM: 98fc0b2be4d9f9b5a23816e3c77ad0e74ea84fa0
|
||||||
|
|
||||||
COCOAPODS: 1.16.2
|
COCOAPODS: 1.16.2
|
||||||
|
|||||||
@@ -48,6 +48,7 @@
|
|||||||
"expo-symbols": "~1.0.7",
|
"expo-symbols": "~1.0.7",
|
||||||
"expo-system-ui": "~6.0.7",
|
"expo-system-ui": "~6.0.7",
|
||||||
"expo-web-browser": "~15.0.9",
|
"expo-web-browser": "~15.0.9",
|
||||||
|
"libphonenumber-js": "^1.12.40",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"moti": "^0.30.0",
|
"moti": "^0.30.0",
|
||||||
"react": "19.1.0",
|
"react": "19.1.0",
|
||||||
|
|||||||
287
plugins/withCustomConfig.js
Normal file
287
plugins/withCustomConfig.js
Normal file
@@ -0,0 +1,287 @@
|
|||||||
|
const {
|
||||||
|
withAppBuildGradle,
|
||||||
|
withProjectBuildGradle,
|
||||||
|
withInfoPlist,
|
||||||
|
} = require("@expo/config-plugins");
|
||||||
|
|
||||||
|
const { withPodfile } = require("@expo/config-plugins");
|
||||||
|
const { withAndroidManifest } = require("@expo/config-plugins");
|
||||||
|
const { withDangerousMod } = require("@expo/config-plugins");
|
||||||
|
const fs = require("fs");
|
||||||
|
const path = require("path");
|
||||||
|
|
||||||
|
// ─────────────────────────────────────────
|
||||||
|
// 1. PROJECT-LEVEL build.gradle
|
||||||
|
// Tambah: google-services classpath + Mapbox maven
|
||||||
|
// ─────────────────────────────────────────
|
||||||
|
const withCustomProjectBuildGradle = (config) => {
|
||||||
|
return withProjectBuildGradle(config, (config) => {
|
||||||
|
let contents = config.modResults.contents;
|
||||||
|
|
||||||
|
// Tambah google-services classpath jika belum ada
|
||||||
|
if (!contents.includes("com.google.gms:google-services")) {
|
||||||
|
contents = contents.replace(
|
||||||
|
/classpath\('com\.android\.tools\.build:gradle'\)/,
|
||||||
|
`classpath('com.android.tools.build:gradle')
|
||||||
|
classpath 'com.google.gms:google-services:4.4.1'`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Tambah Mapbox maven repository jika belum ada
|
||||||
|
if (!contents.includes("api.mapbox.com")) {
|
||||||
|
contents = contents.replace(
|
||||||
|
/allprojects\s*\{[\s\S]*?repositories\s*\{/,
|
||||||
|
`allprojects {
|
||||||
|
repositories {
|
||||||
|
maven {
|
||||||
|
url 'https://api.mapbox.com/downloads/v2/releases/maven'
|
||||||
|
def token = project.properties['MAPBOX_DOWNLOADS_TOKEN'] ?: System.getenv('RNMAPBOX_MAPS_DOWNLOAD_TOKEN')
|
||||||
|
if (token) {
|
||||||
|
authentication { basic(BasicAuthentication) }
|
||||||
|
credentials {
|
||||||
|
username = 'mapbox'
|
||||||
|
password = token
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
config.modResults.contents = contents;
|
||||||
|
return config;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// ─────────────────────────────────────────
|
||||||
|
// 2. APP-LEVEL build.gradle
|
||||||
|
// Tambah: buildConfigField + google-services plugin
|
||||||
|
// ─────────────────────────────────────────
|
||||||
|
const withCustomAppBuildGradle = (config) => {
|
||||||
|
return withAppBuildGradle(config, (config) => {
|
||||||
|
let contents = config.modResults.contents;
|
||||||
|
|
||||||
|
// Tambah Mapbox packagingOptions
|
||||||
|
if (!contents.includes("rnmapbox/maps-libcpp")) {
|
||||||
|
contents = contents.replace(
|
||||||
|
/android\s*\{/,
|
||||||
|
`android {
|
||||||
|
// @generated begin @rnmapbox/maps-libcpp - expo prebuild (DO NOT MODIFY) sync-e24830a5a3e854b398227dfe9630aabfaa1cadd1
|
||||||
|
packagingOptions {
|
||||||
|
pickFirst 'lib/x86/libc++_shared.so'
|
||||||
|
pickFirst 'lib/x86_64/libc++_shared.so'
|
||||||
|
pickFirst 'lib/arm64-v8a/libc++_shared.so'
|
||||||
|
pickFirst 'lib/armeabi-v7a/libc++_shared.so'
|
||||||
|
}
|
||||||
|
// @generated end @rnmapbox/maps-libcpp`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Tambah buildConfigField REACT_NATIVE_RELEASE_LEVEL
|
||||||
|
if (!contents.includes("REACT_NATIVE_RELEASE_LEVEL")) {
|
||||||
|
contents = contents.replace(
|
||||||
|
/defaultConfig\s*\{/,
|
||||||
|
`defaultConfig {
|
||||||
|
buildConfigField "String", "REACT_NATIVE_RELEASE_LEVEL", "\\"${`$`}{findProperty('reactNativeReleaseLevel') ?: 'stable'}\\""`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Tambah apply plugin google-services di akhir file
|
||||||
|
if (!contents.includes("com.google.gms.google-services")) {
|
||||||
|
contents += `\napply plugin: 'com.google.gms.google-services'\n`;
|
||||||
|
}
|
||||||
|
|
||||||
|
config.modResults.contents = contents;
|
||||||
|
return config;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// ─────────────────────────────────────────
|
||||||
|
// 3. Info.plist
|
||||||
|
// Tambah: custom URL schemes + deskripsi Bahasa Indonesia
|
||||||
|
// ─────────────────────────────────────────
|
||||||
|
const withCustomInfoPlist = (config) => {
|
||||||
|
return withInfoPlist(config, (config) => {
|
||||||
|
const plist = config.modResults;
|
||||||
|
|
||||||
|
// Custom URL Schemes
|
||||||
|
// Pastikan CFBundleURLTypes sudah ada, lalu tambahkan scheme custom
|
||||||
|
if (!plist.CFBundleURLTypes) {
|
||||||
|
plist.CFBundleURLTypes = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
const hasHipmiScheme = plist.CFBundleURLTypes.some((entry) =>
|
||||||
|
entry.CFBundleURLSchemes?.includes("hipmimobile"),
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!hasHipmiScheme) {
|
||||||
|
plist.CFBundleURLTypes.push({
|
||||||
|
CFBundleURLSchemes: ["hipmimobile", "com.anonymous.hipmi-mobile"],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// NSLocationWhenInUseUsageDescription — Bahasa Indonesia
|
||||||
|
plist.NSLocationWhenInUseUsageDescription =
|
||||||
|
"Aplikasi membutuhkan akses lokasi untuk menampilkan peta.";
|
||||||
|
|
||||||
|
// NSPhotoLibraryUsageDescription — Bahasa Indonesia (panjang)
|
||||||
|
plist.NSPhotoLibraryUsageDescription =
|
||||||
|
"Untuk mengunggah dokumen dan media bisnis seperti foto profil, logo usaha, poster lowongan, atau bukti transaksi di berbagai fitur aplikasi: Profile, Portofolio, Job Vacancy, Investasi, dan Donasi.";
|
||||||
|
|
||||||
|
plist.NSFaceIDUsageDescription =
|
||||||
|
"Allow $(PRODUCT_NAME) to access your Face ID biometric data.";
|
||||||
|
|
||||||
|
return config;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// ─────────────────────────────────────────
|
||||||
|
// 4. Android Manifest
|
||||||
|
// Tambah: backup rules untuk expo-secure-store
|
||||||
|
// ─────────────────────────────────────────
|
||||||
|
const withCustomManifest = (config) => {
|
||||||
|
return withAndroidManifest(config, (config) => {
|
||||||
|
const manifest = config.modResults.manifest;
|
||||||
|
const application = manifest.application[0];
|
||||||
|
|
||||||
|
// Tambah atribut backup untuk expo-secure-store
|
||||||
|
application.$["android:fullBackupContent"] =
|
||||||
|
"@xml/secure_store_backup_rules";
|
||||||
|
application.$["android:dataExtractionRules"] =
|
||||||
|
"@xml/secure_store_data_extraction_rules";
|
||||||
|
|
||||||
|
// Tambah tools:replace pada meta-data notification color
|
||||||
|
const metaDataList = application["meta-data"] || [];
|
||||||
|
const notifColorMeta = metaDataList.find(
|
||||||
|
(m) =>
|
||||||
|
m.$["android:name"] ===
|
||||||
|
"com.google.firebase.messaging.default_notification_color",
|
||||||
|
);
|
||||||
|
if (notifColorMeta) {
|
||||||
|
notifColorMeta.$["tools:replace"] = "android:resource";
|
||||||
|
}
|
||||||
|
|
||||||
|
return config;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// ─────────────────────────────────────────
|
||||||
|
// 5. Podfile
|
||||||
|
// Tambah: use_modular_headers!
|
||||||
|
// ─────────────────────────────────────────
|
||||||
|
|
||||||
|
const withCustomPodfile = (config) => {
|
||||||
|
return withPodfile(config, (config) => {
|
||||||
|
let contents = config.modResults.contents;
|
||||||
|
|
||||||
|
// Tambah use_modular_headers! jika belum ada
|
||||||
|
if (!contents.includes("use_modular_headers!")) {
|
||||||
|
contents = contents.replace(
|
||||||
|
/platform :ios/,
|
||||||
|
`use_modular_headers!\nplatform :ios`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Tambah Firebase pods jika belum ada
|
||||||
|
if (!contents.includes("pod 'Firebase/Messaging'")) {
|
||||||
|
contents = contents.replace(
|
||||||
|
/use_react_native_pods\!/,
|
||||||
|
`pod 'Firebase'\n pod 'Firebase/Messaging'\n\n use_react_native_pods!`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Tambah fix script with-environment.sh jika belum ada
|
||||||
|
// Tambah fix script with-environment.sh jika belum ada
|
||||||
|
if (!contents.includes("with-environment.sh")) {
|
||||||
|
const fixScript = [
|
||||||
|
"post_install do |installer|",
|
||||||
|
" # Fix all script phases with incorrect paths",
|
||||||
|
" installer.pods_project.targets.each do |target|",
|
||||||
|
" target.build_phases.each do |phase|",
|
||||||
|
" next unless phase.respond_to?(:shell_script)",
|
||||||
|
" if phase.shell_script.include?('with-environment.sh')",
|
||||||
|
" phase.shell_script = phase.shell_script.gsub(",
|
||||||
|
" %r{(/.*?/node_modules/react-native)+/scripts/xcode/with-environment.sh},",
|
||||||
|
" '${PODS_ROOT}/../../node_modules/react-native/scripts/xcode/with-environment.sh'",
|
||||||
|
" )",
|
||||||
|
" end",
|
||||||
|
" end",
|
||||||
|
" end",
|
||||||
|
].join("\n");
|
||||||
|
|
||||||
|
contents = contents.replace(/post_install do \|installer\|/, fixScript);
|
||||||
|
}
|
||||||
|
|
||||||
|
config.modResults.contents = contents;
|
||||||
|
return config;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// ─────────────────────────────────────────
|
||||||
|
// 6. Android XML Files
|
||||||
|
// Tambah: secure_store_backup_rules.xml dan secure_store_data_extraction_rules.xml
|
||||||
|
// ─────────────────────────────────────────
|
||||||
|
|
||||||
|
const withSecureStoreXml = (config) => {
|
||||||
|
return withDangerousMod(config, [
|
||||||
|
"android",
|
||||||
|
(config) => {
|
||||||
|
const xmlDir = path.join(
|
||||||
|
config.modRequest.platformProjectRoot,
|
||||||
|
"app/src/main/res/xml",
|
||||||
|
);
|
||||||
|
|
||||||
|
// Buat folder jika belum ada
|
||||||
|
if (!fs.existsSync(xmlDir)) {
|
||||||
|
fs.mkdirSync(xmlDir, { recursive: true });
|
||||||
|
}
|
||||||
|
|
||||||
|
// Definisikan path variabel di sini ← INI yang kurang sebelumnya
|
||||||
|
const backupRulesPath = path.join(
|
||||||
|
xmlDir,
|
||||||
|
"secure_store_backup_rules.xml",
|
||||||
|
);
|
||||||
|
const dataExtractionPath = path.join(
|
||||||
|
xmlDir,
|
||||||
|
"secure_store_data_extraction_rules.xml",
|
||||||
|
);
|
||||||
|
|
||||||
|
// secure_store_backup_rules.xml
|
||||||
|
fs.writeFileSync(
|
||||||
|
backupRulesPath,
|
||||||
|
`<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<full-backup-content>
|
||||||
|
<exclude domain="sharedpref" path="SECURESTORE"/>
|
||||||
|
</full-backup-content>`,
|
||||||
|
);
|
||||||
|
|
||||||
|
// secure_store_data_extraction_rules.xml
|
||||||
|
fs.writeFileSync(
|
||||||
|
dataExtractionPath,
|
||||||
|
`<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<data-extraction-rules>
|
||||||
|
<cloud-backup>
|
||||||
|
<exclude domain="sharedpref" path="SECURESTORE"/>
|
||||||
|
</cloud-backup>
|
||||||
|
<device-transfer>
|
||||||
|
<exclude domain="sharedpref" path="SECURESTORE"/>
|
||||||
|
</device-transfer>
|
||||||
|
</data-extraction-rules>`,
|
||||||
|
);
|
||||||
|
|
||||||
|
return config;
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
};
|
||||||
|
|
||||||
|
// ─────────────────────────────────────────
|
||||||
|
// EXPORT
|
||||||
|
// ─────────────────────────────────────────
|
||||||
|
module.exports = (config) => {
|
||||||
|
config = withCustomProjectBuildGradle(config);
|
||||||
|
config = withCustomAppBuildGradle(config);
|
||||||
|
config = withCustomManifest(config);
|
||||||
|
config = withSecureStoreXml(config);
|
||||||
|
config = withCustomInfoPlist(config);
|
||||||
|
config = withCustomPodfile(config);
|
||||||
|
return config;
|
||||||
|
};
|
||||||
@@ -33,7 +33,10 @@ export function EventDetailQRCode({
|
|||||||
const deepLinkURL = `${BASE_URL}/event/${id}/confirmation?userId=${userId}`;
|
const deepLinkURL = `${BASE_URL}/event/${id}/confirmation?userId=${userId}`;
|
||||||
|
|
||||||
// Toggle antara HTTPS link dan custom scheme
|
// Toggle antara HTTPS link dan custom scheme
|
||||||
const qrValue = useHttpsLink ? httpsLink : deepLinkURL;
|
// const qrValue = useHttpsLink ? httpsLink : deepLinkURL;
|
||||||
|
const qrValue = deepLinkURL;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<BaseBox>
|
<BaseBox>
|
||||||
@@ -46,7 +49,7 @@ export function EventDetailQRCode({
|
|||||||
{qrValue}
|
{qrValue}
|
||||||
</TextCustom>
|
</TextCustom>
|
||||||
<Spacing />
|
<Spacing />
|
||||||
<StackCustom direction="row" gap="sm">
|
{/* <StackCustom direction="row" gap="sm">
|
||||||
<ButtonCustom
|
<ButtonCustom
|
||||||
onPress={() => setUseHttpsLink(true)}
|
onPress={() => setUseHttpsLink(true)}
|
||||||
backgroundColor={useHttpsLink ? MainColor.yellow : "transparent"}
|
backgroundColor={useHttpsLink ? MainColor.yellow : "transparent"}
|
||||||
@@ -69,13 +72,13 @@ export function EventDetailQRCode({
|
|||||||
>
|
>
|
||||||
Custom Scheme
|
Custom Scheme
|
||||||
</ButtonCustom>
|
</ButtonCustom>
|
||||||
</StackCustom>
|
</StackCustom> */}
|
||||||
<Spacing />
|
{/* <Spacing />
|
||||||
<TextCustom color="gray" align="center" size={"small"}>
|
<TextCustom color="gray" align="center" size={"small"}>
|
||||||
{useHttpsLink
|
{useHttpsLink
|
||||||
? "✅ Testing Universal Links/App Links (butuh .well-known config)"
|
? "✅ Testing Universal Links/App Links (butuh .well-known config)"
|
||||||
: "🔧 Testing langsung (tanpa domain verification)"}
|
: "🔧 Testing langsung (tanpa domain verification)"}
|
||||||
</TextCustom>
|
</TextCustom> */}
|
||||||
</BaseBox>
|
</BaseBox>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -128,12 +128,13 @@ export function Admin_ScreenEventDetail() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return <Spacing height={100} />;
|
||||||
}, [status, id]);
|
}, [status, id]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<NewWrapper
|
<NewWrapper
|
||||||
|
hideFooter
|
||||||
headerComponent={headerComponent}
|
headerComponent={headerComponent}
|
||||||
// footerComponent={
|
// footerComponent={
|
||||||
// <View style={{ paddingInline: 8 }}>
|
// <View style={{ paddingInline: 8 }}>
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import {
|
|||||||
StackCustom,
|
StackCustom,
|
||||||
TextCustom,
|
TextCustom,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import { IconPlus } from "@/components/_Icon";
|
import { IconPlus } from "@/components/_Icon";
|
||||||
import { IconDot } from "@/components/_Icon/IconComponent";
|
import { IconDot } from "@/components/_Icon/IconComponent";
|
||||||
import ListSkeletonComponent from "@/components/_ShareComponent/ListSkeletonComponent";
|
import ListSkeletonComponent from "@/components/_ShareComponent/ListSkeletonComponent";
|
||||||
@@ -121,12 +122,16 @@ export default function Admin_ScreenNotification() {
|
|||||||
<>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
title: "Admin Notifikasi",
|
header: () => (
|
||||||
headerLeft: () => <BackButton />,
|
<AppHeader
|
||||||
headerRight: () => (
|
title="Admin Notifikasi"
|
||||||
<IconDot
|
left={<BackButton />}
|
||||||
color={MainColor.yellow}
|
right={
|
||||||
onPress={() => setOpenDrawer(true)}
|
<IconDot
|
||||||
|
color={MainColor.yellow}
|
||||||
|
onPress={() => setOpenDrawer(true)}
|
||||||
|
/>
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import {
|
|||||||
} from "@/components";
|
} from "@/components";
|
||||||
import { IconPlus } from "@/components/_Icon";
|
import { IconPlus } from "@/components/_Icon";
|
||||||
import { IconDot } from "@/components/_Icon/IconComponent";
|
import { IconDot } from "@/components/_Icon/IconComponent";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import { AccentColor, MainColor } from "@/constants/color-palet";
|
import { AccentColor, MainColor } from "@/constants/color-palet";
|
||||||
import { ICON_SIZE_SMALL, PAGINATION_DEFAULT_TAKE } from "@/constants/constans-value";
|
import { ICON_SIZE_SMALL, PAGINATION_DEFAULT_TAKE } from "@/constants/constans-value";
|
||||||
import { createPaginationComponents } from "@/helpers/paginationHelpers";
|
import { createPaginationComponents } from "@/helpers/paginationHelpers";
|
||||||
@@ -169,12 +170,16 @@ export default function Admin_ScreenNotification2() {
|
|||||||
<>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
title: "Admin Notifikasi",
|
// title: "Admin Notifikasi",
|
||||||
headerLeft: () => <BackButton />,
|
header: () => (
|
||||||
headerRight: () => (
|
<AppHeader
|
||||||
<IconDot
|
title="Admin Notifikasi"
|
||||||
color={MainColor.yellow}
|
right={
|
||||||
onPress={() => setOpenDrawer(true)}
|
<IconDot
|
||||||
|
color={MainColor.yellow}
|
||||||
|
onPress={() => setOpenDrawer(true)}
|
||||||
|
/>
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
import { NewWrapper } from "@/components";
|
import { NewWrapper, PhoneInputCustom, ViewWrapper } from "@/components";
|
||||||
import ButtonCustom from "@/components/Button/ButtonCustom";
|
import ButtonCustom from "@/components/Button/ButtonCustom";
|
||||||
import ModalReactNative from "@/components/Modal/ModalReactNative";
|
import ModalReactNative from "@/components/Modal/ModalReactNative";
|
||||||
import Spacing from "@/components/_ShareComponent/Spacing";
|
import Spacing from "@/components/_ShareComponent/Spacing";
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
|
import { DEFAULT_COUNTRY, type CountryData } from "@/constants/countries";
|
||||||
import { useAuth } from "@/hooks/use-auth";
|
import { useAuth } from "@/hooks/use-auth";
|
||||||
import { apiVersion, BASE_URL } from "@/service/api-config";
|
import { apiVersion, BASE_URL } from "@/service/api-config";
|
||||||
import { GStyles } from "@/styles/global-styles";
|
import { GStyles } from "@/styles/global-styles";
|
||||||
@@ -10,16 +11,23 @@ import { openBrowser } from "@/utils/openBrower";
|
|||||||
import versionBadge from "@/utils/viersionBadge";
|
import versionBadge from "@/utils/viersionBadge";
|
||||||
import { Redirect } from "expo-router";
|
import { Redirect } from "expo-router";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { RefreshControl, Text, View } from "react-native";
|
import {
|
||||||
import PhoneInput, { ICountry } from "react-native-international-phone-number";
|
KeyboardAvoidingView,
|
||||||
|
Platform,
|
||||||
|
RefreshControl,
|
||||||
|
Text,
|
||||||
|
View,
|
||||||
|
} from "react-native";
|
||||||
|
import { parsePhoneNumber } from "libphonenumber-js";
|
||||||
import Toast from "react-native-toast-message";
|
import Toast from "react-native-toast-message";
|
||||||
import EULASection from "./EULASection";
|
import EULASection from "./EULASection";
|
||||||
|
|
||||||
export default function LoginView() {
|
export default function LoginView() {
|
||||||
const url = BASE_URL;
|
const url = BASE_URL;
|
||||||
const [version, setVersion] = useState<string>("");
|
const [version, setVersion] = useState<string>("");
|
||||||
const [selectedCountry, setSelectedCountry] = useState<null | ICountry>(null);
|
const [selectedCountry, setSelectedCountry] =
|
||||||
const [inputValue, setInputValue] = useState<string>("");
|
useState<CountryData>(DEFAULT_COUNTRY);
|
||||||
|
const [phoneNumber, setPhoneNumber] = useState<string>("");
|
||||||
const [loading, setLoading] = useState<boolean>(false);
|
const [loading, setLoading] = useState<boolean>(false);
|
||||||
const [refreshing, setRefreshing] = useState<boolean>(false);
|
const [refreshing, setRefreshing] = useState<boolean>(false);
|
||||||
const [modalVisible, setModalVisible] = useState(false);
|
const [modalVisible, setModalVisible] = useState(false);
|
||||||
@@ -43,41 +51,43 @@ export default function LoginView() {
|
|||||||
async function handleRefresh() {
|
async function handleRefresh() {
|
||||||
setRefreshing(true);
|
setRefreshing(true);
|
||||||
await onLoadVersion();
|
await onLoadVersion();
|
||||||
setInputValue("");
|
setPhoneNumber("");
|
||||||
|
setSelectedCountry(DEFAULT_COUNTRY);
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
setRefreshing(false);
|
setRefreshing(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleInputValue(phoneNumber: string) {
|
|
||||||
setInputValue(phoneNumber);
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleSelectedCountry(country: ICountry) {
|
|
||||||
setSelectedCountry(country);
|
|
||||||
}
|
|
||||||
|
|
||||||
async function validateData() {
|
async function validateData() {
|
||||||
if (inputValue.length === 0) {
|
if (phoneNumber.length === 0) {
|
||||||
return Toast.show({
|
return Toast.show({
|
||||||
type: "error",
|
type: "error",
|
||||||
text1: "Masukan nomor anda",
|
text1: "Masukan nomor anda",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (selectedCountry === null) {
|
if (phoneNumber.length < 9) {
|
||||||
return Toast.show({
|
|
||||||
type: "error",
|
|
||||||
text1: "Pilih negara",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (inputValue.length < 9) {
|
|
||||||
return Toast.show({
|
return Toast.show({
|
||||||
type: "error",
|
type: "error",
|
||||||
text1: "Nomor tidak valid",
|
text1: "Nomor tidak valid",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Validate with libphonenumber-js
|
||||||
|
try {
|
||||||
|
const parsedNumber = parsePhoneNumber(phoneNumber, selectedCountry.code);
|
||||||
|
if (!parsedNumber || !parsedNumber.isValid()) {
|
||||||
|
return Toast.show({
|
||||||
|
type: "error",
|
||||||
|
text1: "Nomor tidak valid",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
return Toast.show({
|
||||||
|
type: "error",
|
||||||
|
text1: "Format nomor tidak valid",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -85,8 +95,17 @@ export default function LoginView() {
|
|||||||
const isValid = await validateData();
|
const isValid = await validateData();
|
||||||
if (!isValid) return;
|
if (!isValid) return;
|
||||||
|
|
||||||
const callingCode = selectedCountry?.callingCode.replace(/^\+/, "") || "";
|
// Format phone number with country code
|
||||||
let fixNumber = inputValue.replace(/\s+/g, "").replace(/^0+/, "");
|
const callingCode = selectedCountry.callingCode;
|
||||||
|
let fixNumber = phoneNumber.replace(/\s+/g, "").replace(/^0+/, "");
|
||||||
|
|
||||||
|
// Remove country code if already present
|
||||||
|
if (fixNumber.startsWith(callingCode)) {
|
||||||
|
fixNumber = fixNumber.substring(callingCode.length);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remove leading zero
|
||||||
|
fixNumber = fixNumber.replace(/^0+/, "");
|
||||||
|
|
||||||
const realNumber = callingCode + fixNumber;
|
const realNumber = callingCode + fixNumber;
|
||||||
|
|
||||||
@@ -128,75 +147,84 @@ export default function LoginView() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<NewWrapper
|
<KeyboardAvoidingView
|
||||||
withBackground
|
behavior={Platform.OS === "ios" ? "padding" : "height"}
|
||||||
refreshControl={
|
keyboardVerticalOffset={Platform.OS === "ios" ? 100 : 50}
|
||||||
<RefreshControl refreshing={refreshing} onRefresh={handleRefresh} />
|
style={{ flex: 1 }}
|
||||||
}
|
|
||||||
>
|
>
|
||||||
<View style={GStyles.authContainer}>
|
<ViewWrapper
|
||||||
<View>
|
withBackground
|
||||||
<View style={GStyles.authContainerTitle}>
|
refreshControl={
|
||||||
<Text style={GStyles.authSubTitle}>WELCOME TO</Text>
|
<RefreshControl refreshing={refreshing} onRefresh={handleRefresh} />
|
||||||
<Spacing height={5} />
|
}
|
||||||
<Text style={GStyles.authTitle}>HIPMI BADUNG APPS</Text>
|
>
|
||||||
<Spacing height={5} />
|
<View style={[GStyles.authContainer, { paddingBottom: 40 }]}>
|
||||||
|
<View>
|
||||||
|
<View style={GStyles.authContainerTitle}>
|
||||||
|
<Text style={GStyles.authSubTitle}>WELCOME TO</Text>
|
||||||
|
<Spacing height={5} />
|
||||||
|
<Text style={GStyles.authTitle}>HIPMI BADUNG APPS</Text>
|
||||||
|
<Spacing height={5} />
|
||||||
|
</View>
|
||||||
|
<Spacing height={50} />
|
||||||
|
{version && (
|
||||||
|
<Text
|
||||||
|
style={{
|
||||||
|
position: "absolute",
|
||||||
|
bottom: 35,
|
||||||
|
right: 50,
|
||||||
|
fontSize: 10,
|
||||||
|
fontWeight: "thin",
|
||||||
|
fontStyle: "italic",
|
||||||
|
color: MainColor.white_gray,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
powered by muku.id
|
||||||
|
</Text>
|
||||||
|
)}
|
||||||
</View>
|
</View>
|
||||||
<Spacing height={50} />
|
|
||||||
<Text
|
<Spacing height={20} />
|
||||||
style={{
|
|
||||||
position: "absolute",
|
<PhoneInputCustom
|
||||||
bottom: 35,
|
value={phoneNumber}
|
||||||
right: 50,
|
onChangePhoneNumber={setPhoneNumber}
|
||||||
fontSize: 10,
|
selectedCountry={selectedCountry}
|
||||||
fontWeight: "thin",
|
onChangeCountry={setSelectedCountry}
|
||||||
fontStyle: "italic",
|
placeholder="Masukkan nomor"
|
||||||
color: MainColor.white_gray,
|
/>
|
||||||
}}
|
|
||||||
|
<Spacing />
|
||||||
|
|
||||||
|
<ButtonCustom
|
||||||
|
onPress={handleLogin}
|
||||||
|
disabled={loadingTerm}
|
||||||
|
isLoading={loading || loadingTerm}
|
||||||
>
|
>
|
||||||
{version} | powered by muku.id
|
Login
|
||||||
|
</ButtonCustom>
|
||||||
|
<Spacing height={50} />
|
||||||
|
|
||||||
|
<Text
|
||||||
|
style={{ ...GStyles.textLabel, textAlign: "center", fontSize: 12 }}
|
||||||
|
>
|
||||||
|
Dengan menggunakan aplikasi ini, Anda telah menyetujui{" "}
|
||||||
|
<Text
|
||||||
|
style={{
|
||||||
|
color: MainColor.yellow,
|
||||||
|
textDecorationLine: "underline",
|
||||||
|
}}
|
||||||
|
onPress={() => {
|
||||||
|
const toUrl = `${url}/terms-of-service.html`;
|
||||||
|
openBrowser(toUrl);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Syarat & Ketentuan
|
||||||
|
</Text>{" "}
|
||||||
|
dan seluruh kebijakan privasi yang berlaku.
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
|
</ViewWrapper>
|
||||||
<PhoneInput
|
|
||||||
value={inputValue}
|
|
||||||
onChangePhoneNumber={handleInputValue}
|
|
||||||
selectedCountry={selectedCountry}
|
|
||||||
onChangeSelectedCountry={handleSelectedCountry}
|
|
||||||
defaultCountry="ID"
|
|
||||||
placeholder="Masukkan nomor"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<Spacing />
|
|
||||||
|
|
||||||
<ButtonCustom
|
|
||||||
onPress={handleLogin}
|
|
||||||
disabled={loadingTerm}
|
|
||||||
isLoading={loading || loadingTerm}
|
|
||||||
>
|
|
||||||
Login
|
|
||||||
</ButtonCustom>
|
|
||||||
<Spacing height={50} />
|
|
||||||
|
|
||||||
<Text
|
|
||||||
style={{ ...GStyles.textLabel, textAlign: "center", fontSize: 12 }}
|
|
||||||
>
|
|
||||||
Dengan menggunakan aplikasi ini, Anda telah menyetujui{" "}
|
|
||||||
<Text
|
|
||||||
style={{
|
|
||||||
color: MainColor.yellow,
|
|
||||||
textDecorationLine: "underline",
|
|
||||||
}}
|
|
||||||
onPress={() => {
|
|
||||||
const toUrl = `${url}/terms-of-service.html`;
|
|
||||||
openBrowser(toUrl);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Syarat & Ketentuan
|
|
||||||
</Text>{" "}
|
|
||||||
dan seluruh kebijakan privasi yang berlaku.
|
|
||||||
</Text>
|
|
||||||
</View>
|
|
||||||
|
|
||||||
<ModalReactNative isVisible={modalVisible}>
|
<ModalReactNative isVisible={modalVisible}>
|
||||||
<EULASection
|
<EULASection
|
||||||
@@ -205,6 +233,6 @@ export default function LoginView() {
|
|||||||
setLoadingTerm={setLoadingTerm}
|
setLoadingTerm={setLoadingTerm}
|
||||||
/>
|
/>
|
||||||
</ModalReactNative>
|
</ModalReactNative>
|
||||||
</NewWrapper>
|
</KeyboardAvoidingView>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/* eslint-disable react-hooks/exhaustive-deps */
|
/* eslint-disable react-hooks/exhaustive-deps */
|
||||||
import { BackButton, DrawerCustom, MenuDrawerDynamicGrid } from "@/components";
|
import { BackButton, DrawerCustom, MenuDrawerDynamicGrid } from "@/components";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import { IconPlus } from "@/components/_Icon";
|
import { IconPlus } from "@/components/_Icon";
|
||||||
import NewWrapper from "@/components/_ShareComponent/NewWrapper";
|
import NewWrapper from "@/components/_ShareComponent/NewWrapper";
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
@@ -52,8 +53,12 @@ export default function Donation_ScreenListOfNews({
|
|||||||
<>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
title: "Daftar Kabar",
|
header: () => (
|
||||||
headerLeft: () => <BackButton />,
|
<AppHeader
|
||||||
|
title="Daftar Kabar"
|
||||||
|
left={<BackButton />}
|
||||||
|
/>
|
||||||
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<NewWrapper
|
<NewWrapper
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import {
|
|||||||
DrawerCustom,
|
DrawerCustom,
|
||||||
MenuDrawerDynamicGrid,
|
MenuDrawerDynamicGrid,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import { IconPlus } from "@/components/_Icon";
|
import { IconPlus } from "@/components/_Icon";
|
||||||
import NewWrapper from "@/components/_ShareComponent/NewWrapper";
|
import NewWrapper from "@/components/_ShareComponent/NewWrapper";
|
||||||
import { PAGINATION_DEFAULT_TAKE } from "@/constants/constans-value";
|
import { PAGINATION_DEFAULT_TAKE } from "@/constants/constans-value";
|
||||||
@@ -61,9 +62,13 @@ export default function Donation_ScreenRecapOfNews({
|
|||||||
<>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
title: "Rekap Kabar",
|
header: () => (
|
||||||
headerLeft: () => <BackButton />,
|
<AppHeader
|
||||||
headerRight: () => <DotButton onPress={() => setOpenDrawer(true)} />,
|
title="Rekap Kabar"
|
||||||
|
left={<BackButton />}
|
||||||
|
right={<DotButton onPress={() => setOpenDrawer(true)} />}
|
||||||
|
/>
|
||||||
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<NewWrapper
|
<NewWrapper
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import {
|
|||||||
LoaderCustom,
|
LoaderCustom,
|
||||||
TextCustom,
|
TextCustom,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import { useAuth } from "@/hooks/use-auth";
|
import { useAuth } from "@/hooks/use-auth";
|
||||||
import { apiForumGetAll } from "@/service/api-client/api-forum";
|
import { apiForumGetAll } from "@/service/api-client/api-forum";
|
||||||
import { apiUser } from "@/service/api-client/api-user";
|
import { apiUser } from "@/service/api-client/api-user";
|
||||||
@@ -54,13 +55,17 @@ export default function Forum_ViewBeranda() {
|
|||||||
<>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
title: "Forum",
|
header: () => (
|
||||||
headerLeft: () => <BackButton />,
|
<AppHeader
|
||||||
headerRight: () => (
|
title="Forum"
|
||||||
<AvatarComp
|
left={<BackButton />}
|
||||||
fileId={dataUser?.Profile?.imageId}
|
right={
|
||||||
size="base"
|
<AvatarComp
|
||||||
href={`/forum/${user?.id}/forumku`}
|
fileId={dataUser?.Profile?.imageId}
|
||||||
|
size="base"
|
||||||
|
href={`/forum/${user?.id}/forumku`}
|
||||||
|
/>
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import {
|
|||||||
StackCustom,
|
StackCustom,
|
||||||
TextCustom, // ← gunakan NewWrapper yang sudah diperbaiki
|
TextCustom, // ← gunakan NewWrapper yang sudah diperbaiki
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import SkeletonCustom from "@/components/_ShareComponent/SkeletonCustom";
|
import SkeletonCustom from "@/components/_ShareComponent/SkeletonCustom";
|
||||||
import NewWrapper from "@/components/_ShareComponent/NewWrapper";
|
import NewWrapper from "@/components/_ShareComponent/NewWrapper";
|
||||||
import { useAuth } from "@/hooks/use-auth";
|
import { useAuth } from "@/hooks/use-auth";
|
||||||
@@ -155,13 +156,17 @@ export default function Forum_ViewBeranda2() {
|
|||||||
{/* 🔹 Header Navigation */}
|
{/* 🔹 Header Navigation */}
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
title: "Forum",
|
header: () => (
|
||||||
headerLeft: () => <BackButton />,
|
<AppHeader
|
||||||
headerRight: () => (
|
title="Forum"
|
||||||
<AvatarComp
|
left={<BackButton />}
|
||||||
fileId={dataUser?.Profile?.imageId}
|
right={
|
||||||
size="base"
|
<AvatarComp
|
||||||
href={`/forum/${user?.id}/forumku`}
|
fileId={dataUser?.Profile?.imageId}
|
||||||
|
size="base"
|
||||||
|
href={`/forum/${user?.id}/forumku`}
|
||||||
|
/>
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import {
|
|||||||
FloatingButton,
|
FloatingButton,
|
||||||
SearchInput,
|
SearchInput,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import NewWrapper from "@/components/_ShareComponent/NewWrapper";
|
import NewWrapper from "@/components/_ShareComponent/NewWrapper";
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
import { createPaginationComponents } from "@/helpers/paginationHelpers";
|
import { createPaginationComponents } from "@/helpers/paginationHelpers";
|
||||||
@@ -17,7 +18,7 @@ import _ from "lodash";
|
|||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { RefreshControl, TouchableOpacity, View } from "react-native";
|
import { RefreshControl, TouchableOpacity, View } from "react-native";
|
||||||
|
|
||||||
const PAGE_SIZE = 5;
|
const PAGE_SIZE = 10;
|
||||||
|
|
||||||
export default function Forum_ViewBeranda3() {
|
export default function Forum_ViewBeranda3() {
|
||||||
const { user } = useAuth();
|
const { user } = useAuth();
|
||||||
@@ -84,18 +85,22 @@ export default function Forum_ViewBeranda3() {
|
|||||||
<>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
title: "Forum",
|
header: () => (
|
||||||
headerLeft: () => <BackButton />,
|
<AppHeader
|
||||||
headerRight: () => (
|
title="Forum"
|
||||||
<TouchableOpacity
|
left={<BackButton />}
|
||||||
onPress={() => router.navigate(`/forum/${user?.id}/forumku`)}
|
right={
|
||||||
>
|
<TouchableOpacity
|
||||||
<AvatarComp
|
onPress={() => router.navigate(`/forum/${user?.id}/forumku`)}
|
||||||
fileId={dataUser?.Profile?.imageId}
|
>
|
||||||
size="base"
|
<AvatarComp
|
||||||
href={`/forum/${user?.id}/forumku`}
|
fileId={dataUser?.Profile?.imageId}
|
||||||
/>
|
size="base"
|
||||||
</TouchableOpacity>
|
href={`/forum/${user?.id}/forumku`}
|
||||||
|
/>
|
||||||
|
</TouchableOpacity>
|
||||||
|
}
|
||||||
|
/>
|
||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|||||||
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,15 +1,17 @@
|
|||||||
import { ClickableCustom, TextCustom } from "@/components";
|
import { CenterCustom, ClickableCustom, TextCustom } from "@/components";
|
||||||
import Spacing from "@/components/_ShareComponent/Spacing";
|
import Spacing from "@/components/_ShareComponent/Spacing";
|
||||||
import { router } from "expo-router";
|
import { router } from "expo-router";
|
||||||
import { View } from "react-native";
|
import { View } from "react-native";
|
||||||
import Icon from "react-native-vector-icons/FontAwesome";
|
import Icon from "react-native-vector-icons/FontAwesome";
|
||||||
import { stylesHome } from "./homeViewStyle";
|
import { stylesHome } from "./homeViewStyle";
|
||||||
|
import _ from "lodash";
|
||||||
|
|
||||||
export default function Home_BottomFeatureSection({
|
export default function Home_BottomFeatureSection({
|
||||||
listData,
|
listData,
|
||||||
}: {
|
}: {
|
||||||
listData: any[] | null;
|
listData: any[] | null;
|
||||||
}) {
|
}) {
|
||||||
|
console.log("listData", JSON.stringify(listData, null, 2));
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ClickableCustom onPress={() => router.push("/job")}>
|
<ClickableCustom onPress={() => router.push("/job")}>
|
||||||
@@ -24,17 +26,23 @@ export default function Home_BottomFeatureSection({
|
|||||||
|
|
||||||
<View style={stylesHome.vacancyList}>
|
<View style={stylesHome.vacancyList}>
|
||||||
{/* Vacancy Item 1 */}
|
{/* Vacancy Item 1 */}
|
||||||
{listData?.map((item: any, index: number) => (
|
{_.isEmpty(listData) ? (
|
||||||
<View style={stylesHome.vacancyItem} key={index}>
|
<CenterCustom style={{ paddingBlock: 50 }}>
|
||||||
<View style={stylesHome.vacancyDetails}>
|
<TextCustom color="gray">Lowongan pekerjaan belum tersedia</TextCustom>
|
||||||
<TextCustom bold color="yellow" truncate size="large">
|
</CenterCustom>
|
||||||
{item.title}
|
) : (
|
||||||
</TextCustom>
|
listData?.map((item: any, index: number) => (
|
||||||
<Spacing height={5} />
|
<View style={stylesHome.vacancyItem} key={index}>
|
||||||
<TextCustom truncate={2}>{item.deskripsi}</TextCustom>
|
<View style={stylesHome.vacancyDetails}>
|
||||||
|
<TextCustom bold color="yellow" truncate size="large">
|
||||||
|
{item.title}
|
||||||
|
</TextCustom>
|
||||||
|
<Spacing height={5} />
|
||||||
|
<TextCustom truncate={2}>{item.deskripsi}</TextCustom>
|
||||||
|
</View>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
))
|
||||||
))}
|
)}
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
</ClickableCustom>
|
</ClickableCustom>
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ export const stylesHome = StyleSheet.create({
|
|||||||
jobVacancyHeader: {
|
jobVacancyHeader: {
|
||||||
flexDirection: "row",
|
flexDirection: "row",
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
marginBottom: 16,
|
marginBottom: 20,
|
||||||
},
|
},
|
||||||
jobVacancyTitle: {
|
jobVacancyTitle: {
|
||||||
fontSize: 18,
|
fontSize: 18,
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ export default function Home_ImageSection() {
|
|||||||
transition={1000}
|
transition={1000}
|
||||||
style={{
|
style={{
|
||||||
width: "100%",
|
width: "100%",
|
||||||
height: 120,
|
height: 150,
|
||||||
borderRadius: 10,
|
borderRadius: 10,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import { router } from "expo-router";
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import { Text, TouchableOpacity, View } from "react-native";
|
import { Text, TouchableOpacity, View } from "react-native";
|
||||||
|
|
||||||
|
|
||||||
const CustomTab = ({ icon, label, isActive, onPress }: ICustomTab) => (
|
const CustomTab = ({ icon, label, isActive, onPress }: ICustomTab) => (
|
||||||
<TouchableOpacity
|
<TouchableOpacity
|
||||||
style={[GStyles.tabItem, isActive && GStyles.activeTab]}
|
style={[GStyles.tabItem, isActive && GStyles.activeTab]}
|
||||||
@@ -17,7 +16,7 @@ const CustomTab = ({ icon, label, isActive, onPress }: ICustomTab) => (
|
|||||||
>
|
>
|
||||||
<Ionicons
|
<Ionicons
|
||||||
name={icon as any}
|
name={icon as any}
|
||||||
size={20}
|
size={18}
|
||||||
color={isActive ? "#fff" : "#666"}
|
color={isActive ? "#fff" : "#666"}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
@@ -30,8 +29,8 @@ const CustomTab = ({ icon, label, isActive, onPress }: ICustomTab) => (
|
|||||||
export default function TabSection({ tabs }: { tabs: ITabs[] }) {
|
export default function TabSection({ tabs }: { tabs: ITabs[] }) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<View style={GStyles.tabBar}>
|
<View style={GStyles.tabBar} pointerEvents="box-none">
|
||||||
<View style={GStyles.tabContainer}>
|
<View style={GStyles.tabContainer} pointerEvents="box-none">
|
||||||
{tabs.map((e) => (
|
{tabs.map((e) => (
|
||||||
<CustomTab
|
<CustomTab
|
||||||
key={e.id}
|
key={e.id}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import {
|
|||||||
DrawerCustom,
|
DrawerCustom,
|
||||||
MenuDrawerDynamicGrid
|
MenuDrawerDynamicGrid
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import { IconEdit } from "@/components/_Icon";
|
import { IconEdit } from "@/components/_Icon";
|
||||||
import NewWrapper from "@/components/_ShareComponent/NewWrapper";
|
import NewWrapper from "@/components/_ShareComponent/NewWrapper";
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
@@ -125,14 +126,18 @@ export default function Investment_ScreenRecapOfDocument() {
|
|||||||
<>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
title: "Rekap Dokumen",
|
header: () => (
|
||||||
headerLeft: () => <BackButton />,
|
<AppHeader
|
||||||
headerRight: () => (
|
title="Rekap Dokumen"
|
||||||
<DotButton
|
left={<BackButton />}
|
||||||
onPress={() => {
|
right={
|
||||||
setOpenDrawer(true);
|
<DotButton
|
||||||
setOpenDrawerBox(false);
|
onPress={() => {
|
||||||
}}
|
setOpenDrawer(true);
|
||||||
|
setOpenDrawerBox(false);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import {
|
|||||||
MenuDrawerDynamicGrid,
|
MenuDrawerDynamicGrid,
|
||||||
TextCustom,
|
TextCustom,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import { IconPlus } from "@/components/_Icon";
|
import { IconPlus } from "@/components/_Icon";
|
||||||
import NewWrapper from "@/components/_ShareComponent/NewWrapper";
|
import NewWrapper from "@/components/_ShareComponent/NewWrapper";
|
||||||
import { usePagination } from "@/hooks/use-pagination";
|
import { usePagination } from "@/hooks/use-pagination";
|
||||||
@@ -64,9 +65,13 @@ export default function Investment_ScreenListOfNews({
|
|||||||
<>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
title: "Daftar Berita",
|
header: () => (
|
||||||
headerLeft: () => <BackButton />,
|
<AppHeader
|
||||||
// headerRight: () => <DotButton onPress={() => setOpenDrawer(true)} />,
|
title="Daftar Berita"
|
||||||
|
left={<BackButton />}
|
||||||
|
// headerRight: () => <DotButton onPress={() => setOpenDrawer(true)} />,
|
||||||
|
/>
|
||||||
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import {
|
|||||||
Spacing,
|
Spacing,
|
||||||
TextCustom,
|
TextCustom,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import { IconPlus } from "@/components/_Icon";
|
import { IconPlus } from "@/components/_Icon";
|
||||||
import NewWrapper from "@/components/_ShareComponent/NewWrapper";
|
import NewWrapper from "@/components/_ShareComponent/NewWrapper";
|
||||||
import { usePagination } from "@/hooks/use-pagination";
|
import { usePagination } from "@/hooks/use-pagination";
|
||||||
@@ -66,9 +67,13 @@ export default function Investment_ScreenRecapOfNews({
|
|||||||
<>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
title: "Rekap Berita",
|
header: () => (
|
||||||
headerLeft: () => <BackButton />,
|
<AppHeader
|
||||||
headerRight: () => <DotButton onPress={() => setOpenDrawer(true)} />,
|
title="Rekap Berita"
|
||||||
|
left={<BackButton />}
|
||||||
|
right={<DotButton onPress={() => setOpenDrawer(true)} />}
|
||||||
|
/>
|
||||||
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<NewWrapper
|
<NewWrapper
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
import {
|
import {
|
||||||
BaseBox,
|
BaseBox,
|
||||||
LoaderCustom,
|
LoaderCustom,
|
||||||
|
OS_Wrapper,
|
||||||
ScrollableCustom,
|
ScrollableCustom,
|
||||||
TextCustom,
|
TextCustom,
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import { useAuth } from "@/hooks/use-auth";
|
import { useAuth } from "@/hooks/use-auth";
|
||||||
import { dummyMasterStatus } from "@/lib/dummy-data/_master/status";
|
import { dummyMasterStatus } from "@/lib/dummy-data/_master/status";
|
||||||
@@ -12,6 +12,7 @@ import { apiJobGetByStatus } from "@/service/api-client/api-job";
|
|||||||
import { useFocusEffect, useLocalSearchParams } from "expo-router";
|
import { useFocusEffect, useLocalSearchParams } from "expo-router";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import { useCallback, useState } from "react";
|
import { useCallback, useState } from "react";
|
||||||
|
import { PADDING_INLINE } from "@/constants/constans-value";
|
||||||
|
|
||||||
export default function Job_MainViewStatus() {
|
export default function Job_MainViewStatus() {
|
||||||
const { user } = useAuth();
|
const { user } = useAuth();
|
||||||
@@ -64,7 +65,7 @@ export default function Job_MainViewStatus() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ViewWrapper headerComponent={scrollComponent} hideFooter>
|
<OS_Wrapper headerComponent={scrollComponent} hideFooter contentPadding={PADDING_INLINE}>
|
||||||
{isLoadList ? (
|
{isLoadList ? (
|
||||||
<LoaderCustom />
|
<LoaderCustom />
|
||||||
) : _.isEmpty(listData) ? (
|
) : _.isEmpty(listData) ? (
|
||||||
@@ -85,7 +86,7 @@ export default function Job_MainViewStatus() {
|
|||||||
</BaseBox>
|
</BaseBox>
|
||||||
))
|
))
|
||||||
)}
|
)}
|
||||||
</ViewWrapper>
|
</OS_Wrapper>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
/* eslint-disable react-hooks/exhaustive-deps */
|
/* eslint-disable react-hooks/exhaustive-deps */
|
||||||
import { BaseBox, ScrollableCustom, TextCustom } from "@/components";
|
import { BaseBox, OS_Wrapper, 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, PADDING_INLINE } from "@/constants/constans-value";
|
||||||
import { createPaginationComponents } from "@/helpers/paginationHelpers";
|
import { createPaginationComponents } from "@/helpers/paginationHelpers";
|
||||||
import { useAuth } from "@/hooks/use-auth";
|
import { useAuth } from "@/hooks/use-auth";
|
||||||
import { usePagination } from "@/hooks/use-pagination";
|
import { usePagination } from "@/hooks/use-pagination";
|
||||||
@@ -87,7 +86,7 @@ export default function Job_MainViewStatus2() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<NewWrapper
|
<OS_Wrapper
|
||||||
headerComponent={<View style={{ paddingTop: 8 }}>{scrollComponent}</View>}
|
headerComponent={<View style={{ paddingTop: 8 }}>{scrollComponent}</View>}
|
||||||
listData={pagination.listData}
|
listData={pagination.listData}
|
||||||
renderItem={renderJobItem}
|
renderItem={renderJobItem}
|
||||||
@@ -103,6 +102,7 @@ export default function Job_MainViewStatus2() {
|
|||||||
ListEmptyComponent={ListEmptyComponent}
|
ListEmptyComponent={ListEmptyComponent}
|
||||||
ListFooterComponent={ListFooterComponent}
|
ListFooterComponent={ListFooterComponent}
|
||||||
hideFooter
|
hideFooter
|
||||||
|
contentPadding={PADDING_INLINE}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user