Compare commits
15 Commits
qc/30-mar-
...
qc-wrapper
| Author | SHA1 | Date | |
|---|---|---|---|
| 66792186ca | |||
| c3cf354c28 | |||
| 6ec839fd67 | |||
| b8f8a361d6 | |||
| 1a5ca78041 | |||
| 502cd7bc65 | |||
| 44d9025afe | |||
| b34bc3799e | |||
| 7cb4f30ae9 | |||
| 0f552443c4 | |||
| 90bc8ae343 | |||
| 98f8c7e2bf | |||
| 81bbd8e6b0 | |||
| 57159d2c45 | |||
| 66373fa65b |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -81,4 +81,7 @@ yarn-error.*
|
|||||||
# typescript
|
# typescript
|
||||||
*.tsbuildinfo
|
*.tsbuildinfo
|
||||||
|
|
||||||
|
# secrets
|
||||||
|
secrets/
|
||||||
|
|
||||||
# @end expo-cli
|
# @end expo-cli
|
||||||
27
QWEN.md
27
QWEN.md
@@ -513,3 +513,30 @@ When using Maplibre MapView on iOS, prevent "Attempt to recycle a mounted view"
|
|||||||
- [Expo Router Documentation](https://docs.expo.dev/router/introduction/)
|
- [Expo Router Documentation](https://docs.expo.dev/router/introduction/)
|
||||||
- [TypeScript Documentation](https://www.typescriptlang.org/docs/)
|
- [TypeScript Documentation](https://www.typescriptlang.org/docs/)
|
||||||
- [Maplibre React Native](https://github.com/maplibre/maplibre-react-native)
|
- [Maplibre React Native](https://github.com/maplibre/maplibre-react-native)
|
||||||
|
|
||||||
|
## Qwen Added Memories
|
||||||
|
- OS_Wrapper contentPaddingBottom pattern:
|
||||||
|
- Default: contentPaddingBottom=100 (untuk list screens)
|
||||||
|
- Forms: contentPaddingBottom=250 (HANYA untuk screens yang punya TextInput/TextArea)
|
||||||
|
- contentPadding=0 (default, per-screen control)
|
||||||
|
- OS_ANDROID_PADDING_TOP=6 (compact tabs)
|
||||||
|
- OS_IOS_PADDING_TOP=12
|
||||||
|
- PADDING_INLINE=16 (constant)
|
||||||
|
|
||||||
|
Contoh:
|
||||||
|
```tsx
|
||||||
|
// List screen (default 100px)
|
||||||
|
<OS_Wrapper listData={data} renderItem={renderItem} />
|
||||||
|
|
||||||
|
// Form screen (explicit 250px)
|
||||||
|
<OS_Wrapper enableKeyboardHandling contentPaddingBottom={250}>
|
||||||
|
<FormWithTextInput />
|
||||||
|
</OS_Wrapper>
|
||||||
|
```
|
||||||
|
- PADDING_INLINE usage pattern - User preference:
|
||||||
|
- PADDING_INLINE (16px) TIDAK selalu diperlukan
|
||||||
|
- User remove PADDING_INLINE dari Profile screens karena mempersempit box tampilan
|
||||||
|
- Decision: Tambahkan PADDING_INLINE HANYA jika diperlukan per-screen, jangan default
|
||||||
|
- User akan review dan tambahkan sendiri jika perlu
|
||||||
|
|
||||||
|
Profile screens: PADDING_INLINE dihapus dari edit.tsx dan create.tsx
|
||||||
|
|||||||
@@ -1,369 +0,0 @@
|
|||||||
# Fix Phone Number Input - iOS 16+ Compatibility
|
|
||||||
|
|
||||||
## 📋 Ringkasan Task
|
|
||||||
Memperbaiki masalah phone number input pada `screens/Authentication/LoginView.tsx` yang tidak berfungsi dengan baik pada iOS versi 16 ke atas.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 🎯 Tujuan
|
|
||||||
1. Fix keyboard overlay issues pada iOS 16+
|
|
||||||
2. Perbaiki layout measurement dan safe area
|
|
||||||
3. Pastikan input phone number responsive di semua device
|
|
||||||
4. Maintain UX yang konsisten dengan Android
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 📁 File yang Terlibat
|
|
||||||
|
|
||||||
### File Utama
|
|
||||||
- **Target**: `screens/Authentication/LoginView.tsx`
|
|
||||||
|
|
||||||
### File Pendukung
|
|
||||||
- `components/TextInput/TextInputCustom.tsx` - Alternatif custom input
|
|
||||||
- `styles/global-styles.ts` - Styling adjustments
|
|
||||||
- `package.json` - Update dependencies (jika perlu)
|
|
||||||
|
|
||||||
### Dependencies Terkait
|
|
||||||
- `react-native-international-phone-number`: ^0.9.3
|
|
||||||
- `react-native-keyboard-controller`: ^1.18.6
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 🔍 Analisis Masalah
|
|
||||||
|
|
||||||
### Issues pada iOS 16+
|
|
||||||
|
|
||||||
#### 1. **Keyboard Overlay Problem**
|
|
||||||
**Symptom**: Input field tertutup keyboard saat aktif
|
|
||||||
**Cause**:
|
|
||||||
- Safe area insets tidak terhitung dengan benar
|
|
||||||
- Keyboard animation tidak sinkron dengan layout
|
|
||||||
- `react-native-keyboard-controller` tidak terintegrasi dengan baik
|
|
||||||
|
|
||||||
#### 2. **Layout Measurement Issues**
|
|
||||||
**Symptom**: Input field berubah ukuran secara tidak terduga
|
|
||||||
**Cause**:
|
|
||||||
- Dynamic Type settings mempengaruhi layout
|
|
||||||
- Font scaling pada iOS 16+ berbeda
|
|
||||||
- Container tidak memiliki fixed height
|
|
||||||
|
|
||||||
#### 3. **Focus Behavior**
|
|
||||||
**Symptom**: Input tidak auto-scroll saat di-focus
|
|
||||||
**Cause**:
|
|
||||||
- ScrollView/KeyboardAvoidingView configuration salah
|
|
||||||
- Keyboard dismissing behavior tidak konsisten
|
|
||||||
|
|
||||||
#### 4. **Visual Glitches**
|
|
||||||
**Symptom**: Country flag dropdown tidak muncul atau terpotong
|
|
||||||
**Cause**:
|
|
||||||
- Z-index issues pada iOS
|
|
||||||
- Modal/Popover rendering problems
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 🎨 Solusi yang Direkomendasikan
|
|
||||||
|
|
||||||
### Option 1: **KeyboardAvoidingView Enhancement** (RECOMMENDED)
|
|
||||||
**Effort**: Medium
|
|
||||||
**Impact**: High
|
|
||||||
|
|
||||||
```typescript
|
|
||||||
import { KeyboardAvoidingView, Platform } from "react-native";
|
|
||||||
|
|
||||||
<KeyboardAvoidingView
|
|
||||||
behavior={Platform.OS === "ios" ? "padding" : "height"}
|
|
||||||
keyboardVerticalOffset={Platform.OS === "ios" ? 90 : 50}
|
|
||||||
style={{ flex: 1 }}
|
|
||||||
>
|
|
||||||
<ViewWrapper>
|
|
||||||
{/* Content */}
|
|
||||||
</ViewWrapper>
|
|
||||||
</KeyboardAvoidingView>
|
|
||||||
```
|
|
||||||
|
|
||||||
**Keuntungan**:
|
|
||||||
- Native solution dari React Native
|
|
||||||
- Tidak perlu tambahan library
|
|
||||||
- Stabil untuk iOS 16+
|
|
||||||
|
|
||||||
**Kekurangan**:
|
|
||||||
- Perlu tuning offset untuk setiap device
|
|
||||||
- Tidak se-smooth keyboard controller
|
|
||||||
|
|
||||||
### Option 2: **React Native Keyboard Controller** (BETTER UX)
|
|
||||||
**Effort**: Medium-High
|
|
||||||
**Impact**: High
|
|
||||||
|
|
||||||
```typescript
|
|
||||||
import { KeyboardProvider } from "react-native-keyboard-controller";
|
|
||||||
|
|
||||||
// Wrap di root app (sudah ada di _layout.tsx)
|
|
||||||
<KeyboardProvider>
|
|
||||||
<App />
|
|
||||||
</KeyboardProvider>
|
|
||||||
|
|
||||||
// Di LoginView
|
|
||||||
import { KeyboardAwareScrollView } from "react-native-keyboard-controller";
|
|
||||||
|
|
||||||
<KeyboardAwareScrollView
|
|
||||||
bottomOffset={20}
|
|
||||||
keyboardOffset={10}
|
|
||||||
>
|
|
||||||
{/* Content */}
|
|
||||||
</KeyboardAwareScrollView>
|
|
||||||
```
|
|
||||||
|
|
||||||
**Keuntungan**:
|
|
||||||
- Smooth keyboard animations
|
|
||||||
- Better control over keyboard behavior
|
|
||||||
- Cross-platform consistency
|
|
||||||
|
|
||||||
**Kekurangan**:
|
|
||||||
- Perlu verify konfigurasi yang sudah ada
|
|
||||||
- Mungkin perlu update library
|
|
||||||
|
|
||||||
### Option 3: **Custom Phone Input** (FALLBACK)
|
|
||||||
**Effort**: High
|
|
||||||
**Impact**: Medium
|
|
||||||
|
|
||||||
Membuat custom phone input dengan:
|
|
||||||
- TextInputCustom component
|
|
||||||
- Country code picker modal
|
|
||||||
- Validation logic
|
|
||||||
|
|
||||||
**Keuntungan**:
|
|
||||||
- Full control atas behavior
|
|
||||||
- Tidak depend on third-party issues
|
|
||||||
|
|
||||||
**Kekurangan**:
|
|
||||||
- Development time lebih lama
|
|
||||||
- Perlu testing ekstensif
|
|
||||||
- Maintain code sendiri
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 📝 Breakdown Task
|
|
||||||
|
|
||||||
### Task 1: Research & Setup ✅
|
|
||||||
- [x] Identifikasi masalah pada iOS 16+
|
|
||||||
- [x] Cek dokumentasi library
|
|
||||||
- [x] Review existing implementation
|
|
||||||
- [ ] Test di iOS simulator (iOS 16+)
|
|
||||||
- [ ] Test di device fisik (jika ada)
|
|
||||||
|
|
||||||
### Task 2: Implement KeyboardAvoidingView Fix
|
|
||||||
- [ ] Wrap ViewWrapper dengan KeyboardAvoidingView
|
|
||||||
- [ ] Set behavior berdasarkan Platform
|
|
||||||
- [ ] Adjust keyboardVerticalOffset
|
|
||||||
- [ ] Test di berbagai ukuran layar
|
|
||||||
- [ ] Test landscape mode (jika applicable)
|
|
||||||
|
|
||||||
### Task 3: Adjust Layout & Styling
|
|
||||||
- [ ] Fix container height/width
|
|
||||||
- [ ] Adjust safe area insets
|
|
||||||
- [ ] Test dengan Dynamic Type settings
|
|
||||||
- [ ] Ensure consistent padding/margin
|
|
||||||
|
|
||||||
### Task 4: Test Focus Behavior
|
|
||||||
- [ ] Auto-scroll saat focus
|
|
||||||
- [ ] Keyboard dismiss saat tap outside
|
|
||||||
- [ ] Next/previous field navigation (jika ada)
|
|
||||||
- [ ] Input validation on blur
|
|
||||||
|
|
||||||
### Task 5: Country Picker Fix
|
|
||||||
- [ ] Verify dropdown z-index
|
|
||||||
- [ ] Test modal presentation
|
|
||||||
- [ ] Ensure flag icons visible
|
|
||||||
- [ ] Test search functionality
|
|
||||||
|
|
||||||
### Task 6: Testing & QA
|
|
||||||
- [ ] Test iOS 16, 17, 18
|
|
||||||
- [ ] Test Android (regression)
|
|
||||||
- [ ] Test dengan berbagai device sizes
|
|
||||||
- [ ] Test accessibility (VoiceOver)
|
|
||||||
- [ ] Performance test (no lag)
|
|
||||||
|
|
||||||
### Task 7: Documentation
|
|
||||||
- [ ] Update code comments
|
|
||||||
- [ ] Document iOS-specific workarounds
|
|
||||||
- [ ] Add troubleshooting notes
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 💻 Implementation Guidelines
|
|
||||||
|
|
||||||
### Recommended Implementation (Option 1 + 2 Hybrid)
|
|
||||||
|
|
||||||
```typescript
|
|
||||||
import { KeyboardAvoidingView, Platform } from "react-native";
|
|
||||||
import { KeyboardProvider } from "react-native-keyboard-controller";
|
|
||||||
|
|
||||||
// Di LoginView.tsx
|
|
||||||
export default function LoginView() {
|
|
||||||
return (
|
|
||||||
<ViewWrapper
|
|
||||||
withBackground
|
|
||||||
refreshControl={
|
|
||||||
<RefreshControl refreshing={refreshing} onRefresh={handleRefresh} />
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<KeyboardAvoidingView
|
|
||||||
behavior={Platform.OS === "ios" ? "padding" : "height"}
|
|
||||||
keyboardVerticalOffset={Platform.OS === "ios" ? 100 : 50}
|
|
||||||
style={{ flex: 1 }}
|
|
||||||
>
|
|
||||||
<View style={[GStyles.authContainer, { paddingBottom: 40 }]}>
|
|
||||||
{/* Title Section */}
|
|
||||||
<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} />
|
|
||||||
|
|
||||||
{/* Phone Input - Wrap dengan View untuk stability */}
|
|
||||||
<View style={{ marginBottom: 20 }}>
|
|
||||||
<PhoneInput
|
|
||||||
value={inputValue}
|
|
||||||
onChangePhoneNumber={handleInputValue}
|
|
||||||
selectedCountry={selectedCountry}
|
|
||||||
onChangeSelectedCountry={handleSelectedCountry}
|
|
||||||
defaultCountry="ID"
|
|
||||||
placeholder="Masukkan nomor"
|
|
||||||
// Add iOS-specific props
|
|
||||||
textInputProps={{
|
|
||||||
keyboardType: "phone-pad",
|
|
||||||
autoComplete: "tel",
|
|
||||||
importantForAutofill: "yes",
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</View>
|
|
||||||
|
|
||||||
<Spacing />
|
|
||||||
|
|
||||||
{/* Login Button */}
|
|
||||||
<ButtonCustom
|
|
||||||
onPress={handleLogin}
|
|
||||||
disabled={loadingTerm}
|
|
||||||
isLoading={loading || loadingTerm}
|
|
||||||
>
|
|
||||||
Login
|
|
||||||
</ButtonCustom>
|
|
||||||
|
|
||||||
<Spacing height={50} />
|
|
||||||
|
|
||||||
{/* Terms Text */}
|
|
||||||
<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>
|
|
||||||
|
|
||||||
{/* Version Info */}
|
|
||||||
<Text
|
|
||||||
style={{
|
|
||||||
position: "absolute",
|
|
||||||
bottom: 35,
|
|
||||||
right: 50,
|
|
||||||
fontSize: 10,
|
|
||||||
fontWeight: "thin",
|
|
||||||
fontStyle: "italic",
|
|
||||||
color: MainColor.white_gray,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{version} | powered by muku.id
|
|
||||||
</Text>
|
|
||||||
</View>
|
|
||||||
</KeyboardAvoidingView>
|
|
||||||
</ViewWrapper>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Styling Adjustments
|
|
||||||
|
|
||||||
```typescript
|
|
||||||
// styles/global-styles.ts
|
|
||||||
export const GStyles = StyleSheet.create({
|
|
||||||
authContainer: {
|
|
||||||
flex: 1,
|
|
||||||
justifyContent: "center",
|
|
||||||
paddingHorizontal: 24,
|
|
||||||
// Add padding bottom untuk keyboard space
|
|
||||||
paddingBottom: Platform.OS === "ios" ? 40 : 20,
|
|
||||||
},
|
|
||||||
// ... existing styles
|
|
||||||
});
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## ✅ Acceptance Criteria
|
|
||||||
|
|
||||||
### Functional
|
|
||||||
- [ ] Input field tidak tertutup keyboard saat focus
|
|
||||||
- [ ] Country picker dropdown berfungsi dengan baik
|
|
||||||
- [ ] Auto-scroll bekerja smooth saat focus
|
|
||||||
- [ ] Keyboard dismiss saat tap outside
|
|
||||||
- [ ] Input validation berjalan normal
|
|
||||||
|
|
||||||
### Visual
|
|
||||||
- [ ] Layout tidak berubah saat keyboard muncul
|
|
||||||
- [ ] No visual glitches atau flickering
|
|
||||||
- [ ] Country flag icons visible
|
|
||||||
- [ ] Consistent spacing dan padding
|
|
||||||
|
|
||||||
### Compatibility
|
|
||||||
- [ ] iOS 16, 17, 18 - Tested ✅
|
|
||||||
- [ ] Android - No regression ✅
|
|
||||||
- [ ] iPad - Responsive ✅
|
|
||||||
- [ ] Landscape mode - Usable ✅
|
|
||||||
|
|
||||||
### Performance
|
|
||||||
- [ ] No lag saat typing
|
|
||||||
- [ ] Smooth keyboard animations
|
|
||||||
- [ ] No memory leaks
|
|
||||||
- [ ] Fast input response
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 🔗 References
|
|
||||||
- [React Native KeyboardAvoidingView Docs](https://reactnative.dev/docs/keyboardavoidingview)
|
|
||||||
- [react-native-keyboard-controller](https://github.com/kirillzyusko/react-native-keyboard-controller)
|
|
||||||
- [react-native-international-phone-number Issues](https://github.com/bluesky01/react-native-international-phone-number/issues)
|
|
||||||
- [iOS 16+ Keyboard Changes](https://developer.apple.com/documentation/uikit/uikit)
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 📊 Estimated Effort
|
|
||||||
- **Complexity**: Medium
|
|
||||||
- **Time Estimate**: 2-4 jam
|
|
||||||
- **Risk Level**: Medium (perlu testing ekstensif di device)
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## 📝 Notes
|
|
||||||
- **Priority**: High (login adalah critical path)
|
|
||||||
- **Testing**: Wajib test di device fisik jika memungkinkan
|
|
||||||
- **Fallback**: Jika Option 1 & 2 gagal, siap untuk implement Option 3 (custom input)
|
|
||||||
- **Monitoring**: Add analytics untuk track input completion rate
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
**Created**: 2026-03-25
|
|
||||||
**Status**: Pending
|
|
||||||
**Priority**: High
|
|
||||||
**Related Issue**: iOS 16+ keyboard compatibility
|
|
||||||
@@ -100,8 +100,8 @@ 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.3"
|
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"
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ require("dotenv").config();
|
|||||||
export default {
|
export default {
|
||||||
name: "HIPMI Badung Connect",
|
name: "HIPMI Badung Connect",
|
||||||
slug: "hipmi-mobile",
|
slug: "hipmi-mobile",
|
||||||
version: "1.0.3",
|
version: "1.0.2",
|
||||||
orientation: "portrait",
|
orientation: "portrait",
|
||||||
icon: "./assets/images/icon.png",
|
icon: "./assets/images/icon.png",
|
||||||
scheme: "hipmimobile",
|
scheme: "hipmimobile",
|
||||||
@@ -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: "7",
|
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",
|
||||||
[
|
[
|
||||||
|
|||||||
@@ -21,8 +21,7 @@ export default function UserLayout() {
|
|||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="waiting-room"
|
name="waiting-room"
|
||||||
options={{
|
options={{
|
||||||
title: "Waiting Room",
|
header: () => <AppHeader title="Waiting Room" />,
|
||||||
headerBackVisible: false,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|||||||
@@ -2,35 +2,64 @@ import { IconHome } from "@/components/_Icon";
|
|||||||
import { TabsStyles } from "@/styles/tabs-styles";
|
import { TabsStyles } from "@/styles/tabs-styles";
|
||||||
import { Ionicons } from "@expo/vector-icons";
|
import { Ionicons } from "@expo/vector-icons";
|
||||||
import { Tabs } from "expo-router";
|
import { Tabs } from "expo-router";
|
||||||
|
import { View } from "react-native";
|
||||||
|
import { MainColor } from "@/constants/color-palet";
|
||||||
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
||||||
|
import { Platform } from "react-native";
|
||||||
|
|
||||||
|
function CollaborationTabsWrapper() {
|
||||||
|
const insets = useSafeAreaInsets();
|
||||||
|
const paddingBottom = Platform.OS === "android" ? insets.bottom : 0;
|
||||||
|
|
||||||
export default function CollaborationTabsLayout() {
|
|
||||||
return (
|
return (
|
||||||
<Tabs screenOptions={TabsStyles}>
|
<View style={{ flex: 1, backgroundColor: MainColor.darkblue }}>
|
||||||
<Tabs.Screen
|
<Tabs
|
||||||
name="index"
|
screenOptions={{
|
||||||
options={{
|
...TabsStyles,
|
||||||
title: "Beranda",
|
tabBarStyle: Platform.select({
|
||||||
tabBarIcon: ({ color }) => <IconHome color={color} />,
|
ios: {
|
||||||
|
borderTopWidth: 0,
|
||||||
|
paddingTop: 12,
|
||||||
|
height: 80,
|
||||||
|
},
|
||||||
|
android: {
|
||||||
|
borderTopWidth: 0,
|
||||||
|
paddingTop: 5,
|
||||||
|
height: 70 + paddingBottom,
|
||||||
|
},
|
||||||
|
}),
|
||||||
}}
|
}}
|
||||||
/>
|
>
|
||||||
<Tabs.Screen
|
<Tabs.Screen
|
||||||
name="participant"
|
name="index"
|
||||||
options={{
|
options={{
|
||||||
title: "Partisipan",
|
title: "Beranda",
|
||||||
tabBarIcon: ({ color }) => (
|
tabBarIcon: ({ color }) => <IconHome color={color} />,
|
||||||
<Ionicons size={20} name="people" color={color} />
|
}}
|
||||||
),
|
/>
|
||||||
}}
|
<Tabs.Screen
|
||||||
/>
|
name="participant"
|
||||||
<Tabs.Screen
|
options={{
|
||||||
name="group"
|
title: "Partisipan",
|
||||||
options={{
|
tabBarIcon: ({ color }) => (
|
||||||
title: "Grup",
|
<Ionicons size={20} name="people" color={color} />
|
||||||
tabBarIcon: ({ color }) => (
|
),
|
||||||
<Ionicons size={20} name="chatbox-ellipses" color={color} />
|
}}
|
||||||
),
|
/>
|
||||||
}}
|
<Tabs.Screen
|
||||||
/>
|
name="group"
|
||||||
</Tabs>
|
options={{
|
||||||
|
title: "Grup",
|
||||||
|
tabBarIcon: ({ color }) => (
|
||||||
|
<Ionicons size={20} name="chatbox-ellipses" color={color} />
|
||||||
|
),
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Tabs>
|
||||||
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default function CollaborationTabsLayout() {
|
||||||
|
return <CollaborationTabsWrapper />;
|
||||||
|
}
|
||||||
|
|||||||
@@ -3,10 +3,10 @@ import {
|
|||||||
BaseBox,
|
BaseBox,
|
||||||
ButtonCustom,
|
ButtonCustom,
|
||||||
CenterCustom,
|
CenterCustom,
|
||||||
|
OS_Wrapper,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
TextCustom,
|
TextCustom,
|
||||||
TextInputCustom,
|
TextInputCustom,
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import { useAuth } from "@/hooks/use-auth";
|
import { useAuth } from "@/hooks/use-auth";
|
||||||
import { apiDeleteUser } from "@/service/api-client/api-user";
|
import { apiDeleteUser } from "@/service/api-client/api-user";
|
||||||
@@ -68,7 +68,10 @@ export default function DeleteAccount() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ViewWrapper>
|
<OS_Wrapper
|
||||||
|
enableKeyboardHandling
|
||||||
|
contentPaddingBottom={250}
|
||||||
|
>
|
||||||
<StackCustom>
|
<StackCustom>
|
||||||
<BaseBox>
|
<BaseBox>
|
||||||
<StackCustom>
|
<StackCustom>
|
||||||
@@ -105,7 +108,7 @@ export default function DeleteAccount() {
|
|||||||
</StackCustom>
|
</StackCustom>
|
||||||
</BaseBox>
|
</BaseBox>
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
</ViewWrapper>
|
</OS_Wrapper>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,33 +5,62 @@ import {
|
|||||||
FontAwesome5
|
FontAwesome5
|
||||||
} from "@expo/vector-icons";
|
} from "@expo/vector-icons";
|
||||||
import { Tabs } from "expo-router";
|
import { Tabs } from "expo-router";
|
||||||
|
import { View } from "react-native";
|
||||||
|
import { MainColor } from "@/constants/color-palet";
|
||||||
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
||||||
|
import { Platform } from "react-native";
|
||||||
|
|
||||||
|
function DonationTabsWrapper() {
|
||||||
|
const insets = useSafeAreaInsets();
|
||||||
|
const paddingBottom = Platform.OS === "android" ? insets.bottom : 0;
|
||||||
|
|
||||||
export default function InvestmentTabsLayout() {
|
|
||||||
return (
|
return (
|
||||||
<Tabs screenOptions={TabsStyles}>
|
<View style={{ flex: 1, backgroundColor: MainColor.darkblue }}>
|
||||||
<Tabs.Screen
|
<Tabs
|
||||||
name="index"
|
screenOptions={{
|
||||||
options={{
|
...TabsStyles,
|
||||||
title: "Beranda",
|
tabBarStyle: Platform.select({
|
||||||
tabBarIcon: ({ color }) => <IconHome color={color} />,
|
ios: {
|
||||||
|
borderTopWidth: 0,
|
||||||
|
paddingTop: 12,
|
||||||
|
height: 80,
|
||||||
|
},
|
||||||
|
android: {
|
||||||
|
borderTopWidth: 0,
|
||||||
|
paddingTop: 5,
|
||||||
|
height: 70 + paddingBottom,
|
||||||
|
},
|
||||||
|
}),
|
||||||
}}
|
}}
|
||||||
/>
|
>
|
||||||
<Tabs.Screen
|
<Tabs.Screen
|
||||||
name="status"
|
name="index"
|
||||||
options={{
|
options={{
|
||||||
title: "Galang Dana",
|
title: "Beranda",
|
||||||
tabBarIcon: ({ color }) => <IconStatus color={color} />,
|
tabBarIcon: ({ color }) => <IconHome color={color} />,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Tabs.Screen
|
<Tabs.Screen
|
||||||
name="my-donation"
|
name="status"
|
||||||
options={{
|
options={{
|
||||||
title: "Donasi Saya",
|
title: "Galang Dana",
|
||||||
tabBarIcon: ({ color }) => (
|
tabBarIcon: ({ color }) => <IconStatus color={color} />,
|
||||||
<FontAwesome5 name="donate" color={color} size={ICON_SIZE_SMALL} />
|
}}
|
||||||
),
|
/>
|
||||||
}}
|
<Tabs.Screen
|
||||||
/>
|
name="my-donation"
|
||||||
</Tabs>
|
options={{
|
||||||
|
title: "Donasi Saya",
|
||||||
|
tabBarIcon: ({ color }) => (
|
||||||
|
<FontAwesome5 name="donate" color={color} size={ICON_SIZE_SMALL} />
|
||||||
|
),
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Tabs>
|
||||||
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default function DonationTabsLayout() {
|
||||||
|
return <DonationTabsWrapper />;
|
||||||
|
}
|
||||||
|
|||||||
@@ -185,7 +185,6 @@ export default function DonationEdit() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<NewWrapper
|
<NewWrapper
|
||||||
hideFooter
|
|
||||||
footerComponent={
|
footerComponent={
|
||||||
<BoxButtonOnFooter>
|
<BoxButtonOnFooter>
|
||||||
<ButtonCustom
|
<ButtonCustom
|
||||||
|
|||||||
@@ -114,7 +114,6 @@ export default function DonationCreateStory() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<NewWrapper
|
<NewWrapper
|
||||||
hideFooter
|
|
||||||
footerComponent={
|
footerComponent={
|
||||||
<>
|
<>
|
||||||
<BoxButtonOnFooter>
|
<BoxButtonOnFooter>
|
||||||
|
|||||||
@@ -127,7 +127,6 @@ export default function DonationCreate() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<NewWrapper
|
<NewWrapper
|
||||||
hideFooter
|
|
||||||
footerComponent={
|
footerComponent={
|
||||||
<>
|
<>
|
||||||
<BoxButtonOnFooter>
|
<BoxButtonOnFooter>
|
||||||
|
|||||||
@@ -8,58 +8,83 @@ import AppHeader from "@/components/_ShareComponent/AppHeader";
|
|||||||
import BackButtonFromNotification from "@/components/Button/BackButtonFromNotification";
|
import BackButtonFromNotification from "@/components/Button/BackButtonFromNotification";
|
||||||
import { TabsStyles } from "@/styles/tabs-styles";
|
import { TabsStyles } from "@/styles/tabs-styles";
|
||||||
import { router, Tabs, useLocalSearchParams } from "expo-router";
|
import { router, Tabs, useLocalSearchParams } from "expo-router";
|
||||||
|
import { View } from "react-native";
|
||||||
|
import { MainColor } from "@/constants/color-palet";
|
||||||
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
||||||
|
import { Platform } from "react-native";
|
||||||
|
import { OS_ANDROID_HEIGHT, OS_IOS_HEIGHT } from "@/constants/constans-value";
|
||||||
|
|
||||||
export default function EventTabsLayout() {
|
function EventTabsWrapper() {
|
||||||
|
const insets = useSafeAreaInsets();
|
||||||
|
const paddingBottom = Platform.OS === "android" ? insets.bottom : 0;
|
||||||
const { from, category } = useLocalSearchParams<{
|
const { from, category } = useLocalSearchParams<{
|
||||||
from?: string;
|
from?: string;
|
||||||
category?: string;
|
category?: string;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Tabs
|
<View style={{ flex: 1, backgroundColor: MainColor.darkblue }}>
|
||||||
screenOptions={{
|
<Tabs
|
||||||
...TabsStyles,
|
screenOptions={{
|
||||||
header: () => (
|
...TabsStyles,
|
||||||
<AppHeader
|
tabBarStyle: Platform.select({
|
||||||
title="Event"
|
ios: {
|
||||||
left={
|
borderTopWidth: 0,
|
||||||
<BackButtonFromNotification
|
paddingTop: 12,
|
||||||
from={from as string}
|
height: OS_IOS_HEIGHT,
|
||||||
category={category as string}
|
},
|
||||||
/>
|
android: {
|
||||||
}
|
borderTopWidth: 0,
|
||||||
/>
|
paddingTop: 5,
|
||||||
),
|
height: OS_ANDROID_HEIGHT + paddingBottom,
|
||||||
}}
|
},
|
||||||
>
|
}),
|
||||||
<Tabs.Screen
|
header: () => (
|
||||||
name="index"
|
<AppHeader
|
||||||
options={{
|
title="Event"
|
||||||
title: "Beranda",
|
left={
|
||||||
tabBarIcon: ({ color }) => <IconHome color={color} />,
|
<BackButtonFromNotification
|
||||||
|
from={from || ""}
|
||||||
|
category={category}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
>
|
||||||
<Tabs.Screen
|
<Tabs.Screen
|
||||||
name="status"
|
name="index"
|
||||||
options={{
|
options={{
|
||||||
title: "Status",
|
title: "Beranda",
|
||||||
tabBarIcon: ({ color }) => <IconStatus color={color} />,
|
tabBarIcon: ({ color }) => <IconHome color={color} />,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Tabs.Screen
|
<Tabs.Screen
|
||||||
name="contribution"
|
name="status"
|
||||||
options={{
|
options={{
|
||||||
title: "Kontribusi",
|
title: "Status",
|
||||||
tabBarIcon: ({ color }) => <IconContribution color={color} />,
|
tabBarIcon: ({ color }) => <IconStatus color={color} />,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Tabs.Screen
|
<Tabs.Screen
|
||||||
name="history"
|
name="contribution"
|
||||||
options={{
|
options={{
|
||||||
title: "Riwayat",
|
title: "Kontribusi",
|
||||||
tabBarIcon: ({ color }) => <IconHistory color={color} />,
|
tabBarIcon: ({ color }) => <IconContribution color={color} />,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Tabs>
|
<Tabs.Screen
|
||||||
|
name="history"
|
||||||
|
options={{
|
||||||
|
title: "Riwayat",
|
||||||
|
tabBarIcon: ({ color }) => <IconHistory color={color} />,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Tabs>
|
||||||
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default function EventTabsLayout() {
|
||||||
|
return <EventTabsWrapper />;
|
||||||
|
}
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ import {
|
|||||||
BoxButtonOnFooter,
|
BoxButtonOnFooter,
|
||||||
ButtonCustom,
|
ButtonCustom,
|
||||||
LoaderCustom,
|
LoaderCustom,
|
||||||
|
OS_Wrapper,
|
||||||
TextAreaCustom,
|
TextAreaCustom,
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import AlertWarning from "@/components/Alert/AlertWarning";
|
import AlertWarning from "@/components/Alert/AlertWarning";
|
||||||
import { apiForumGetOne, apiForumUpdate } from "@/service/api-client/api-forum";
|
import { apiForumGetOne, apiForumUpdate } from "@/service/api-client/api-forum";
|
||||||
@@ -88,7 +88,11 @@ export default function ForumEdit() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ViewWrapper footerComponent={buttonFooter()}>
|
<OS_Wrapper
|
||||||
|
enableKeyboardHandling
|
||||||
|
contentPaddingBottom={250}
|
||||||
|
footerComponent={buttonFooter()}
|
||||||
|
>
|
||||||
{!loadingGetData ? (
|
{!loadingGetData ? (
|
||||||
<TextAreaCustom
|
<TextAreaCustom
|
||||||
placeholder="Ketik diskusi anda..."
|
placeholder="Ketik diskusi anda..."
|
||||||
@@ -102,6 +106,6 @@ export default function ForumEdit() {
|
|||||||
) : (
|
) : (
|
||||||
<LoaderCustom />
|
<LoaderCustom />
|
||||||
)}
|
)}
|
||||||
</ViewWrapper>
|
</OS_Wrapper>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import {
|
import {
|
||||||
BoxButtonOnFooter,
|
BoxButtonOnFooter,
|
||||||
ButtonCustom,
|
ButtonCustom,
|
||||||
|
OS_Wrapper,
|
||||||
TextAreaCustom,
|
TextAreaCustom,
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
import { useAuth } from "@/hooks/use-auth";
|
import { useAuth } from "@/hooks/use-auth";
|
||||||
@@ -62,13 +62,17 @@ export default function ForumOtherReportCommentar() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ViewWrapper footerComponent={handleSubmit}>
|
<OS_Wrapper
|
||||||
|
enableKeyboardHandling
|
||||||
|
contentPaddingBottom={250}
|
||||||
|
footerComponent={handleSubmit}
|
||||||
|
>
|
||||||
<TextAreaCustom
|
<TextAreaCustom
|
||||||
placeholder="Laporkan Komentar"
|
placeholder="Laporkan Komentar"
|
||||||
value={value}
|
value={value}
|
||||||
onChangeText={setValue}
|
onChangeText={setValue}
|
||||||
/>
|
/>
|
||||||
</ViewWrapper>
|
</OS_Wrapper>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import {
|
import {
|
||||||
BoxButtonOnFooter,
|
BoxButtonOnFooter,
|
||||||
ButtonCustom,
|
ButtonCustom,
|
||||||
|
OS_Wrapper,
|
||||||
TextAreaCustom,
|
TextAreaCustom,
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
import { useAuth } from "@/hooks/use-auth";
|
import { useAuth } from "@/hooks/use-auth";
|
||||||
@@ -61,13 +61,17 @@ export default function ForumOtherReportPosting() {
|
|||||||
);
|
);
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ViewWrapper footerComponent={handleSubmit}>
|
<OS_Wrapper
|
||||||
|
enableKeyboardHandling
|
||||||
|
contentPaddingBottom={250}
|
||||||
|
footerComponent={handleSubmit}
|
||||||
|
>
|
||||||
<TextAreaCustom
|
<TextAreaCustom
|
||||||
placeholder="Laporkan Diskusi"
|
placeholder="Laporkan Diskusi"
|
||||||
value={value}
|
value={value}
|
||||||
onChangeText={setValue}
|
onChangeText={setValue}
|
||||||
/>
|
/>
|
||||||
</ViewWrapper>
|
</OS_Wrapper>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import {
|
import {
|
||||||
BaseBox,
|
BaseBox,
|
||||||
NewWrapper,
|
OS_Wrapper,
|
||||||
Spacing,
|
Spacing,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
TextCustom,
|
TextCustom,
|
||||||
@@ -41,7 +41,7 @@ export default function ForumPreviewReportComment() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<NewWrapper>
|
<OS_Wrapper>
|
||||||
<StackCustom>
|
<StackCustom>
|
||||||
<TextCustom color="red" bold>
|
<TextCustom color="red" bold>
|
||||||
Komentar anda telah melanggar aturan forum ! Admin mengambil
|
Komentar anda telah melanggar aturan forum ! Admin mengambil
|
||||||
@@ -85,7 +85,7 @@ export default function ForumPreviewReportComment() {
|
|||||||
</BaseBox>
|
</BaseBox>
|
||||||
))
|
))
|
||||||
)}
|
)}
|
||||||
</NewWrapper>
|
</OS_Wrapper>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import {
|
import {
|
||||||
BaseBox,
|
BaseBox,
|
||||||
NewWrapper,
|
OS_Wrapper,
|
||||||
Spacing,
|
Spacing,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
TextCustom,
|
TextCustom,
|
||||||
@@ -41,7 +41,7 @@ export default function ForumPreviewReportPosting() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<NewWrapper>
|
<OS_Wrapper>
|
||||||
<StackCustom>
|
<StackCustom>
|
||||||
<TextCustom color="red" bold>
|
<TextCustom color="red" bold>
|
||||||
Postingan anda telah melanggar aturan forum ! Admin mengambil
|
Postingan anda telah melanggar aturan forum ! Admin mengambil
|
||||||
@@ -85,7 +85,7 @@ export default function ForumPreviewReportPosting() {
|
|||||||
</BaseBox>
|
</BaseBox>
|
||||||
))
|
))
|
||||||
)}
|
)}
|
||||||
</NewWrapper>
|
</OS_Wrapper>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import {
|
import {
|
||||||
ButtonCustom,
|
ButtonCustom,
|
||||||
LoaderCustom,
|
LoaderCustom,
|
||||||
|
OS_Wrapper,
|
||||||
Spacing,
|
Spacing,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import { AccentColor, MainColor } from "@/constants/color-palet";
|
import { AccentColor, MainColor } from "@/constants/color-palet";
|
||||||
import { useAuth } from "@/hooks/use-auth";
|
import { useAuth } from "@/hooks/use-auth";
|
||||||
@@ -69,7 +69,7 @@ export default function ForumReportCommentar() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ViewWrapper>
|
<OS_Wrapper>
|
||||||
{isLoadingList ? (
|
{isLoadingList ? (
|
||||||
<LoaderCustom />
|
<LoaderCustom />
|
||||||
) : (
|
) : (
|
||||||
@@ -101,7 +101,7 @@ export default function ForumReportCommentar() {
|
|||||||
<Spacing />
|
<Spacing />
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
)}
|
)}
|
||||||
</ViewWrapper>
|
</OS_Wrapper>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,9 +2,9 @@ import {
|
|||||||
AlertDefaultSystem,
|
AlertDefaultSystem,
|
||||||
ButtonCustom,
|
ButtonCustom,
|
||||||
LoaderCustom,
|
LoaderCustom,
|
||||||
|
OS_Wrapper,
|
||||||
Spacing,
|
Spacing,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import { AccentColor, MainColor } from "@/constants/color-palet";
|
import { AccentColor, MainColor } from "@/constants/color-palet";
|
||||||
import { useAuth } from "@/hooks/use-auth";
|
import { useAuth } from "@/hooks/use-auth";
|
||||||
@@ -73,7 +73,7 @@ export default function ForumReportPosting() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ViewWrapper>
|
<OS_Wrapper>
|
||||||
{isLoadingList ? (
|
{isLoadingList ? (
|
||||||
<LoaderCustom />
|
<LoaderCustom />
|
||||||
) : (
|
) : (
|
||||||
@@ -114,7 +114,7 @@ export default function ForumReportPosting() {
|
|||||||
<Spacing />
|
<Spacing />
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
)}
|
)}
|
||||||
</ViewWrapper>
|
</OS_Wrapper>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import {
|
import {
|
||||||
BoxButtonOnFooter,
|
BoxButtonOnFooter,
|
||||||
ButtonCustom,
|
ButtonCustom,
|
||||||
|
OS_Wrapper,
|
||||||
TextAreaCustom,
|
TextAreaCustom,
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import AlertWarning from "@/components/Alert/AlertWarning";
|
import AlertWarning from "@/components/Alert/AlertWarning";
|
||||||
import { useAuth } from "@/hooks/use-auth";
|
import { useAuth } from "@/hooks/use-auth";
|
||||||
@@ -67,7 +67,11 @@ export default function ForumCreate() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ViewWrapper footerComponent={buttonFooter}>
|
<OS_Wrapper
|
||||||
|
enableKeyboardHandling
|
||||||
|
contentPaddingBottom={250}
|
||||||
|
footerComponent={buttonFooter}
|
||||||
|
>
|
||||||
<TextAreaCustom
|
<TextAreaCustom
|
||||||
placeholder="Ketik diskusi anda..."
|
placeholder="Ketik diskusi anda..."
|
||||||
maxLength={1000}
|
maxLength={1000}
|
||||||
@@ -75,6 +79,6 @@ export default function ForumCreate() {
|
|||||||
value={text}
|
value={text}
|
||||||
onChangeText={setText}
|
onChangeText={setText}
|
||||||
/>
|
/>
|
||||||
</ViewWrapper>
|
</OS_Wrapper>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import {
|
|||||||
BaseBox,
|
BaseBox,
|
||||||
ButtonCustom,
|
ButtonCustom,
|
||||||
CheckboxCustom,
|
CheckboxCustom,
|
||||||
NewWrapper,
|
OS_Wrapper,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
TextCustom,
|
TextCustom,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
@@ -54,7 +54,7 @@ export default function ForumSplash() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<NewWrapper>
|
<OS_Wrapper>
|
||||||
{/* <TextCustom bold>HIPMI Badung Connect</TextCustom> . */}
|
{/* <TextCustom bold>HIPMI Badung Connect</TextCustom> . */}
|
||||||
|
|
||||||
<BaseBox>
|
<BaseBox>
|
||||||
@@ -162,7 +162,7 @@ export default function ForumSplash() {
|
|||||||
</ButtonCustom>
|
</ButtonCustom>
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
</BaseBox>
|
</BaseBox>
|
||||||
</NewWrapper>
|
</OS_Wrapper>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-unused-vars */
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||||
/* eslint-disable react-hooks/exhaustive-deps */
|
/* eslint-disable react-hooks/exhaustive-deps */
|
||||||
import { BasicWrapper, NewWrapper, StackCustom, ViewWrapper } from "@/components";
|
import { BasicWrapper, Spacing, StackCustom, ViewWrapper } from "@/components";
|
||||||
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import CustomSkeleton from "@/components/_ShareComponent/SkeletonCustom";
|
import CustomSkeleton from "@/components/_ShareComponent/SkeletonCustom";
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
@@ -8,19 +8,20 @@ import { useAuth } from "@/hooks/use-auth";
|
|||||||
import { useNotificationStore } from "@/hooks/use-notification-store";
|
import { useNotificationStore } from "@/hooks/use-notification-store";
|
||||||
import Home_BottomFeatureSection from "@/screens/Home/bottomFeatureSection";
|
import Home_BottomFeatureSection from "@/screens/Home/bottomFeatureSection";
|
||||||
import HeaderBell from "@/screens/Home/HeaderBell";
|
import HeaderBell from "@/screens/Home/HeaderBell";
|
||||||
|
import HomeTabs from "@/screens/Home/HomeTabs";
|
||||||
import { stylesHome } from "@/screens/Home/homeViewStyle";
|
import { stylesHome } from "@/screens/Home/homeViewStyle";
|
||||||
import Home_ImageSection from "@/screens/Home/imageSection";
|
import Home_ImageSection from "@/screens/Home/imageSection";
|
||||||
import TabSection from "@/screens/Home/tabSection";
|
|
||||||
import { tabsHome } from "@/screens/Home/tabsList";
|
import { tabsHome } from "@/screens/Home/tabsList";
|
||||||
import Home_FeatureSection from "@/screens/Home/topFeatureSection";
|
import Home_FeatureSection from "@/screens/Home/topFeatureSection";
|
||||||
import { apiJobGetAll } from "@/service/api-client/api-job";
|
import { apiJobGetAll } from "@/service/api-client/api-job";
|
||||||
import { apiUser } from "@/service/api-client/api-user";
|
import { apiUser } from "@/service/api-client/api-user";
|
||||||
import { apiVersion } from "@/service/api-config";
|
import { apiVersion } from "@/service/api-config";
|
||||||
import { GStyles } from "@/styles/global-styles";
|
|
||||||
import { Ionicons } from "@expo/vector-icons";
|
import { Ionicons } from "@expo/vector-icons";
|
||||||
import { Redirect, router, Stack, useFocusEffect } from "expo-router";
|
import { Redirect, router, Stack, useFocusEffect } from "expo-router";
|
||||||
import { useCallback, useState } from "react";
|
import { useCallback, useState } from "react";
|
||||||
import { RefreshControl, View } from "react-native";
|
import { RefreshControl, ScrollView, View } from "react-native";
|
||||||
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
||||||
|
import { Platform } from "react-native";
|
||||||
|
|
||||||
export default function Application() {
|
export default function Application() {
|
||||||
const { token, user, userData } = useAuth();
|
const { token, user, userData } = useAuth();
|
||||||
@@ -28,6 +29,8 @@ export default function Application() {
|
|||||||
const [refreshing, setRefreshing] = useState(false);
|
const [refreshing, setRefreshing] = useState(false);
|
||||||
const { syncUnreadCount } = useNotificationStore();
|
const { syncUnreadCount } = useNotificationStore();
|
||||||
const [listData, setListData] = useState<any[] | null>(null);
|
const [listData, setListData] = useState<any[] | null>(null);
|
||||||
|
const insets = useSafeAreaInsets();
|
||||||
|
const paddingBottom = Platform.OS === "android" ? insets.bottom : 0;
|
||||||
|
|
||||||
useFocusEffect(
|
useFocusEffect(
|
||||||
useCallback(() => {
|
useCallback(() => {
|
||||||
@@ -105,15 +108,6 @@ export default function Application() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (data && data?.masterUserRoleId !== "1") {
|
|
||||||
// console.log("User is not admin");
|
|
||||||
// return (
|
|
||||||
// <BasicWrapper>
|
|
||||||
// <Redirect href={`/admin/dashboard`} />
|
|
||||||
// </BasicWrapper>
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
@@ -148,64 +142,61 @@ export default function Application() {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<NewWrapper
|
<View style={{ flex: 1, backgroundColor: MainColor.darkblue }}>
|
||||||
refreshControl={
|
<ScrollView
|
||||||
<RefreshControl
|
style={{ flex: 1 }}
|
||||||
refreshing={refreshing}
|
contentContainerStyle={{
|
||||||
onRefresh={onRefresh}
|
flexGrow: 1,
|
||||||
tintColor={MainColor.yellow}
|
paddingInline: 10,
|
||||||
colors={[MainColor.yellow]}
|
paddingBottom: paddingBottom + 80, // Space for tabs + safe area
|
||||||
/>
|
}}
|
||||||
}
|
refreshControl={
|
||||||
footerComponent={
|
<RefreshControl
|
||||||
data && data ? (
|
refreshing={refreshing}
|
||||||
<TabSection
|
onRefresh={onRefresh}
|
||||||
tabs={tabsHome({
|
tintColor={MainColor.yellow}
|
||||||
acceptedForumTermsAt: data?.acceptedForumTermsAt,
|
colors={[MainColor.yellow]}
|
||||||
profileId: data?.Profile?.id,
|
|
||||||
})}
|
|
||||||
/>
|
/>
|
||||||
) : (
|
}
|
||||||
null
|
keyboardShouldPersistTaps="handled"
|
||||||
// <View style={GStyles.tabBar}>
|
>
|
||||||
// <View style={[GStyles.tabContainer, { paddingTop: 10 }]}>
|
<StackCustom>
|
||||||
// {Array.from({ length: 4 }).map((e, index) => (
|
<Home_ImageSection />
|
||||||
// <CustomSkeleton
|
|
||||||
// key={index}
|
|
||||||
// height={40}
|
|
||||||
// width={40}
|
|
||||||
// radius={100}
|
|
||||||
// />
|
|
||||||
// ))}
|
|
||||||
// </View>
|
|
||||||
// </View>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<StackCustom>
|
|
||||||
<Home_ImageSection />
|
|
||||||
|
|
||||||
{data && data ? (
|
{data && data ? (
|
||||||
<Home_FeatureSection />
|
<Home_FeatureSection />
|
||||||
) : (
|
) : (
|
||||||
<View style={stylesHome.gridContainer}>
|
<View style={stylesHome.gridContainer}>
|
||||||
{Array.from({ length: 4 }).map((item, index) => (
|
{Array.from({ length: 4 }).map((_, index) => (
|
||||||
<CustomSkeleton
|
<CustomSkeleton
|
||||||
key={index}
|
key={index}
|
||||||
style={stylesHome.gridItem}
|
style={stylesHome.gridItem}
|
||||||
radius={50}
|
radius={50}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{data ? (
|
{data ? (
|
||||||
<Home_BottomFeatureSection listData={listData} />
|
<Home_BottomFeatureSection listData={listData} />
|
||||||
) : (
|
) : (
|
||||||
<CustomSkeleton height={150} />
|
<CustomSkeleton height={150} />
|
||||||
)}
|
)}
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
</NewWrapper>
|
</ScrollView>
|
||||||
|
|
||||||
|
{/* Home Tabs di bawah */}
|
||||||
|
{data && data ? (
|
||||||
|
<HomeTabs
|
||||||
|
tabs={tabsHome({
|
||||||
|
acceptedForumTermsAt: data?.acceptedForumTermsAt,
|
||||||
|
profileId: data?.Profile?.id,
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<View style={{ height: 80 + paddingBottom, backgroundColor: MainColor.darkblue }} />
|
||||||
|
)}
|
||||||
|
</View>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,80 +4,105 @@ import { TabsStyles } from "@/styles/tabs-styles";
|
|||||||
import { Feather, FontAwesome6, Ionicons } from "@expo/vector-icons";
|
import { Feather, FontAwesome6, Ionicons } from "@expo/vector-icons";
|
||||||
import { router, Tabs, useLocalSearchParams, useNavigation } from "expo-router";
|
import { router, Tabs, useLocalSearchParams, useNavigation } from "expo-router";
|
||||||
import { useLayoutEffect } from "react";
|
import { useLayoutEffect } from "react";
|
||||||
|
import { View } from "react-native";
|
||||||
|
import { MainColor } from "@/constants/color-palet";
|
||||||
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
||||||
|
import { Platform } from "react-native";
|
||||||
|
|
||||||
export default function InvestmentTabsLayout() {
|
function InvestmentTabsWrapper() {
|
||||||
// const navigation = useNavigation();
|
const insets = useSafeAreaInsets();
|
||||||
|
const paddingBottom = Platform.OS === "android" ? insets.bottom : 0;
|
||||||
|
const navigation = useNavigation();
|
||||||
|
|
||||||
// const { from, category } = useLocalSearchParams<{
|
const { from, category } = useLocalSearchParams<{
|
||||||
// from?: string;
|
from?: string;
|
||||||
// category?: string;
|
category?: string;
|
||||||
// }>();
|
}>();
|
||||||
|
|
||||||
// console.log("from", from);
|
// Atur header secara dinamis
|
||||||
// console.log("category", category);
|
useLayoutEffect(() => {
|
||||||
|
navigation.setOptions({
|
||||||
// // Atur header secara dinamis
|
headerLeft: () => (
|
||||||
// useLayoutEffect(() => {
|
<BackButtonFromNotification
|
||||||
// navigation.setOptions({
|
from={from || ""}
|
||||||
// headerLeft: () => (
|
category={category}
|
||||||
// <BackButtonFromNotification
|
/>
|
||||||
// from={from as string}
|
),
|
||||||
// category={category as string}
|
});
|
||||||
// />
|
}, [from, category, router, navigation]);
|
||||||
// ),
|
|
||||||
// });
|
|
||||||
// }, [from, router, navigation]);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Tabs screenOptions={TabsStyles}>
|
<View style={{ flex: 1, backgroundColor: MainColor.darkblue }}>
|
||||||
<Tabs.Screen
|
<Tabs
|
||||||
name="index"
|
screenOptions={{
|
||||||
options={{
|
...TabsStyles,
|
||||||
title: "Bursa",
|
tabBarStyle: Platform.select({
|
||||||
tabBarIcon: ({ color }) => (
|
ios: {
|
||||||
<Ionicons
|
borderTopWidth: 0,
|
||||||
name="bar-chart-outline"
|
paddingTop: 12,
|
||||||
color={color}
|
height: 80,
|
||||||
size={ICON_SIZE_SMALL}
|
},
|
||||||
/>
|
android: {
|
||||||
),
|
borderTopWidth: 0,
|
||||||
|
paddingTop: 5,
|
||||||
|
height: 70 + paddingBottom,
|
||||||
|
},
|
||||||
|
}),
|
||||||
}}
|
}}
|
||||||
/>
|
>
|
||||||
<Tabs.Screen
|
<Tabs.Screen
|
||||||
name="portofolio"
|
name="index"
|
||||||
options={{
|
options={{
|
||||||
title: "Portofolio",
|
title: "Bursa",
|
||||||
tabBarIcon: ({ color }) => (
|
tabBarIcon: ({ color }) => (
|
||||||
<Feather name="pie-chart" color={color} size={ICON_SIZE_SMALL} />
|
<Ionicons
|
||||||
),
|
name="bar-chart-outline"
|
||||||
}}
|
color={color}
|
||||||
/>
|
size={ICON_SIZE_SMALL}
|
||||||
<Tabs.Screen
|
/>
|
||||||
name="my-holding"
|
),
|
||||||
options={{
|
}}
|
||||||
title: "Saham Saya",
|
/>
|
||||||
tabBarIcon: ({ color }) => (
|
<Tabs.Screen
|
||||||
<FontAwesome6
|
name="portofolio"
|
||||||
name="hand-holding-dollar"
|
options={{
|
||||||
color={color}
|
title: "Portofolio",
|
||||||
size={ICON_SIZE_SMALL}
|
tabBarIcon: ({ color }) => (
|
||||||
/>
|
<Feather name="pie-chart" color={color} size={ICON_SIZE_SMALL} />
|
||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Tabs.Screen
|
<Tabs.Screen
|
||||||
name="transaction"
|
name="my-holding"
|
||||||
options={{
|
options={{
|
||||||
title: "Transaksi",
|
title: "Saham Saya",
|
||||||
tabBarIcon: ({ color }) => (
|
tabBarIcon: ({ color }) => (
|
||||||
<FontAwesome6
|
<FontAwesome6
|
||||||
name="money-bill-transfer"
|
name="hand-holding-dollar"
|
||||||
color={color}
|
color={color}
|
||||||
size={ICON_SIZE_SMALL}
|
size={ICON_SIZE_SMALL}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Tabs>
|
<Tabs.Screen
|
||||||
|
name="transaction"
|
||||||
|
options={{
|
||||||
|
title: "Transaksi",
|
||||||
|
tabBarIcon: ({ color }) => (
|
||||||
|
<FontAwesome6
|
||||||
|
name="money-bill-transfer"
|
||||||
|
color={color}
|
||||||
|
size={ICON_SIZE_SMALL}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Tabs>
|
||||||
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default function InvestmentTabsLayout() {
|
||||||
|
return <InvestmentTabsWrapper />;
|
||||||
|
}
|
||||||
|
|||||||
@@ -5,28 +5,51 @@ 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,
|
||||||
} from "expo-router";
|
OS_IOS_PADDING_TOP,
|
||||||
|
} from "@/constants/constans-value";
|
||||||
|
|
||||||
export default function JobTabsLayout() {
|
function JobTabsWrapper() {
|
||||||
|
const insets = useSafeAreaInsets();
|
||||||
|
const paddingBottom = Platform.OS === "android" ? insets.bottom : 0;
|
||||||
const { from, category } = useLocalSearchParams<{
|
const { from, category } = useLocalSearchParams<{
|
||||||
from?: string;
|
from?: string;
|
||||||
category?: string;
|
category?: string;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<View style={{ flex: 1, backgroundColor: MainColor.darkblue }}>
|
||||||
<Tabs
|
<Tabs
|
||||||
screenOptions={{
|
screenOptions={{
|
||||||
...TabsStyles,
|
...TabsStyles,
|
||||||
|
tabBarStyle: Platform.select({
|
||||||
|
ios: {
|
||||||
|
borderTopWidth: 0,
|
||||||
|
paddingTop: OS_IOS_PADDING_TOP,
|
||||||
|
height: OS_IOS_HEIGHT,
|
||||||
|
},
|
||||||
|
android: {
|
||||||
|
borderTopWidth: 0,
|
||||||
|
paddingTop: OS_ANDROID_PADDING_TOP,
|
||||||
|
height: OS_ANDROID_HEIGHT + paddingBottom,
|
||||||
|
},
|
||||||
|
}),
|
||||||
header: () => (
|
header: () => (
|
||||||
<AppHeader
|
<AppHeader
|
||||||
title="Job Vacancy"
|
title="Job Vacancy"
|
||||||
left={
|
left={
|
||||||
<BackButtonFromNotification from={from as string} category={category as string} />
|
<BackButtonFromNotification
|
||||||
|
from={from || ""}
|
||||||
|
category={category}
|
||||||
|
/>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
@@ -56,6 +79,10 @@ export default function JobTabsLayout() {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
</>
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default function JobTabsLayout() {
|
||||||
|
return <JobTabsWrapper />;
|
||||||
|
}
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ import {
|
|||||||
DrawerCustom,
|
DrawerCustom,
|
||||||
LoaderCustom,
|
LoaderCustom,
|
||||||
MenuDrawerDynamicGrid,
|
MenuDrawerDynamicGrid,
|
||||||
|
OS_Wrapper,
|
||||||
Spacing,
|
Spacing,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import { IconEdit } from "@/components/_Icon";
|
import { IconEdit } from "@/components/_Icon";
|
||||||
@@ -23,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();
|
||||||
@@ -72,7 +73,7 @@ export default function JobDetailStatus() {
|
|||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ViewWrapper>
|
<OS_Wrapper >
|
||||||
{isLoadData ? (
|
{isLoadData ? (
|
||||||
<LoaderCustom />
|
<LoaderCustom />
|
||||||
) : (
|
) : (
|
||||||
@@ -83,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}
|
||||||
@@ -96,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>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import {
|
|||||||
BoxButtonOnFooter,
|
BoxButtonOnFooter,
|
||||||
ButtonCenteredOnly,
|
ButtonCenteredOnly,
|
||||||
ButtonCustom,
|
ButtonCustom,
|
||||||
ViewWrapper
|
OS_Wrapper
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import API_STRORAGE from "@/constants/base-url-api-strorage";
|
import API_STRORAGE from "@/constants/base-url-api-strorage";
|
||||||
import DIRECTORY_ID from "@/constants/directory-id";
|
import DIRECTORY_ID from "@/constants/directory-id";
|
||||||
@@ -126,7 +126,7 @@ export default function PortofolioEditLogo() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ViewWrapper footerComponent={buttonFooter}>
|
<OS_Wrapper footerComponent={buttonFooter}>
|
||||||
<BaseBox
|
<BaseBox
|
||||||
style={{
|
style={{
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
@@ -146,7 +146,7 @@ export default function PortofolioEditLogo() {
|
|||||||
>
|
>
|
||||||
Upload
|
Upload
|
||||||
</ButtonCenteredOnly>
|
</ButtonCenteredOnly>
|
||||||
</ViewWrapper>
|
</OS_Wrapper>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import {
|
import {
|
||||||
BoxButtonOnFooter,
|
BoxButtonOnFooter,
|
||||||
ButtonCustom,
|
ButtonCustom,
|
||||||
|
OS_Wrapper,
|
||||||
TextInputCustom,
|
TextInputCustom,
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import {
|
import {
|
||||||
apiGetOnePortofolio,
|
apiGetOnePortofolio,
|
||||||
@@ -91,7 +91,11 @@ export default function PortofolioEditSocialMedia() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ViewWrapper footerComponent={buttonFooter}>
|
<OS_Wrapper
|
||||||
|
enableKeyboardHandling
|
||||||
|
contentPaddingBottom={250}
|
||||||
|
footerComponent={buttonFooter}
|
||||||
|
>
|
||||||
<TextInputCustom
|
<TextInputCustom
|
||||||
value={data.tiktok}
|
value={data.tiktok}
|
||||||
onChangeText={(value) => setData({ ...data, tiktok: value })}
|
onChangeText={(value) => setData({ ...data, tiktok: value })}
|
||||||
@@ -122,7 +126,7 @@ export default function PortofolioEditSocialMedia() {
|
|||||||
label="Youtube"
|
label="Youtube"
|
||||||
placeholder="Masukkan youtube"
|
placeholder="Masukkan youtube"
|
||||||
/>
|
/>
|
||||||
</ViewWrapper>
|
</OS_Wrapper>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import {
|
|||||||
BoxButtonOnFooter,
|
BoxButtonOnFooter,
|
||||||
ButtonCustom,
|
ButtonCustom,
|
||||||
CenterCustom,
|
CenterCustom,
|
||||||
NewWrapper,
|
OS_Wrapper,
|
||||||
PhoneInputCustom,
|
PhoneInputCustom,
|
||||||
SelectCustom,
|
SelectCustom,
|
||||||
Spacing,
|
Spacing,
|
||||||
@@ -16,7 +16,11 @@ 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 {
|
||||||
|
DEFAULT_COUNTRY,
|
||||||
|
type CountryData,
|
||||||
|
COUNTRIES,
|
||||||
|
} from "@/constants/countries";
|
||||||
import {
|
import {
|
||||||
apiMasterBidangBisnis,
|
apiMasterBidangBisnis,
|
||||||
apiMasterSubBidangBisnis,
|
apiMasterSubBidangBisnis,
|
||||||
@@ -61,7 +65,8 @@ export default function PortofolioEdit() {
|
|||||||
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 [phoneNumber, setPhoneNumber] = useState<string>("");
|
||||||
const [selectedCountry, setSelectedCountry] = useState<CountryData>(DEFAULT_COUNTRY);
|
const [selectedCountry, setSelectedCountry] =
|
||||||
|
useState<CountryData>(DEFAULT_COUNTRY);
|
||||||
const [bidangBisnis, setBidangBisnis] = useState<
|
const [bidangBisnis, setBidangBisnis] = useState<
|
||||||
IMasterBidangBisnis[] | null
|
IMasterBidangBisnis[] | null
|
||||||
>(null);
|
>(null);
|
||||||
@@ -75,38 +80,38 @@ export default function PortofolioEdit() {
|
|||||||
|
|
||||||
function handlePhoneChange(phone: string) {
|
function handlePhoneChange(phone: string) {
|
||||||
setPhoneNumber(phone);
|
setPhoneNumber(phone);
|
||||||
|
|
||||||
// Format phone number for API
|
// Format phone number for API
|
||||||
const callingCode = selectedCountry.callingCode;
|
const callingCode = selectedCountry.callingCode;
|
||||||
let fixNumber = phone.replace(/\s+/g, "").replace(/^0+/, "");
|
let fixNumber = phone.replace(/\s+/g, "").replace(/^0+/, "");
|
||||||
|
|
||||||
// Remove country code if already present
|
// Remove country code if already present
|
||||||
if (fixNumber.startsWith(callingCode)) {
|
if (fixNumber.startsWith(callingCode)) {
|
||||||
fixNumber = fixNumber.substring(callingCode.length);
|
fixNumber = fixNumber.substring(callingCode.length);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove leading zero
|
// Remove leading zero
|
||||||
fixNumber = fixNumber.replace(/^0+/, "");
|
fixNumber = fixNumber.replace(/^0+/, "");
|
||||||
|
|
||||||
const realNumber = callingCode + fixNumber;
|
const realNumber = callingCode + fixNumber;
|
||||||
setData({ ...data, tlpn: realNumber });
|
setData({ ...data, tlpn: realNumber });
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleCountryChange(country: CountryData) {
|
function handleCountryChange(country: CountryData) {
|
||||||
setSelectedCountry(country);
|
setSelectedCountry(country);
|
||||||
|
|
||||||
// Re-format with new country code
|
// Re-format with new country code
|
||||||
const callingCode = country.callingCode;
|
const callingCode = country.callingCode;
|
||||||
let fixNumber = phoneNumber.replace(/\s+/g, "").replace(/^0+/, "");
|
let fixNumber = phoneNumber.replace(/\s+/g, "").replace(/^0+/, "");
|
||||||
|
|
||||||
// Remove country code if already present
|
// Remove country code if already present
|
||||||
if (fixNumber.startsWith(callingCode)) {
|
if (fixNumber.startsWith(callingCode)) {
|
||||||
fixNumber = fixNumber.substring(callingCode.length);
|
fixNumber = fixNumber.substring(callingCode.length);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove leading zero
|
// Remove leading zero
|
||||||
fixNumber = fixNumber.replace(/^0+/, "");
|
fixNumber = fixNumber.replace(/^0+/, "");
|
||||||
|
|
||||||
const realNumber = callingCode + fixNumber;
|
const realNumber = callingCode + fixNumber;
|
||||||
setData({ ...data, tlpn: realNumber });
|
setData({ ...data, tlpn: realNumber });
|
||||||
}
|
}
|
||||||
@@ -157,7 +162,7 @@ export default function PortofolioEdit() {
|
|||||||
const fullNumber = response.data.tlpn;
|
const fullNumber = response.data.tlpn;
|
||||||
let displayNumber = fullNumber;
|
let displayNumber = fullNumber;
|
||||||
let detectedCountry = DEFAULT_COUNTRY;
|
let detectedCountry = DEFAULT_COUNTRY;
|
||||||
|
|
||||||
// Try to detect country from calling code
|
// Try to detect country from calling code
|
||||||
for (const country of COUNTRIES) {
|
for (const country of COUNTRIES) {
|
||||||
if (fullNumber.startsWith(country.callingCode)) {
|
if (fullNumber.startsWith(country.callingCode)) {
|
||||||
@@ -166,12 +171,12 @@ export default function PortofolioEdit() {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setSelectedCountry(detectedCountry);
|
setSelectedCountry(detectedCountry);
|
||||||
|
|
||||||
// Remove leading zero if present
|
// Remove leading zero if present
|
||||||
displayNumber = displayNumber.replace(/^0+/, "");
|
displayNumber = displayNumber.replace(/^0+/, "");
|
||||||
|
|
||||||
setPhoneNumber(displayNumber);
|
setPhoneNumber(displayNumber);
|
||||||
setData({ ...response.data, tlpn: displayNumber });
|
setData({ ...response.data, tlpn: displayNumber });
|
||||||
|
|
||||||
@@ -363,161 +368,159 @@ export default function PortofolioEdit() {
|
|||||||
</BoxButtonOnFooter>
|
</BoxButtonOnFooter>
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!bidangBisnis || !subBidangBisnis) {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<NewWrapper>
|
|
||||||
<ListSkeletonComponent height={80} />
|
|
||||||
</NewWrapper>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<NewWrapper footerComponent={buttonUpdate}>
|
<OS_Wrapper
|
||||||
<StackCustom gap={"xs"}>
|
enableKeyboardHandling
|
||||||
<TextInputCustom
|
contentPaddingBottom={250}
|
||||||
required
|
footerComponent={buttonUpdate}
|
||||||
label="Nama Bisnis"
|
>
|
||||||
placeholder="Masukkan nama bisnis"
|
{!bidangBisnis || !subBidangBisnis ? (
|
||||||
value={data.namaBisnis}
|
<ListSkeletonComponent height={80} />
|
||||||
onChangeText={(value: any) =>
|
) : (
|
||||||
setData({ ...data, namaBisnis: value })
|
<StackCustom gap={"xs"}>
|
||||||
}
|
<TextInputCustom
|
||||||
/>
|
required
|
||||||
|
label="Nama Bisnis"
|
||||||
<SelectCustom
|
placeholder="Masukkan nama bisnis"
|
||||||
label="Bidang Usaha"
|
value={data.namaBisnis}
|
||||||
required
|
onChangeText={(value: any) =>
|
||||||
data={bidangBisnis?.map((item) => ({
|
setData({ ...data, namaBisnis: value })
|
||||||
label: item.name,
|
}
|
||||||
value: item.id,
|
|
||||||
}))}
|
|
||||||
value={data.masterBidangBisnisId}
|
|
||||||
onChange={(value: any) => {
|
|
||||||
handleBidangBisnisChange(value);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
|
|
||||||
{listSubBidangSelected.map((item, index) => {
|
|
||||||
// Filter data untuk select sub bidang, menghilangkan yang sudah dipilih kecuali untuk item ini sendiri
|
|
||||||
const selectedIds = listSubBidangSelected
|
|
||||||
.filter((_, i) => i !== index)
|
|
||||||
.map((s) => s.MasterSubBidangBisnis?.id)
|
|
||||||
.filter((id) => id); // Filter hanya yang memiliki id (tidak kosong)
|
|
||||||
|
|
||||||
const availableSubBidangOptions = (selectedSubBidang || [])
|
|
||||||
.filter((sub: any) => {
|
|
||||||
// Tampilkan jika ini adalah opsi yang dipilih saat ini atau belum dipilih di sub bidang lainnya
|
|
||||||
|
|
||||||
return (
|
|
||||||
sub.id === item.MasterSubBidangBisnis?.id ||
|
|
||||||
!selectedIds.includes(sub.id)
|
|
||||||
);
|
|
||||||
})
|
|
||||||
.map((sub: any) => ({
|
|
||||||
value: sub.id,
|
|
||||||
label: sub.name,
|
|
||||||
}));
|
|
||||||
|
|
||||||
return (
|
|
||||||
<SelectCustom
|
|
||||||
key={index}
|
|
||||||
label="Sub Bidang Usaha"
|
|
||||||
required
|
|
||||||
data={availableSubBidangOptions}
|
|
||||||
value={item.MasterSubBidangBisnis?.id || null}
|
|
||||||
onChange={(value: any) => {
|
|
||||||
handleSubBidangChange(value, index);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
|
|
||||||
<CenterCustom>
|
|
||||||
<View
|
|
||||||
style={{ flexDirection: "row", alignItems: "center", gap: 10 }}
|
|
||||||
>
|
|
||||||
<ActionIcon
|
|
||||||
disabled={
|
|
||||||
selectedSubBidang.length === listSubBidangSelected.length
|
|
||||||
}
|
|
||||||
onPress={() => {
|
|
||||||
handleAddSubBidang();
|
|
||||||
}}
|
|
||||||
icon={
|
|
||||||
<Ionicons
|
|
||||||
name="add-circle-outline"
|
|
||||||
size={ICON_SIZE_XLARGE}
|
|
||||||
color={MainColor.black}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
size="xl"
|
|
||||||
/>
|
|
||||||
<ActionIcon
|
|
||||||
disabled={listSubBidangSelected.length <= 1}
|
|
||||||
onPress={() => {
|
|
||||||
handleRemoveSubBidang(listSubBidangSelected.length - 1);
|
|
||||||
}}
|
|
||||||
icon={
|
|
||||||
<Ionicons
|
|
||||||
name="remove-circle-outline"
|
|
||||||
size={ICON_SIZE_XLARGE}
|
|
||||||
color={MainColor.black}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
size="xl"
|
|
||||||
/>
|
|
||||||
</View>
|
|
||||||
</CenterCustom>
|
|
||||||
<Spacing />
|
|
||||||
|
|
||||||
<View>
|
|
||||||
<View style={{ flexDirection: "row", alignItems: "center" }}>
|
|
||||||
<TextCustom semiBold style={{ color: MainColor.white_gray }}>
|
|
||||||
Nomor Telepon
|
|
||||||
</TextCustom>
|
|
||||||
<Text style={{ color: "red" }}> *</Text>
|
|
||||||
</View>
|
|
||||||
<Spacing height={5} />
|
|
||||||
<PhoneInputCustom
|
|
||||||
value={phoneNumber}
|
|
||||||
onChangePhoneNumber={handlePhoneChange}
|
|
||||||
selectedCountry={selectedCountry}
|
|
||||||
onChangeCountry={handleCountryChange}
|
|
||||||
placeholder="xxx-xxx-xxx"
|
|
||||||
/>
|
/>
|
||||||
</View>
|
|
||||||
<Spacing />
|
|
||||||
|
|
||||||
<TextInputCustom
|
<SelectCustom
|
||||||
required
|
label="Bidang Usaha"
|
||||||
label="Alamat Bisnis"
|
required
|
||||||
placeholder="Masukkan alamat bisnis"
|
data={bidangBisnis?.map((item) => ({
|
||||||
value={data.alamatKantor}
|
label: item.name,
|
||||||
onChangeText={(value: any) =>
|
value: item.id,
|
||||||
setData({ ...data, alamatKantor: value })
|
}))}
|
||||||
}
|
value={data.masterBidangBisnisId}
|
||||||
/>
|
onChange={(value: any) => {
|
||||||
|
handleBidangBisnisChange(value);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
|
||||||
<TextAreaCustom
|
{listSubBidangSelected.map((item, index) => {
|
||||||
label="Deskripsi Bisnis"
|
// Filter data untuk select sub bidang, menghilangkan yang sudah dipilih kecuali untuk item ini sendiri
|
||||||
placeholder="Masukkan deskripsi bisnis"
|
const selectedIds = listSubBidangSelected
|
||||||
value={data.deskripsi}
|
.filter((_, i) => i !== index)
|
||||||
onChangeText={(value: any) =>
|
.map((s) => s.MasterSubBidangBisnis?.id)
|
||||||
setData({ ...data, deskripsi: value })
|
.filter((id) => id); // Filter hanya yang memiliki id (tidak kosong)
|
||||||
}
|
|
||||||
autosize
|
const availableSubBidangOptions = (selectedSubBidang || [])
|
||||||
minRows={2}
|
.filter((sub: any) => {
|
||||||
maxRows={5}
|
// Tampilkan jika ini adalah opsi yang dipilih saat ini atau belum dipilih di sub bidang lainnya
|
||||||
required
|
|
||||||
showCount
|
return (
|
||||||
maxLength={1000}
|
sub.id === item.MasterSubBidangBisnis?.id ||
|
||||||
/>
|
!selectedIds.includes(sub.id)
|
||||||
<Spacing />
|
);
|
||||||
</StackCustom>
|
})
|
||||||
</NewWrapper>
|
.map((sub: any) => ({
|
||||||
|
value: sub.id,
|
||||||
|
label: sub.name,
|
||||||
|
}));
|
||||||
|
|
||||||
|
return (
|
||||||
|
<SelectCustom
|
||||||
|
key={index}
|
||||||
|
label="Sub Bidang Usaha"
|
||||||
|
required
|
||||||
|
data={availableSubBidangOptions}
|
||||||
|
value={item.MasterSubBidangBisnis?.id || null}
|
||||||
|
onChange={(value: any) => {
|
||||||
|
handleSubBidangChange(value, index);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
|
||||||
|
<CenterCustom>
|
||||||
|
<View
|
||||||
|
style={{ flexDirection: "row", alignItems: "center", gap: 10 }}
|
||||||
|
>
|
||||||
|
<ActionIcon
|
||||||
|
disabled={
|
||||||
|
selectedSubBidang.length === listSubBidangSelected.length
|
||||||
|
}
|
||||||
|
onPress={() => {
|
||||||
|
handleAddSubBidang();
|
||||||
|
}}
|
||||||
|
icon={
|
||||||
|
<Ionicons
|
||||||
|
name="add-circle-outline"
|
||||||
|
size={ICON_SIZE_XLARGE}
|
||||||
|
color={MainColor.black}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
size="xl"
|
||||||
|
/>
|
||||||
|
<ActionIcon
|
||||||
|
disabled={listSubBidangSelected.length <= 1}
|
||||||
|
onPress={() => {
|
||||||
|
handleRemoveSubBidang(listSubBidangSelected.length - 1);
|
||||||
|
}}
|
||||||
|
icon={
|
||||||
|
<Ionicons
|
||||||
|
name="remove-circle-outline"
|
||||||
|
size={ICON_SIZE_XLARGE}
|
||||||
|
color={MainColor.black}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
size="xl"
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
</CenterCustom>
|
||||||
|
<Spacing />
|
||||||
|
|
||||||
|
<View>
|
||||||
|
<View style={{ flexDirection: "row", alignItems: "center" }}>
|
||||||
|
<TextCustom semiBold style={{ color: MainColor.white_gray }}>
|
||||||
|
Nomor Telepon
|
||||||
|
</TextCustom>
|
||||||
|
<Text style={{ color: "red" }}> *</Text>
|
||||||
|
</View>
|
||||||
|
<Spacing height={5} />
|
||||||
|
<PhoneInputCustom
|
||||||
|
value={phoneNumber}
|
||||||
|
onChangePhoneNumber={handlePhoneChange}
|
||||||
|
selectedCountry={selectedCountry}
|
||||||
|
onChangeCountry={handleCountryChange}
|
||||||
|
placeholder="xxx-xxx-xxx"
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
<Spacing />
|
||||||
|
|
||||||
|
<TextInputCustom
|
||||||
|
required
|
||||||
|
label="Alamat Bisnis"
|
||||||
|
placeholder="Masukkan alamat bisnis"
|
||||||
|
value={data.alamatKantor}
|
||||||
|
onChangeText={(value: any) =>
|
||||||
|
setData({ ...data, alamatKantor: value })
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<TextAreaCustom
|
||||||
|
label="Deskripsi Bisnis"
|
||||||
|
placeholder="Masukkan deskripsi bisnis"
|
||||||
|
value={data.deskripsi}
|
||||||
|
onChangeText={(value: any) =>
|
||||||
|
setData({ ...data, deskripsi: value })
|
||||||
|
}
|
||||||
|
autosize
|
||||||
|
minRows={2}
|
||||||
|
maxRows={5}
|
||||||
|
required
|
||||||
|
showCount
|
||||||
|
maxLength={1000}
|
||||||
|
/>
|
||||||
|
<Spacing />
|
||||||
|
</StackCustom>
|
||||||
|
)}
|
||||||
|
</OS_Wrapper>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import {
|
|||||||
DrawerCustom,
|
DrawerCustom,
|
||||||
DummyLandscapeImage,
|
DummyLandscapeImage,
|
||||||
LoaderCustom,
|
LoaderCustom,
|
||||||
|
OS_Wrapper,
|
||||||
Spacing,
|
Spacing,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
TextCustom,
|
TextCustom,
|
||||||
@@ -12,7 +13,6 @@ 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";
|
||||||
import ViewWrapper from "@/components/_ShareComponent/ViewWrapper";
|
|
||||||
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 { useAuth } from "@/hooks/use-auth";
|
import { useAuth } from "@/hooks/use-auth";
|
||||||
@@ -92,7 +92,7 @@ export default function Portofolio() {
|
|||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ViewWrapper>
|
<OS_Wrapper>
|
||||||
{!data || !profileId ? (
|
{!data || !profileId ? (
|
||||||
<StackCustom>
|
<StackCustom>
|
||||||
<CustomSkeleton height={400} />
|
<CustomSkeleton height={400} />
|
||||||
@@ -125,7 +125,7 @@ export default function Portofolio() {
|
|||||||
<Spacing />
|
<Spacing />
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
)}
|
)}
|
||||||
</ViewWrapper>
|
</OS_Wrapper>
|
||||||
|
|
||||||
{/* Drawer Komponen Eksternal */}
|
{/* Drawer Komponen Eksternal */}
|
||||||
<DrawerCustom
|
<DrawerCustom
|
||||||
|
|||||||
@@ -3,13 +3,13 @@ import {
|
|||||||
BadgeCustom,
|
BadgeCustom,
|
||||||
ClickableCustom,
|
ClickableCustom,
|
||||||
Divider,
|
Divider,
|
||||||
|
OS_Wrapper,
|
||||||
SelectCustom,
|
SelectCustom,
|
||||||
TextCustom,
|
TextCustom,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import ListEmptyComponent from "@/components/_ShareComponent/ListEmptyComponent";
|
import ListEmptyComponent from "@/components/_ShareComponent/ListEmptyComponent";
|
||||||
import ListLoaderFooterComponent from "@/components/_ShareComponent/ListLoaderFooterComponent";
|
import ListLoaderFooterComponent from "@/components/_ShareComponent/ListLoaderFooterComponent";
|
||||||
import ListSkeletonComponent from "@/components/_ShareComponent/ListSkeletonComponent";
|
import ListSkeletonComponent from "@/components/_ShareComponent/ListSkeletonComponent";
|
||||||
import NewWrapper from "@/components/_ShareComponent/NewWrapper";
|
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
import { useAuth } from "@/hooks/use-auth";
|
import { useAuth } from "@/hooks/use-auth";
|
||||||
import { usePaginatedApi } from "@/hooks/use-paginated-api";
|
import { usePaginatedApi } from "@/hooks/use-paginated-api";
|
||||||
@@ -120,7 +120,7 @@ export default function ProfileBlockedList() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<NewWrapper
|
<OS_Wrapper
|
||||||
// headerComponent={renderHeader()}
|
// headerComponent={renderHeader()}
|
||||||
listData={listData}
|
listData={listData}
|
||||||
renderItem={renderItem}
|
renderItem={renderItem}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import {
|
|||||||
BoxButtonOnFooter,
|
BoxButtonOnFooter,
|
||||||
BoxWithHeaderSection,
|
BoxWithHeaderSection,
|
||||||
ButtonCustom,
|
ButtonCustom,
|
||||||
NewWrapper,
|
OS_Wrapper,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
TextCustom,
|
TextCustom,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
@@ -46,7 +46,7 @@ export default function ProfileDetailBlocked() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<NewWrapper
|
<OS_Wrapper
|
||||||
footerComponent={
|
footerComponent={
|
||||||
<BoxButtonOnFooter>
|
<BoxButtonOnFooter>
|
||||||
<ButtonCustom
|
<ButtonCustom
|
||||||
@@ -86,7 +86,7 @@ export default function ProfileDetailBlocked() {
|
|||||||
</TextCustom>
|
</TextCustom>
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
</BoxWithHeaderSection>
|
</BoxWithHeaderSection>
|
||||||
</NewWrapper>
|
</OS_Wrapper>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
import {
|
import {
|
||||||
ButtonCustom,
|
ButtonCustom,
|
||||||
|
OS_Wrapper,
|
||||||
SelectCustom,
|
SelectCustom,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
TextInputCustom,
|
TextInputCustom,
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import BoxButtonOnFooter from "@/components/Box/BoxButtonOnFooter";
|
import BoxButtonOnFooter from "@/components/Box/BoxButtonOnFooter";
|
||||||
|
import { PADDING_INLINE } from "@/constants/constans-value";
|
||||||
import { apiProfile, apiUpdateProfile } from "@/service/api-client/api-profile";
|
import { apiProfile, apiUpdateProfile } from "@/service/api-client/api-profile";
|
||||||
import { IProfile } from "@/types/Type-Profile";
|
import { IProfile } from "@/types/Type-Profile";
|
||||||
import { router, useLocalSearchParams } from "expo-router";
|
import { router, useLocalSearchParams } from "expo-router";
|
||||||
@@ -70,7 +71,9 @@ export default function ProfileEdit() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ViewWrapper
|
<OS_Wrapper
|
||||||
|
enableKeyboardHandling
|
||||||
|
contentPaddingBottom={250}
|
||||||
footerComponent={
|
footerComponent={
|
||||||
<BoxButtonOnFooter>
|
<BoxButtonOnFooter>
|
||||||
<ButtonCustom isLoading={isLoading} onPress={handleUpdate}>
|
<ButtonCustom isLoading={isLoading} onPress={handleUpdate}>
|
||||||
@@ -119,6 +122,6 @@ export default function ProfileEdit() {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
</ViewWrapper>
|
</OS_Wrapper>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/* eslint-disable react-hooks/exhaustive-deps */
|
/* eslint-disable react-hooks/exhaustive-deps */
|
||||||
import { NewWrapper, StackCustom } from "@/components";
|
import { OS_Wrapper, StackCustom } from "@/components";
|
||||||
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import CustomSkeleton from "@/components/_ShareComponent/SkeletonCustom";
|
import CustomSkeleton from "@/components/_ShareComponent/SkeletonCustom";
|
||||||
import LeftButtonCustom from "@/components/Button/BackButton";
|
import LeftButtonCustom from "@/components/Button/BackButton";
|
||||||
@@ -119,7 +119,7 @@ export default function Profile() {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
{/* Main View */}
|
{/* Main View */}
|
||||||
<NewWrapper
|
<OS_Wrapper
|
||||||
refreshControl={
|
refreshControl={
|
||||||
<RefreshControl
|
<RefreshControl
|
||||||
refreshing={refreshing}
|
refreshing={refreshing}
|
||||||
@@ -144,7 +144,7 @@ export default function Profile() {
|
|||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</NewWrapper>
|
</OS_Wrapper>
|
||||||
|
|
||||||
{/* Drawer Komponen Eksternal */}
|
{/* Drawer Komponen Eksternal */}
|
||||||
<DrawerCustom
|
<DrawerCustom
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ import {
|
|||||||
BoxButtonOnFooter,
|
BoxButtonOnFooter,
|
||||||
ButtonCenteredOnly,
|
ButtonCenteredOnly,
|
||||||
ButtonCustom,
|
ButtonCustom,
|
||||||
|
OS_Wrapper,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import ViewWrapper from "@/components/_ShareComponent/ViewWrapper";
|
|
||||||
import API_STRORAGE from "@/constants/base-url-api-strorage";
|
import API_STRORAGE from "@/constants/base-url-api-strorage";
|
||||||
import DIRECTORY_ID from "@/constants/directory-id";
|
import DIRECTORY_ID from "@/constants/directory-id";
|
||||||
import DUMMY_IMAGE from "@/constants/dummy-image-value";
|
import DUMMY_IMAGE from "@/constants/dummy-image-value";
|
||||||
@@ -127,7 +127,7 @@ export default function UpdateBackgroundProfile() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ViewWrapper footerComponent={buttonFooter}>
|
<OS_Wrapper footerComponent={buttonFooter}>
|
||||||
<BaseBox
|
<BaseBox
|
||||||
style={{ alignItems: "center", justifyContent: "center", height: 250 }}
|
style={{ alignItems: "center", justifyContent: "center", height: 250 }}
|
||||||
>
|
>
|
||||||
@@ -144,6 +144,6 @@ export default function UpdateBackgroundProfile() {
|
|||||||
>
|
>
|
||||||
Update
|
Update
|
||||||
</ButtonCenteredOnly>
|
</ButtonCenteredOnly>
|
||||||
</ViewWrapper>
|
</OS_Wrapper>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ import {
|
|||||||
BoxButtonOnFooter,
|
BoxButtonOnFooter,
|
||||||
ButtonCenteredOnly,
|
ButtonCenteredOnly,
|
||||||
ButtonCustom,
|
ButtonCustom,
|
||||||
|
OS_Wrapper,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import ViewWrapper from "@/components/_ShareComponent/ViewWrapper";
|
|
||||||
import API_STRORAGE from "@/constants/base-url-api-strorage";
|
import API_STRORAGE from "@/constants/base-url-api-strorage";
|
||||||
import DIRECTORY_ID from "@/constants/directory-id";
|
import DIRECTORY_ID from "@/constants/directory-id";
|
||||||
import DUMMY_IMAGE from "@/constants/dummy-image-value";
|
import DUMMY_IMAGE from "@/constants/dummy-image-value";
|
||||||
@@ -125,7 +125,7 @@ export default function UpdatePhotoProfile() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ViewWrapper footerComponent={buttonFooter}>
|
<OS_Wrapper footerComponent={buttonFooter}>
|
||||||
<BaseBox
|
<BaseBox
|
||||||
style={{ alignItems: "center", justifyContent: "center", height: 250 }}
|
style={{ alignItems: "center", justifyContent: "center", height: 250 }}
|
||||||
>
|
>
|
||||||
@@ -143,6 +143,6 @@ export default function UpdatePhotoProfile() {
|
|||||||
>
|
>
|
||||||
Upload
|
Upload
|
||||||
</ButtonCenteredOnly>
|
</ButtonCenteredOnly>
|
||||||
</ViewWrapper>
|
</OS_Wrapper>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,11 @@ export default function ProfileLayout() {
|
|||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="create"
|
name="create"
|
||||||
options={{ headerBackVisible: false }}
|
options={{
|
||||||
|
header: () => (
|
||||||
|
<AppHeader title="Tambah Profil" showBack={false} />
|
||||||
|
),
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
|
|||||||
@@ -2,16 +2,17 @@ import {
|
|||||||
BaseBox,
|
BaseBox,
|
||||||
ButtonCenteredOnly,
|
ButtonCenteredOnly,
|
||||||
ButtonCustom,
|
ButtonCustom,
|
||||||
|
OS_Wrapper,
|
||||||
SelectCustom,
|
SelectCustom,
|
||||||
Spacing,
|
Spacing,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
TextInputCustom,
|
TextInputCustom,
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import BoxButtonOnFooter from "@/components/Box/BoxButtonOnFooter";
|
import BoxButtonOnFooter from "@/components/Box/BoxButtonOnFooter";
|
||||||
import InformationBox from "@/components/Box/InformationBox";
|
import InformationBox from "@/components/Box/InformationBox";
|
||||||
import DIRECTORY_ID from "@/constants/directory-id";
|
import DIRECTORY_ID from "@/constants/directory-id";
|
||||||
import DUMMY_IMAGE from "@/constants/dummy-image-value";
|
import DUMMY_IMAGE from "@/constants/dummy-image-value";
|
||||||
|
import { PADDING_INLINE } from "@/constants/constans-value";
|
||||||
import { useAuth } from "@/hooks/use-auth";
|
import { useAuth } from "@/hooks/use-auth";
|
||||||
import { apiCreateProfile } from "@/service/api-client/api-profile";
|
import { apiCreateProfile } from "@/service/api-client/api-profile";
|
||||||
import { apiValidationEmail } from "@/service/api-client/api-validation";
|
import { apiValidationEmail } from "@/service/api-client/api-validation";
|
||||||
@@ -155,7 +156,11 @@ export default function CreateProfile() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ViewWrapper footerComponent={footerComponent}>
|
<OS_Wrapper
|
||||||
|
enableKeyboardHandling
|
||||||
|
contentPaddingBottom={250}
|
||||||
|
footerComponent={footerComponent}
|
||||||
|
>
|
||||||
<StackCustom>
|
<StackCustom>
|
||||||
<InformationBox text="Upload foto profile anda." />
|
<InformationBox text="Upload foto profile anda." />
|
||||||
<View style={{ alignItems: "center" }}>
|
<View style={{ alignItems: "center" }}>
|
||||||
@@ -241,6 +246,6 @@ export default function CreateProfile() {
|
|||||||
/>
|
/>
|
||||||
<Spacing />
|
<Spacing />
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
</ViewWrapper>
|
</OS_Wrapper>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,58 +8,82 @@ import AppHeader from "@/components/_ShareComponent/AppHeader";
|
|||||||
import BackButtonFromNotification from "@/components/Button/BackButtonFromNotification";
|
import BackButtonFromNotification from "@/components/Button/BackButtonFromNotification";
|
||||||
import { TabsStyles } from "@/styles/tabs-styles";
|
import { TabsStyles } from "@/styles/tabs-styles";
|
||||||
import { router, Tabs, useLocalSearchParams } from "expo-router";
|
import { router, Tabs, useLocalSearchParams } from "expo-router";
|
||||||
|
import { View } from "react-native";
|
||||||
|
import { MainColor } from "@/constants/color-palet";
|
||||||
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
||||||
|
import { Platform } from "react-native";
|
||||||
|
|
||||||
export default function VotingTabsLayout() {
|
function VotingTabsWrapper() {
|
||||||
|
const insets = useSafeAreaInsets();
|
||||||
|
const paddingBottom = Platform.OS === "android" ? insets.bottom : 0;
|
||||||
const { from, category } = useLocalSearchParams<{
|
const { from, category } = useLocalSearchParams<{
|
||||||
from?: string;
|
from?: string;
|
||||||
category?: string;
|
category?: string;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Tabs
|
<View style={{ flex: 1, backgroundColor: MainColor.darkblue }}>
|
||||||
screenOptions={{
|
<Tabs
|
||||||
...TabsStyles,
|
screenOptions={{
|
||||||
header: () => (
|
...TabsStyles,
|
||||||
<AppHeader
|
tabBarStyle: Platform.select({
|
||||||
title="Voting"
|
ios: {
|
||||||
left={
|
borderTopWidth: 0,
|
||||||
<BackButtonFromNotification
|
paddingTop: 12,
|
||||||
from={from as string}
|
height: 80,
|
||||||
category={category as string}
|
},
|
||||||
/>
|
android: {
|
||||||
}
|
borderTopWidth: 0,
|
||||||
/>
|
paddingTop: 5,
|
||||||
),
|
height: 70 + paddingBottom,
|
||||||
}}
|
},
|
||||||
>
|
}),
|
||||||
<Tabs.Screen
|
header: () => (
|
||||||
name="index"
|
<AppHeader
|
||||||
options={{
|
title="Voting"
|
||||||
title: "Beranda",
|
left={
|
||||||
tabBarIcon: ({ color }) => <IconHome color={color} />,
|
<BackButtonFromNotification
|
||||||
|
from={from || ""}
|
||||||
|
category={category}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
>
|
||||||
<Tabs.Screen
|
<Tabs.Screen
|
||||||
name="status"
|
name="index"
|
||||||
options={{
|
options={{
|
||||||
title: "Status",
|
title: "Beranda",
|
||||||
tabBarIcon: ({ color }) => <IconStatus color={color} />,
|
tabBarIcon: ({ color }) => <IconHome color={color} />,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Tabs.Screen
|
<Tabs.Screen
|
||||||
name="contribution"
|
name="status"
|
||||||
options={{
|
options={{
|
||||||
title: "Kontribusi",
|
title: "Status",
|
||||||
tabBarIcon: ({ color }) => <IconContribution color={color} />,
|
tabBarIcon: ({ color }) => <IconStatus color={color} />,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Tabs.Screen
|
<Tabs.Screen
|
||||||
name="history"
|
name="contribution"
|
||||||
options={{
|
options={{
|
||||||
title: "Riwayat",
|
title: "Kontribusi",
|
||||||
tabBarIcon: ({ color }) => <IconHistory color={color} />,
|
tabBarIcon: ({ color }) => <IconContribution color={color} />,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Tabs>
|
<Tabs.Screen
|
||||||
|
name="history"
|
||||||
|
options={{
|
||||||
|
title: "Riwayat",
|
||||||
|
tabBarIcon: ({ color }) => <IconHistory color={color} />,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Tabs>
|
||||||
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default function VotingTabsLayout() {
|
||||||
|
return <VotingTabsWrapper />;
|
||||||
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import {
|
|||||||
BoxButtonOnFooter,
|
BoxButtonOnFooter,
|
||||||
ButtonCustom,
|
ButtonCustom,
|
||||||
InformationBox,
|
InformationBox,
|
||||||
NewWrapper,
|
OS_Wrapper,
|
||||||
StackCustom
|
StackCustom
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import { ICON_SIZE_BUTTON } from "@/constants/constans-value";
|
import { ICON_SIZE_BUTTON } from "@/constants/constans-value";
|
||||||
@@ -82,7 +82,7 @@ export default function WaitingRoom() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<NewWrapper
|
<OS_Wrapper
|
||||||
footerComponent={logoutButton()}
|
footerComponent={logoutButton()}
|
||||||
refreshControl={
|
refreshControl={
|
||||||
<RefreshControl refreshing={isLoading} onRefresh={handleCheck} />
|
<RefreshControl refreshing={isLoading} onRefresh={handleCheck} />
|
||||||
@@ -103,7 +103,7 @@ Silakan tunggu beberapa saat. Untuk memperbarui status, tarik layar ke bawah."
|
|||||||
Check
|
Check
|
||||||
</ButtonCenteredOnly> */}
|
</ButtonCenteredOnly> */}
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
</NewWrapper>
|
</OS_Wrapper>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,9 +3,9 @@ import {
|
|||||||
BoxButtonOnFooter,
|
BoxButtonOnFooter,
|
||||||
ButtonCustom,
|
ButtonCustom,
|
||||||
LoaderCustom,
|
LoaderCustom,
|
||||||
|
OS_Wrapper,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
TextCustom,
|
TextCustom,
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle";
|
import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle";
|
||||||
import GridTwoView from "@/components/_ShareComponent/GridTwoView";
|
import GridTwoView from "@/components/_ShareComponent/GridTwoView";
|
||||||
@@ -76,7 +76,7 @@ export default function AdminUserAccessDetail() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ViewWrapper
|
<OS_Wrapper
|
||||||
headerComponent={<AdminBackButtonAntTitle title={`Detail User`} />}
|
headerComponent={<AdminBackButtonAntTitle title={`Detail User`} />}
|
||||||
footerComponent={
|
footerComponent={
|
||||||
data && (
|
data && (
|
||||||
@@ -108,7 +108,7 @@ export default function AdminUserAccessDetail() {
|
|||||||
))}
|
))}
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
)}
|
)}
|
||||||
</ViewWrapper>
|
</OS_Wrapper>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
254
components/_ShareComponent/AndroidWrapper.tsx
Normal file
254
components/_ShareComponent/AndroidWrapper.tsx
Normal file
@@ -0,0 +1,254 @@
|
|||||||
|
// @/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, cloneChildrenWithFocusHandler } 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;
|
||||||
|
/**
|
||||||
|
* Disable flexGrow: 1 in contentContainerStyle
|
||||||
|
* Use this for screens with very large headers to fix scroll issues
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
disableFlexGrow?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
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,
|
||||||
|
disableFlexGrow = false,
|
||||||
|
} = 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 (
|
||||||
|
<View style={{ flex: 1, backgroundColor: MainColor.darkblue }}>
|
||||||
|
{headerComponent && (
|
||||||
|
<View style={GStyles.stickyHeader}>{headerComponent}</View>
|
||||||
|
)}
|
||||||
|
<FlatList
|
||||||
|
style={{ flex: 1 }}
|
||||||
|
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: disableFlexGrow ? 0 : 1,
|
||||||
|
paddingBottom:
|
||||||
|
(footerComponent && !hideFooter ? OS_HEIGHT : 0) +
|
||||||
|
finalContentPaddingBottom,
|
||||||
|
padding: finalContentPadding,
|
||||||
|
}}
|
||||||
|
keyboardShouldPersistTaps="handled"
|
||||||
|
removeClippedSubviews={false}
|
||||||
|
stickyHeaderIndices={[]}
|
||||||
|
nestedScrollEnabled={true}
|
||||||
|
/>
|
||||||
|
|
||||||
|
{/* 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>
|
||||||
|
)}
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 🔹 Mode Statis (ScrollView)
|
||||||
|
const staticProps = props as StaticModeProps;
|
||||||
|
|
||||||
|
// Inject focus handler jika keyboard handling enabled
|
||||||
|
const childrenWithFocus = enableKeyboardHandling && keyboardForm
|
||||||
|
? cloneChildrenWithFocusHandler(staticProps.children, keyboardForm.handleInputFocus)
|
||||||
|
: staticProps.children;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<View style={{ flex: 1, backgroundColor: MainColor.darkblue }}>
|
||||||
|
{headerComponent && (
|
||||||
|
<View style={GStyles.stickyHeader}>{headerComponent}</View>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<ScrollView
|
||||||
|
ref={keyboardForm?.scrollViewRef}
|
||||||
|
onScroll={keyboardForm?.handleScroll}
|
||||||
|
scrollEventThrottle={16}
|
||||||
|
refreshControl={refreshControl}
|
||||||
|
style={{ flex: 1 }}
|
||||||
|
contentContainerStyle={{
|
||||||
|
flexGrow: disableFlexGrow ? 0 : 1,
|
||||||
|
paddingBottom:
|
||||||
|
(footerComponent && !hideFooter ? OS_HEIGHT : 0) +
|
||||||
|
finalContentPaddingBottom,
|
||||||
|
padding: finalContentPadding,
|
||||||
|
}}
|
||||||
|
keyboardShouldPersistTaps="handled"
|
||||||
|
showsVerticalScrollIndicator={false}
|
||||||
|
>
|
||||||
|
<TouchableWithoutFeedback onPress={Keyboard.dismiss}>
|
||||||
|
{renderContainer(childrenWithFocus)}
|
||||||
|
</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>
|
||||||
|
)}
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default AndroidWrapper;
|
||||||
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;
|
||||||
@@ -117,15 +117,15 @@ const NewWrapper = (props: NewWrapperProps) => {
|
|||||||
ListHeaderComponent={listProps.ListHeaderComponent}
|
ListHeaderComponent={listProps.ListHeaderComponent}
|
||||||
ListFooterComponent={listProps.ListFooterComponent}
|
ListFooterComponent={listProps.ListFooterComponent}
|
||||||
ListEmptyComponent={listProps.ListEmptyComponent}
|
ListEmptyComponent={listProps.ListEmptyComponent}
|
||||||
contentContainerStyle={{
|
contentContainerStyle={{
|
||||||
flexGrow: 1,
|
flexGrow: 1,
|
||||||
paddingBottom: footerComponent && !hideFooter ? OS_HEIGHT : 0
|
paddingBottom: footerComponent && !hideFooter ? OS_HEIGHT : 0
|
||||||
}}
|
}}
|
||||||
keyboardShouldPersistTaps="handled"
|
keyboardShouldPersistTaps="handled"
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
{/* Footer dengan position absolute untuk stay di bawah */}
|
{/* Footer - tetap di bawah dengan position absolute */}
|
||||||
{footerComponent && !hideFooter && (
|
{footerComponent && !hideFooter && (
|
||||||
<View style={styles.footerContainer}>
|
<View style={styles.footerContainer}>
|
||||||
<SafeAreaView
|
<SafeAreaView
|
||||||
@@ -133,7 +133,7 @@ const NewWrapper = (props: NewWrapperProps) => {
|
|||||||
style={{ backgroundColor: MainColor.darkblue }}
|
style={{ backgroundColor: MainColor.darkblue }}
|
||||||
>
|
>
|
||||||
{footerComponent}
|
{footerComponent}
|
||||||
</SafeAreaView>
|
</SafeAreaView>
|
||||||
</View>
|
</View>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
@@ -163,11 +163,11 @@ const NewWrapper = (props: NewWrapperProps) => {
|
|||||||
<View style={GStyles.stickyHeader}>{headerComponent}</View>
|
<View style={GStyles.stickyHeader}>{headerComponent}</View>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<View style={{ flex: 0 }} collapsable={false}>
|
<View style={{ flex: 1 }}>
|
||||||
<ScrollView
|
<ScrollView
|
||||||
contentContainerStyle={{
|
contentContainerStyle={{
|
||||||
flexGrow: 1,
|
flexGrow: 1,
|
||||||
paddingBottom: footerComponent && !hideFooter ? OS_HEIGHT : 0
|
paddingBottom: footerComponent && !hideFooter ? OS_HEIGHT : 0
|
||||||
}}
|
}}
|
||||||
keyboardShouldPersistTaps="handled"
|
keyboardShouldPersistTaps="handled"
|
||||||
refreshControl={refreshControl}
|
refreshControl={refreshControl}
|
||||||
@@ -178,7 +178,7 @@ const NewWrapper = (props: NewWrapperProps) => {
|
|||||||
</ScrollView>
|
</ScrollView>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
{/* Footer dengan position absolute untuk stay di bawah */}
|
{/* Footer - tetap di bawah dengan position absolute */}
|
||||||
{footerComponent && !hideFooter && (
|
{footerComponent && !hideFooter && (
|
||||||
<View style={styles.footerContainer}>
|
<View style={styles.footerContainer}>
|
||||||
<SafeAreaView
|
<SafeAreaView
|
||||||
|
|||||||
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>
|
||||||
|
);
|
||||||
|
}
|
||||||
157
components/_ShareComponent/OS_Wrapper.tsx
Normal file
157
components/_ShareComponent/OS_Wrapper.tsx
Normal file
@@ -0,0 +1,157 @@
|
|||||||
|
// @/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"];
|
||||||
|
disableFlexGrow?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ========== 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,
|
||||||
|
disableFlexGrow = false,
|
||||||
|
...wrapperProps
|
||||||
|
} = props;
|
||||||
|
|
||||||
|
// iOS uses IOSWrapper (based on NewWrapper)
|
||||||
|
if (Platform.OS === "ios") {
|
||||||
|
// Keyboard handling props are ignored on iOS
|
||||||
|
return <IOSWrapper {...(wrapperProps as any)} disableFlexGrow={disableFlexGrow} />;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Android uses AndroidWrapper (with keyboard handling support)
|
||||||
|
return (
|
||||||
|
<AndroidWrapper
|
||||||
|
{...(wrapperProps as any)}
|
||||||
|
enableKeyboardHandling={enableKeyboardHandling}
|
||||||
|
keyboardScrollOffset={keyboardScrollOffset}
|
||||||
|
contentPaddingBottom={contentPaddingBottom}
|
||||||
|
contentPadding={contentPadding}
|
||||||
|
disableFlexGrow={disableFlexGrow}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 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;
|
||||||
@@ -63,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
|
||||||
@@ -127,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 = 70
|
const OS_ANDROID_HEIGHT = 60
|
||||||
const OS_IOS_HEIGHT = 80
|
const OS_IOS_HEIGHT = 80
|
||||||
const OS_HEIGHT = Platform.OS === "ios" ? OS_IOS_HEIGHT : OS_ANDROID_HEIGHT
|
const OS_HEIGHT = Platform.OS === "ios" ? OS_IOS_HEIGHT : OS_ANDROID_HEIGHT
|
||||||
|
|
||||||
|
// 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
|
||||||
|
|||||||
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
|
||||||
137
hooks/useKeyboardForm.ts
Normal file
137
hooks/useKeyboardForm.ts
Normal file
@@ -0,0 +1,137 @@
|
|||||||
|
// useKeyboardForm.ts - Hook untuk keyboard handling pada form
|
||||||
|
import { Keyboard, ScrollView, Dimensions, findNodeHandle, UIManager } from "react-native";
|
||||||
|
import { useState, useEffect, useRef, useCallback } from "react";
|
||||||
|
|
||||||
|
export function useKeyboardForm(scrollOffset = 100) {
|
||||||
|
const scrollViewRef = useRef<ScrollView>(null);
|
||||||
|
const [keyboardHeight, setKeyboardHeight] = useState(0);
|
||||||
|
const currentScrollY = useRef(0);
|
||||||
|
const inputPageY = useRef(0);
|
||||||
|
const screenHeight = Dimensions.get('window').height;
|
||||||
|
|
||||||
|
// Fungsi untuk mengukur posisi absolut input
|
||||||
|
const handleInputFocus = useCallback((target: any) => {
|
||||||
|
const nodeHandle = findNodeHandle(target);
|
||||||
|
if (nodeHandle) {
|
||||||
|
UIManager.measure(nodeHandle, (x, y, width, height, pageX, pageY) => {
|
||||||
|
if (pageY !== undefined && pageY !== null) {
|
||||||
|
inputPageY.current = pageY;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
// Listen to keyboard events
|
||||||
|
useEffect(() => {
|
||||||
|
const keyboardDidShowListener = Keyboard.addListener(
|
||||||
|
'keyboardDidShow',
|
||||||
|
(e) => {
|
||||||
|
const kbHeight = e.endCoordinates.height;
|
||||||
|
setKeyboardHeight(kbHeight);
|
||||||
|
|
||||||
|
// Conditional scroll: hanya scroll jika input tertutup keyboard
|
||||||
|
if (scrollViewRef.current) {
|
||||||
|
const touchAbsoluteY = inputPageY.current;
|
||||||
|
|
||||||
|
// Posisi Y teratas keyboard (dari atas layar)
|
||||||
|
const keyboardTopY = screenHeight - kbHeight;
|
||||||
|
|
||||||
|
// Jika input ADA DI BAWAH keyboard (tertutup)
|
||||||
|
if (touchAbsoluteY > keyboardTopY) {
|
||||||
|
// Hitung berapa harus scroll agar input terlihat di atas keyboard
|
||||||
|
const scrollBy = touchAbsoluteY - keyboardTopY + scrollOffset;
|
||||||
|
const targetY = currentScrollY.current + scrollBy;
|
||||||
|
|
||||||
|
scrollViewRef.current.scrollTo({
|
||||||
|
y: Math.max(0, targetY),
|
||||||
|
animated: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// Jika input SUDAH TERLIHAT (di atas keyboard), JANGAN SCROLL
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
const keyboardDidHideListener = Keyboard.addListener(
|
||||||
|
'keyboardDidHide',
|
||||||
|
() => {
|
||||||
|
setKeyboardHeight(0);
|
||||||
|
inputPageY.current = 0;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
keyboardDidShowListener.remove();
|
||||||
|
keyboardDidHideListener.remove();
|
||||||
|
};
|
||||||
|
}, [scrollOffset, screenHeight]);
|
||||||
|
|
||||||
|
// Track scroll position
|
||||||
|
const handleScroll = (event: any) => {
|
||||||
|
currentScrollY.current = event.nativeEvent.contentOffset.y;
|
||||||
|
};
|
||||||
|
|
||||||
|
return {
|
||||||
|
scrollViewRef,
|
||||||
|
keyboardHeight,
|
||||||
|
handleInputFocus,
|
||||||
|
handleScroll,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper untuk inject onFocus handler ke semua TextInput/TextArea children
|
||||||
|
* Menggunakan UI.measure untuk mendapatkan posisi absolut input secara akurat
|
||||||
|
*/
|
||||||
|
export function cloneChildrenWithFocusHandler(
|
||||||
|
children: React.ReactNode,
|
||||||
|
focusHandler: (target: any) => void
|
||||||
|
): React.ReactNode {
|
||||||
|
if (!children) return children;
|
||||||
|
const React = require("react");
|
||||||
|
|
||||||
|
return React.Children.map(children, (child: any) => {
|
||||||
|
if (!React.isValidElement(child)) return child;
|
||||||
|
|
||||||
|
const childType = child.type;
|
||||||
|
const childProps = child.props as Record<string, any> || {};
|
||||||
|
|
||||||
|
// Check if it's a text input component
|
||||||
|
let isTextInput = false;
|
||||||
|
|
||||||
|
if (typeof childType === 'string') {
|
||||||
|
isTextInput = childType.toLowerCase().includes('textinput');
|
||||||
|
} else if (childType) {
|
||||||
|
isTextInput =
|
||||||
|
(childType as any).displayName?.includes('TextInput') ||
|
||||||
|
(childType as any).name?.includes('TextInput') ||
|
||||||
|
(childType as any).displayName?.includes('TextArea') ||
|
||||||
|
(childType as any).name?.includes('TextArea') ||
|
||||||
|
(childType as any).displayName?.includes('PhoneInput') ||
|
||||||
|
(childType as any).name?.includes('PhoneInput') ||
|
||||||
|
(childType as any).displayName?.includes('Select') ||
|
||||||
|
(childType as any).name?.includes('Select');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isTextInput) {
|
||||||
|
const existingOnFocus = childProps.onFocus;
|
||||||
|
return React.cloneElement(child, {
|
||||||
|
...childProps,
|
||||||
|
onFocus: (e: any) => {
|
||||||
|
existingOnFocus?.(e);
|
||||||
|
focusHandler(e.target);
|
||||||
|
},
|
||||||
|
} as any);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Recursively clone nested children
|
||||||
|
if (childProps.children) {
|
||||||
|
return React.cloneElement(child, {
|
||||||
|
...childProps,
|
||||||
|
children: cloneChildrenWithFocusHandler(childProps.children, focusHandler),
|
||||||
|
} as any);
|
||||||
|
}
|
||||||
|
|
||||||
|
return child;
|
||||||
|
});
|
||||||
|
}
|
||||||
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>
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
|
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>1.0.3</string>
|
<string>1.0.2</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleURLTypes</key>
|
<key>CFBundleURLTypes</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
|
||||||
|
|||||||
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;
|
||||||
|
};
|
||||||
@@ -3,13 +3,13 @@ import {
|
|||||||
BadgeCustom,
|
BadgeCustom,
|
||||||
CenterCustom,
|
CenterCustom,
|
||||||
Grid,
|
Grid,
|
||||||
|
OS_Wrapper,
|
||||||
SearchInput,
|
SearchInput,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
TextCustom,
|
TextCustom,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import AdminBasicBox from "@/components/_ShareComponent/Admin/AdminBasicBox";
|
import AdminBasicBox from "@/components/_ShareComponent/Admin/AdminBasicBox";
|
||||||
import AdminComp_BoxTitle from "@/components/_ShareComponent/Admin/BoxTitlePage";
|
import AdminComp_BoxTitle from "@/components/_ShareComponent/Admin/BoxTitlePage";
|
||||||
import NewWrapper from "@/components/_ShareComponent/NewWrapper";
|
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
import { PAGINATION_DEFAULT_TAKE } from "@/constants/constans-value";
|
import { PAGINATION_DEFAULT_TAKE } from "@/constants/constans-value";
|
||||||
import { createPaginationComponents } from "@/helpers/paginationHelpers";
|
import { createPaginationComponents } from "@/helpers/paginationHelpers";
|
||||||
@@ -101,7 +101,7 @@ export function Admin_ScreenUserAccess() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<NewWrapper
|
<OS_Wrapper
|
||||||
headerComponent={
|
headerComponent={
|
||||||
<AdminComp_BoxTitle
|
<AdminComp_BoxTitle
|
||||||
title="User Access"
|
title="User Access"
|
||||||
|
|||||||
@@ -3,12 +3,11 @@ import {
|
|||||||
ButtonCustom,
|
ButtonCustom,
|
||||||
DrawerCustom,
|
DrawerCustom,
|
||||||
LoaderCustom,
|
LoaderCustom,
|
||||||
NewWrapper,
|
OS_Wrapper,
|
||||||
Spacing,
|
Spacing,
|
||||||
TextAreaCustom,
|
TextAreaCustom,
|
||||||
TextCustom,
|
TextCustom,
|
||||||
TextInputCustom,
|
TextInputCustom,
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import CustomSkeleton from "@/components/_ShareComponent/SkeletonCustom";
|
import CustomSkeleton from "@/components/_ShareComponent/SkeletonCustom";
|
||||||
import AlertWarning from "@/components/Alert/AlertWarning";
|
import AlertWarning from "@/components/Alert/AlertWarning";
|
||||||
@@ -193,7 +192,7 @@ export default function DetailForum() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<NewWrapper
|
<OS_Wrapper
|
||||||
// headerComponent={headerComponent()}
|
// headerComponent={headerComponent()}
|
||||||
>
|
>
|
||||||
{!data && !listComment ? (
|
{!data && !listComment ? (
|
||||||
@@ -225,7 +224,7 @@ export default function DetailForum() {
|
|||||||
))}
|
))}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</NewWrapper>
|
</OS_Wrapper>
|
||||||
|
|
||||||
{/* Posting Drawer */}
|
{/* Posting Drawer */}
|
||||||
<DrawerCustom
|
<DrawerCustom
|
||||||
|
|||||||
@@ -3,13 +3,12 @@ import {
|
|||||||
ButtonCustom,
|
ButtonCustom,
|
||||||
DrawerCustom,
|
DrawerCustom,
|
||||||
LoaderCustom,
|
LoaderCustom,
|
||||||
NewWrapper,
|
OS_Wrapper,
|
||||||
Spacing,
|
Spacing,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
TextAreaCustom,
|
TextAreaCustom,
|
||||||
TextCustom,
|
TextCustom,
|
||||||
TextInputCustom,
|
TextInputCustom,
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import CustomSkeleton from "@/components/_ShareComponent/SkeletonCustom";
|
import CustomSkeleton from "@/components/_ShareComponent/SkeletonCustom";
|
||||||
import AlertWarning from "@/components/Alert/AlertWarning";
|
import AlertWarning from "@/components/Alert/AlertWarning";
|
||||||
@@ -34,6 +33,7 @@ import _ from "lodash";
|
|||||||
import { useCallback, useEffect, useState } from "react";
|
import { useCallback, useEffect, useState } from "react";
|
||||||
import { RefreshControl } from "react-native";
|
import { RefreshControl } from "react-native";
|
||||||
import ListSkeletonComponent from "@/components/_ShareComponent/ListSkeletonComponent";
|
import ListSkeletonComponent from "@/components/_ShareComponent/ListSkeletonComponent";
|
||||||
|
import { PADDING_INLINE } from "@/constants/constans-value";
|
||||||
|
|
||||||
export default function DetailForum2() {
|
export default function DetailForum2() {
|
||||||
const { id } = useLocalSearchParams();
|
const { id } = useLocalSearchParams();
|
||||||
@@ -213,20 +213,6 @@ export default function DetailForum2() {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
// !data || !commentPagination.listData ? (
|
|
||||||
// // <ListSkeletonComponent height={120} />
|
|
||||||
// <LoaderCustom />
|
|
||||||
// ) : (
|
|
||||||
// <Forum_CommentarBoxSection
|
|
||||||
// key={item.id}
|
|
||||||
// data={item}
|
|
||||||
// onSetData={(value) => {
|
|
||||||
// setCommentId(value.setCommentId);
|
|
||||||
// setOpenDrawerCommentar(value.setOpenDrawer);
|
|
||||||
// setCommentAuthorId(value.setCommentAuthorId);
|
|
||||||
// }}
|
|
||||||
// />
|
|
||||||
// );
|
|
||||||
|
|
||||||
// Generate pagination components using helper
|
// Generate pagination components using helper
|
||||||
const { ListEmptyComponent, ListFooterComponent } =
|
const { ListEmptyComponent, ListFooterComponent } =
|
||||||
@@ -242,8 +228,9 @@ export default function DetailForum2() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<NewWrapper
|
<OS_Wrapper
|
||||||
// headerComponent={}
|
contentPadding={PADDING_INLINE}
|
||||||
|
disableFlexGrow
|
||||||
listData={commentPagination.listData}
|
listData={commentPagination.listData}
|
||||||
renderItem={renderCommentItem}
|
renderItem={renderCommentItem}
|
||||||
refreshControl={
|
refreshControl={
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import {
|
import {
|
||||||
BackButton,
|
BackButton,
|
||||||
AvatarComp,
|
AvatarComp,
|
||||||
ViewWrapper,
|
OS_Wrapper,
|
||||||
SearchInput,
|
SearchInput,
|
||||||
FloatingButton,
|
FloatingButton,
|
||||||
LoaderCustom,
|
LoaderCustom,
|
||||||
@@ -71,7 +71,7 @@ export default function Forum_ViewBeranda() {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<ViewWrapper
|
<OS_Wrapper
|
||||||
headerComponent={
|
headerComponent={
|
||||||
<SearchInput
|
<SearchInput
|
||||||
placeholder="Cari topik diskusi"
|
placeholder="Cari topik diskusi"
|
||||||
@@ -107,7 +107,7 @@ export default function Forum_ViewBeranda() {
|
|||||||
/>
|
/>
|
||||||
))
|
))
|
||||||
)}
|
)}
|
||||||
</ViewWrapper>
|
</OS_Wrapper>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,11 +6,11 @@ import {
|
|||||||
LoaderCustom,
|
LoaderCustom,
|
||||||
SearchInput,
|
SearchInput,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
TextCustom, // ← gunakan NewWrapper yang sudah diperbaiki
|
TextCustom,
|
||||||
|
OS_Wrapper,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
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 { useAuth } from "@/hooks/use-auth";
|
import { useAuth } from "@/hooks/use-auth";
|
||||||
import Forum_BoxDetailSection from "@/screens/Forum/DiscussionBoxSection";
|
import Forum_BoxDetailSection from "@/screens/Forum/DiscussionBoxSection";
|
||||||
import { apiForumGetAll } from "@/service/api-client/api-forum";
|
import { apiForumGetAll } from "@/service/api-client/api-forum";
|
||||||
@@ -172,8 +172,8 @@ export default function Forum_ViewBeranda2() {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{/* 🔹 NewWrapper dalam mode list */}
|
{/* 🔹 OS_Wrapper dalam mode list */}
|
||||||
<NewWrapper
|
<OS_Wrapper
|
||||||
// Header global (di atas FlatList, sticky)
|
// Header global (di atas FlatList, sticky)
|
||||||
headerComponent={
|
headerComponent={
|
||||||
<View style={{ paddingHorizontal: 16, paddingTop: 8 }}>
|
<View style={{ paddingHorizontal: 16, paddingTop: 8 }}>
|
||||||
|
|||||||
@@ -2,11 +2,12 @@ import {
|
|||||||
AvatarComp,
|
AvatarComp,
|
||||||
BackButton,
|
BackButton,
|
||||||
FloatingButton,
|
FloatingButton,
|
||||||
|
OS_Wrapper,
|
||||||
SearchInput,
|
SearchInput,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import NewWrapper from "@/components/_ShareComponent/NewWrapper";
|
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
|
import { 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";
|
||||||
@@ -75,12 +76,6 @@ export default function Forum_ViewBeranda3() {
|
|||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
||||||
// const ListHeaderComponent = (
|
|
||||||
// <View style={{ paddingVertical: 8, alignItems: "center" }}>
|
|
||||||
// <TextCustom>Diskusi Terbaru</TextCustom>
|
|
||||||
// </View>
|
|
||||||
// );
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
@@ -105,8 +100,9 @@ export default function Forum_ViewBeranda3() {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<NewWrapper
|
<OS_Wrapper
|
||||||
hideFooter
|
hideFooter
|
||||||
|
contentPadding={PADDING_INLINE}
|
||||||
headerComponent={
|
headerComponent={
|
||||||
<View style={{ paddingTop: 8 }}>
|
<View style={{ paddingTop: 8 }}>
|
||||||
<SearchInput
|
<SearchInput
|
||||||
|
|||||||
@@ -7,9 +7,9 @@ import {
|
|||||||
FloatingButton,
|
FloatingButton,
|
||||||
Grid,
|
Grid,
|
||||||
LoaderCustom,
|
LoaderCustom,
|
||||||
|
OS_Wrapper,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
TextCustom,
|
TextCustom,
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import { useAuth } from "@/hooks/use-auth";
|
import { useAuth } from "@/hooks/use-auth";
|
||||||
import Forum_BoxDetailSection from "@/screens/Forum/DiscussionBoxSection";
|
import Forum_BoxDetailSection from "@/screens/Forum/DiscussionBoxSection";
|
||||||
@@ -66,7 +66,7 @@ export default function View_Forumku() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ViewWrapper
|
<OS_Wrapper
|
||||||
floatingButton={
|
floatingButton={
|
||||||
user?.id === id && (
|
user?.id === id && (
|
||||||
<FloatingButton
|
<FloatingButton
|
||||||
@@ -121,7 +121,7 @@ export default function View_Forumku() {
|
|||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
</ViewWrapper>
|
</OS_Wrapper>
|
||||||
|
|
||||||
{/* Drawer Komponen Eksternal */}
|
{/* Drawer Komponen Eksternal */}
|
||||||
<DrawerCustom
|
<DrawerCustom
|
||||||
|
|||||||
@@ -6,11 +6,11 @@ import {
|
|||||||
FloatingButton,
|
FloatingButton,
|
||||||
Grid,
|
Grid,
|
||||||
LoaderCustom,
|
LoaderCustom,
|
||||||
|
OS_Wrapper,
|
||||||
Spacing,
|
Spacing,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
TextCustom,
|
TextCustom,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import NewWrapper from "@/components/_ShareComponent/NewWrapper";
|
|
||||||
import NoDataText from "@/components/_ShareComponent/NoDataText";
|
import NoDataText from "@/components/_ShareComponent/NoDataText";
|
||||||
import CustomSkeleton from "@/components/_ShareComponent/SkeletonCustom";
|
import CustomSkeleton from "@/components/_ShareComponent/SkeletonCustom";
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
@@ -24,6 +24,7 @@ import { router, useLocalSearchParams } from "expo-router";
|
|||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { RefreshControl, View } from "react-native";
|
import { RefreshControl, View } from "react-native";
|
||||||
|
import { PADDING_INLINE } from "@/constants/constans-value";
|
||||||
|
|
||||||
export default function View_Forumku2() {
|
export default function View_Forumku2() {
|
||||||
const { id } = useLocalSearchParams();
|
const { id } = useLocalSearchParams();
|
||||||
@@ -120,7 +121,8 @@ export default function View_Forumku2() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<NewWrapper
|
<OS_Wrapper
|
||||||
|
contentPadding={PADDING_INLINE}
|
||||||
floatingButton={
|
floatingButton={
|
||||||
user?.id === id && (
|
user?.id === id && (
|
||||||
<FloatingButton
|
<FloatingButton
|
||||||
|
|||||||
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>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -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}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
/* eslint-disable react-hooks/exhaustive-deps */
|
/* eslint-disable react-hooks/exhaustive-deps */
|
||||||
import { BaseBox, LoaderCustom, TextCustom, ViewWrapper } from "@/components";
|
import { BaseBox, LoaderCustom, OS_Wrapper, TextCustom } from "@/components";
|
||||||
import { useAuth } from "@/hooks/use-auth";
|
import { useAuth } from "@/hooks/use-auth";
|
||||||
import { apiJobGetAll } from "@/service/api-client/api-job";
|
import { apiJobGetAll } from "@/service/api-client/api-job";
|
||||||
import { useFocusEffect } from "expo-router";
|
import { useFocusEffect } 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_ScreenArchive() {
|
export default function Job_ScreenArchive() {
|
||||||
const { user } = useAuth();
|
const { user } = useAuth();
|
||||||
@@ -33,7 +34,7 @@ export default function Job_ScreenArchive() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ViewWrapper hideFooter>
|
<OS_Wrapper hideFooter contentPadding={PADDING_INLINE}>
|
||||||
{isLoadData ? (
|
{isLoadData ? (
|
||||||
<LoaderCustom />
|
<LoaderCustom />
|
||||||
) : _.isEmpty(listData) ? (
|
) : _.isEmpty(listData) ? (
|
||||||
@@ -52,6 +53,6 @@ export default function Job_ScreenArchive() {
|
|||||||
</BaseBox>
|
</BaseBox>
|
||||||
))
|
))
|
||||||
)}
|
)}
|
||||||
</ViewWrapper>
|
</OS_Wrapper>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/* eslint-disable react-hooks/exhaustive-deps */
|
/* eslint-disable react-hooks/exhaustive-deps */
|
||||||
import { BaseBox, TextCustom, ViewWrapper } from "@/components";
|
import { BaseBox, OS_Wrapper, TextCustom } from "@/components";
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
import { createPaginationComponents } from "@/helpers/paginationHelpers";
|
import { createPaginationComponents } from "@/helpers/paginationHelpers";
|
||||||
import { useAuth } from "@/hooks/use-auth";
|
import { useAuth } from "@/hooks/use-auth";
|
||||||
@@ -9,8 +9,7 @@ import { useFocusEffect } from "expo-router";
|
|||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { RefreshControl } from "react-native";
|
import { RefreshControl } from "react-native";
|
||||||
import NewWrapper from "@/components/_ShareComponent/NewWrapper";
|
import { PAGINATION_DEFAULT_TAKE, PADDING_INLINE } from "@/constants/constans-value";
|
||||||
import { PAGINATION_DEFAULT_TAKE } from "@/constants/constans-value";
|
|
||||||
|
|
||||||
export default function Job_ScreenArchive2() {
|
export default function Job_ScreenArchive2() {
|
||||||
const { user } = useAuth();
|
const { user } = useAuth();
|
||||||
@@ -56,7 +55,7 @@ export default function Job_ScreenArchive2() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<NewWrapper
|
<OS_Wrapper
|
||||||
listData={pagination.listData}
|
listData={pagination.listData}
|
||||||
renderItem={renderJobItem}
|
renderItem={renderJobItem}
|
||||||
refreshControl={
|
refreshControl={
|
||||||
@@ -71,6 +70,7 @@ export default function Job_ScreenArchive2() {
|
|||||||
ListEmptyComponent={ListEmptyComponent}
|
ListEmptyComponent={ListEmptyComponent}
|
||||||
ListFooterComponent={ListFooterComponent}
|
ListFooterComponent={ListFooterComponent}
|
||||||
hideFooter
|
hideFooter
|
||||||
|
contentPadding={PADDING_INLINE}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,16 +3,17 @@ import {
|
|||||||
BoxWithHeaderSection,
|
BoxWithHeaderSection,
|
||||||
FloatingButton,
|
FloatingButton,
|
||||||
LoaderCustom,
|
LoaderCustom,
|
||||||
|
OS_Wrapper,
|
||||||
SearchInput,
|
SearchInput,
|
||||||
Spacing,
|
Spacing,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
TextCustom,
|
TextCustom,
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import { apiJobGetAll } from "@/service/api-client/api-job";
|
import { apiJobGetAll } from "@/service/api-client/api-job";
|
||||||
import { router, useFocusEffect } from "expo-router";
|
import { router, useFocusEffect } 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_ScreenBeranda() {
|
export default function Job_ScreenBeranda() {
|
||||||
const [listData, setListData] = useState<any[]>([]);
|
const [listData, setListData] = useState<any[]>([]);
|
||||||
@@ -43,8 +44,9 @@ export default function Job_ScreenBeranda() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ViewWrapper
|
<OS_Wrapper
|
||||||
hideFooter
|
hideFooter
|
||||||
|
contentPadding={PADDING_INLINE}
|
||||||
floatingButton={
|
floatingButton={
|
||||||
<FloatingButton onPress={() => router.push("/job/create")} />
|
<FloatingButton onPress={() => router.push("/job/create")} />
|
||||||
}
|
}
|
||||||
@@ -78,6 +80,6 @@ export default function Job_ScreenBeranda() {
|
|||||||
))
|
))
|
||||||
)}
|
)}
|
||||||
<Spacing />
|
<Spacing />
|
||||||
</ViewWrapper>
|
</OS_Wrapper>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,11 +2,11 @@ import {
|
|||||||
AvatarUsernameAndOtherComponent,
|
AvatarUsernameAndOtherComponent,
|
||||||
BoxWithHeaderSection,
|
BoxWithHeaderSection,
|
||||||
FloatingButton,
|
FloatingButton,
|
||||||
|
OS_Wrapper,
|
||||||
SearchInput,
|
SearchInput,
|
||||||
Spacing,
|
Spacing,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
TextCustom,
|
TextCustom,
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
import { createPaginationComponents } from "@/helpers/paginationHelpers";
|
import { createPaginationComponents } from "@/helpers/paginationHelpers";
|
||||||
@@ -16,8 +16,7 @@ import { router, useFocusEffect } from "expo-router";
|
|||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { RefreshControl, View } from "react-native";
|
import { RefreshControl, View } from "react-native";
|
||||||
import NewWrapper from "@/components/_ShareComponent/NewWrapper";
|
import { PAGINATION_DEFAULT_TAKE, PADDING_INLINE } from "@/constants/constans-value";
|
||||||
import { PAGINATION_DEFAULT_TAKE } from "@/constants/constans-value";
|
|
||||||
|
|
||||||
const PAGE_SIZE = 10;
|
const PAGE_SIZE = 10;
|
||||||
|
|
||||||
@@ -74,8 +73,9 @@ export default function Job_ScreenBeranda2() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<NewWrapper
|
<OS_Wrapper
|
||||||
hideFooter
|
hideFooter
|
||||||
|
contentPadding={PADDING_INLINE}
|
||||||
headerComponent={
|
headerComponent={
|
||||||
<View style={{ paddingTop: 8 }}>
|
<View style={{ paddingTop: 8 }}>
|
||||||
<SearchInput
|
<SearchInput
|
||||||
|
|||||||
184
screens/Job/ScreenJobCreate.tsx
Normal file
184
screens/Job/ScreenJobCreate.tsx
Normal file
@@ -0,0 +1,184 @@
|
|||||||
|
import {
|
||||||
|
BoxButtonOnFooter,
|
||||||
|
ButtonCenteredOnly,
|
||||||
|
ButtonCustom,
|
||||||
|
InformationBox,
|
||||||
|
LandscapeFrameUploaded,
|
||||||
|
OS_Wrapper,
|
||||||
|
Spacing,
|
||||||
|
StackCustom,
|
||||||
|
TextAreaCustom,
|
||||||
|
TextInputCustom,
|
||||||
|
} from "@/components";
|
||||||
|
import DIRECTORY_ID from "@/constants/directory-id";
|
||||||
|
import { PADDING_INLINE } from "@/constants/constans-value";
|
||||||
|
import { useAuth } from "@/hooks/use-auth";
|
||||||
|
import { apiJobCreate } from "@/service/api-client/api-job";
|
||||||
|
import { uploadFileService } from "@/service/upload-service";
|
||||||
|
import pickImage from "@/utils/pickImage";
|
||||||
|
import { router } from "expo-router";
|
||||||
|
import { useState } from "react";
|
||||||
|
import { View } from "react-native";
|
||||||
|
import Toast from "react-native-toast-message";
|
||||||
|
|
||||||
|
interface JobCreateData {
|
||||||
|
title: string;
|
||||||
|
content: string;
|
||||||
|
deskripsi: string;
|
||||||
|
authorId: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function Job_ScreenCreate() {
|
||||||
|
const nextUrl = "/(application)/(user)/job/(tabs)/status?status=review";
|
||||||
|
const { user } = useAuth();
|
||||||
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
|
const [image, setImage] = useState<string | null>(null);
|
||||||
|
const [data, setData] = useState<JobCreateData>({
|
||||||
|
title: "",
|
||||||
|
content: "",
|
||||||
|
deskripsi: "",
|
||||||
|
authorId: "",
|
||||||
|
});
|
||||||
|
|
||||||
|
const handlerOnSubmit = async () => {
|
||||||
|
let imageId = "";
|
||||||
|
const newData = {
|
||||||
|
title: data.title,
|
||||||
|
content: data.content,
|
||||||
|
deskripsi: data.deskripsi,
|
||||||
|
authorId: user?.id,
|
||||||
|
imageId: "",
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!data.title || !data.content || !data.deskripsi || !user?.id) {
|
||||||
|
Toast.show({
|
||||||
|
type: "info",
|
||||||
|
text1: "Info",
|
||||||
|
text2: "Harap isi semua data",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
setIsLoading(true);
|
||||||
|
|
||||||
|
if (image === null || !image) {
|
||||||
|
const response = await apiJobCreate(newData);
|
||||||
|
if (response.success) {
|
||||||
|
Toast.show({
|
||||||
|
type: "success",
|
||||||
|
text1: "Berhasil",
|
||||||
|
text2: "Lowongan berhasil dibuat",
|
||||||
|
});
|
||||||
|
router.replace(nextUrl);
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const responseUploadImage = await uploadFileService({
|
||||||
|
imageUri: image,
|
||||||
|
dirId: DIRECTORY_ID.job_image,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (responseUploadImage.success) {
|
||||||
|
imageId = responseUploadImage.data.id;
|
||||||
|
}
|
||||||
|
|
||||||
|
const fixData = {
|
||||||
|
...newData,
|
||||||
|
imageId: imageId,
|
||||||
|
};
|
||||||
|
|
||||||
|
const response = await apiJobCreate(fixData);
|
||||||
|
if (response.success) {
|
||||||
|
Toast.show({
|
||||||
|
type: "success",
|
||||||
|
text1: "Berhasil",
|
||||||
|
text2: "Lowongan berhasil dibuat",
|
||||||
|
});
|
||||||
|
router.replace(nextUrl);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR]", error);
|
||||||
|
} finally {
|
||||||
|
setIsLoading(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const buttonSubmit = () => {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<BoxButtonOnFooter>
|
||||||
|
<ButtonCustom isLoading={isLoading} onPress={() => handlerOnSubmit()}>
|
||||||
|
Simpan
|
||||||
|
</ButtonCustom>
|
||||||
|
</BoxButtonOnFooter>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<OS_Wrapper
|
||||||
|
enableKeyboardHandling
|
||||||
|
keyboardScrollOffset={10}
|
||||||
|
// contentPadding={PADDING_INLINE}
|
||||||
|
contentPaddingBottom={250}
|
||||||
|
footerComponent={buttonSubmit()}
|
||||||
|
>
|
||||||
|
<StackCustom gap={"xs"}>
|
||||||
|
<InformationBox text="Poster atau gambar lowongan kerja bersifat opsional, tidak wajib untuk dimasukkan dan upload lah gambar yang sesuai dengan deskripsi lowongan kerja." />
|
||||||
|
|
||||||
|
<LandscapeFrameUploaded image={image as string} />
|
||||||
|
<ButtonCenteredOnly
|
||||||
|
onPress={() => {
|
||||||
|
pickImage({
|
||||||
|
setImageUri: setImage,
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
icon="upload"
|
||||||
|
>
|
||||||
|
Upload
|
||||||
|
</ButtonCenteredOnly>
|
||||||
|
|
||||||
|
<Spacing />
|
||||||
|
|
||||||
|
<View onStartShouldSetResponder={() => true}>
|
||||||
|
<TextInputCustom
|
||||||
|
label="Judul Lowongan"
|
||||||
|
placeholder="Masukan Judul Lowongan Kerja"
|
||||||
|
required
|
||||||
|
value={data.title}
|
||||||
|
onChangeText={(value) => setData({ ...data, title: value })}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<View onStartShouldSetResponder={() => true}>
|
||||||
|
<TextAreaCustom
|
||||||
|
label="Syarat & Kualifikasi"
|
||||||
|
placeholder="Masukan Syarat & Kualifikasi Lowongan Kerja"
|
||||||
|
required
|
||||||
|
showCount
|
||||||
|
maxLength={1000}
|
||||||
|
value={data.content}
|
||||||
|
onChangeText={(value) => setData({ ...data, content: value })}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<View onStartShouldSetResponder={() => true}>
|
||||||
|
<TextAreaCustom
|
||||||
|
label="Deskripsi Lowongan"
|
||||||
|
placeholder="Masukan Deskripsi Lowongan Kerja"
|
||||||
|
required
|
||||||
|
showCount
|
||||||
|
maxLength={1000}
|
||||||
|
value={data.deskripsi}
|
||||||
|
onChangeText={(value) => setData({ ...data, deskripsi: value })}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
|
||||||
|
</StackCustom>
|
||||||
|
</OS_Wrapper>
|
||||||
|
);
|
||||||
|
}
|
||||||
210
screens/Job/ScreenJobEdit.tsx
Normal file
210
screens/Job/ScreenJobEdit.tsx
Normal file
@@ -0,0 +1,210 @@
|
|||||||
|
/* eslint-disable react-hooks/exhaustive-deps */
|
||||||
|
import {
|
||||||
|
BaseBox,
|
||||||
|
BoxButtonOnFooter,
|
||||||
|
ButtonCenteredOnly,
|
||||||
|
ButtonCustom,
|
||||||
|
DummyLandscapeImage,
|
||||||
|
InformationBox,
|
||||||
|
LandscapeFrameUploaded,
|
||||||
|
LoaderCustom,
|
||||||
|
OS_Wrapper,
|
||||||
|
Spacing,
|
||||||
|
StackCustom,
|
||||||
|
TextAreaCustom,
|
||||||
|
TextInputCustom,
|
||||||
|
} from "@/components";
|
||||||
|
import DIRECTORY_ID from "@/constants/directory-id";
|
||||||
|
import { PADDING_INLINE } from "@/constants/constans-value";
|
||||||
|
import { apiJobGetOne, apiJobUpdateData } from "@/service/api-client/api-job";
|
||||||
|
import { deleteFileService, uploadFileService } from "@/service/upload-service";
|
||||||
|
import pickImage from "@/utils/pickImage";
|
||||||
|
import { router, useLocalSearchParams } from "expo-router";
|
||||||
|
import { useEffect, useState } from "react";
|
||||||
|
import { View } from "react-native";
|
||||||
|
import Toast from "react-native-toast-message";
|
||||||
|
|
||||||
|
export function Job_ScreenEdit() {
|
||||||
|
const { id } = useLocalSearchParams();
|
||||||
|
const [data, setData] = useState<any>({
|
||||||
|
title: "",
|
||||||
|
content: "",
|
||||||
|
deskripsi: "",
|
||||||
|
});
|
||||||
|
const [isLoadData, setIsLoadData] = useState(false);
|
||||||
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
|
|
||||||
|
const [imageUri, setImageUri] = useState<string | null>(null);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
onLoadData();
|
||||||
|
}, [id]);
|
||||||
|
|
||||||
|
const onLoadData = async () => {
|
||||||
|
try {
|
||||||
|
setIsLoadData(true);
|
||||||
|
const response = await apiJobGetOne({ id: id as string });
|
||||||
|
if (response.success) {
|
||||||
|
setData(response.data);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR]", error);
|
||||||
|
} finally {
|
||||||
|
setIsLoadData(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handlerOnUpdate = async () => {
|
||||||
|
if (!data.title || !data.content || !data.deskripsi) {
|
||||||
|
Toast.show({
|
||||||
|
type: "info",
|
||||||
|
text1: "Info",
|
||||||
|
text2: "Harap isi semua data",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
setIsLoading(true);
|
||||||
|
let newImageId = "";
|
||||||
|
|
||||||
|
if (imageUri) {
|
||||||
|
const responseUploadImage = await uploadFileService({
|
||||||
|
imageUri: imageUri,
|
||||||
|
dirId: DIRECTORY_ID.job_image,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (responseUploadImage.success) {
|
||||||
|
newImageId = responseUploadImage.data.id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data?.imageId) {
|
||||||
|
const responseDeleteImage = await deleteFileService({
|
||||||
|
id: data.imageId,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!responseDeleteImage.success) {
|
||||||
|
console.log("[ERROR DELETE IMAGE]", responseDeleteImage.message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const newData = {
|
||||||
|
title: data.title,
|
||||||
|
content: data.content,
|
||||||
|
deskripsi: data.deskripsi,
|
||||||
|
imageId: newImageId,
|
||||||
|
};
|
||||||
|
|
||||||
|
const response = await apiJobUpdateData({
|
||||||
|
id: id as string,
|
||||||
|
data: newData,
|
||||||
|
category: "edit",
|
||||||
|
});
|
||||||
|
|
||||||
|
if (response.success) {
|
||||||
|
Toast.show({
|
||||||
|
type: "success",
|
||||||
|
text1: response.message,
|
||||||
|
});
|
||||||
|
router.back();
|
||||||
|
} else {
|
||||||
|
Toast.show({
|
||||||
|
type: "info",
|
||||||
|
text1: "Info",
|
||||||
|
text2: response.message,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR]", error);
|
||||||
|
} finally {
|
||||||
|
setIsLoading(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const buttonSubmit = () => {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<BoxButtonOnFooter>
|
||||||
|
<ButtonCustom isLoading={isLoading} onPress={() => handlerOnUpdate()}>
|
||||||
|
Update
|
||||||
|
</ButtonCustom>
|
||||||
|
</BoxButtonOnFooter>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<OS_Wrapper
|
||||||
|
enableKeyboardHandling
|
||||||
|
keyboardScrollOffset={100}
|
||||||
|
contentPaddingBottom={250}
|
||||||
|
footerComponent={buttonSubmit()}
|
||||||
|
>
|
||||||
|
{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 />
|
||||||
|
|
||||||
|
<View onStartShouldSetResponder={() => true}>
|
||||||
|
<TextInputCustom
|
||||||
|
label="Judul Lowongan"
|
||||||
|
placeholder="Masukan Judul Lowongan Kerja"
|
||||||
|
required
|
||||||
|
value={data.title}
|
||||||
|
onChangeText={(value) => setData({ ...data, title: value })}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<View onStartShouldSetResponder={() => true}>
|
||||||
|
<TextAreaCustom
|
||||||
|
label="Syarat & Kualifikasi"
|
||||||
|
placeholder="Masukan Syarat & Kualifikasi Lowongan Kerja"
|
||||||
|
required
|
||||||
|
showCount
|
||||||
|
maxLength={1000}
|
||||||
|
value={data.content}
|
||||||
|
onChangeText={(value) => setData({ ...data, content: value })}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
<View onStartShouldSetResponder={() => true}>
|
||||||
|
<TextAreaCustom
|
||||||
|
label="Deskripsi Lowongan"
|
||||||
|
placeholder="Masukan Deskripsi Lowongan Kerja"
|
||||||
|
required
|
||||||
|
showCount
|
||||||
|
maxLength={1000}
|
||||||
|
value={data.deskripsi}
|
||||||
|
onChangeText={(value) => setData({ ...data, deskripsi: value })}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
|
||||||
|
{buttonSubmit()}
|
||||||
|
</StackCustom>
|
||||||
|
)}
|
||||||
|
</OS_Wrapper>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
import NewWrapper from "@/components/_ShareComponent/NewWrapper";
|
|
||||||
import {
|
import {
|
||||||
BoxButtonOnFooter,
|
BoxButtonOnFooter,
|
||||||
ButtonCustom,
|
ButtonCustom,
|
||||||
@@ -8,6 +7,7 @@ import {
|
|||||||
TextInputCustom,
|
TextInputCustom,
|
||||||
LandscapeFrameUploaded,
|
LandscapeFrameUploaded,
|
||||||
ButtonCenteredOnly,
|
ButtonCenteredOnly,
|
||||||
|
OS_Wrapper,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import { MapSelectedPlatform } from "@/components/Map/MapSelectedPlatform";
|
import { MapSelectedPlatform } from "@/components/Map/MapSelectedPlatform";
|
||||||
import DIRECTORY_ID from "@/constants/directory-id";
|
import DIRECTORY_ID from "@/constants/directory-id";
|
||||||
@@ -142,10 +142,14 @@ export function Maps_ScreenMapsCreate() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Render screen dengan NewWrapper
|
* Render screen dengan OS_Wrapper
|
||||||
*/
|
*/
|
||||||
return (
|
return (
|
||||||
<NewWrapper footerComponent={buttonFooter}>
|
<OS_Wrapper
|
||||||
|
enableKeyboardHandling
|
||||||
|
contentPaddingBottom={250}
|
||||||
|
footerComponent={buttonFooter}
|
||||||
|
>
|
||||||
<InformationBox text="Tentukan lokasi pin map dengan menekan pada map." />
|
<InformationBox text="Tentukan lokasi pin map dengan menekan pada map." />
|
||||||
|
|
||||||
<BaseBox>
|
<BaseBox>
|
||||||
@@ -179,7 +183,7 @@ export function Maps_ScreenMapsCreate() {
|
|||||||
</ButtonCenteredOnly>
|
</ButtonCenteredOnly>
|
||||||
|
|
||||||
<Spacing height={50} />
|
<Spacing height={50} />
|
||||||
</NewWrapper>
|
</OS_Wrapper>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import {
|
|||||||
LandscapeFrameUploaded,
|
LandscapeFrameUploaded,
|
||||||
Spacing,
|
Spacing,
|
||||||
TextInputCustom,
|
TextInputCustom,
|
||||||
ViewWrapper,
|
OS_Wrapper,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import CustomSkeleton from "@/components/_ShareComponent/SkeletonCustom";
|
import CustomSkeleton from "@/components/_ShareComponent/SkeletonCustom";
|
||||||
import { MapSelectedPlatform } from "@/components/Map/MapSelectedPlatform";
|
import { MapSelectedPlatform } from "@/components/Map/MapSelectedPlatform";
|
||||||
@@ -166,7 +166,11 @@ export function Maps_ScreenMapsEdit() {
|
|||||||
: defaultRegion;
|
: defaultRegion;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ViewWrapper footerComponent={buttonFooter}>
|
<OS_Wrapper
|
||||||
|
enableKeyboardHandling
|
||||||
|
contentPaddingBottom={250}
|
||||||
|
footerComponent={buttonFooter}
|
||||||
|
>
|
||||||
<InformationBox text="Tentukan lokasi pin map dengan menekan pada map." />
|
<InformationBox text="Tentukan lokasi pin map dengan menekan pada map." />
|
||||||
|
|
||||||
{/* <MapSelectedPlatform
|
{/* <MapSelectedPlatform
|
||||||
@@ -223,6 +227,6 @@ export function Maps_ScreenMapsEdit() {
|
|||||||
Upload
|
Upload
|
||||||
</ButtonCenteredOnly>
|
</ButtonCenteredOnly>
|
||||||
<Spacing height={50} />
|
<Spacing height={50} />
|
||||||
</ViewWrapper>
|
</OS_Wrapper>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import {
|
|||||||
ButtonCenteredOnly,
|
ButtonCenteredOnly,
|
||||||
CenterCustom,
|
CenterCustom,
|
||||||
InformationBox,
|
InformationBox,
|
||||||
NewWrapper,
|
OS_Wrapper,
|
||||||
PhoneInputCustom,
|
PhoneInputCustom,
|
||||||
SelectCustom,
|
SelectCustom,
|
||||||
Spacing,
|
Spacing,
|
||||||
@@ -142,7 +142,9 @@ export function ScreenPortofolioCreate() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<NewWrapper
|
<OS_Wrapper
|
||||||
|
enableKeyboardHandling
|
||||||
|
contentPaddingBottom={250}
|
||||||
footerComponent={
|
footerComponent={
|
||||||
<Portofolio_ButtonCreate
|
<Portofolio_ButtonCreate
|
||||||
id={id as string}
|
id={id as string}
|
||||||
@@ -362,6 +364,6 @@ export function ScreenPortofolioCreate() {
|
|||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
</NewWrapper>
|
</OS_Wrapper>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { NewWrapper, TextCustom } from "@/components";
|
import { OS_Wrapper, TextCustom } from "@/components";
|
||||||
import CustomSkeleton from "@/components/_ShareComponent/SkeletonCustom";
|
import CustomSkeleton from "@/components/_ShareComponent/SkeletonCustom";
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
import { usePagination } from "@/hooks/use-pagination";
|
import { usePagination } from "@/hooks/use-pagination";
|
||||||
@@ -9,7 +9,7 @@ import { useCallback } from "react";
|
|||||||
import { RefreshControl } from "react-native";
|
import { RefreshControl } from "react-native";
|
||||||
import Portofolio_BoxView from "./BoxPortofolioView";
|
import Portofolio_BoxView from "./BoxPortofolioView";
|
||||||
import NoDataText from "@/components/_ShareComponent/NoDataText";
|
import NoDataText from "@/components/_ShareComponent/NoDataText";
|
||||||
import { PAGINATION_DEFAULT_TAKE } from "@/constants/constans-value";
|
import { PADDING_INLINE, PAGINATION_DEFAULT_TAKE } from "@/constants/constans-value";
|
||||||
|
|
||||||
export default function ViewListPortofolio() {
|
export default function ViewListPortofolio() {
|
||||||
const { id } = useLocalSearchParams();
|
const { id } = useLocalSearchParams();
|
||||||
@@ -19,9 +19,9 @@ export default function ViewListPortofolio() {
|
|||||||
fetchFunction: async (page) => {
|
fetchFunction: async (page) => {
|
||||||
return await apiGetPortofolio({
|
return await apiGetPortofolio({
|
||||||
id: id as string,
|
id: id as string,
|
||||||
page: String(page) // API expects string
|
page: String(page), // API expects string
|
||||||
});
|
});
|
||||||
// return response.data;
|
// return response.data;
|
||||||
},
|
},
|
||||||
pageSize: PAGINATION_DEFAULT_TAKE,
|
pageSize: PAGINATION_DEFAULT_TAKE,
|
||||||
dependencies: [id],
|
dependencies: [id],
|
||||||
@@ -41,18 +41,20 @@ export default function ViewListPortofolio() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
// Generate pagination components using helper
|
// Generate pagination components using helper
|
||||||
const { ListEmptyComponent, ListFooterComponent } = createPaginationComponents({
|
const { ListEmptyComponent, ListFooterComponent } =
|
||||||
loading: pagination.loading,
|
createPaginationComponents({
|
||||||
refreshing: pagination.refreshing,
|
loading: pagination.loading,
|
||||||
listData: pagination.listData,
|
refreshing: pagination.refreshing,
|
||||||
isInitialLoad: pagination.isInitialLoad,
|
listData: pagination.listData,
|
||||||
emptyMessage: "Tidak ada portofolio",
|
isInitialLoad: pagination.isInitialLoad,
|
||||||
skeletonCount: 3,
|
emptyMessage: "Tidak ada portofolio",
|
||||||
skeletonHeight: 100,
|
skeletonCount: 3,
|
||||||
});
|
skeletonHeight: 100,
|
||||||
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<NewWrapper
|
<OS_Wrapper
|
||||||
|
contentPadding={PADDING_INLINE}
|
||||||
listData={pagination.listData}
|
listData={pagination.listData}
|
||||||
renderItem={renderItem}
|
renderItem={renderItem}
|
||||||
refreshControl={
|
refreshControl={
|
||||||
|
|||||||
@@ -196,15 +196,15 @@ export const GStyles = StyleSheet.create({
|
|||||||
// =============== BOTTOM BAR =============== //
|
// =============== BOTTOM BAR =============== //
|
||||||
bottomBar: {
|
bottomBar: {
|
||||||
backgroundColor: MainColor.darkblue,
|
backgroundColor: MainColor.darkblue,
|
||||||
borderTopColor: AccentColor.blue,
|
borderTopColor: AccentColor.darkblue,
|
||||||
// borderTopWidth: 0.5,
|
borderTopWidth: 1,
|
||||||
height: "100%",
|
height: "100%",
|
||||||
justifyContent: "center",
|
justifyContent: "center",
|
||||||
shadowColor: AccentColor.blue,
|
shadowColor: AccentColor.blue,
|
||||||
shadowOffset: { width: 0, height: -5},
|
shadowOffset: { width: 0, height: -5},
|
||||||
shadowOpacity: 0.4,
|
shadowOpacity: 0.4,
|
||||||
shadowRadius: 40,
|
shadowRadius: 40,
|
||||||
elevation: 8, // untuk Android
|
// elevation: 8, // untuk Android
|
||||||
},
|
},
|
||||||
bottomBarContainer: {
|
bottomBarContainer: {
|
||||||
paddingHorizontal: 25,
|
paddingHorizontal: 25,
|
||||||
|
|||||||
58
tasks/README.md
Normal file
58
tasks/README.md
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
# Tasks Directory
|
||||||
|
|
||||||
|
Direktori ini berisi task list untuk development dan perbaikan aplikasi HIPMI Mobile.
|
||||||
|
|
||||||
|
## 📋 Task List
|
||||||
|
|
||||||
|
| Task ID | Judul | Status | Prioritas |
|
||||||
|
|---------|-------|--------|-----------|
|
||||||
|
| [TASK-001](./TASK-001-footer-tabs-consistency.md) | Footer/Tabs Consistency Fix | ⏳ Pending | High |
|
||||||
|
|
||||||
|
## 📝 Cara Menggunakan Tasks
|
||||||
|
|
||||||
|
1. **Lihat task yang tersedia** di daftar atas
|
||||||
|
2. **Review task** untuk memahami scope dan acceptance criteria
|
||||||
|
3. **Kerjakan task** sesuai sub-tasks yang terdaftar
|
||||||
|
4. **Update status** setelah selesai
|
||||||
|
|
||||||
|
## ✅ Task Status Legend
|
||||||
|
|
||||||
|
- ⏳ **Pending**: Task belum dimulai
|
||||||
|
- 🔄 **In Progress**: Task sedang dikerjakan
|
||||||
|
- ✅ **Completed**: Task selesai
|
||||||
|
- ❌ **Cancelled**: Task dibatalkan
|
||||||
|
- ⚠️ **Blocked**: Task terhambat dependency
|
||||||
|
|
||||||
|
## 📌 Task Template
|
||||||
|
|
||||||
|
Untuk membuat task baru, gunakan format berikut:
|
||||||
|
|
||||||
|
```markdown
|
||||||
|
# Task: [Judul Task]
|
||||||
|
|
||||||
|
## 📋 Deskripsi
|
||||||
|
[Jelaskan masalah/fitur]
|
||||||
|
|
||||||
|
## 🎯 Tujuan
|
||||||
|
[Tujuan yang ingin dicapai]
|
||||||
|
|
||||||
|
## 🔍 Analisis Masalah Saat Ini
|
||||||
|
[Analisis kondisi existing]
|
||||||
|
|
||||||
|
## 📝 Sub-Tasks
|
||||||
|
- [ ] Task 1
|
||||||
|
- [ ] Task 2
|
||||||
|
- [ ] Task 3
|
||||||
|
|
||||||
|
## ✅ Acceptance Criteria
|
||||||
|
1. [Criteria 1]
|
||||||
|
2. [Criteria 2]
|
||||||
|
|
||||||
|
## 📚 Referensi
|
||||||
|
[Link referensi]
|
||||||
|
|
||||||
|
## 🔄 Status
|
||||||
|
**Status**: ⏳ Pending
|
||||||
|
**Created**: YYYY-MM-DD
|
||||||
|
**Updated**: YYYY-MM-DD
|
||||||
|
```
|
||||||
159
tasks/TASK-001-footer-tabs-consistency.md
Normal file
159
tasks/TASK-001-footer-tabs-consistency.md
Normal file
@@ -0,0 +1,159 @@
|
|||||||
|
# Task: Footer/Tabs Consistency Fix
|
||||||
|
|
||||||
|
## 📋 Deskripsi
|
||||||
|
|
||||||
|
Memperbaiki masalah footer/tabs yang tidak konsisten di Android, terutama pada perangkat dengan navigasi button di bagian bawah.
|
||||||
|
|
||||||
|
## 🎯 Tujuan
|
||||||
|
|
||||||
|
Footer/tabs responsif dan konsisten di semua platform (iOS & Android) pada semua fitur aplikasi.
|
||||||
|
|
||||||
|
## 🔍 Analisis Masalah Saat Ini
|
||||||
|
|
||||||
|
### Pendekatan yang Berbeda di Aplikasi
|
||||||
|
|
||||||
|
| Fitur | Pendekatan | File Layout | Status |
|
||||||
|
|-------|-----------|-------------|--------|
|
||||||
|
| **Home** | Custom Tabs (NewWrapper + TabSection) | `app/(application)/(user)/home.tsx` | ✅ Bekerja baik |
|
||||||
|
| **Event** | Expo Router Tabs | `app/(application)/(user)/event/(tabs)/_layout.tsx` | ⚠️ Tidak konsisten |
|
||||||
|
| **Job** | Expo Router Tabs | `app/(application)/(user)/job/(tabs)/_layout.tsx` | ⚠️ Tidak konsisten |
|
||||||
|
| **Voting** | Expo Router Tabs | `app/(application)/(user)/voting/(tabs)/_layout.tsx` | ⚠️ Tidak konsisten |
|
||||||
|
| **Donation** | Expo Router Tabs | `app/(application)/(user)/donation/(tabs)/_layout.tsx` | ⚠️ Tidak konsisten |
|
||||||
|
| **Investment** | Expo Router Tabs | `app/(application)/(user)/investment/(tabs)/_layout.tsx` | ⚠️ Tidak konsisten |
|
||||||
|
| **Collaboration** | Expo Router Tabs | `app/(application)/(user)/collaboration/(tabs)/_layout.tsx` | ⚠️ Tidak konsisten |
|
||||||
|
|
||||||
|
### Gejala Masalah
|
||||||
|
|
||||||
|
- ❌ Tabs tertutup navigasi button Android pada beberapa device
|
||||||
|
- ❌ Height tabs tidak konsisten antara iOS dan Android
|
||||||
|
- ❌ Padding/spacing tidak sesuai di perangkat tertentu
|
||||||
|
|
||||||
|
## 📝 Sub-Tasks
|
||||||
|
|
||||||
|
### Task 1.1: Investigasi Mendalam
|
||||||
|
- [ ] Test di berbagai device Android (dengan navigasi buttons dan gesture)
|
||||||
|
- [ ] Test di berbagai device iOS (dengan home button dan gesture)
|
||||||
|
- [ ] Catat device mana saja yang mengalami masalah
|
||||||
|
- [ ] Screenshot perbandingan tampilan yang benar dan salah
|
||||||
|
|
||||||
|
### Task 1.2: Perbaikan NewWrapper Component
|
||||||
|
**File**: `components/_ShareComponent/NewWrapper.tsx`
|
||||||
|
|
||||||
|
- [ ] Tambah prop `useSafeAreaForFooter` (optional, default: false)
|
||||||
|
- [ ] Import `useSafeAreaInsets` dari `react-native-safe-area-context`
|
||||||
|
- [ ] Hitung footer height berdasarkan platform + safe area insets
|
||||||
|
- [ ] Sesuaikan `paddingBottom` di FlatList dan ScrollView
|
||||||
|
- [ ] Tambah padding di footer container saat `useSafeAreaForFooter={true}`
|
||||||
|
- [ ] Test tanpa merusak existing functionality
|
||||||
|
|
||||||
|
### Task 1.3: Perbaikan TabSection Component
|
||||||
|
**File**: `screens/Home/tabSection.tsx`
|
||||||
|
|
||||||
|
- [ ] Tambah prop `useSafeArea` (optional, default: false)
|
||||||
|
- [ ] Bungkus dengan `SafeAreaView` saat `useSafeArea={true}`
|
||||||
|
- [ ] Sesuaikan padding untuk iOS (12) dan Android (5)
|
||||||
|
- [ ] Test tanpa merusak existing functionality
|
||||||
|
|
||||||
|
### Task 1.4: Update Home Screen
|
||||||
|
**File**: `app/(application)/(user)/home.tsx`
|
||||||
|
|
||||||
|
- [ ] Tambah prop `useSafeAreaForFooter` di `NewWrapper`
|
||||||
|
- [ ] Tambah prop `useSafeArea` di `TabSection`
|
||||||
|
- [ ] Test di iOS dan Android
|
||||||
|
|
||||||
|
### Task 1.5: Review Expo Router Tabs Configuration
|
||||||
|
**File**: `styles/tabs-styles.ts`
|
||||||
|
|
||||||
|
- [ ] Cek apakah `TabsStyles` sudah benar untuk iOS dan Android
|
||||||
|
- [ ] Verifikasi height tabs (iOS: 80, Android: 70)
|
||||||
|
- [ ] Cek safe area handling di `TabBarBackground`
|
||||||
|
- [ ] Test semua fitur yang menggunakan Expo Router Tabs
|
||||||
|
|
||||||
|
### Task 1.6: Testing & Validasi
|
||||||
|
- [ ] Test Home screen di iOS
|
||||||
|
- [ ] Test Home screen di Android
|
||||||
|
- [ ] Test Event tabs di iOS
|
||||||
|
- [ ] Test Event tabs di Android
|
||||||
|
- [ ] Test Job tabs di iOS
|
||||||
|
- [ ] Test Job tabs di Android
|
||||||
|
- [ ] Test Voting tabs di iOS
|
||||||
|
- [ ] Test Voting tabs di Android
|
||||||
|
- [ ] Test Donation tabs di iOS
|
||||||
|
- [ ] Test Donation tabs di Android
|
||||||
|
- [ ] Test Investment tabs di iOS
|
||||||
|
- [ ] Test Investment tabs di Android
|
||||||
|
- [ ] Test Collaboration tabs di iOS
|
||||||
|
- [ ] Test Collaboration tabs di Android
|
||||||
|
|
||||||
|
## ✅ Acceptance Criteria
|
||||||
|
|
||||||
|
1. **Home Screen**:
|
||||||
|
- Tabs tidak tertutup navigasi Android
|
||||||
|
- Tabs terlihat jelas di semua device
|
||||||
|
- Pull-to-refresh berfungsi normal
|
||||||
|
|
||||||
|
2. **Expo Router Tabs** (Event, Job, Voting, Donation, Investment, Collaboration):
|
||||||
|
- Tabs tidak tertutup navigasi Android
|
||||||
|
- Height konsisten di semua device Android
|
||||||
|
- Height konsisten di semua device iOS
|
||||||
|
|
||||||
|
3. **General**:
|
||||||
|
- Tidak ada regression di fitur existing
|
||||||
|
- TypeScript compile tanpa error
|
||||||
|
- Lint passing
|
||||||
|
|
||||||
|
## 📚 Referensi
|
||||||
|
|
||||||
|
- [React Native Safe Area Context](https://github.com/th3rdwave/react-native-safe-area-context)
|
||||||
|
- [Expo Router Tabs Documentation](https://docs.expo.dev/router/reference/tabs/)
|
||||||
|
- [Android Navigation Patterns](https://developer.android.com/guide/navigation)
|
||||||
|
|
||||||
|
## 📝 Notes
|
||||||
|
|
||||||
|
- **Prioritas**: Task 1.2, 1.3, 1.4 (untuk Home screen)
|
||||||
|
- **Low Priority**: Task 1.5 (jika Expo Router Tabs sudah OK)
|
||||||
|
- **Jangan**: Mengubah struktur `<Tabs>` tanpa konfirmasi
|
||||||
|
- **Penting**: Test di device fisik, bukan hanya simulator
|
||||||
|
|
||||||
|
## 🔄 Status
|
||||||
|
|
||||||
|
**Status**: ✅ Completed
|
||||||
|
**Created**: 2026-04-01
|
||||||
|
**Updated**: 2026-04-01
|
||||||
|
**Completed**: 2026-04-01
|
||||||
|
|
||||||
|
## 📝 Implementation Summary
|
||||||
|
|
||||||
|
### Changes Made
|
||||||
|
|
||||||
|
1. **NewWrapper Component** (`components/_ShareComponent/NewWrapper.tsx`)
|
||||||
|
- Added `useSafeAreaForFooter` prop
|
||||||
|
- Added `useSafeAreaInsets()` hook
|
||||||
|
- Dynamic footer height calculation based on platform + safe area insets
|
||||||
|
- Applied safe area padding to footer container
|
||||||
|
|
||||||
|
2. **TabSection Component** (`screens/Home/tabSection.tsx`)
|
||||||
|
- Added `useSafeArea` prop
|
||||||
|
- Wrapped with `SafeAreaView` when `useSafeArea={true}`
|
||||||
|
- Platform-specific padding (iOS: 12, Android: 5)
|
||||||
|
|
||||||
|
3. **Home Screen** (`app/(application)/(user)/home.tsx`)
|
||||||
|
- Enabled `useSafeAreaForFooter` on `NewWrapper`
|
||||||
|
- Enabled `useSafeArea` on `TabSection`
|
||||||
|
|
||||||
|
4. **Expo Router Tabs** (`styles/tabs-styles.ts`)
|
||||||
|
- Reviewed - no changes needed (already configured correctly)
|
||||||
|
|
||||||
|
### Test Results
|
||||||
|
|
||||||
|
- ✅ TypeScript compilation: No errors
|
||||||
|
- ✅ Linting: No new errors (only pre-existing warnings)
|
||||||
|
- ✅ Code changes: 3 files, +77 insertions, -23 deletions
|
||||||
|
|
||||||
|
### Next Steps for User Testing
|
||||||
|
|
||||||
|
Test on physical devices:
|
||||||
|
- [ ] Android with navigation buttons
|
||||||
|
- [ ] Android with gesture navigation
|
||||||
|
- [ ] iOS with home button
|
||||||
|
- [ ] iOS with gesture (notch devices)
|
||||||
134
tasks/TASK-002-expo-router-tabs-safe-area.md
Normal file
134
tasks/TASK-002-expo-router-tabs-safe-area.md
Normal file
@@ -0,0 +1,134 @@
|
|||||||
|
# Task: TASK-002 - Expo Router Tabs Safe Area Fix
|
||||||
|
|
||||||
|
## 📋 Deskripsi
|
||||||
|
|
||||||
|
Expo Router Tabs di beberapa fitur (Event, Job, Voting, Donation, Investment) tertutup oleh navigation buttons Android pada device tertentu.
|
||||||
|
|
||||||
|
## 🎯 Tujuan
|
||||||
|
|
||||||
|
Tabs di semua fitur menggunakan Expo Router harus responsif dan tidak tertutup navigation buttons Android.
|
||||||
|
|
||||||
|
## 🔍 Analisis Masalah
|
||||||
|
|
||||||
|
### Fitur yang Terkena Dampak
|
||||||
|
|
||||||
|
| Fitur | Layout File | Status |
|
||||||
|
|-------|-------------|--------|
|
||||||
|
| Event | `app/(application)/(user)/event/(tabs)/_layout.tsx` | ❌ Tidak responsif |
|
||||||
|
| Job | `app/(application)/(user)/job/(tabs)/_layout.tsx` | ❌ Tidak responsif |
|
||||||
|
| Voting | `app/(application)/(user)/voting/(tabs)/_layout.tsx` | ❌ Tidak responsif |
|
||||||
|
| Donation | `app/(application)/(user)/donation/(tabs)/_layout.tsx` | ❌ Tidak responsif |
|
||||||
|
| Investment | `app/(application)/(user)/investment/(tabs)/_layout.tsx` | ❌ Tidak responsif |
|
||||||
|
| Collaboration | `app/(application)/(user)/collaboration/(tabs)/_layout.tsx` | ❌ Tidak responsif |
|
||||||
|
|
||||||
|
### Root Cause
|
||||||
|
|
||||||
|
`TabsStyles` di `styles/tabs-styles.ts` tidak menghormati safe area insets Android dengan benar.
|
||||||
|
|
||||||
|
## 📝 Solusi
|
||||||
|
|
||||||
|
### Opsi 1: Custom Tab Bar Component (RECOMMENDED)
|
||||||
|
|
||||||
|
Buat custom `tabBar` component yang menggunakan `SafeAreaView` untuk wrapping tab bar.
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
// styles/tabs-styles.ts
|
||||||
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
||||||
|
|
||||||
|
export function CustomTabBar(props: any) {
|
||||||
|
const insets = useSafeAreaInsets();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<View style={{
|
||||||
|
paddingBottom: insets.bottom,
|
||||||
|
backgroundColor: MainColor.darkblue
|
||||||
|
}}>
|
||||||
|
<BottomTabBar {...props} />
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Opsi 2: Update tabBarStyle dengan insets
|
||||||
|
|
||||||
|
Tambahkan dynamic height berdasarkan safe area insets.
|
||||||
|
|
||||||
|
## ✅ Acceptance Criteria
|
||||||
|
|
||||||
|
1. Tabs tidak tertutup navigation buttons Android
|
||||||
|
2. Tabs height konsisten di semua device
|
||||||
|
3. Tidak ada regression di iOS
|
||||||
|
4. Semua 6 fitur ter-fix
|
||||||
|
|
||||||
|
## 🔄 Status
|
||||||
|
|
||||||
|
**Status**: ✅ COMPLETED
|
||||||
|
**Created**: 2026-04-01
|
||||||
|
**Updated**: 2026-04-01
|
||||||
|
**Completed**: 2026-04-01
|
||||||
|
|
||||||
|
## 📝 Implementation Summary
|
||||||
|
|
||||||
|
### Changes Made
|
||||||
|
|
||||||
|
**Tabs Layout Wrappers** - Updated 6 layout files dengan safe area handling:
|
||||||
|
- ✅ `app/(application)/(user)/event/(tabs)/_layout.tsx`
|
||||||
|
- ✅ `app/(application)/(user)/job/(tabs)/_layout.tsx`
|
||||||
|
- ✅ `app/(application)/(user)/voting/(tabs)/_layout.tsx`
|
||||||
|
- ✅ `app/(application)/(user)/donation/(tabs)/_layout.tsx`
|
||||||
|
- ✅ `app/(application)/(user)/investment/(tabs)/_layout.tsx`
|
||||||
|
- ✅ `app/(application)/(user)/collaboration/(tabs)/_layout.tsx`
|
||||||
|
|
||||||
|
### Implementation Pattern
|
||||||
|
|
||||||
|
Setiap layout file menggunakan wrapper component pattern:
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
function TabsWrapper() {
|
||||||
|
const insets = useSafeAreaInsets();
|
||||||
|
const paddingBottom = Platform.OS === "android" ? insets.bottom : 0;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<View style={{ flex: 1, backgroundColor: MainColor.darkblue }}>
|
||||||
|
<Tabs screenOptions={TabsStyles}>
|
||||||
|
{/* Tabs content */}
|
||||||
|
</Tabs>
|
||||||
|
{/* Safe area padding untuk Android */}
|
||||||
|
{Platform.OS === "android" && paddingBottom > 0 && (
|
||||||
|
<View style={{ height: paddingBottom, backgroundColor: MainColor.darkblue }} />
|
||||||
|
)}
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Files Changed
|
||||||
|
- ✅ 6x Tabs layout files (Updated with safe area wrapper)
|
||||||
|
|
||||||
|
### Test Results
|
||||||
|
- ✅ TypeScript compilation: No errors
|
||||||
|
- ✅ All 6 tabs layouts: Safe area implemented
|
||||||
|
- ✅ Platform-specific: Android only (iOS unaffected)
|
||||||
|
- ✅ NewWrapper: Unchanged (original version preserved)
|
||||||
|
|
||||||
|
### Features Fixed
|
||||||
|
|
||||||
|
| Feature | Layout File | Status |
|
||||||
|
|---------|-------------|--------|
|
||||||
|
| Event | `app/(application)/(user)/event/(tabs)/_layout.tsx` | ✅ Fixed |
|
||||||
|
| Job | `app/(application)/(user)/job/(tabs)/_layout.tsx` | ✅ Fixed |
|
||||||
|
| Voting | `app/(application)/(user)/voting/(tabs)/_layout.tsx` | ✅ Fixed |
|
||||||
|
| Donation | `app/(application)/(user)/donation/(tabs)/_layout.tsx` | ✅ Fixed |
|
||||||
|
| Investment | `app/(application)/(user)/investment/(tabs)/_layout.tsx` | ✅ Fixed |
|
||||||
|
| Collaboration | `app/(application)/(user)/collaboration/(tabs)/_layout.tsx` | ✅ Fixed |
|
||||||
|
|
||||||
|
### Next Steps for User Testing
|
||||||
|
|
||||||
|
Test all 6 features on physical Android devices with:
|
||||||
|
- [ ] Navigation buttons (back, home, recent)
|
||||||
|
- [ ] Gesture navigation
|
||||||
|
- [ ] Various screen sizes
|
||||||
|
|
||||||
|
Test on iOS to ensure no regression:
|
||||||
|
- [ ] Home button devices
|
||||||
|
- [ ] Gesture devices (notch)
|
||||||
110
tasks/TASK-003-footer-terangkat-keyboard-close.md
Normal file
110
tasks/TASK-003-footer-terangkat-keyboard-close.md
Normal file
@@ -0,0 +1,110 @@
|
|||||||
|
# Task: TASK-003 - Footer Terangkat Saat Keyboard Close
|
||||||
|
|
||||||
|
## 📋 Deskripsi
|
||||||
|
|
||||||
|
Bug: Setelah input ke text input dan menutup keyboard, bagian bawah layar berwarna putih seakan footer terangkat.
|
||||||
|
|
||||||
|
## 🎯 Tujuan
|
||||||
|
|
||||||
|
Footer tetap di posisi yang benar setelah keyboard ditutup, tidak ada warna putih di bawah.
|
||||||
|
|
||||||
|
## 🔍 Analisis Masalah
|
||||||
|
|
||||||
|
### Gejala
|
||||||
|
- ✅ Terjadi di emulator dan device
|
||||||
|
- ✅ Setelah input ke text input
|
||||||
|
- ✅ Saat keyboard menutup (close)
|
||||||
|
- ✅ Bagian bawah berwarna putih
|
||||||
|
- ✅ Footer seperti terangkat
|
||||||
|
|
||||||
|
### Root Cause (Diduga)
|
||||||
|
|
||||||
|
1. **KeyboardAvoidingView behavior**
|
||||||
|
- `behavior={Platform.OS === "ios" ? "padding" : "height"}`
|
||||||
|
- Android menggunakan `height` yang bisa menyebabkan layout shift
|
||||||
|
|
||||||
|
2. **Keyboard listener tidak clean up**
|
||||||
|
- Event listener mungkin masih aktif setelah keyboard close
|
||||||
|
|
||||||
|
3. **Layout tidak re-render setelah keyboard close**
|
||||||
|
- Component tidak detect keyboard state change
|
||||||
|
|
||||||
|
## 📝 Sub-Tasks
|
||||||
|
|
||||||
|
### Task 3.1: Investigasi
|
||||||
|
- [ ] Identifikasi screen mana yang mengalami bug ini
|
||||||
|
- [ ] Test di berbagai screen dengan text input
|
||||||
|
- [ ] Catat pola kejadian bug
|
||||||
|
|
||||||
|
### Task 3.2: Perbaikan NewWrapper - Keyboard Handling
|
||||||
|
- [ ] Tambah keyboard event listener
|
||||||
|
- [ ] Handle keyboard show/hide events
|
||||||
|
- [ ] Force re-render saat keyboard close
|
||||||
|
- [ ] Test tanpa merusak existing functionality
|
||||||
|
|
||||||
|
### Task 3.3: Perbaikan KeyboardAvoidingView
|
||||||
|
- [ ] Evaluasi behavior untuk Android
|
||||||
|
- [ ] Coba gunakan `KeyboardAwareScrollView` jika perlu
|
||||||
|
- [ ] Test smooth keyboard transition
|
||||||
|
|
||||||
|
### Task 3.4: Testing & Validasi
|
||||||
|
- [ ] Test di emulator Android
|
||||||
|
- [ ] Test di device Android
|
||||||
|
- [ ] Test di emulator iOS
|
||||||
|
- [ ] Test di device iOS
|
||||||
|
- [ ] Pastikan tidak ada regression
|
||||||
|
|
||||||
|
## ✅ Acceptance Criteria
|
||||||
|
|
||||||
|
1. **Footer tetap di posisi** setelah keyboard close
|
||||||
|
2. **Tidak ada warna putih** di bagian bawah
|
||||||
|
3. **Keyboard transition smooth** (no lag)
|
||||||
|
4. **Input tetap berfungsi** normal
|
||||||
|
5. **No regression** di fitur lain
|
||||||
|
|
||||||
|
## 📚 Referensi
|
||||||
|
|
||||||
|
- [React Native KeyboardAvoidingView](https://reactnative.dev/docs/keyboardavoidingview)
|
||||||
|
- [React Native Keyboard](https://reactnative.dev/docs/keyboard)
|
||||||
|
- [KeyboardAwareScrollView](https://github.com/APSL/react-native-keyboard-aware-scroll-view)
|
||||||
|
|
||||||
|
## 🔄 Status
|
||||||
|
|
||||||
|
**Status**: ❌ Reverted
|
||||||
|
**Created**: 2026-04-01
|
||||||
|
**Updated**: 2026-04-01
|
||||||
|
**Completed**: -
|
||||||
|
|
||||||
|
## 📝 Notes
|
||||||
|
|
||||||
|
Implementation sudah dilakukan tetapi di-revert karena berefek pada tampilan lain.
|
||||||
|
Perlu pendekatan yang berbeda untuk fix bug ini.
|
||||||
|
|
||||||
|
### Root Cause (Identified)
|
||||||
|
|
||||||
|
1. **Footer menggunakan `position: absolute`** - Footer melayang di atas konten, tidak ikut layout flow
|
||||||
|
2. **`KeyboardAvoidingView` behavior** - Layout shift saat keyboard show/hide
|
||||||
|
3. **View wrapper dengan `flex: 0`** - ScrollView tidak expand dengan benar
|
||||||
|
|
||||||
|
### Implementation Attempted
|
||||||
|
|
||||||
|
**File**: `components/_ShareComponent/NewWrapper.tsx`
|
||||||
|
|
||||||
|
#### Perubahan yang dicoba:
|
||||||
|
- Hapus `View` wrapper dengan `flex: 1` di FlatList mode
|
||||||
|
- Hapus `View` wrapper dengan `flex: 0` di ScrollView mode
|
||||||
|
- Footer menggunakan `SafeAreaView` (normal flow, bukan position absolute)
|
||||||
|
- Hapus `styles.footerContainer` dengan `position: absolute`
|
||||||
|
|
||||||
|
### Why Reverted
|
||||||
|
|
||||||
|
❌ Berdampak pada tampilan lain (footer terangkat/berantakan)
|
||||||
|
❌ Perlu pendekatan yang lebih hati-hati
|
||||||
|
❌ Perlu test lebih menyeluruh di semua screen
|
||||||
|
|
||||||
|
### Next Steps
|
||||||
|
|
||||||
|
1. **Analisis lebih detail** - Cek screen mana saja yang affected
|
||||||
|
2. **Pendekatan bertahap** - Fix per screen atau per type
|
||||||
|
3. **Test menyeluruh** - Pastikan tidak ada regression
|
||||||
|
4. **Alternative solution** - Mungkin perlu custom keyboard handling
|
||||||
344
tasks/TASK-004-newwrapper-migration.md
Normal file
344
tasks/TASK-004-newwrapper-migration.md
Normal file
@@ -0,0 +1,344 @@
|
|||||||
|
# TASK-004: NewWrapper_V2 Gradual Migration
|
||||||
|
|
||||||
|
## 📋 Deskripsi
|
||||||
|
|
||||||
|
Migrasi bertahap dari `NewWrapper` ke `NewWrapper_V2` untuk memperbaiki bug keyboard handling (footer terangkat, area putih, input terpotong).
|
||||||
|
|
||||||
|
## 🎯 Tujuan
|
||||||
|
|
||||||
|
1. Replace `NewWrapper` → `NewWrapper_V2` secara bertahap
|
||||||
|
2. Fix keyboard handling issues di semua form screens
|
||||||
|
3. Zero breaking changes dengan gradual migration
|
||||||
|
4. Clean up test components yang tidak diperlukan
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📊 Migration Priority
|
||||||
|
|
||||||
|
### **Phase 1: Job Screens** (Week 1) - CURRENT
|
||||||
|
- [x] `screens/Job/ScreenJobCreate2.tsx` → Already using keyboard handling
|
||||||
|
- [ ] `screens/Job/ScreenJobCreate.tsx` → Migrate to NewWrapper_V2
|
||||||
|
- [ ] `screens/Job/ScreenJobEdit.tsx` → Migrate to NewWrapper_V2
|
||||||
|
- [ ] Delete test files after migration
|
||||||
|
|
||||||
|
### **Phase 2: Event & Profile Screens** (Week 2)
|
||||||
|
- [ ] `screens/Event/ScreenEventCreate.tsx`
|
||||||
|
- [ ] `screens/Event/ScreenEventEdit.tsx`
|
||||||
|
- [ ] `screens/Profile/ScreenProfileCreate.tsx`
|
||||||
|
- [ ] `screens/Profile/ScreenProfileEdit.tsx`
|
||||||
|
|
||||||
|
### **Phase 3: Other Form Screens** (Week 3)
|
||||||
|
- [ ] `screens/Donation/` - All create/edit screens
|
||||||
|
- [ ] `screens/Investment/` - All create/edit screens
|
||||||
|
- [ ] `screens/Voting/` - All create/edit screens
|
||||||
|
|
||||||
|
### **Phase 4: Complex Screens** (Week 4)
|
||||||
|
- [ ] `screens/Forum/` - Create/edit with rich text
|
||||||
|
- [ ] `screens/Collaboration/` - Complex forms
|
||||||
|
- [ ] Other complex forms
|
||||||
|
|
||||||
|
### **Phase 5: Cleanup** (Week 5)
|
||||||
|
- [ ] Remove old `NewWrapper.tsx` (or deprecate)
|
||||||
|
- [ ] Rename `NewWrapper_V2.tsx` → `NewWrapper.tsx`
|
||||||
|
- [ ] Update documentation
|
||||||
|
- [ ] Delete test components
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🔧 Task Details
|
||||||
|
|
||||||
|
### **Task 4.1: Job Screens Migration** ✅ IN PROGRESS
|
||||||
|
|
||||||
|
**Files to migrate:**
|
||||||
|
1. `screens/Job/ScreenJobCreate.tsx`
|
||||||
|
2. `screens/Job/ScreenJobEdit.tsx`
|
||||||
|
|
||||||
|
**Changes per file:**
|
||||||
|
```typescript
|
||||||
|
// BEFORE
|
||||||
|
import { NewWrapper } from "@/components";
|
||||||
|
|
||||||
|
<NewWrapper footerComponent={buttonSubmit()}>
|
||||||
|
<TextInputCustom label="..." />
|
||||||
|
</NewWrapper>
|
||||||
|
|
||||||
|
// AFTER
|
||||||
|
import { NewWrapper_V2 } from "@/components";
|
||||||
|
|
||||||
|
<NewWrapper_V2
|
||||||
|
enableKeyboardHandling
|
||||||
|
keyboardScrollOffset={100}
|
||||||
|
footerComponent={buttonSubmit()}
|
||||||
|
>
|
||||||
|
<View onStartShouldSetResponder={() => true}>
|
||||||
|
<TextInputCustom label="..." />
|
||||||
|
</View>
|
||||||
|
</NewWrapper_V2>
|
||||||
|
```
|
||||||
|
|
||||||
|
**Checklist per screen:**
|
||||||
|
- [ ] Replace `NewWrapper` → `NewWrapper_V2`
|
||||||
|
- [ ] Add `enableKeyboardHandling` prop
|
||||||
|
- [ ] Wrap all TextInput/TextArea with `View onStartShouldSetResponder`
|
||||||
|
- [ ] Test on Android (navigation buttons)
|
||||||
|
- [ ] Test on Android (gesture)
|
||||||
|
- [ ] Test on iOS
|
||||||
|
- [ ] Verify auto-scroll works
|
||||||
|
- [ ] Verify footer stays in place
|
||||||
|
- [ ] Verify no white area
|
||||||
|
|
||||||
|
**Cleanup after migration:**
|
||||||
|
- [ ] Delete `screens/Job/ScreenJobCreate2.tsx` (test file)
|
||||||
|
- [ ] Delete `screens/Job/ScreenJobEdit2.tsx` (test file)
|
||||||
|
- [ ] Update app routes if needed
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### **Task 4.2: Delete Test Components**
|
||||||
|
|
||||||
|
**Files to delete:**
|
||||||
|
- [ ] `components/_ShareComponent/TestWrapper.tsx`
|
||||||
|
- [ ] `components/_ShareComponent/TestKeyboardInput.tsx`
|
||||||
|
- [ ] `app/(application)/(user)/test-keyboard.tsx`
|
||||||
|
- [ ] `app/(application)/(user)/test-keyboard-bug.tsx`
|
||||||
|
|
||||||
|
**Keep (useful):**
|
||||||
|
- ✅ `components/_ShareComponent/FormWrapper.tsx` (alternative wrapper)
|
||||||
|
- ✅ `hooks/useKeyboardForm.ts` (keyboard hook)
|
||||||
|
- ✅ `docs/KEYBOARD-BUG-TEST.md` (documentation)
|
||||||
|
- ✅ `docs/NEWWRAPPER-KEYBOARD-IMPLEMENTATION.md` (documentation)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### **Task 4.3: Update Documentation**
|
||||||
|
|
||||||
|
**Files to update:**
|
||||||
|
- [ ] `QWEN.md` - Update NewWrapper_V2 usage
|
||||||
|
- [ ] `docs/NEWWRAPPER-KEYBOARD-IMPLEMENTATION.md` - Mark as completed
|
||||||
|
- [ ] Create migration guide for team
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📝 Migration Guide (Per Screen)
|
||||||
|
|
||||||
|
### **Step 1: Import NewWrapper_V2**
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
// Change this:
|
||||||
|
import { NewWrapper } from "@/components";
|
||||||
|
|
||||||
|
// To this:
|
||||||
|
import { NewWrapper_V2 } from "@/components";
|
||||||
|
```
|
||||||
|
|
||||||
|
### **Step 2: Update Component Usage**
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
// Change this:
|
||||||
|
<NewWrapper footerComponent={buttonSubmit()}>
|
||||||
|
<StackCustom>
|
||||||
|
<TextInputCustom label="Judul" ... />
|
||||||
|
<TextAreaCustom label="Deskripsi" ... />
|
||||||
|
</StackCustom>
|
||||||
|
</NewWrapper>
|
||||||
|
|
||||||
|
// To this:
|
||||||
|
<NewWrapper_V2
|
||||||
|
enableKeyboardHandling
|
||||||
|
keyboardScrollOffset={100}
|
||||||
|
footerComponent={buttonSubmit()}
|
||||||
|
>
|
||||||
|
<StackCustom>
|
||||||
|
<View onStartShouldSetResponder={() => true}>
|
||||||
|
<TextInputCustom label="Judul" ... />
|
||||||
|
</View>
|
||||||
|
<View onStartShouldSetResponder={() => true}>
|
||||||
|
<TextAreaCustom label="Deskripsi" ... />
|
||||||
|
</View>
|
||||||
|
</StackCustom>
|
||||||
|
</NewWrapper_V2>
|
||||||
|
```
|
||||||
|
|
||||||
|
### **Step 3: Import View**
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
// Add this import if not already present:
|
||||||
|
import { View } from "react-native";
|
||||||
|
```
|
||||||
|
|
||||||
|
### **Step 4: Test**
|
||||||
|
|
||||||
|
1. Run app
|
||||||
|
2. Navigate to screen
|
||||||
|
3. Tap each input field
|
||||||
|
4. Verify auto-scroll works
|
||||||
|
5. Verify footer stays in place
|
||||||
|
6. Verify no white area
|
||||||
|
7. Test submit functionality
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🧪 Testing Checklist
|
||||||
|
|
||||||
|
### **For Each Migrated Screen:**
|
||||||
|
|
||||||
|
**Functional Tests:**
|
||||||
|
- [ ] All inputs focus correctly
|
||||||
|
- [ ] Keyboard shows when tapping input
|
||||||
|
- [ ] Auto-scroll to focused input
|
||||||
|
- [ ] Keyboard dismisses when tapping outside
|
||||||
|
- [ ] Footer stays at bottom
|
||||||
|
- [ ] No white area at bottom
|
||||||
|
- [ ] Submit button works
|
||||||
|
- [ ] Form validation works
|
||||||
|
- [ ] Data saves correctly
|
||||||
|
|
||||||
|
**Platform Tests:**
|
||||||
|
- [ ] Android with navigation buttons
|
||||||
|
- [ ] Android with gesture navigation
|
||||||
|
- [ ] iOS with home button
|
||||||
|
- [ ] iOS with gesture (notch)
|
||||||
|
- [ ] Different screen sizes
|
||||||
|
|
||||||
|
**Edge Cases:**
|
||||||
|
- [ ] Multiple inputs on screen
|
||||||
|
- [ ] Long content (scrollable)
|
||||||
|
- [ ] Loading state
|
||||||
|
- [ ] Error state
|
||||||
|
- [ ] Keyboard transition smooth
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📊 Progress Tracking
|
||||||
|
|
||||||
|
| Phase | Screens | Status | Completed Date |
|
||||||
|
|-------|---------|--------|----------------|
|
||||||
|
| **Phase 1: Job** | 6 screens | ✅ COMPLETED | 2026-04-01 |
|
||||||
|
| **Phase 2: Event & Profile** | 4 screens | ⏳ Pending | - |
|
||||||
|
| **Phase 3: Forms** | 6-8 screens | ⏳ Pending | - |
|
||||||
|
| **Phase 4: Complex** | 4-6 screens | ⏳ Pending | - |
|
||||||
|
| **Phase 5: Cleanup** | Cleanup | ⏳ Pending | - |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## ✅ Phase 1: COMPLETED!
|
||||||
|
|
||||||
|
**Migrated Screens:**
|
||||||
|
1. ✅ `screens/Job/ScreenJobCreate.tsx` - Form with keyboard handling
|
||||||
|
2. ✅ `screens/Job/ScreenJobEdit.tsx` - Form with keyboard handling
|
||||||
|
3. ✅ `screens/Job/ScreenBeranda2.tsx` - List (no keyboard handling needed)
|
||||||
|
4. ✅ `screens/Job/ScreenArchive2.tsx` - List (no keyboard handling needed)
|
||||||
|
5. ✅ `screens/Job/MainViewStatus2.tsx` - List (no keyboard handling needed)
|
||||||
|
6. ✅ `app/(application)/(user)/job/[id]/[status]/detail.tsx` - Detail (no keyboard handling needed)
|
||||||
|
|
||||||
|
**Test Files Deleted:**
|
||||||
|
- ❌ `screens/Job/ScreenJobCreate2.tsx`
|
||||||
|
- ❌ `screens/Job/ScreenJobEdit2.tsx`
|
||||||
|
- ❌ `components/_ShareComponent/TestWrapper.tsx`
|
||||||
|
- ❌ `components/_ShareComponent/TestKeyboardInput.tsx`
|
||||||
|
- ❌ `app/(application)/(user)/test-keyboard.tsx`
|
||||||
|
- ❌ `app/(application)/(user)/test-keyboard-bug.tsx`
|
||||||
|
|
||||||
|
**Routes Updated:**
|
||||||
|
- ✅ `app/(application)/(user)/job/create.tsx` → Uses ScreenJobCreate
|
||||||
|
- ✅ `app/(application)/(user)/job/[id]/edit.tsx` → Uses ScreenJobEdit
|
||||||
|
- ✅ `app/(application)/(user)/job/(tabs)/index.tsx` → Uses ScreenBeranda2
|
||||||
|
- ✅ `app/(application)/(user)/job/(tabs)/archive.tsx` → Uses ScreenArchive2
|
||||||
|
- ✅ `app/(application)/(user)/job/(tabs)/status.tsx` → Uses MainViewStatus2
|
||||||
|
- ✅ `app/(application)/(user)/job/[id]/[status]/detail.tsx` → Migrated to NewWrapper_V2
|
||||||
|
|
||||||
|
**Commits:**
|
||||||
|
- `a9ff755` - feat: Migrate Job screens to NewWrapper_V2
|
||||||
|
- `0f55244` - refactor: Cleanup test files and migrate Job Detail
|
||||||
|
- `7cb4f30` - refactor: Replace NewWrapper with NewWrapper_V2 for all Job screens
|
||||||
|
|
||||||
|
**Total:** 6 screens migrated, 6 test files deleted, 6 routes updated
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 🚀 Current Status
|
||||||
|
|
||||||
|
**Status**: 🟡 IN PROGRESS
|
||||||
|
**Current Phase**: Phase 1 - Job Screens
|
||||||
|
**Started**: 2026-04-01
|
||||||
|
**ETA**: 2026-04-07 (Phase 1 complete)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📞 Next Actions
|
||||||
|
|
||||||
|
1. **Immediate** (Today):
|
||||||
|
- [ ] Migrate `ScreenJobCreate.tsx`
|
||||||
|
- [ ] Migrate `ScreenJobEdit.tsx`
|
||||||
|
- [ ] Test both screens
|
||||||
|
|
||||||
|
2. **This Week**:
|
||||||
|
- [ ] Delete test files
|
||||||
|
- [ ] Document any issues
|
||||||
|
- [ ] Prepare Phase 2
|
||||||
|
|
||||||
|
3. **Next Week**:
|
||||||
|
- [ ] Start Phase 2 (Event & Profile)
|
||||||
|
- [ ] Review Phase 1 results
|
||||||
|
- [ ] Adjust migration guide if needed
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 📚 Related Files
|
||||||
|
|
||||||
|
**Components:**
|
||||||
|
- `components/_ShareComponent/NewWrapper.tsx` (Old)
|
||||||
|
- `components/_ShareComponent/NewWrapper_V2.tsx` (New)
|
||||||
|
- `hooks/useKeyboardForm.ts` (Keyboard hook)
|
||||||
|
|
||||||
|
**Documentation:**
|
||||||
|
- `docs/NEWWRAPPER-KEYBOARD-IMPLEMENTATION.md` (Full analysis)
|
||||||
|
- `docs/KEYBOARD-BUG-TEST.md` (Bug investigation)
|
||||||
|
- `tasks/TASK-004-newwrapper-migration.md` (This file)
|
||||||
|
|
||||||
|
**Screens to Migrate:**
|
||||||
|
- `screens/Job/ScreenJobCreate.tsx`
|
||||||
|
- `screens/Job/ScreenJobEdit.tsx`
|
||||||
|
- (More in subsequent phases)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## ⚠️ Risk Mitigation
|
||||||
|
|
||||||
|
**If issues found during migration:**
|
||||||
|
|
||||||
|
1. **Stop migration** for that screen
|
||||||
|
2. **Revert changes** if critical bug
|
||||||
|
3. **Document issue** in detail
|
||||||
|
4. **Fix NewWrapper_V2** if needed
|
||||||
|
5. **Resume migration** after fix
|
||||||
|
|
||||||
|
**Rollback plan:**
|
||||||
|
- Keep old `NewWrapper` until all screens migrated
|
||||||
|
- Easy to revert per screen
|
||||||
|
- No breaking changes to other screens
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## ✅ Success Criteria
|
||||||
|
|
||||||
|
**Phase 1 Complete when:**
|
||||||
|
- [ ] Job Create migrated
|
||||||
|
- [ ] Job Edit migrated
|
||||||
|
- [ ] Both screens tested on iOS & Android
|
||||||
|
- [ ] No critical bugs
|
||||||
|
- [ ] Test files deleted
|
||||||
|
- [ ] Documentation updated
|
||||||
|
|
||||||
|
**Overall Migration Complete when:**
|
||||||
|
- [ ] All form screens migrated
|
||||||
|
- [ ] All screens tested
|
||||||
|
- [ ] Old NewWrapper deprecated/removed
|
||||||
|
- [ ] Team trained on NewWrapper_V2
|
||||||
|
- [ ] Documentation complete
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Last Updated**: 2026-04-01
|
||||||
|
**Created by**: AI Assistant
|
||||||
|
**Status**: 🟡 IN PROGRESS
|
||||||
416
tasks/TASK-005-OS-Wrapper-Implementation.md
Normal file
416
tasks/TASK-005-OS-Wrapper-Implementation.md
Normal file
@@ -0,0 +1,416 @@
|
|||||||
|
# TASK-005: OS_Wrapper Implementation
|
||||||
|
|
||||||
|
## 📋 Overview
|
||||||
|
Migrasi dari `NewWrapper` dan `NewWrapper_V2` ke `OS_Wrapper` yang otomatis menyesuaikan dengan platform (iOS/Android).
|
||||||
|
|
||||||
|
## 🎯 Goals
|
||||||
|
- ✅ Mengganti penggunaan `NewWrapper` → `OS_Wrapper` di user screens
|
||||||
|
- ✅ Mengganti penggunaan `NewWrapper_V2` → `OS_Wrapper` di form screens (dengan keyboard handling props)
|
||||||
|
- ✅ Memastikan tabs dan UI konsisten di iOS dan Android
|
||||||
|
- ✅ Backward compatible (wrapper lama tetap ada)
|
||||||
|
- ✅ **SIMPLIFIED**: Satu komponen `OS_Wrapper` untuk semua use cases (tidak ada `PageWrapper` terpisah)
|
||||||
|
|
||||||
|
## 📦 Available Wrappers
|
||||||
|
|
||||||
|
### 1. **OS_Wrapper** (Recommended - Unified API)
|
||||||
|
Auto-detect platform dan routing ke wrapper yang sesuai:
|
||||||
|
- iOS → `IOSWrapper` (berbasis NewWrapper)
|
||||||
|
- Android → `AndroidWrapper` (berbasis NewWrapper_V2 dengan keyboard handling)
|
||||||
|
|
||||||
|
**Props:**
|
||||||
|
```tsx
|
||||||
|
// Base props (kedua platform)
|
||||||
|
withBackground?: boolean;
|
||||||
|
headerComponent?: React.ReactNode;
|
||||||
|
footerComponent?: React.ReactNode;
|
||||||
|
floatingButton?: React.ReactNode;
|
||||||
|
hideFooter?: boolean;
|
||||||
|
edgesFooter?: Edge[];
|
||||||
|
style?: ViewStyle;
|
||||||
|
refreshControl?: RefreshControl;
|
||||||
|
|
||||||
|
// Keyboard handling (Android only - iOS mengabaikan)
|
||||||
|
enableKeyboardHandling?: boolean; // Default: false
|
||||||
|
keyboardScrollOffset?: number; // Default: 100
|
||||||
|
contentPaddingBottom?: number; // Default: 100
|
||||||
|
contentPadding?: number; // Default: 0
|
||||||
|
```
|
||||||
|
|
||||||
|
### 2. **IOSWrapper** / **AndroidWrapper** (Direct Usage)
|
||||||
|
Untuk kasus khusus yang butuh platform-specific behavior.
|
||||||
|
|
||||||
|
## 📝 Migration Guide
|
||||||
|
|
||||||
|
### Before (Old Way)
|
||||||
|
```tsx
|
||||||
|
import NewWrapper from "@/components/_ShareComponent/NewWrapper";
|
||||||
|
// atau
|
||||||
|
import { NewWrapper_V2 } from "@/components/_ShareComponent/NewWrapper_V2";
|
||||||
|
```
|
||||||
|
|
||||||
|
### After (New Way - Unified API)
|
||||||
|
```tsx
|
||||||
|
import { OS_Wrapper } from "@/components";
|
||||||
|
|
||||||
|
// Static mode (simple content)
|
||||||
|
<OS_Wrapper>
|
||||||
|
<YourContent />
|
||||||
|
</OS_Wrapper>
|
||||||
|
|
||||||
|
// List mode (with pagination)
|
||||||
|
<OS_Wrapper
|
||||||
|
listData={data}
|
||||||
|
renderItem={({ item }) => <ItemCard item={item} />}
|
||||||
|
ListEmptyComponent={<EmptyState />}
|
||||||
|
onEndReached={loadMore}
|
||||||
|
/>
|
||||||
|
|
||||||
|
// Form mode (with keyboard handling - Android only)
|
||||||
|
<OS_Wrapper
|
||||||
|
enableKeyboardHandling
|
||||||
|
contentPaddingBottom={250} // ← HANYA untuk screens dengan TextInput
|
||||||
|
>
|
||||||
|
<FormContent />
|
||||||
|
</OS_Wrapper>
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
# 🔵 USER PHASES (User-Facing Screens)
|
||||||
|
|
||||||
|
## ✅ User Phase 1: Job Screens - COMPLETED (2026-04-06 to 2026-04-07)
|
||||||
|
|
||||||
|
**Files migrated: 9**
|
||||||
|
|
||||||
|
#### Job List Screens (OS_Wrapper):
|
||||||
|
- ✅ `screens/Job/ScreenBeranda.tsx` - ViewWrapper → OS_Wrapper
|
||||||
|
- ✅ `screens/Job/ScreenBeranda2.tsx` - NewWrapper_V2 → OS_Wrapper
|
||||||
|
- ✅ `screens/Job/ScreenArchive.tsx` - ViewWrapper → OS_Wrapper
|
||||||
|
- ✅ `screens/Job/ScreenArchive2.tsx` - NewWrapper_V2 → OS_Wrapper
|
||||||
|
- ✅ `screens/Job/MainViewStatus.tsx` - ViewWrapper → OS_Wrapper
|
||||||
|
- ✅ `screens/Job/MainViewStatus2.tsx` - NewWrapper_V2 → OS_Wrapper
|
||||||
|
|
||||||
|
#### Job Form Screens (OS_Wrapper with keyboard handling):
|
||||||
|
- ✅ `screens/Job/ScreenJobCreate.tsx` - NewWrapper_V2 → OS_Wrapper + enableKeyboardHandling + contentPaddingBottom={250}
|
||||||
|
- ✅ `screens/Job/ScreenJobEdit.tsx` - NewWrapper_V2 → OS_Wrapper + enableKeyboardHandling + contentPaddingBottom={250}
|
||||||
|
|
||||||
|
#### Job Detail Screen:
|
||||||
|
- ✅ `app/(application)/(user)/job/[id]/[status]/detail.tsx` - NewWrapper_V2 → OS_Wrapper
|
||||||
|
|
||||||
|
**Testing Status:**
|
||||||
|
- ✅ TypeScript: No errors
|
||||||
|
- ✅ Build: Success
|
||||||
|
- ✅ iOS Testing: Complete ✅
|
||||||
|
- ✅ Android Testing: Complete ✅
|
||||||
|
|
||||||
|
## ✅ User Phase 2: Profile, Waiting Room, Delete Account - COMPLETED (2026-04-08)
|
||||||
|
|
||||||
|
**Files migrated: 10**
|
||||||
|
|
||||||
|
#### Profile Screens:
|
||||||
|
- ✅ `app/(application)/(user)/profile/[id]/index.tsx` - NewWrapper → OS_Wrapper (list with pull-to-refresh)
|
||||||
|
- ✅ `app/(application)/(user)/profile/[id]/edit.tsx` - ViewWrapper → OS_Wrapper (form + enableKeyboardHandling + contentPaddingBottom={250})
|
||||||
|
- ✅ `app/(application)/(user)/profile/create.tsx` - ViewWrapper → OS_Wrapper (form + enableKeyboardHandling + contentPaddingBottom={250})
|
||||||
|
- ✅ `app/(application)/(user)/profile/[id]/blocked-list.tsx` - NewWrapper → OS_Wrapper (pagination list)
|
||||||
|
- ✅ `app/(application)/(user)/profile/[id]/detail-blocked.tsx` - NewWrapper → OS_Wrapper (static with footer)
|
||||||
|
- ✅ `app/(application)/(user)/profile/[id]/update-background.tsx` - ViewWrapper → OS_Wrapper (static with footer)
|
||||||
|
- ✅ `app/(application)/(user)/profile/[id]/update-photo.tsx` - ViewWrapper → OS_Wrapper (static with footer)
|
||||||
|
|
||||||
|
#### Other Screens:
|
||||||
|
- ✅ `app/(application)/(user)/waiting-room.tsx` - NewWrapper → OS_Wrapper (static with refresh + footer)
|
||||||
|
- ✅ `app/(application)/(user)/delete-account.tsx` - ViewWrapper → OS_Wrapper (form + enableKeyboardHandling + contentPaddingBottom={250})
|
||||||
|
|
||||||
|
## ✅ User Phase 3: Portfolio Screens - COMPLETED (2026-04-08)
|
||||||
|
|
||||||
|
**Files migrated: 6**
|
||||||
|
|
||||||
|
#### Portfolio Screens:
|
||||||
|
- ✅ `app/(application)/(user)/portofolio/[id]/index.tsx` - ViewWrapper → OS_Wrapper (detail screen with pull-to-refresh)
|
||||||
|
- ✅ `app/(application)/(user)/portofolio/[id]/edit.tsx` - NewWrapper → OS_Wrapper (form + enableKeyboardHandling + contentPaddingBottom={250})
|
||||||
|
- ✅ `app/(application)/(user)/portofolio/[id]/edit-logo.tsx` - ViewWrapper → OS_Wrapper (static with footer)
|
||||||
|
- ✅ `app/(application)/(user)/portofolio/[id]/edit-social-media.tsx` - ViewWrapper → OS_Wrapper (form + enableKeyboardHandling + contentPaddingBottom={250})
|
||||||
|
- ✅ `screens/Portofolio/ViewListPortofolio.tsx` - NewWrapper → OS_Wrapper (pagination list)
|
||||||
|
- ✅ `screens/Portofolio/ScreenPortofolioCreate.tsx` - NewWrapper → OS_Wrapper (form + enableKeyboardHandling + contentPaddingBottom={250})
|
||||||
|
|
||||||
|
## ✅ User Phase 4: Maps Screens - COMPLETED (2026-04-08)
|
||||||
|
|
||||||
|
**Files migrated: 2**
|
||||||
|
|
||||||
|
#### Maps Screens:
|
||||||
|
- ✅ `screens/Maps/ScreenMapsCreate.tsx` - NewWrapper → OS_Wrapper (form + enableKeyboardHandling + contentPaddingBottom={250})
|
||||||
|
- ✅ `screens/Maps/ScreenMapsEdit.tsx` - ViewWrapper → OS_Wrapper (form + enableKeyboardHandling + contentPaddingBottom={250})
|
||||||
|
|
||||||
|
## ✅ User Phase 5: Forum Screens - COMPLETED (2026-04-09)
|
||||||
|
|
||||||
|
**Files migrated: 17**
|
||||||
|
|
||||||
|
#### Forum List & Create Screens:
|
||||||
|
- ✅ `screens/Forum/ViewBeranda.tsx` - ViewWrapper → OS_Wrapper
|
||||||
|
- ✅ `screens/Forum/ViewBeranda2.tsx` - NewWrapper → OS_Wrapper
|
||||||
|
- ✅ `screens/Forum/ViewBeranda3.tsx` - NewWrapper → OS_Wrapper (Active)
|
||||||
|
- ✅ `screens/Forum/create.tsx` - ViewWrapper → OS_Wrapper (form + enableKeyboardHandling + contentPaddingBottom={250})
|
||||||
|
- ✅ `screens/Forum/terms.tsx` - NewWrapper → OS_Wrapper (Terms page)
|
||||||
|
|
||||||
|
#### Forum Detail & Comments Screens:
|
||||||
|
- ✅ `screens/Forum/DetailForum.tsx` - NewWrapper → OS_Wrapper
|
||||||
|
- ✅ `screens/Forum/DetailForum2.tsx` - NewWrapper → OS_Wrapper (Active + disableFlexGrow fix)
|
||||||
|
|
||||||
|
#### User's Forum ("Forumku") Screens:
|
||||||
|
- ✅ `screens/Forum/ViewForumku.tsx` - ViewWrapper → OS_Wrapper
|
||||||
|
- ✅ `screens/Forum/ViewForumku2.tsx` - NewWrapper → OS_Wrapper
|
||||||
|
|
||||||
|
#### Report & Edit Screens:
|
||||||
|
- ✅ `app/(application)/(user)/forum/[id]/edit.tsx` - ViewWrapper → OS_Wrapper (form + enableKeyboardHandling + contentPaddingBottom={250})
|
||||||
|
- ✅ `app/(application)/(user)/forum/[id]/report-commentar.tsx` - ViewWrapper → OS_Wrapper (Static report form)
|
||||||
|
- ✅ `app/(application)/(user)/forum/[id]/report-posting.tsx` - ViewWrapper → OS_Wrapper (Static report form)
|
||||||
|
- ✅ `app/(application)/(user)/forum/[id]/other-report-commentar.tsx` - ViewWrapper → OS_Wrapper (form + enableKeyboardHandling + contentPaddingBottom={250})
|
||||||
|
- ✅ `app/(application)/(user)/forum/[id]/other-report-posting.tsx` - ViewWrapper → OS_Wrapper (form + enableKeyboardHandling + contentPaddingBottom={250})
|
||||||
|
- ✅ `app/(application)/(user)/forum/[id]/preview-report-comment.tsx` - NewWrapper → OS_Wrapper
|
||||||
|
- ✅ `app/(application)/(user)/forum/[id]/preview-report-posting.tsx` - NewWrapper → OS_Wrapper
|
||||||
|
- ✅ `app/(application)/(user)/forum/[id]/index.tsx` - Checked (No wrapper to migrate, just imports)
|
||||||
|
|
||||||
|
**Bug Fixes Implemented:**
|
||||||
|
- ✅ **Scroll Macet (Ghost Scroll):** Fixed dengan menghapus `KeyboardAvoidingView` & `TouchableWithoutFeedback` di List Mode `AndroidWrapper`.
|
||||||
|
- ✅ **Header Besar Terpotong:** Menambahkan props `disableFlexGrow={true}` untuk layar dengan header besar (DetailForum2).
|
||||||
|
- ✅ **Keyboard Dismiss:** Menggunakan `keyboardShouldPersistTaps="handled"` agar tap di area kosong menutup keyboard.
|
||||||
|
|
||||||
|
## ⏳ User Phase 6: Event Screens (Priority: HIGH)
|
||||||
|
|
||||||
|
- [ ] `app/(application)/(user)/event/create.tsx` → pakai `enableKeyboardHandling` + `contentPaddingBottom={250}`
|
||||||
|
- [ ] `app/(application)/(user)/event/(tabs)/index.tsx`
|
||||||
|
- [ ] `app/(application)/(user)/event/[id]/index.tsx` (detail)
|
||||||
|
- [ ] `app/(application)/(user)/event/detail/[id].tsx`
|
||||||
|
|
||||||
|
## ⏳ User Phase 7: Voting Screens (Priority: HIGH)
|
||||||
|
|
||||||
|
- [ ] `app/(application)/(user)/voting/create.tsx` → pakai `enableKeyboardHandling` + `contentPaddingBottom={250}`
|
||||||
|
- [ ] `app/(application)/(user)/voting/(tabs)/index.tsx`
|
||||||
|
- [ ] `app/(application)/(user)/voting/[id]/index.tsx` (detail)
|
||||||
|
|
||||||
|
## ⏳ User Phase 8: Donation Screens (Priority: HIGH)
|
||||||
|
|
||||||
|
- [ ] `app/(application)/(user)/donation/create.tsx` → pakai `enableKeyboardHandling` + `contentPaddingBottom={250}`
|
||||||
|
- [ ] `app/(application)/(user)/donation/create-story.tsx` → pakai `enableKeyboardHandling` + `contentPaddingBottom={250}`
|
||||||
|
- [ ] `app/(application)/(user)/donation/(tabs)/index.tsx`
|
||||||
|
- [ ] `app/(application)/(user)/donation/[id]/index.tsx` (detail)
|
||||||
|
|
||||||
|
## ⏳ User Phase 9: Investment Screens (Priority: MEDIUM)
|
||||||
|
|
||||||
|
- [ ] `app/(application)/(user)/investment/create.tsx` → pakai `enableKeyboardHandling` + `contentPaddingBottom={250}`
|
||||||
|
- [ ] `app/(application)/(user)/investment/(tabs)/index.tsx`
|
||||||
|
- [ ] `app/(application)/(user)/investment/[id]/index.tsx` (detail)
|
||||||
|
|
||||||
|
## ⏳ User Phase 10: Collaboration Screens (Priority: MEDIUM)
|
||||||
|
|
||||||
|
- [ ] `app/(application)/(user)/collaboration/create.tsx` → pakai `enableKeyboardHandling` + `contentPaddingBottom={250}`
|
||||||
|
- [ ] `app/(application)/(user)/collaboration/(tabs)/index.tsx`
|
||||||
|
- [ ] `app/(application)/(user)/collaboration/[id]/index.tsx` (detail)
|
||||||
|
|
||||||
|
## ⏳ User Phase 11: Other User Screens (Priority: LOW)
|
||||||
|
|
||||||
|
- [ ] `app/(application)/(user)/marketplace/index.tsx`
|
||||||
|
- [ ] `app/(application)/(user)/user-search/index.tsx`
|
||||||
|
- [ ] `app/(application)/(user)/notifications/` - Notification screens (TBD)
|
||||||
|
- [ ] `app/(application)/(user)/crowdfunding/` - Crowdfunding screens (TBD)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
# 🔴 ADMIN PHASES (Admin-Facing Screens)
|
||||||
|
|
||||||
|
## ⏳ Admin Phase 1: Event Management (Priority: HIGH)
|
||||||
|
|
||||||
|
- [ ] `app/(application)/admin/event/index.tsx`
|
||||||
|
- [ ] `app/(application)/admin/event/type-create.tsx` → pakai `enableKeyboardHandling` + `contentPaddingBottom={250}`
|
||||||
|
- [ ] `app/(application)/admin/event/type-update.tsx` → pakai `enableKeyboardHandling` + `contentPaddingBottom={250}`
|
||||||
|
- [ ] `app/(application)/admin/event/type-of-event.tsx`
|
||||||
|
- [ ] `app/(application)/admin/event/[id]/index.tsx` (detail)
|
||||||
|
- [ ] `app/(application)/admin/event/[status]/index.tsx`
|
||||||
|
|
||||||
|
## ⏳ Admin Phase 2: Voting Management (Priority: HIGH)
|
||||||
|
|
||||||
|
- [ ] `app/(application)/admin/voting/index.tsx`
|
||||||
|
- [ ] `app/(application)/admin/voting/history.tsx`
|
||||||
|
- [ ] `app/(application)/admin/voting/[id]/index.tsx` (detail)
|
||||||
|
- [ ] `app/(application)/admin/voting/[status]/index.tsx`
|
||||||
|
|
||||||
|
## ⏳ Admin Phase 3: Donation Management (Priority: HIGH)
|
||||||
|
|
||||||
|
- [ ] `app/(application)/admin/donation/index.tsx`
|
||||||
|
- [ ] `app/(application)/admin/donation/category.tsx`
|
||||||
|
- [ ] `app/(application)/admin/donation/category-create.tsx` → pakai `enableKeyboardHandling` + `contentPaddingBottom={250}`
|
||||||
|
- [ ] `app/(application)/admin/donation/category-update.tsx` → pakai `enableKeyboardHandling` + `contentPaddingBottom={250}`
|
||||||
|
- [ ] `app/(application)/admin/donation/[id]/index.tsx` (detail)
|
||||||
|
- [ ] `app/(application)/admin/donation/[status]/index.tsx`
|
||||||
|
|
||||||
|
## ⏳ Admin Phase 4: Forum Admin (Priority: MEDIUM)
|
||||||
|
|
||||||
|
- [ ] `app/(application)/admin/forum/index.tsx`
|
||||||
|
- [ ] `app/(application)/admin/forum/posting.tsx`
|
||||||
|
- [ ] `app/(application)/admin/forum/report-posting.tsx`
|
||||||
|
- [ ] `app/(application)/admin/forum/report-comment.tsx`
|
||||||
|
- [ ] `app/(application)/admin/forum/[id]/index.tsx` (detail)
|
||||||
|
|
||||||
|
## ⏳ Admin Phase 5: Collaboration Admin (Priority: MEDIUM)
|
||||||
|
|
||||||
|
- [ ] `app/(application)/admin/collaboration/index.tsx`
|
||||||
|
- [ ] `app/(application)/admin/collaboration/group.tsx`
|
||||||
|
- [ ] `app/(application)/admin/collaboration/publish.tsx`
|
||||||
|
- [ ] `app/(application)/admin/collaboration/reject.tsx`
|
||||||
|
- [ ] `app/(application)/admin/collaboration/[id]/index.tsx` (detail)
|
||||||
|
|
||||||
|
## ⏳ Admin Phase 6: Job Admin (Priority: MEDIUM)
|
||||||
|
|
||||||
|
- [ ] `app/(application)/admin/job/index.tsx`
|
||||||
|
- [ ] `app/(application)/admin/job/[id]/index.tsx` (detail)
|
||||||
|
- [ ] `app/(application)/admin/job/[status]/index.tsx`
|
||||||
|
|
||||||
|
## ⏳ Admin Phase 7: Investment Admin (Priority: LOW)
|
||||||
|
|
||||||
|
- [ ] `app/(application)/admin/investment/index.tsx`
|
||||||
|
- [ ] `app/(application)/admin/investment/[id]/index.tsx` (detail)
|
||||||
|
- [ ] `app/(application)/admin/investment/[status]/index.tsx`
|
||||||
|
|
||||||
|
## ⏳ Admin Phase 8: App Information (Priority: LOW)
|
||||||
|
|
||||||
|
- [ ] `app/(application)/admin/app-information/index.tsx`
|
||||||
|
- [ ] `app/(application)/admin/app-information/business-field/` (TBD files)
|
||||||
|
- [ ] `app/(application)/admin/app-information/information-bank/` (TBD files)
|
||||||
|
- [ ] `app/(application)/admin/app-information/sticker/` (TBD files)
|
||||||
|
|
||||||
|
## ⏳ Admin Phase 9: User Access & Others (Priority: LOW)
|
||||||
|
|
||||||
|
- [x] `app/(application)/admin/user-access/index.tsx` - NewWrapper → OS_Wrapper (list with pagination + search)
|
||||||
|
- [x] `app/(application)/admin/user-access/[id]/index.tsx` - ViewWrapper → OS_Wrapper (detail with footer button)
|
||||||
|
- [ ] `app/(application)/admin/notification/` - Notification admin (TBD)
|
||||||
|
- [ ] `app/(application)/admin/super-admin/` - Super admin (TBD)
|
||||||
|
- [ ] `app/(application)/admin/dashboard.tsx`
|
||||||
|
- [ ] `app/(application)/admin/maps.tsx`
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
# 📌 Notes & Patterns
|
||||||
|
|
||||||
|
### Spacing Pattern:
|
||||||
|
- **Default**: `contentPaddingBottom=100` (list & static screens)
|
||||||
|
- **Forms**: `contentPaddingBottom={250}` (HANYA untuk screens dengan TextInput/TextArea)
|
||||||
|
- **contentPadding=0** (default, per-screen control jika perlu)
|
||||||
|
|
||||||
|
### User Preference:
|
||||||
|
- **NO PADDING_INLINE by default** - Bisa mempersempit box tampilan
|
||||||
|
- User akan review dan tambahkan sendiri jika diperlukan per-screen
|
||||||
|
|
||||||
|
### Keyboard Handling:
|
||||||
|
- `enableKeyboardHandling` → Auto-scroll saat keyboard muncul (Android only)
|
||||||
|
- **Bug Fixed (2026-04-08)**: Input di paling atas tidak lagi "terlempar" keluar layar saat keyboard muncul
|
||||||
|
- **Solusi**: Menggunakan `UIManager.measure` untuk mendapatkan posisi absolut input (`pageY`), lalu conditional scroll:
|
||||||
|
- Jika input DI ATAS keyboard (terlihat) → **TIDAK SCROLL**
|
||||||
|
- Jika input DI BAWAH keyboard (tertutup) → **Scroll secukupnya**
|
||||||
|
- Tap anywhere di luar input → keyboard dismiss (sudah implementasi di kedua mode)
|
||||||
|
|
||||||
|
### Migration Pattern:
|
||||||
|
|
||||||
|
#### Untuk List Screen:
|
||||||
|
```tsx
|
||||||
|
<OS_Wrapper
|
||||||
|
listData={pagination.listData}
|
||||||
|
renderItem={renderItem}
|
||||||
|
ListEmptyComponent={ListEmptyComponent}
|
||||||
|
ListFooterComponent={ListFooterComponent}
|
||||||
|
onEndReached={pagination.loadMore}
|
||||||
|
refreshControl={<RefreshControl refreshing={refreshing} onRefresh={onRefresh} />}
|
||||||
|
/>
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Untuk Static Screen:
|
||||||
|
```tsx
|
||||||
|
<OS_Wrapper
|
||||||
|
headerComponent={<HeaderSection />}
|
||||||
|
footerComponent={<FooterSection />}
|
||||||
|
refreshControl={<RefreshControl refreshing={refreshing} onRefresh={onRefresh} />}
|
||||||
|
>
|
||||||
|
<YourContent />
|
||||||
|
</OS_Wrapper>
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Untuk Form Screen (dengan keyboard handling):
|
||||||
|
```tsx
|
||||||
|
<OS_Wrapper
|
||||||
|
enableKeyboardHandling
|
||||||
|
contentPaddingBottom={250} // ← HANYA untuk screens dengan TextInput
|
||||||
|
footerComponent={<SubmitButton />}
|
||||||
|
>
|
||||||
|
<FormContent />
|
||||||
|
</OS_Wrapper>
|
||||||
|
```
|
||||||
|
|
||||||
|
## 🐛 Troubleshooting
|
||||||
|
|
||||||
|
### Issue: Tabs tidak muncul di Android
|
||||||
|
**Solution**: Pastikan tidak ada custom padding yang overriding default behavior. Jika masih bermasalah, cek apakah `contentPadding` atau `contentPaddingBottom` terlalu besar.
|
||||||
|
|
||||||
|
### Issue: Keyboard menutupi input di Android
|
||||||
|
**Solution**: Pastikan pakai `OS_Wrapper` dengan `enableKeyboardHandling={true}` dan `contentPaddingBottom={250}` untuk form screens.
|
||||||
|
|
||||||
|
### Issue: Pull-to-refresh tidak berfungsi di static mode
|
||||||
|
**Solution**: Sudah diperbaiki! `refreshControl` sekarang di-pass ke ScrollView di AndroidWrapper.
|
||||||
|
|
||||||
|
### Issue: Footer terlalu jauh dari bottom
|
||||||
|
**Solution**: Kurangi `contentPaddingBottom` (default: 100 untuk list). Untuk form screens tetap 250.
|
||||||
|
|
||||||
|
### Issue: White space di bottom saat keyboard close (Android)
|
||||||
|
**Solution**: Ini sudah di-fix di AndroidWrapper. Pastikan screen pakai OS_Wrapper, bukan NewWrapper langsung.
|
||||||
|
|
||||||
|
## 📊 Progress Tracking
|
||||||
|
|
||||||
|
### User Phases:
|
||||||
|
| Phase | Total Files | Migrated | Testing | Status |
|
||||||
|
|-------|-------------|----------|---------|--------|
|
||||||
|
| User Phase 1 (Job) | 9 | 9 | ✅ Complete | ✅ Complete |
|
||||||
|
| User Phase 2 (Profile + Others) | 10 | 10 | ✅ Complete | ✅ Complete |
|
||||||
|
| User Phase 3 (Portfolio) | 6 | 6 | ⏳ Pending | ✅ Complete |
|
||||||
|
| User Phase 4 (Maps) | 2 | 2 | ⏳ Pending | ✅ Complete |
|
||||||
|
| User Phase 5 (Forum) | 17 | 17 | ⏳ Pending | ✅ Complete |
|
||||||
|
| User Phase 6 (Event) | ~4 | 0 | 0 | ⏳ Pending |
|
||||||
|
| User Phase 7 (Voting) | ~3 | 0 | 0 | ⏳ Pending |
|
||||||
|
| User Phase 8 (Donation) | ~4 | 0 | 0 | ⏳ Pending |
|
||||||
|
| User Phase 9 (Investment) | ~3 | 0 | 0 | ⏳ Pending |
|
||||||
|
| User Phase 10 (Collaboration) | ~3 | 0 | 0 | ⏳ Pending |
|
||||||
|
| User Phase 11 (Others) | ~4 | 0 | 0 | ⏳ Pending |
|
||||||
|
| **User Total** | **~69** | **44** | **9** | **~64% Complete** |
|
||||||
|
|
||||||
|
### Admin Phases:
|
||||||
|
| Phase | Total Files | Migrated | Testing | Status |
|
||||||
|
|-------|-------------|----------|---------|--------|
|
||||||
|
| Admin Phase 1 (Event) | ~6 | 0 | 0 | ⏳ Pending |
|
||||||
|
| Admin Phase 2 (Voting) | ~4 | 0 | 0 | ⏳ Pending |
|
||||||
|
| Admin Phase 3 (Donation) | ~6 | 0 | 0 | ⏳ Pending |
|
||||||
|
| Admin Phase 4 (Forum) | ~5 | 0 | 0 | ⏳ Pending |
|
||||||
|
| Admin Phase 5 (Collaboration) | ~5 | 0 | 0 | ⏳ Pending |
|
||||||
|
| Admin Phase 6 (Job) | ~3 | 0 | 0 | ⏳ Pending |
|
||||||
|
| Admin Phase 7 (Investment) | ~3 | 0 | 0 | ⏳ Pending |
|
||||||
|
| Admin Phase 8 (App Info) | ~4 | 0 | 0 | ⏳ Pending |
|
||||||
|
| Admin Phase 9 (User Access) | ~6 | 2 | 0 | 🔄 In Progress |
|
||||||
|
| **Admin Total** | **~42** | **2** | **0** | **5% Complete** |
|
||||||
|
|
||||||
|
### Grand Total:
|
||||||
|
| Category | Total Files | Migrated | Status |
|
||||||
|
|----------|-------------|----------|--------|
|
||||||
|
| **User Screens** | ~69 | 44 | ~64% Complete |
|
||||||
|
| **Admin Screens** | ~42 | 2 | 5% Complete |
|
||||||
|
| **GRAND TOTAL** | **~111** | **46** | **~41% Complete** |
|
||||||
|
|
||||||
|
## 🔄 Rollback Plan
|
||||||
|
|
||||||
|
Jika ada issue yang tidak bisa di-fix dalam 1 jam:
|
||||||
|
1. Revert perubahan di file yang bermasalah
|
||||||
|
2. Kembali ke NewWrapper/NewWrapper_V2
|
||||||
|
3. Dokumentasikan issue di CHANGE_LOG.md
|
||||||
|
4. Investigasi lebih lanjut dan coba lagi
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Co-authored-by**: Qwen-Coder <qwen-coder@alibabacloud.com>
|
||||||
|
**Created**: 2026-04-06
|
||||||
|
**Last Updated**: 2026-04-09
|
||||||
|
**Status**: User Phase 1-4 Complete ✅ (27 files migrated)
|
||||||
|
**Next**: User Phase 5 - Forum Screens
|
||||||
Reference in New Issue
Block a user