Compare commits
69 Commits
loaddata/9
...
qc-wrapper
| Author | SHA1 | Date | |
|---|---|---|---|
| d0eb812adc | |||
| 6d4dc0f7f7 | |||
| 0823a1c26a | |||
| eb64c30d49 | |||
| 2f87776d8b | |||
| 243313b8eb | |||
| 8e61c980af | |||
| c709dffd20 | |||
| 54537d2449 | |||
| 66792186ca | |||
| c3cf354c28 | |||
| 6ec839fd67 | |||
| b8f8a361d6 | |||
| 1a5ca78041 | |||
| 502cd7bc65 | |||
| 44d9025afe | |||
| b34bc3799e | |||
| 7cb4f30ae9 | |||
| 0f552443c4 | |||
| 90bc8ae343 | |||
| 98f8c7e2bf | |||
| 81bbd8e6b0 | |||
| 57159d2c45 | |||
| 66373fa65b | |||
| 6d545f2af9 | |||
| eeb95336f2 | |||
| 6fb3b229c3 | |||
| 76deec9c53 | |||
| 31948f71db | |||
| 16decd89c8 | |||
| ecbcc12abf | |||
| 0cb734e790 | |||
| 0d2fef1878 | |||
| 2e58f8c7b4 | |||
| b6cd308b0b | |||
| f68deab8c0 | |||
| 37d2fbe48a | |||
| 57c9215771 | |||
| 4efdbd3c7b | |||
| ad32eb6fe6 | |||
| a5026cc285 | |||
| 836ef709d2 | |||
| 3bbee15c3a | |||
| ad7dbaf162 | |||
| 9c94ec0454 | |||
| 4c63485a5b | |||
| f5d09a2906 | |||
| 67070bb2f1 | |||
| fb19ec60b2 | |||
| e8f5c5b174 | |||
| 74a4d88277 | |||
| 2ad93a26a8 | |||
| 768b0caa9e | |||
| 208b0ce813 | |||
| 66e6aebf41 | |||
| 32a42d1b60 | |||
| 107d4312e1 | |||
| 4862975402 | |||
| f284e2ec02 | |||
| 1d61ad51e5 | |||
| 76845b71b4 | |||
| 97e1f50660 | |||
| 1cbe4ab330 | |||
| 42fa80c228 | |||
| fb697366fe | |||
| 6d71c3a86f | |||
| e030b8f486 | |||
| 5c931b069c | |||
| b2be7be533 |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -81,4 +81,7 @@ yarn-error.*
|
|||||||
# typescript
|
# typescript
|
||||||
*.tsbuildinfo
|
*.tsbuildinfo
|
||||||
|
|
||||||
|
# secrets
|
||||||
|
secrets/
|
||||||
|
|
||||||
# @end expo-cli
|
# @end expo-cli
|
||||||
8
.qwen/settings.json
Normal file
8
.qwen/settings.json
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"permissions": {
|
||||||
|
"allow": [
|
||||||
|
"Bash(git add *)"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"$version": 3
|
||||||
|
}
|
||||||
7
.qwen/settings.json.orig
Normal file
7
.qwen/settings.json.orig
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"permissions": {
|
||||||
|
"allow": [
|
||||||
|
"Bash(git add *)"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
570
QWEN.md
570
QWEN.md
@@ -2,53 +2,68 @@
|
|||||||
|
|
||||||
## Project Overview
|
## Project Overview
|
||||||
|
|
||||||
HIPMI Mobile is a cross-platform mobile application built with Expo and React Native. The application is named "HIPMI Badung Connect" and serves as a platform for the HIPMI (Himpunan Pengusaha dan Pengusaha Indonesia) Badung chapter. It's designed to run on iOS, Android, and web platforms using a single codebase.
|
HIPMI Mobile is a cross-platform mobile application built with Expo and React Native. The application is named **"HIPMI Badung Connect"** and serves as a platform for the HIPMI (Himpunan Pengusaha dan Pengusaha Indonesia) Badung chapter. It's designed to run on iOS, Android, and web platforms using a single codebase.
|
||||||
|
|
||||||
### Key Technologies
|
### Key Technologies
|
||||||
- **Framework**: Expo (v54.0.0) with React Native (v0.81.4)
|
- **Framework**: Expo (v54.0.0) with React Native (v0.81.5)
|
||||||
- **Language**: TypeScript
|
- **Language**: TypeScript
|
||||||
- **Architecture**: File-based routing with Expo Router
|
- **Architecture**: File-based routing with Expo Router
|
||||||
- **State Management**: Context API
|
- **State Management**: Context API (AuthContext)
|
||||||
- **UI Components**: React Native Paper, custom components
|
- **UI Components**: React Native Paper, custom components
|
||||||
- **Maps Integration**: Mapbox Maps for React Native
|
- **Maps Integration**: Maplibre Maps for React Native (`@maplibre/maplibre-react-native` v10.4.2)
|
||||||
- **Push Notifications**: React Native Firebase Messaging
|
- **Push Notifications**: React Native Firebase Messaging
|
||||||
- **Build System**: Metro bundler
|
- **Build System**: Metro bundler
|
||||||
|
- **Package Manager**: Bun
|
||||||
|
|
||||||
### Project Structure
|
### Project Structure
|
||||||
```
|
```
|
||||||
hipmi-mobile/
|
hipmi-mobile/
|
||||||
├── app/ # Main application screens and routing
|
├── app/ # Main application screens and routing (Expo Router)
|
||||||
│ ├── _layout.tsx # Root layout component
|
│ ├── _layout.tsx # Root layout component
|
||||||
│ ├── index.tsx # Entry point (Login screen)
|
│ ├── index.tsx # Entry point (Login screen)
|
||||||
│ └── ...
|
│ └── (application)/ # Main app screens
|
||||||
|
│ ├── admin/ # Admin panel screens
|
||||||
|
│ ├── (user)/ # User screens
|
||||||
|
│ └── ...
|
||||||
├── components/ # Reusable UI components
|
├── components/ # Reusable UI components
|
||||||
|
│ ├── _ShareComponent/ # Shared components (NewWrapper, Admin components)
|
||||||
|
│ ├── _Icon/ # Icon components
|
||||||
|
│ └── ...
|
||||||
├── context/ # State management (AuthContext)
|
├── context/ # State management (AuthContext)
|
||||||
├── screens/ # Screen components organized by feature
|
├── screens/ # Screen components organized by feature
|
||||||
│ ├── Admin/ # Admin panel screens
|
│ ├── Admin/ # Admin panel screens
|
||||||
|
│ │ ├── Donation/ # Donation management screens
|
||||||
|
│ │ ├── Voting/ # Voting management screens
|
||||||
|
│ │ ├── Event/ # Event management screens
|
||||||
|
│ │ └── ...
|
||||||
│ ├── Authentication/ # Login, registration flows
|
│ ├── Authentication/ # Login, registration flows
|
||||||
│ ├── Collaboration/ # Collaboration features
|
│ ├── RootLayout/ # Root layout components
|
||||||
│ ├── Event/ # Event management
|
|
||||||
│ ├── Forum/ # Forum functionality
|
|
||||||
│ ├── Home/ # Home screen
|
|
||||||
│ ├── Maps/ # Map integration
|
|
||||||
│ ├── Profile/ # User profile
|
|
||||||
│ └── ...
|
│ └── ...
|
||||||
├── assets/ # Images, icons, and static assets
|
|
||||||
├── constants/ # Constants and configuration values
|
|
||||||
├── hooks/ # Custom React hooks
|
|
||||||
├── lib/ # Utility libraries
|
|
||||||
├── navigation/ # Navigation configuration
|
|
||||||
├── service/ # API services and business logic
|
├── service/ # API services and business logic
|
||||||
|
│ ├── api-admin/ # Admin API endpoints
|
||||||
|
│ ├── api-client/ # Client API endpoints
|
||||||
|
│ └── api-config.ts # Axios configuration
|
||||||
|
├── hooks/ # Custom React hooks
|
||||||
|
│ ├── use-pagination.tsx # Pagination hook
|
||||||
|
│ └── ...
|
||||||
|
├── helpers/ # Helper functions
|
||||||
|
│ ├── paginationHelpers.tsx # Pagination UI helpers
|
||||||
|
│ └── ...
|
||||||
├── types/ # TypeScript type definitions
|
├── types/ # TypeScript type definitions
|
||||||
└── utils/ # Helper functions
|
├── utils/ # Utility functions
|
||||||
|
├── constants/ # Constants and configuration values
|
||||||
|
├── styles/ # Global styles
|
||||||
|
├── assets/ # Images, icons, and static assets
|
||||||
|
└── docs/ # Documentation files
|
||||||
```
|
```
|
||||||
|
|
||||||
## Building and Running
|
## Building and Running
|
||||||
|
|
||||||
### Prerequisites
|
### Prerequisites
|
||||||
- Node.js (with bun as the package manager)
|
- **Node.js**: v18+ with Bun package manager
|
||||||
- Expo CLI
|
- **Expo CLI**: Installed globally or via npx
|
||||||
- iOS Simulator or Android Emulator (for native builds)
|
- **iOS**: Xcode (macOS only) for iOS simulator/builds
|
||||||
|
- **Android**: Android Studio for Android emulator/builds
|
||||||
|
|
||||||
### Setup and Development
|
### Setup and Development
|
||||||
|
|
||||||
@@ -60,110 +75,469 @@ hipmi-mobile/
|
|||||||
2. **Run Development Server**
|
2. **Run Development Server**
|
||||||
```bash
|
```bash
|
||||||
bun run start
|
bun run start
|
||||||
```
|
# or
|
||||||
Or use the shorthand:
|
|
||||||
```bash
|
|
||||||
bunx expo start
|
bunx expo start
|
||||||
```
|
```
|
||||||
|
|
||||||
3. **Platform-Specific Commands**
|
3. **Platform-Specific Commands**
|
||||||
- iOS: `bun run ios` or `bunx expo start --ios`
|
```bash
|
||||||
- Android: `bun run android` or `bunx expo start --android`
|
# iOS Simulator
|
||||||
- Web: `bun run web` or `bunx expo start --web`
|
bun run ios
|
||||||
|
# or
|
||||||
|
bunx expo start --ios
|
||||||
|
|
||||||
|
# Android Emulator
|
||||||
|
bun run android
|
||||||
|
# or
|
||||||
|
bunx expo start --android
|
||||||
|
|
||||||
|
# Web Browser
|
||||||
|
bun run web
|
||||||
|
# or
|
||||||
|
bunx expo start --web
|
||||||
|
```
|
||||||
|
|
||||||
4. **Linting**
|
4. **Linting**
|
||||||
```bash
|
```bash
|
||||||
bun run lint
|
bun run lint
|
||||||
```
|
```
|
||||||
|
|
||||||
### Environment Variables
|
### Build Commands
|
||||||
The application uses environment variables defined in the app.config.js file:
|
|
||||||
- `API_BASE_URL`: Base URL for API endpoints
|
|
||||||
- `BASE_URL`: Base application URL
|
|
||||||
- `DEEP_LINK_URL`: URL for deep linking functionality
|
|
||||||
|
|
||||||
### EAS Build Configuration
|
#### EAS Build (Production)
|
||||||
The project uses Expo Application Services (EAS) for building and deploying:
|
```bash
|
||||||
- Development builds with development client
|
# Production build (App Store / Play Store)
|
||||||
- Preview builds for internal distribution
|
eas build --profile production
|
||||||
- Production builds for app stores
|
|
||||||
|
|
||||||
## Features and Functionality
|
# Preview build (Internal distribution)
|
||||||
|
eas build --profile preview
|
||||||
|
|
||||||
The application appears to include several key modules:
|
# Development build (Development client)
|
||||||
- **Authentication**: Login, registration, and verification flows
|
eas build --profile development
|
||||||
- **Admin Panel**: Administrative functions
|
```
|
||||||
- **Collaboration**: Tools for member collaboration
|
|
||||||
- **Events**: Event management and calendar
|
#### Local Native Builds
|
||||||
- **Forum**: Discussion forums
|
```bash
|
||||||
- **Maps**: Location-based services with Mapbox integration
|
# Generate native folders (iOS & Android)
|
||||||
- **Donations**: Donation functionality
|
npx expo prebuild
|
||||||
- **Job Board**: Employment opportunities
|
|
||||||
- **Investment**: Investment-related features
|
# iOS specific
|
||||||
- **Voting**: Voting systems
|
bunx expo prebuild --platform ios
|
||||||
- **Portfolio**: Member portfolio showcase
|
open ios/HIPMIBadungConnect.xcworkspace
|
||||||
- **Notifications**: Push notifications via Firebase
|
|
||||||
|
# Android specific
|
||||||
|
bunx expo prebuild --platform android
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Version Management
|
||||||
|
```bash
|
||||||
|
# Patch version update
|
||||||
|
npm version patch
|
||||||
|
|
||||||
|
# Update iOS build number
|
||||||
|
bunx expo prebuild --platform ios
|
||||||
|
|
||||||
|
# Update Android version code
|
||||||
|
bunx expo prebuild --platform android
|
||||||
|
```
|
||||||
|
|
||||||
|
### Android Debugging
|
||||||
|
```bash
|
||||||
|
# List connected devices
|
||||||
|
adb devices
|
||||||
|
|
||||||
|
# Install APK to device/emulator
|
||||||
|
adb install android/app/build/outputs/apk/debug/app-debug.apk
|
||||||
|
|
||||||
|
# Install to specific device
|
||||||
|
adb -s <device_id> install android/app/build/outputs/apk/debug/app-debug.apk
|
||||||
|
```
|
||||||
|
|
||||||
|
## Environment Variables
|
||||||
|
|
||||||
|
Create a `.env` file in the project root with:
|
||||||
|
|
||||||
|
```env
|
||||||
|
API_BASE_URL=https://your-api-base-url.com
|
||||||
|
BASE_URL=https://your-app-url.com
|
||||||
|
DEEP_LINK_URL=hipmimobile://
|
||||||
|
```
|
||||||
|
|
||||||
|
These are loaded in `app.config.js` and accessible via `Constants.expoConfig.extra`.
|
||||||
|
|
||||||
|
## Architecture Patterns
|
||||||
|
|
||||||
|
### 1. Separation of Concerns
|
||||||
|
|
||||||
|
**Route Files** (`app/`) should be minimal (max 5 lines):
|
||||||
|
```typescript
|
||||||
|
import { Admin_ScreenXXX } from "@/screens/Admin/XXX/ScreenXXX";
|
||||||
|
|
||||||
|
export default function AdminXXX() {
|
||||||
|
return <Admin_ScreenXXX />;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**Screen Components** (`screens/`) contain all business logic:
|
||||||
|
```typescript
|
||||||
|
export function Admin_ScreenXXX() {
|
||||||
|
// Logic, hooks, state management
|
||||||
|
return <NewWrapper ... />;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### 2. Pagination Pattern
|
||||||
|
|
||||||
|
Using `usePagination` hook with infinite scroll:
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
const pagination = usePagination({
|
||||||
|
fetchFunction: async (page, searchQuery) => {
|
||||||
|
const response = await apiXXX({ page: String(page) });
|
||||||
|
if (response.success) {
|
||||||
|
return { data: response.data };
|
||||||
|
}
|
||||||
|
return { data: [] };
|
||||||
|
},
|
||||||
|
pageSize: PAGINATION_DEFAULT_TAKE, // 10
|
||||||
|
searchQuery: search,
|
||||||
|
dependencies: [dependency],
|
||||||
|
});
|
||||||
|
|
||||||
|
const { ListEmptyComponent, ListFooterComponent } =
|
||||||
|
createPaginationComponents({
|
||||||
|
loading: pagination.loading,
|
||||||
|
refreshing: pagination.refreshing,
|
||||||
|
listData: pagination.listData,
|
||||||
|
emptyMessage: "Belum ada data",
|
||||||
|
skeletonCount: PAGINATION_DEFAULT_TAKE,
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
### 3. Wrapper Components
|
||||||
|
|
||||||
|
**NewWrapper** (preferred for lists):
|
||||||
|
```typescript
|
||||||
|
<NewWrapper
|
||||||
|
listData={pagination.listData}
|
||||||
|
renderItem={renderItem}
|
||||||
|
headerComponent={headerComponent}
|
||||||
|
ListEmptyComponent={ListEmptyComponent}
|
||||||
|
ListFooterComponent={ListFooterComponent}
|
||||||
|
onEndReached={pagination.loadMore}
|
||||||
|
refreshControl={<RefreshControl ... />}
|
||||||
|
/>
|
||||||
|
```
|
||||||
|
|
||||||
|
**AdminBasicBox** (for card layouts):
|
||||||
|
```typescript
|
||||||
|
<AdminBasicBox
|
||||||
|
onPress={() => router.push(`/path/${item.id}`)}
|
||||||
|
style={{ marginHorizontal: 10, marginVertical: 5 }}
|
||||||
|
>
|
||||||
|
<StackCustom gap={0}>
|
||||||
|
<GridSpan_4_8 label="Label" value={<TextCustom>Value</TextCustom>} />
|
||||||
|
</StackCustom>
|
||||||
|
</AdminBasicBox>
|
||||||
|
```
|
||||||
|
|
||||||
|
### 4. API Service Structure
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
// service/api-admin/api-xxx.ts
|
||||||
|
export async function apiXXX({ page = "1" }: { page?: string }) {
|
||||||
|
try {
|
||||||
|
const response = await apiConfig.get(`/mobile/admin/xxx?page=${page}`);
|
||||||
|
return response.data;
|
||||||
|
} catch (error) {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
**Important**: All list APIs should support pagination with `page` parameter (default: "1").
|
||||||
|
|
||||||
|
### 5. Authentication Flow
|
||||||
|
|
||||||
|
Managed by `AuthContext`:
|
||||||
|
- `loginWithNomor()` - Send phone number, receive OTP
|
||||||
|
- `validateOtp()` - Validate OTP, get token
|
||||||
|
- `registerUser()` - Register new user
|
||||||
|
- `logout()` - Clear session and logout
|
||||||
|
- `userData()` - Fetch user data by token
|
||||||
|
|
||||||
## Development Conventions
|
## Development Conventions
|
||||||
|
|
||||||
### Coding Standards
|
### Coding Standards
|
||||||
- TypeScript is used throughout the project for type safety
|
- **TypeScript**: Strict mode enabled
|
||||||
- Component-based architecture with reusable components
|
- **Naming**:
|
||||||
- Context API for state management
|
- Components: PascalCase (`Admin_ScreenDonationStatus`)
|
||||||
- File-based routing with Expo Router
|
- Files: PascalCase for components (`ScreenDonationStatus.tsx`)
|
||||||
- Consistent naming conventions using camelCase for variables and PascalCase for components
|
- Variables: camelCase
|
||||||
|
- Constants: UPPER_SNAKE_CASE
|
||||||
|
- **Path Aliases**: `@/*` maps to project root
|
||||||
|
- **Imports**: Group imports by type (components, hooks, services, etc.)
|
||||||
|
|
||||||
|
### Component Structure
|
||||||
|
```typescript
|
||||||
|
// 1. Imports (grouped)
|
||||||
|
import { ... } from "@/components";
|
||||||
|
import { ... } from "@/hooks";
|
||||||
|
import { ... } from "@/service";
|
||||||
|
|
||||||
|
// 2. Types/Interfaces
|
||||||
|
interface Props { ... }
|
||||||
|
|
||||||
|
// 3. Main Component
|
||||||
|
export function ComponentName() {
|
||||||
|
// State
|
||||||
|
// Hooks
|
||||||
|
// Functions
|
||||||
|
// Render
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
### Testing
|
### Testing
|
||||||
- Linting is configured with ESLint
|
- Linting: `bun run lint`
|
||||||
- Standard Expo linting configuration is used
|
- No formal test suite configured yet
|
||||||
|
|
||||||
### Security
|
### Git Workflow
|
||||||
- Firebase is integrated for authentication and messaging
|
- Feature branches: `feature/xxx` or `fixed-admin/xxx`
|
||||||
- Camera and location permissions are properly configured
|
- Commit messages: Clear and descriptive
|
||||||
- Deep linking is secured with app domain associations
|
- Use CHANGE_LOG.md for tracking changes
|
||||||
|
|
||||||
## Key Dependencies
|
## Key Features
|
||||||
|
|
||||||
### Core Dependencies
|
### Authentication
|
||||||
- `@react-navigation/*`: Navigation solution for React Native
|
- Phone number login with OTP
|
||||||
- `@react-native-firebase/*`: Firebase integration for React Native
|
- User registration
|
||||||
- `@rnmapbox/maps`: Mapbox integration for React Native
|
- Terms & Conditions acceptance
|
||||||
- `expo-router`: File-based routing for Expo applications
|
- Session persistence with AsyncStorage
|
||||||
- `react-native-paper`: Material Design components for React Native
|
|
||||||
- `react-native-toast-message`: Toast notifications
|
|
||||||
- `react-native-otp-entry`: OTP input components
|
|
||||||
- `react-native-qrcode-svg`: QR code generation
|
|
||||||
|
|
||||||
### Development Dependencies
|
### Admin Module
|
||||||
- `@types/*`: TypeScript type definitions
|
- **Dashboard**: Overview and statistics
|
||||||
- `eslint-config-expo`: Expo-specific ESLint configuration
|
- **User Access**: User management
|
||||||
- `typescript`: Type checking
|
- **Event**: Event CRUD with status management
|
||||||
|
- **Voting**: Voting management (publish/review/reject)
|
||||||
|
- **Donation**: Donation management with categories and transaction tracking
|
||||||
|
- **Collaboration**: Collaboration requests
|
||||||
|
- **Investment**: Investment management
|
||||||
|
- **Maps**: Location-based features
|
||||||
|
- **App Information**: Bank and business field management
|
||||||
|
|
||||||
## Platform Support
|
### User Module
|
||||||
|
- **Home**: Main dashboard
|
||||||
|
- **Forum**: Discussion forums
|
||||||
|
- **Profile**: User profile management
|
||||||
|
- **Portfolio**: Member portfolio
|
||||||
|
- **Notifications**: Push notifications via Firebase
|
||||||
|
|
||||||
The application is configured to support:
|
## API Configuration
|
||||||
- **iOS**: With tablet support and proper permissions
|
|
||||||
- **Android**: With adaptive icons and intent filters for deep linking
|
|
||||||
- **Web**: Static output configuration for web deployment
|
|
||||||
|
|
||||||
## Special Configurations
|
### Base URLs
|
||||||
|
```typescript
|
||||||
|
// From app.config.js extra
|
||||||
|
API_BASE_URL: process.env.API_BASE_URL
|
||||||
|
BASE_URL: process.env.BASE_URL
|
||||||
|
DEEP_LINK_URL: process.env.DEEP_LINK_URL
|
||||||
|
```
|
||||||
|
|
||||||
### iOS Configuration
|
### Axios Interceptor
|
||||||
- Bundle identifier: `com.anonymous.hipmi-mobile`
|
All API calls use `apiConfig` with automatic token injection:
|
||||||
- Supports tablets
|
```typescript
|
||||||
- Google Services integration
|
apiConfig.interceptors.request.use(async (config) => {
|
||||||
- Location permission handling
|
const token = await AsyncStorage.getItem("authToken");
|
||||||
- Associated domains for deep linking
|
if (token) {
|
||||||
|
config.headers.Authorization = `Bearer ${token}`;
|
||||||
|
}
|
||||||
|
return config;
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
### Android Configuration
|
## Platform Configuration
|
||||||
- Package name: `com.bip.hipmimobileapp`
|
|
||||||
- Adaptive icons
|
|
||||||
- Edge-to-edge display enabled
|
|
||||||
- Intent filters for HTTPS deep linking
|
|
||||||
- Google Services integration
|
|
||||||
|
|
||||||
### Maps Integration
|
### iOS
|
||||||
The application uses Mapbox for mapping functionality with the `@rnmapbox/maps` plugin.
|
- **Bundle ID**: `com.anonymous.hipmi-mobile`
|
||||||
|
- **Build Number**: 21
|
||||||
|
- **Google Services**: Configured
|
||||||
|
- **Associated Domains**: `applinks:cld-dkr-staging-hipmi.wibudev.com`
|
||||||
|
- **Tablet Support**: Enabled
|
||||||
|
|
||||||
### Push Notifications
|
### Android
|
||||||
Firebase Cloud Messaging is integrated for push notifications with proper configuration for both iOS and Android platforms.
|
- **Package**: `com.bip.hipmimobileapp`
|
||||||
|
- **Version Code**: 4
|
||||||
|
- **Google Services**: Configured (`google-services.json`)
|
||||||
|
- **Deep Links**: HTTPS intent filters configured
|
||||||
|
- **Edge-to-Edge**: Enabled
|
||||||
|
|
||||||
|
### Web
|
||||||
|
- **Output**: Static
|
||||||
|
- **Bundler**: Metro
|
||||||
|
|
||||||
|
## Special Integrations
|
||||||
|
|
||||||
|
### Firebase
|
||||||
|
- Authentication
|
||||||
|
- Push Notifications (FCM)
|
||||||
|
- Configured for both iOS and Android
|
||||||
|
|
||||||
|
### Maplibre
|
||||||
|
- Map integration via `@maplibre/maplibre-react-native`
|
||||||
|
- Location permissions configured
|
||||||
|
|
||||||
|
### Deep Linking
|
||||||
|
- Scheme: `hipmimobile://`
|
||||||
|
- HTTPS: `cld-dkr-hipmi-stg.wibudev.com`
|
||||||
|
- Configured for both platforms
|
||||||
|
|
||||||
|
### Camera
|
||||||
|
- Camera and microphone permissions
|
||||||
|
- QR code generation support
|
||||||
|
|
||||||
|
## Common Development Tasks
|
||||||
|
|
||||||
|
### Adding a New Admin Screen
|
||||||
|
|
||||||
|
1. **Create Screen Component** (`screens/Admin/Feature/ScreenXXX.tsx`):
|
||||||
|
```typescript
|
||||||
|
export function Admin_ScreenXXX() {
|
||||||
|
const pagination = usePagination({...});
|
||||||
|
const renderItem = useCallback(...);
|
||||||
|
const headerComponent = useMemo(...);
|
||||||
|
|
||||||
|
return <NewWrapper ... />;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
2. **Create Box Component** (optional, for custom item rendering):
|
||||||
|
```typescript
|
||||||
|
export default function Admin_BoxXXX({ item }: { item: any }) {
|
||||||
|
return (
|
||||||
|
<AdminBasicBox onPress={() => router.push(...)}>
|
||||||
|
...
|
||||||
|
</AdminBasicBox>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
3. **Update API** (add pagination if needed):
|
||||||
|
```typescript
|
||||||
|
export async function apiXXX({ page = "1" }: { page?: string }) {
|
||||||
|
// ...
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
4. **Create Route File** (`app/(application)/admin/feature/xxx.tsx`):
|
||||||
|
```typescript
|
||||||
|
import { Admin_ScreenXXX } from "@/screens/Admin/Feature/ScreenXXX";
|
||||||
|
|
||||||
|
export default function AdminXXX() {
|
||||||
|
return <Admin_ScreenXXX />;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Updating API Endpoints
|
||||||
|
|
||||||
|
1. Add function in appropriate service file
|
||||||
|
2. Include `page` parameter for list endpoints
|
||||||
|
3. Use `apiConfig` axios instance
|
||||||
|
4. Handle errors properly
|
||||||
|
|
||||||
|
## Troubleshooting
|
||||||
|
|
||||||
|
### Build Issues
|
||||||
|
```bash
|
||||||
|
# Clean and rebuild
|
||||||
|
rm -rf node_modules
|
||||||
|
bun install
|
||||||
|
bunx expo prebuild --clean
|
||||||
|
|
||||||
|
# iOS specific
|
||||||
|
cd ios && pod install && cd ..
|
||||||
|
|
||||||
|
# Android specific
|
||||||
|
cd android && ./gradlew clean && cd ..
|
||||||
|
```
|
||||||
|
|
||||||
|
### Cache Issues
|
||||||
|
```bash
|
||||||
|
# Clear Expo cache
|
||||||
|
bunx expo start -c
|
||||||
|
|
||||||
|
# Clear Metro cache
|
||||||
|
bunx expo start --clear
|
||||||
|
```
|
||||||
|
|
||||||
|
### Dependency Issues
|
||||||
|
```bash
|
||||||
|
# Reinstall dependencies
|
||||||
|
rm -rf node_modules bun.lock
|
||||||
|
bun install
|
||||||
|
```
|
||||||
|
|
||||||
|
### iOS Maplibre Crash Fix
|
||||||
|
|
||||||
|
When using Maplibre MapView on iOS, prevent "Attempt to recycle a mounted view" crash:
|
||||||
|
|
||||||
|
1. **Always render PointAnnotation** (not conditional)
|
||||||
|
2. **Use opacity for visibility** instead of conditional rendering
|
||||||
|
3. **Avoid key prop changes** that force remounting
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
// ✅ GOOD: Stable PointAnnotation
|
||||||
|
<PointAnnotation
|
||||||
|
coordinate={annotationCoordinate} // Always rendered
|
||||||
|
...
|
||||||
|
>
|
||||||
|
<View style={{ opacity: selectedLocation ? 1 : 0 }}>
|
||||||
|
<SelectedLocationMarker />
|
||||||
|
</View>
|
||||||
|
</PointAnnotation>
|
||||||
|
|
||||||
|
// ❌ BAD: Conditional rendering causes crash
|
||||||
|
{selectedLocation && (
|
||||||
|
<PointAnnotation coordinate={selectedLocation} ... />
|
||||||
|
)}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Documentation Files
|
||||||
|
|
||||||
|
- `docs/CHANGE_LOG.md` - Change log for recent updates
|
||||||
|
- `docs/hipmi-note.md` - Build and deployment notes
|
||||||
|
- `docs/prompt-for-qwen-code.md` - Development prompts and patterns
|
||||||
|
|
||||||
|
## Resources
|
||||||
|
|
||||||
|
- [Expo Documentation](https://docs.expo.dev/)
|
||||||
|
- [React Native Documentation](https://reactnative.dev/)
|
||||||
|
- [Expo Router Documentation](https://docs.expo.dev/router/introduction/)
|
||||||
|
- [TypeScript Documentation](https://www.typescriptlang.org/docs/)
|
||||||
|
- [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
|
||||||
|
- User ingin mengecek semua user layout tabs setelah perubahan height layout tabs donation di constants. Pattern yang perlu dicek: semua tabs screens harus pakai contentPadding={PADDING_INLINE} untuk konsistensi layout.
|
||||||
|
|||||||
@@ -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 4
|
versionCode 5
|
||||||
versionName "1.0.1"
|
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-staging-hipmi.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"
|
||||||
|
|||||||
@@ -1,10 +1,21 @@
|
|||||||
// app.config.js
|
// app.config.js
|
||||||
require("dotenv").config();
|
require("dotenv").config();
|
||||||
|
|
||||||
|
// const isDev = process.env.NODE_ENV === "development";
|
||||||
|
// const isStaging = process.env.NEXT_PUBLIC_ENV === "staging";
|
||||||
|
// const isProd = process.env.NEXT_PUBLIC_ENV === "production";
|
||||||
|
|
||||||
|
// Domain berdasarkan environment
|
||||||
|
// const domain = isDev
|
||||||
|
// ? "localhost:3000"
|
||||||
|
// : isStaging
|
||||||
|
// ? "cld-dkr-hipmi-stg.wibudev.com"
|
||||||
|
// : "hipmi.muku.id"; // Production domain
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "HIPMI Badung Connect",
|
name: "HIPMI Badung Connect",
|
||||||
slug: "hipmi-mobile",
|
slug: "hipmi-mobile",
|
||||||
version: "1.0.1",
|
version: "1.0.2",
|
||||||
orientation: "portrait",
|
orientation: "portrait",
|
||||||
icon: "./assets/images/icon.png",
|
icon: "./assets/images/icon.png",
|
||||||
scheme: "hipmimobile",
|
scheme: "hipmimobile",
|
||||||
@@ -14,25 +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: ["applinks:cld-dkr-staging-hipmi.wibudev.com"],
|
associatedDomains: [
|
||||||
buildNumber: "20",
|
"applinks:hipmi.muku.id",
|
||||||
|
],
|
||||||
|
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: 4,
|
versionCode: 5,
|
||||||
// softwareKeyboardLayoutMode: 'resize', // option: untuk mengatur keyboard pada room chst collaboration
|
// softwareKeyboardLayoutMode: 'resize', // option: untuk mengatur keyboard pada room chst collaboration
|
||||||
intentFilters: [
|
intentFilters: [
|
||||||
{
|
{
|
||||||
@@ -41,7 +54,7 @@ export default {
|
|||||||
data: [
|
data: [
|
||||||
{
|
{
|
||||||
scheme: "https",
|
scheme: "https",
|
||||||
host: "cld-dkr-staging-hipmi.wibudev.com",
|
host: "hipmi.muku.id",
|
||||||
pathPrefix: "/",
|
pathPrefix: "/",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@@ -57,6 +70,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
plugins: [
|
plugins: [
|
||||||
|
"./plugins/withCustomConfig",
|
||||||
"expo-router",
|
"expo-router",
|
||||||
"expo-web-browser",
|
"expo-web-browser",
|
||||||
[
|
[
|
||||||
@@ -77,7 +91,6 @@ export default {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
"expo-font",
|
"expo-font",
|
||||||
"@rnmapbox/maps",
|
|
||||||
"@react-native-firebase/app",
|
"@react-native-firebase/app",
|
||||||
[
|
[
|
||||||
"expo-notifications",
|
"expo-notifications",
|
||||||
@@ -87,6 +100,7 @@ export default {
|
|||||||
iosDisplayInForeground: true,
|
iosDisplayInForeground: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
"@maplibre/maplibre-react-native",
|
||||||
],
|
],
|
||||||
|
|
||||||
experiments: {
|
experiments: {
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { BackButton } from "@/components";
|
import { BackButton } from "@/components";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import PdfViewer from "@/components/_ShareComponent/PdfViewer";
|
import PdfViewer from "@/components/_ShareComponent/PdfViewer";
|
||||||
import API_STRORAGE from "@/constants/base-url-api-strorage";
|
import API_STRORAGE from "@/constants/base-url-api-strorage";
|
||||||
import { Stack, useLocalSearchParams } from "expo-router";
|
import { Stack, useLocalSearchParams } from "expo-router";
|
||||||
@@ -7,13 +8,12 @@ import { SafeAreaView } from "react-native-safe-area-context";
|
|||||||
export default function FileScreen() {
|
export default function FileScreen() {
|
||||||
const { id } = useLocalSearchParams();
|
const { id } = useLocalSearchParams();
|
||||||
const url = API_STRORAGE.GET({ fileId: id as string });
|
const url = API_STRORAGE.GET({ fileId: id as string });
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
title: "File",
|
header: () => <AppHeader title="File" left={<BackButton />} />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<SafeAreaView style={{ flex: 1 }} edges={["bottom"]}>
|
<SafeAreaView style={{ flex: 1 }} edges={["bottom"]}>
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ export default function TakePicture() {
|
|||||||
</Pressable>
|
</Pressable>
|
||||||
|
|
||||||
<Pressable onPress={pickImage}>
|
<Pressable onPress={pickImage}>
|
||||||
<AntDesign name="folderopen" size={32} color="white" />
|
<AntDesign name="folder-open" size={32} color="white" />
|
||||||
</Pressable>
|
</Pressable>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
@@ -1,29 +1,27 @@
|
|||||||
import { BackButton } from "@/components";
|
import { BackButton } from "@/components";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import { IconPlus } from "@/components/_Icon";
|
import { IconPlus } from "@/components/_Icon";
|
||||||
import { IconDot } from "@/components/_Icon/IconComponent";
|
import { IconDot } from "@/components/_Icon/IconComponent";
|
||||||
import LeftButtonCustom from "@/components/Button/BackButton";
|
import LeftButtonCustom from "@/components/Button/BackButton";
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
import { ICON_SIZE_SMALL } from "@/constants/constans-value";
|
import { ICON_SIZE_SMALL } from "@/constants/constans-value";
|
||||||
import { HeaderStyles } from "@/styles/header-styles";
|
|
||||||
import { Ionicons } from "@expo/vector-icons";
|
import { Ionicons } from "@expo/vector-icons";
|
||||||
import { router, Stack } from "expo-router";
|
import { router, Stack } from "expo-router";
|
||||||
|
|
||||||
export default function UserLayout() {
|
export default function UserLayout() {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack screenOptions={HeaderStyles}>
|
<Stack>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="delete-account"
|
name="delete-account"
|
||||||
options={{
|
options={{
|
||||||
title: "Hapus Akun",
|
header: () => <AppHeader title="Hapus Akun" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="waiting-room"
|
name="waiting-room"
|
||||||
options={{
|
options={{
|
||||||
title: "Waiting Room",
|
header: () => <AppHeader title="Waiting Room" />,
|
||||||
headerBackVisible: false,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@@ -47,8 +45,7 @@ export default function UserLayout() {
|
|||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="user-search/index"
|
name="user-search/index"
|
||||||
options={{
|
options={{
|
||||||
title: "Pencarian Pengguna",
|
header: () => <AppHeader title="Pencarian Pengguna" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@@ -71,10 +68,18 @@ export default function UserLayout() {
|
|||||||
|
|
||||||
{/* ========== Event Section ========= */}
|
{/* ========== Event Section ========= */}
|
||||||
|
|
||||||
|
{/* <Stack.Screen
|
||||||
|
name="event/(tabs)"
|
||||||
|
options={{
|
||||||
|
header: () => <AppHeader title="Event" left={<BackButton path="/home" />} />,
|
||||||
|
}}
|
||||||
|
/> */}
|
||||||
|
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="event/(tabs)"
|
name="event/(tabs)"
|
||||||
options={{
|
options={{
|
||||||
title: "Event",
|
title: "Event",
|
||||||
|
header: () => <AppHeader title="Event" left={<BackButton path="/home" />} />,
|
||||||
// NOTE: DIPINDAH DI FILE /Event/(Tabs)/_layout.tsx
|
// NOTE: DIPINDAH DI FILE /Event/(Tabs)/_layout.tsx
|
||||||
// headerLeft: () => (
|
// headerLeft: () => (
|
||||||
// <LeftButtonCustom path="/(application)/(user)/home" />
|
// <LeftButtonCustom path="/(application)/(user)/home" />
|
||||||
@@ -85,32 +90,28 @@ export default function UserLayout() {
|
|||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="event/create"
|
name="event/create"
|
||||||
options={{
|
options={{
|
||||||
title: "Tambah Event",
|
header: () => <AppHeader title="Tambah Event" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="event/detail/[id]"
|
name="event/detail/[id]"
|
||||||
options={{
|
options={{
|
||||||
title: "Event Detail",
|
header: () => <AppHeader title="Event Detail" left={<LeftButtonCustom />} />,
|
||||||
headerLeft: () => <LeftButtonCustom />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="event/[id]/edit"
|
name="event/[id]/edit"
|
||||||
options={{
|
options={{
|
||||||
title: "Edit Event",
|
header: () => <AppHeader title="Edit Event" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="event/[id]/list-of-participants"
|
name="event/[id]/list-of-participants"
|
||||||
options={{
|
options={{
|
||||||
title: "Daftar peserta",
|
header: () => <AppHeader title="Daftar peserta" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
{/* ========== End Event Section ========= */}
|
{/* ========== End Event Section ========= */}
|
||||||
@@ -119,22 +120,19 @@ export default function UserLayout() {
|
|||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="collaboration/(tabs)"
|
name="collaboration/(tabs)"
|
||||||
options={{
|
options={{
|
||||||
title: "Collaboration",
|
header: () => <AppHeader title="Collaboration" left={<BackButton path="/home" />} />,
|
||||||
headerLeft: () => <BackButton path="/home" />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="collaboration/create"
|
name="collaboration/create"
|
||||||
options={{
|
options={{
|
||||||
title: "Tambah Proyek",
|
header: () => <AppHeader title="Tambah Proyek" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="collaboration/[id]/list-of-participants"
|
name="collaboration/[id]/list-of-participants"
|
||||||
options={{
|
options={{
|
||||||
title: "Daftar Partisipan",
|
header: () => <AppHeader title="Daftar Partisipan" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
{/* <Stack.Screen
|
{/* <Stack.Screen
|
||||||
@@ -147,22 +145,19 @@ export default function UserLayout() {
|
|||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="collaboration/[id]/edit"
|
name="collaboration/[id]/edit"
|
||||||
options={{
|
options={{
|
||||||
title: "Edit Proyek",
|
header: () => <AppHeader title="Edit Proyek" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="collaboration/[id]/create-pacticipants"
|
name="collaboration/[id]/create-pacticipants"
|
||||||
options={{
|
options={{
|
||||||
title: "Ajukan Partisipasi",
|
header: () => <AppHeader title="Ajukan Partisipasi" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="collaboration/[id]/select-of-participants"
|
name="collaboration/[id]/select-of-participants"
|
||||||
options={{
|
options={{
|
||||||
title: "Pilih Partisipan",
|
header: () => <AppHeader title="Pilih Partisipan" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@@ -172,29 +167,25 @@ export default function UserLayout() {
|
|||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="voting/create"
|
name="voting/create"
|
||||||
options={{
|
options={{
|
||||||
title: "Tambah Voting",
|
header: () => <AppHeader title="Tambah Voting" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="voting/(tabs)"
|
name="voting/(tabs)"
|
||||||
options={{
|
options={{
|
||||||
title: "Voting",
|
header: () => <AppHeader title="Voting" left={<BackButton path="/home" />} />,
|
||||||
headerLeft: () => <BackButton path="/home" />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="voting/[id]/edit"
|
name="voting/[id]/edit"
|
||||||
options={{
|
options={{
|
||||||
title: "Edit Voting",
|
header: () => <AppHeader title="Edit Voting" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="voting/[id]/list-of-contributor"
|
name="voting/[id]/list-of-contributor"
|
||||||
options={{
|
options={{
|
||||||
title: "Daftar Kontributor",
|
header: () => <AppHeader title="Daftar Kontributor" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@@ -204,8 +195,7 @@ export default function UserLayout() {
|
|||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="crowdfunding/index"
|
name="crowdfunding/index"
|
||||||
options={{
|
options={{
|
||||||
title: "Crowdfunding",
|
header: () => <AppHeader title="Crowdfunding" left={<BackButton path="/home" />} />,
|
||||||
headerLeft: () => <BackButton path="/home" />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@@ -215,103 +205,95 @@ export default function UserLayout() {
|
|||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="investment/(tabs)"
|
name="investment/(tabs)"
|
||||||
options={{
|
options={{
|
||||||
title: "Investasi",
|
header: () => <AppHeader title="Investasi" left={<BackButton path="/crowdfunding" />} />,
|
||||||
headerLeft: () => <BackButton path="/crowdfunding" />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="investment/create"
|
name="investment/create"
|
||||||
options={{
|
options={{
|
||||||
title: "Tambah Investasi",
|
header: () => <AppHeader title="Tambah Investasi" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="investment/[id]/index"
|
name="investment/[id]/index"
|
||||||
options={{
|
options={{
|
||||||
title: "Detail Investasi",
|
header: () => <AppHeader title="Detail Investasi" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="investment/[id]/edit"
|
name="investment/[id]/edit"
|
||||||
options={{
|
options={{
|
||||||
title: "Edit Investasi",
|
header: () => <AppHeader title="Edit Investasi" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="investment/[id]/edit-prospectus"
|
name="investment/[id]/edit-prospectus"
|
||||||
options={{
|
options={{
|
||||||
title: "Edit Prospektus",
|
header: () => <AppHeader title="Edit Prospektus" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="investment/[id]/(document)/list-of-document"
|
name="investment/[id]/(document)/list-of-document"
|
||||||
options={{
|
options={{
|
||||||
title: "Daftar Dokumen",
|
header: () => <AppHeader title="Daftar Dokumen" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="investment/[id]/(document)/add-document"
|
name="investment/[id]/(document)/add-document"
|
||||||
options={{
|
options={{
|
||||||
title: "Tambah Dokumen",
|
header: () => <AppHeader title="Tambah Dokumen" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="investment/[id]/(document)/edit-document"
|
name="investment/[id]/(document)/edit-document"
|
||||||
options={{
|
options={{
|
||||||
title: "Edit Dokumen",
|
header: () => <AppHeader title="Edit Dokumen" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="investment/[id]/(news)/add-news"
|
name="investment/[id]/(news)/add-news"
|
||||||
options={{
|
options={{
|
||||||
title: "Tambah Berita",
|
header: () => <AppHeader title="Tambah Berita" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="investment/[id]/investor"
|
name="investment/[id]/investor"
|
||||||
options={{
|
options={{
|
||||||
title: "Investor",
|
header: () => <AppHeader title="Investor" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="investment/[id]/(transaction-flow)/index"
|
name="investment/[id]/(transaction-flow)/index"
|
||||||
options={{
|
options={{
|
||||||
title: "Pembelian Saham",
|
header: () => <AppHeader title="Pembelian Saham" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="investment/[id]/(transaction-flow)/select-bank"
|
name="investment/[id]/(transaction-flow)/select-bank"
|
||||||
options={{
|
options={{
|
||||||
title: "Pilih Bank",
|
header: () => <AppHeader title="Pilih Bank" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="investment/[id]/(transaction-flow)/invoice"
|
name="investment/[id]/(transaction-flow)/invoice"
|
||||||
options={{
|
options={{
|
||||||
title: "Invoice",
|
header: () => (
|
||||||
headerLeft: () => (
|
<AppHeader
|
||||||
<Ionicons
|
title="Invoice"
|
||||||
name="close"
|
left={
|
||||||
size={ICON_SIZE_SMALL}
|
<Ionicons
|
||||||
color={MainColor.yellow}
|
name="close"
|
||||||
onPress={() =>
|
size={ICON_SIZE_SMALL}
|
||||||
router.navigate(`/investment/(tabs)/transaction`)
|
color={MainColor.yellow}
|
||||||
|
onPress={() =>
|
||||||
|
router.navigate(`/investment/(tabs)/transaction`)
|
||||||
|
}
|
||||||
|
/>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
@@ -320,14 +302,18 @@ export default function UserLayout() {
|
|||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="investment/[id]/(transaction-flow)/process"
|
name="investment/[id]/(transaction-flow)/process"
|
||||||
options={{
|
options={{
|
||||||
title: "Proses",
|
header: () => (
|
||||||
headerLeft: () => (
|
<AppHeader
|
||||||
<Ionicons
|
title="Proses"
|
||||||
name="close"
|
left={
|
||||||
size={ICON_SIZE_SMALL}
|
<Ionicons
|
||||||
color={MainColor.yellow}
|
name="close"
|
||||||
onPress={() =>
|
size={ICON_SIZE_SMALL}
|
||||||
router.navigate(`/investment/(tabs)/transaction`)
|
color={MainColor.yellow}
|
||||||
|
onPress={() =>
|
||||||
|
router.navigate(`/investment/(tabs)/transaction`)
|
||||||
|
}
|
||||||
|
/>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
@@ -336,23 +322,20 @@ export default function UserLayout() {
|
|||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="investment/[id]/(transaction-flow)/success"
|
name="investment/[id]/(transaction-flow)/success"
|
||||||
options={{
|
options={{
|
||||||
title: "Transaksi Berhasil",
|
header: () => <AppHeader title="Transaksi Berhasil" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="investment/[id]/(transaction-flow)/failed"
|
name="investment/[id]/(transaction-flow)/failed"
|
||||||
options={{
|
options={{
|
||||||
title: "Transaksi Gagal",
|
header: () => <AppHeader title="Transaksi Gagal" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="investment/[id]/(my-holding)/[id]"
|
name="investment/[id]/(my-holding)/[id]"
|
||||||
options={{
|
options={{
|
||||||
title: "Detail Saham Saya",
|
header: () => <AppHeader title="Detail Saham Saya" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
{/* ========== End Investment Section ========= */}
|
{/* ========== End Investment Section ========= */}
|
||||||
@@ -361,122 +344,111 @@ export default function UserLayout() {
|
|||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="donation/(tabs)"
|
name="donation/(tabs)"
|
||||||
options={{
|
options={{
|
||||||
title: "Donasi",
|
header: () => <AppHeader title="Donasi" left={<BackButton path="/crowdfunding" />} />,
|
||||||
headerLeft: () => <BackButton path="/crowdfunding" />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="donation/create"
|
name="donation/create"
|
||||||
options={{
|
options={{
|
||||||
title: "Tambah Donasi",
|
header: () => <AppHeader title="Tambah Donasi" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="donation/create-story"
|
name="donation/create-story"
|
||||||
options={{
|
options={{
|
||||||
title: "Tambah Donasi",
|
header: () => <AppHeader title="Tambah Donasi" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="donation/[id]/edit"
|
name="donation/[id]/edit"
|
||||||
options={{
|
options={{
|
||||||
title: "Edit Donasi",
|
header: () => <AppHeader title="Edit Donasi" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="donation/[id]/edit-story"
|
name="donation/[id]/edit-story"
|
||||||
options={{
|
options={{
|
||||||
title: "Edit Donasi",
|
header: () => <AppHeader title="Edit Donasi" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="donation/[id]/edit-rekening"
|
name="donation/[id]/edit-rekening"
|
||||||
options={{
|
options={{
|
||||||
title: "Edit Rekening",
|
header: () => <AppHeader title="Edit Rekening" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="donation/[id]/detail-story"
|
name="donation/[id]/detail-story"
|
||||||
options={{
|
options={{
|
||||||
title: "Cerita Penggalang",
|
header: () => <AppHeader title="Cerita Penggalang" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="donation/[id]/infromation-fundrising"
|
name="donation/[id]/infromation-fundrising"
|
||||||
options={{
|
options={{
|
||||||
title: "Informasi Penggalang Dana",
|
header: () => <AppHeader title="Informasi Penggalang Dana" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="donation/[id]/list-of-donatur"
|
name="donation/[id]/list-of-donatur"
|
||||||
options={{
|
options={{
|
||||||
title: "Daftar Donatur",
|
header: () => <AppHeader title="Daftar Donatur" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="donation/[id]/fund-disbursement"
|
name="donation/[id]/fund-disbursement"
|
||||||
options={{
|
options={{
|
||||||
title: "Pencairan Dana",
|
header: () => <AppHeader title="Pencairan Dana" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="donation/[id]/(news)/recap-of-news"
|
name="donation/[id]/(news)/recap-of-news"
|
||||||
options={{
|
options={{
|
||||||
title: "Rekap Kabar",
|
header: () => <AppHeader title="Rekap Kabar" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="donation/[id]/(news)/add-news"
|
name="donation/[id]/(news)/add-news"
|
||||||
options={{
|
options={{
|
||||||
title: "Tambah Berita",
|
header: () => <AppHeader title="Tambah Berita" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="donation/[id]/(news)/[news]/edit-news"
|
name="donation/[id]/(news)/[news]/edit-news"
|
||||||
options={{
|
options={{
|
||||||
title: "Edit Berita",
|
header: () => <AppHeader title="Edit Berita" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="donation/[id]/(transaction-flow)/index"
|
name="donation/[id]/(transaction-flow)/index"
|
||||||
options={{
|
options={{
|
||||||
title: "Donasi",
|
header: () => <AppHeader title="Donasi" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="donation/[id]/(transaction-flow)/select-bank"
|
name="donation/[id]/(transaction-flow)/select-bank"
|
||||||
options={{
|
options={{
|
||||||
title: "Pilih Bank",
|
header: () => <AppHeader title="Pilih Bank" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="donation/[id]/(transaction-flow)/[invoiceId]/invoice"
|
name="donation/[id]/(transaction-flow)/[invoiceId]/invoice"
|
||||||
options={{
|
options={{
|
||||||
title: "Invoice",
|
header: () => (
|
||||||
headerLeft: () => (
|
<AppHeader
|
||||||
<Ionicons
|
title="Invoice"
|
||||||
name="close"
|
left={
|
||||||
size={ICON_SIZE_SMALL}
|
<Ionicons
|
||||||
color={MainColor.yellow}
|
name="close"
|
||||||
onPress={() => router.navigate(`/donation/(tabs)/my-donation`)}
|
size={ICON_SIZE_SMALL}
|
||||||
|
color={MainColor.yellow}
|
||||||
|
onPress={() => router.navigate(`/donation/(tabs)/my-donation`)}
|
||||||
|
/>
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
@@ -484,13 +456,17 @@ export default function UserLayout() {
|
|||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="donation/[id]/(transaction-flow)/[invoiceId]/process"
|
name="donation/[id]/(transaction-flow)/[invoiceId]/process"
|
||||||
options={{
|
options={{
|
||||||
title: "Proses",
|
header: () => (
|
||||||
headerLeft: () => (
|
<AppHeader
|
||||||
<Ionicons
|
title="Proses"
|
||||||
name="close"
|
left={
|
||||||
size={ICON_SIZE_SMALL}
|
<Ionicons
|
||||||
color={MainColor.yellow}
|
name="close"
|
||||||
onPress={() => router.navigate(`/donation/(tabs)/my-donation`)}
|
size={ICON_SIZE_SMALL}
|
||||||
|
color={MainColor.yellow}
|
||||||
|
onPress={() => router.navigate(`/donation/(tabs)/my-donation`)}
|
||||||
|
/>
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
@@ -498,55 +474,51 @@ export default function UserLayout() {
|
|||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="donation/[id]/(transaction-flow)/[invoiceId]/success"
|
name="donation/[id]/(transaction-flow)/[invoiceId]/success"
|
||||||
options={{
|
options={{
|
||||||
title: "Donasi Berhasil",
|
header: () => <AppHeader title="Donasi Berhasil" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="donation/[id]/(transaction-flow)/[invoiceId]/failed"
|
name="donation/[id]/(transaction-flow)/[invoiceId]/failed"
|
||||||
options={{
|
options={{
|
||||||
title: "Donasi Gagal",
|
header: () => <AppHeader title="Donasi Gagal" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{/* ========== End Donation Section ========= */}
|
{/* ========== End Donation Section ========= */}
|
||||||
|
|
||||||
{/* ========== Job Section ========= */}
|
{/* ========== Job Section ========= */}
|
||||||
|
|
||||||
|
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="job/create"
|
name="job/create"
|
||||||
options={{
|
options={{
|
||||||
title: "Tambah Job",
|
header: () => <AppHeader title="Tambah Job" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="job/(tabs)"
|
name="job/(tabs)"
|
||||||
options={{
|
options={{
|
||||||
title: "Job Vacancy",
|
title: "Job Vacancy",
|
||||||
// headerLeft: () => <BackButton path="/home" />,
|
|
||||||
// NOTE: headerLeft di pindahkan ke Tabs Layout
|
// NOTE: headerLeft di pindahkan ke Tabs Layout
|
||||||
|
header: () => <AppHeader title="Job Vacancy" left={<BackButton path="/home" />} />,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="job/[id]/index"
|
name="job/[id]/index"
|
||||||
options={{
|
options={{
|
||||||
title: "Detail Job",
|
header: () => <AppHeader title="Detail Job" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="job/[id]/edit"
|
name="job/[id]/edit"
|
||||||
options={{
|
options={{
|
||||||
title: "Edit Job",
|
header: () => <AppHeader title="Edit Job" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="job/[id]/archive"
|
name="job/[id]/archive"
|
||||||
options={{
|
options={{
|
||||||
title: "Arsip Job",
|
header: () => <AppHeader title="Arsip Job" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@@ -556,78 +528,67 @@ export default function UserLayout() {
|
|||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="forum/create"
|
name="forum/create"
|
||||||
options={{
|
options={{
|
||||||
title: "Tambah Diskusi",
|
header: () => <AppHeader title="Tambah Diskusi" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="forum/[id]/edit"
|
name="forum/[id]/edit"
|
||||||
options={{
|
options={{
|
||||||
title: "Edit Diskusi",
|
header: () => <AppHeader title="Edit Diskusi" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="forum/[id]/forumku"
|
name="forum/[id]/forumku"
|
||||||
options={{
|
options={{
|
||||||
title: "Forumku",
|
header: () => <AppHeader title="Forumku" left={<BackButton icon={"close"} />} />,
|
||||||
headerLeft: () => <BackButton icon={"close"} />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="forum/[id]/index"
|
name="forum/[id]/index"
|
||||||
options={{
|
options={{
|
||||||
title: "Detail",
|
header: () => <AppHeader title="Detail" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="forum/[id]/report-commentar"
|
name="forum/[id]/report-commentar"
|
||||||
options={{
|
options={{
|
||||||
title: "Laporkan Komentar",
|
header: () => <AppHeader title="Laporkan Komentar" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="forum/[id]/other-report-commentar"
|
name="forum/[id]/other-report-commentar"
|
||||||
options={{
|
options={{
|
||||||
title: "Laporkan Komentar",
|
header: () => <AppHeader title="Laporkan Komentar" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="forum/[id]/report-posting"
|
name="forum/[id]/report-posting"
|
||||||
options={{
|
options={{
|
||||||
title: "Laporkan Diskusi",
|
header: () => <AppHeader title="Laporkan Diskusi" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="forum/[id]/other-report-posting"
|
name="forum/[id]/other-report-posting"
|
||||||
options={{
|
options={{
|
||||||
title: "Laporkan Diskusi",
|
header: () => <AppHeader title="Laporkan Diskusi" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="forum/terms"
|
name="forum/terms"
|
||||||
options={{
|
options={{
|
||||||
title: "Syarat & Ketentuan Forum",
|
header: () => <AppHeader title="Syarat & Ketentuan Forum" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="forum/[id]/preview-report-posting"
|
name="forum/[id]/preview-report-posting"
|
||||||
options={{
|
options={{
|
||||||
title: "Laporan Postingan",
|
header: () => <AppHeader title="Laporan Postingan" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="forum/[id]/preview-report-comment"
|
name="forum/[id]/preview-report-comment"
|
||||||
options={{
|
options={{
|
||||||
title: "Laporan Komentar",
|
header: () => <AppHeader title="Laporan Komentar" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@@ -635,29 +596,25 @@ export default function UserLayout() {
|
|||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="maps/index"
|
name="maps/index"
|
||||||
options={{
|
options={{
|
||||||
title: "Maps",
|
header: () => <AppHeader title="Maps" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="maps/create"
|
name="maps/create"
|
||||||
options={{
|
options={{
|
||||||
title: "Tambah Maps",
|
header: () => <AppHeader title="Tambah Maps" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="maps/[id]/edit"
|
name="maps/[id]/edit"
|
||||||
options={{
|
options={{
|
||||||
title: "Edit Maps",
|
header: () => <AppHeader title="Edit Maps" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="maps/[id]/custom-pin"
|
name="maps/[id]/custom-pin"
|
||||||
options={{
|
options={{
|
||||||
title: "Custom Pin Maps",
|
header: () => <AppHeader title="Custom Pin Maps" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@@ -665,8 +622,7 @@ export default function UserLayout() {
|
|||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="marketplace/index"
|
name="marketplace/index"
|
||||||
options={{
|
options={{
|
||||||
title: "Market Place",
|
header: () => <AppHeader title="Market Place" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|||||||
@@ -2,35 +2,64 @@ import { IconHome } from "@/components/_Icon";
|
|||||||
import { TabsStyles } from "@/styles/tabs-styles";
|
import { TabsStyles } from "@/styles/tabs-styles";
|
||||||
import { Ionicons } from "@expo/vector-icons";
|
import { Ionicons } from "@expo/vector-icons";
|
||||||
import { Tabs } from "expo-router";
|
import { Tabs } from "expo-router";
|
||||||
|
import { View } from "react-native";
|
||||||
|
import { MainColor } from "@/constants/color-palet";
|
||||||
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
||||||
|
import { Platform } from "react-native";
|
||||||
|
|
||||||
|
function CollaborationTabsWrapper() {
|
||||||
|
const insets = useSafeAreaInsets();
|
||||||
|
const paddingBottom = Platform.OS === "android" ? insets.bottom : 0;
|
||||||
|
|
||||||
export default function CollaborationTabsLayout() {
|
|
||||||
return (
|
return (
|
||||||
<Tabs screenOptions={TabsStyles}>
|
<View style={{ flex: 1, backgroundColor: MainColor.darkblue }}>
|
||||||
<Tabs.Screen
|
<Tabs
|
||||||
name="index"
|
screenOptions={{
|
||||||
options={{
|
...TabsStyles,
|
||||||
title: "Beranda",
|
tabBarStyle: Platform.select({
|
||||||
tabBarIcon: ({ color }) => <IconHome color={color} />,
|
ios: {
|
||||||
|
borderTopWidth: 0,
|
||||||
|
paddingTop: 12,
|
||||||
|
height: 80,
|
||||||
|
},
|
||||||
|
android: {
|
||||||
|
borderTopWidth: 0,
|
||||||
|
paddingTop: 5,
|
||||||
|
height: 70 + paddingBottom,
|
||||||
|
},
|
||||||
|
}),
|
||||||
}}
|
}}
|
||||||
/>
|
>
|
||||||
<Tabs.Screen
|
<Tabs.Screen
|
||||||
name="participant"
|
name="index"
|
||||||
options={{
|
options={{
|
||||||
title: "Partisipan",
|
title: "Beranda",
|
||||||
tabBarIcon: ({ color }) => (
|
tabBarIcon: ({ color }) => <IconHome color={color} />,
|
||||||
<Ionicons size={20} name="people" color={color} />
|
}}
|
||||||
),
|
/>
|
||||||
}}
|
<Tabs.Screen
|
||||||
/>
|
name="participant"
|
||||||
<Tabs.Screen
|
options={{
|
||||||
name="group"
|
title: "Partisipan",
|
||||||
options={{
|
tabBarIcon: ({ color }) => (
|
||||||
title: "Grup",
|
<Ionicons size={20} name="people" color={color} />
|
||||||
tabBarIcon: ({ color }) => (
|
),
|
||||||
<Ionicons size={20} name="chatbox-ellipses" color={color} />
|
}}
|
||||||
),
|
/>
|
||||||
}}
|
<Tabs.Screen
|
||||||
/>
|
name="group"
|
||||||
</Tabs>
|
options={{
|
||||||
|
title: "Grup",
|
||||||
|
tabBarIcon: ({ color }) => (
|
||||||
|
<Ionicons size={20} name="chatbox-ellipses" color={color} />
|
||||||
|
),
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Tabs>
|
||||||
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default function CollaborationTabsLayout() {
|
||||||
|
return <CollaborationTabsWrapper />;
|
||||||
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import {
|
|||||||
TextCustom,
|
TextCustom,
|
||||||
ViewWrapper,
|
ViewWrapper,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import { apiCollaborationGroup } from "@/service/api-client/api-collaboration";
|
import { apiCollaborationGroup } from "@/service/api-client/api-collaboration";
|
||||||
import { Stack, useFocusEffect, useLocalSearchParams } from "expo-router";
|
import { Stack, useFocusEffect, useLocalSearchParams } from "expo-router";
|
||||||
import { useState, useCallback } from "react";
|
import { useState, useCallback } from "react";
|
||||||
@@ -40,8 +41,7 @@ export default function CollaborationRoomInfo() {
|
|||||||
<>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
title: `Info`,
|
header: () => <AppHeader title="Info" left={<BackButton />} />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { BackButton } from "@/components";
|
import { BackButton } from "@/components";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
import { ICON_SIZE_SMALL } from "@/constants/constans-value";
|
import { ICON_SIZE_SMALL } from "@/constants/constans-value";
|
||||||
import ChatScreen from "@/screens/Collaboration/GroupChatSection";
|
import ChatScreen from "@/screens/Collaboration/GroupChatSection";
|
||||||
@@ -12,14 +13,18 @@ export default function CollaborationRoomChat() {
|
|||||||
<>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
title: `Proyek ${detail}`,
|
header: () => (
|
||||||
headerLeft: () => <BackButton />,
|
<AppHeader
|
||||||
headerRight: () => (
|
title={`Proyek ${detail}`}
|
||||||
<Feather
|
left={<BackButton />}
|
||||||
name="info"
|
right={
|
||||||
size={ICON_SIZE_SMALL}
|
<Feather
|
||||||
color={MainColor.yellow}
|
name="info"
|
||||||
onPress={() => router.push(`/collaboration/${id}/${detail}/info`)}
|
size={ICON_SIZE_SMALL}
|
||||||
|
color={MainColor.yellow}
|
||||||
|
onPress={() => router.push(`/collaboration/${id}/${detail}/info`)}
|
||||||
|
/>
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import {
|
|||||||
MenuDrawerDynamicGrid,
|
MenuDrawerDynamicGrid,
|
||||||
ViewWrapper
|
ViewWrapper
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import Collaboration_BoxDetailSection from "@/screens/Collaboration/BoxDetailSection";
|
import Collaboration_BoxDetailSection from "@/screens/Collaboration/BoxDetailSection";
|
||||||
import { apiCollaborationGetOne } from "@/service/api-client/api-collaboration";
|
import { apiCollaborationGetOne } from "@/service/api-client/api-collaboration";
|
||||||
import { Ionicons } from "@expo/vector-icons";
|
import { Ionicons } from "@expo/vector-icons";
|
||||||
@@ -38,10 +39,14 @@ export default function CollaborationDetailParticipant() {
|
|||||||
<>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
title: "Detail Proyek",
|
header: () => (
|
||||||
headerLeft: () => <BackButton />,
|
<AppHeader
|
||||||
headerRight: () => (
|
title="Detail Proyek"
|
||||||
<DotButton onPress={() => setOpenDrawerParticipant(true)} />
|
left={<BackButton />}
|
||||||
|
right={
|
||||||
|
<DotButton onPress={() => setOpenDrawerParticipant(true)} />
|
||||||
|
}
|
||||||
|
/>
|
||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import {
|
|||||||
Spacing,
|
Spacing,
|
||||||
ViewWrapper
|
ViewWrapper
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import { IconEdit } from "@/components/_Icon";
|
import { IconEdit } from "@/components/_Icon";
|
||||||
import Collaboration_BoxDetailSection from "@/screens/Collaboration/BoxDetailSection";
|
import Collaboration_BoxDetailSection from "@/screens/Collaboration/BoxDetailSection";
|
||||||
import {
|
import {
|
||||||
@@ -66,9 +67,13 @@ export default function CollaborationDetailProjectMain() {
|
|||||||
<>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
title: "Proyek Saya",
|
header: () => (
|
||||||
headerLeft: () => <BackButton />,
|
<AppHeader
|
||||||
headerRight: () => <DotButton onPress={() => setOpenDrawer(true)} />,
|
title="Proyek Saya"
|
||||||
|
left={<BackButton />}
|
||||||
|
right={<DotButton onPress={() => setOpenDrawer(true)} />}
|
||||||
|
/>
|
||||||
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ViewWrapper>
|
<ViewWrapper>
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import {
|
|||||||
MenuDrawerDynamicGrid,
|
MenuDrawerDynamicGrid,
|
||||||
ViewWrapper,
|
ViewWrapper,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import { useAuth } from "@/hooks/use-auth";
|
import { useAuth } from "@/hooks/use-auth";
|
||||||
import Collaboration_BoxDetailSection from "@/screens/Collaboration/BoxDetailSection";
|
import Collaboration_BoxDetailSection from "@/screens/Collaboration/BoxDetailSection";
|
||||||
import {
|
import {
|
||||||
@@ -74,10 +75,14 @@ export default function CollaborationDetail() {
|
|||||||
<>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
title: "Detail Proyek",
|
header: () => (
|
||||||
headerLeft: () => <BackButton />,
|
<AppHeader
|
||||||
headerRight: () => (
|
title="Detail Proyek"
|
||||||
<DotButton onPress={() => setOpenDrawerMenu(true)} />
|
left={<BackButton />}
|
||||||
|
right={
|
||||||
|
<DotButton onPress={() => setOpenDrawerMenu(true)} />
|
||||||
|
}
|
||||||
|
/>
|
||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import {
|
import {
|
||||||
BaseBox,
|
BaseBox,
|
||||||
Grid,
|
Grid,
|
||||||
|
OS_Wrapper,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
TextCustom,
|
TextCustom,
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
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";
|
||||||
@@ -25,7 +25,7 @@ export default function Crowdfunding() {
|
|||||||
];
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ViewWrapper>
|
<OS_Wrapper>
|
||||||
<StackCustom>
|
<StackCustom>
|
||||||
<Image
|
<Image
|
||||||
source={require("@/assets/images/constants/crowd-hipmi.png")}
|
source={require("@/assets/images/constants/crowd-hipmi.png")}
|
||||||
@@ -63,6 +63,6 @@ export default function Crowdfunding() {
|
|||||||
</BaseBox>
|
</BaseBox>
|
||||||
))}
|
))}
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
</ViewWrapper>
|
</OS_Wrapper>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,37 +1,66 @@
|
|||||||
import { IconHome, IconStatus } from "@/components/_Icon";
|
import { IconHome, IconStatus } from "@/components/_Icon";
|
||||||
import { ICON_SIZE_SMALL } from "@/constants/constans-value";
|
import { ICON_SIZE_SMALL, OS_ANDROID_HEIGHT, OS_IOS_HEIGHT } from "@/constants/constans-value";
|
||||||
import { TabsStyles } from "@/styles/tabs-styles";
|
import { TabsStyles } from "@/styles/tabs-styles";
|
||||||
import {
|
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: OS_IOS_HEIGHT,
|
||||||
|
},
|
||||||
|
android: {
|
||||||
|
borderTopWidth: 0,
|
||||||
|
paddingTop: 5,
|
||||||
|
height: OS_ANDROID_HEIGHT + 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 />;
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,56 +1,9 @@
|
|||||||
import {
|
import Donation_ScreenBeranda from "@/screens/Donation/ScreenBeranda";
|
||||||
FloatingButton,
|
|
||||||
LoaderCustom,
|
|
||||||
TextCustom,
|
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
|
||||||
import Donation_BoxPublish from "@/screens/Donation/BoxPublish";
|
|
||||||
import { apiDonationGetAll } from "@/service/api-client/api-donation";
|
|
||||||
import { router, useFocusEffect } from "expo-router";
|
|
||||||
import _ from "lodash";
|
|
||||||
import { useCallback, useState } from "react";
|
|
||||||
|
|
||||||
export default function DonationBeranda() {
|
export default function DonationBeranda() {
|
||||||
const [list, setList] = useState<any[] | null>(null);
|
|
||||||
const [loadList, setLoadList] = useState(false);
|
|
||||||
|
|
||||||
useFocusEffect(
|
|
||||||
useCallback(() => {
|
|
||||||
onLoadData();
|
|
||||||
}, [])
|
|
||||||
);
|
|
||||||
|
|
||||||
const onLoadData = async () => {
|
|
||||||
try {
|
|
||||||
setLoadList(true);
|
|
||||||
const response = await apiDonationGetAll({
|
|
||||||
category: "beranda"
|
|
||||||
});
|
|
||||||
|
|
||||||
setList(response.data);
|
|
||||||
} catch (error) {
|
|
||||||
console.log("[ERROR]", error);
|
|
||||||
} finally {
|
|
||||||
setLoadList(false);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ViewWrapper
|
<>
|
||||||
hideFooter
|
<Donation_ScreenBeranda />
|
||||||
floatingButton={
|
</>
|
||||||
<FloatingButton onPress={() => router.push("/donation/create")} />
|
|
||||||
}
|
|
||||||
>
|
|
||||||
{loadList ? (
|
|
||||||
<LoaderCustom />
|
|
||||||
) : _.isEmpty(list) ? (
|
|
||||||
<TextCustom align="center" color="gray">Belum ada donasi</TextCustom>
|
|
||||||
) : (
|
|
||||||
list?.map((item: any, index: number) => (
|
|
||||||
<Donation_BoxPublish data={item} key={index} id={item.id} />
|
|
||||||
))
|
|
||||||
)}
|
|
||||||
</ViewWrapper>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,148 +1,5 @@
|
|||||||
/* eslint-disable react-hooks/exhaustive-deps */
|
import Donation_ScreenMyDonation from "@/screens/Donation/ScreenMyDonation";
|
||||||
import {
|
|
||||||
BadgeCustom,
|
|
||||||
BaseBox,
|
|
||||||
DummyLandscapeImage,
|
|
||||||
Grid,
|
|
||||||
LoaderCustom,
|
|
||||||
StackCustom,
|
|
||||||
TextCustom,
|
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
|
||||||
import { useAuth } from "@/hooks/use-auth";
|
|
||||||
import { apiDonationGetAll } from "@/service/api-client/api-donation";
|
|
||||||
import { formatCurrencyDisplay } from "@/utils/formatCurrencyDisplay";
|
|
||||||
import { Href, router, useFocusEffect } from "expo-router";
|
|
||||||
import _ from "lodash";
|
|
||||||
import { useCallback, useState } from "react";
|
|
||||||
import { View } from "react-native";
|
|
||||||
import Toast from "react-native-toast-message";
|
|
||||||
|
|
||||||
export default function DonationMyDonation() {
|
export default function DonationMyDonation() {
|
||||||
const { user } = useAuth();
|
return <Donation_ScreenMyDonation />;
|
||||||
const [list, setList] = useState<any[] | null>(null);
|
|
||||||
const [loadList, setLoadList] = useState(false);
|
|
||||||
|
|
||||||
useFocusEffect(
|
|
||||||
useCallback(() => {
|
|
||||||
onLoadData();
|
|
||||||
}, [user?.id]),
|
|
||||||
);
|
|
||||||
|
|
||||||
const onLoadData = async () => {
|
|
||||||
if (!user?.id) {
|
|
||||||
Toast.show({
|
|
||||||
type: "error",
|
|
||||||
text1: "Load data gagal, user tidak ditemukan",
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
setLoadList(true);
|
|
||||||
const response = await apiDonationGetAll({
|
|
||||||
category: "my-donation",
|
|
||||||
authorId: user?.id,
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
setList(response.data);
|
|
||||||
} catch (error) {
|
|
||||||
console.log("[ERROR]", error);
|
|
||||||
} finally {
|
|
||||||
setLoadList(false);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const handlerColor = (status: string) => {
|
|
||||||
if (status === "menunggu") {
|
|
||||||
return "orange";
|
|
||||||
} else if (status === "proses") {
|
|
||||||
return "white";
|
|
||||||
} else if (status === "berhasil") {
|
|
||||||
return "green";
|
|
||||||
} else if (status === "gagal") {
|
|
||||||
return "red";
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const handlePress = ({
|
|
||||||
invoiceId,
|
|
||||||
donationId,
|
|
||||||
status,
|
|
||||||
}: {
|
|
||||||
invoiceId: string;
|
|
||||||
donationId: string;
|
|
||||||
status: string;
|
|
||||||
}) => {
|
|
||||||
const url: Href = `../${donationId}/(transaction-flow)/${invoiceId}`;
|
|
||||||
if (status === "menunggu") {
|
|
||||||
router.push(`${url}/invoice`);
|
|
||||||
} else if (status === "proses") {
|
|
||||||
router.push(`${url}/process`);
|
|
||||||
} else if (status === "berhasil") {
|
|
||||||
router.push(`${url}/success`);
|
|
||||||
} else if (status === "gagal") {
|
|
||||||
router.push(`${url}/failed`);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<ViewWrapper hideFooter>
|
|
||||||
{loadList ? (
|
|
||||||
<LoaderCustom />
|
|
||||||
) : _.isEmpty(list) ? (
|
|
||||||
<TextCustom align="center" color="gray">
|
|
||||||
Belum ada transaksi
|
|
||||||
</TextCustom>
|
|
||||||
) : (
|
|
||||||
list?.map((item, index) => (
|
|
||||||
<BaseBox
|
|
||||||
key={index}
|
|
||||||
paddingTop={7}
|
|
||||||
paddingBottom={7}
|
|
||||||
onPress={() => {
|
|
||||||
handlePress({
|
|
||||||
status: _.lowerCase(item.statusInvoice),
|
|
||||||
invoiceId: item.id,
|
|
||||||
donationId: item.donasiId,
|
|
||||||
});
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Grid>
|
|
||||||
<Grid.Col span={5}>
|
|
||||||
<DummyLandscapeImage
|
|
||||||
height={100}
|
|
||||||
unClickPath
|
|
||||||
imageId={item.imageId}
|
|
||||||
/>
|
|
||||||
</Grid.Col>
|
|
||||||
<Grid.Col span={1}>
|
|
||||||
<View />
|
|
||||||
</Grid.Col>
|
|
||||||
<Grid.Col span={6}>
|
|
||||||
<StackCustom>
|
|
||||||
<TextCustom truncate={2} bold>
|
|
||||||
{item.title || "-"}
|
|
||||||
</TextCustom>
|
|
||||||
|
|
||||||
<TextCustom bold color="yellow">
|
|
||||||
Rp. {formatCurrencyDisplay(item.nominal)}
|
|
||||||
</TextCustom>
|
|
||||||
|
|
||||||
<BadgeCustom
|
|
||||||
variant="light"
|
|
||||||
color={handlerColor(_.lowerCase(item.statusInvoice))}
|
|
||||||
fullWidth
|
|
||||||
>
|
|
||||||
{item.statusInvoice}
|
|
||||||
</BadgeCustom>
|
|
||||||
</StackCustom>
|
|
||||||
</Grid.Col>
|
|
||||||
</Grid>
|
|
||||||
</BaseBox>
|
|
||||||
))
|
|
||||||
)}
|
|
||||||
</ViewWrapper>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
/* eslint-disable react-hooks/exhaustive-deps */
|
/* eslint-disable react-hooks/exhaustive-deps */
|
||||||
import {
|
import {
|
||||||
|
BoxButtonOnFooter,
|
||||||
ButtonCenteredOnly,
|
ButtonCenteredOnly,
|
||||||
ButtonCustom,
|
ButtonCustom,
|
||||||
InformationBox,
|
InformationBox,
|
||||||
LandscapeFrameUploaded,
|
LandscapeFrameUploaded,
|
||||||
|
OS_Wrapper,
|
||||||
Spacing,
|
Spacing,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
TextAreaCustom,
|
TextAreaCustom,
|
||||||
TextInputCustom,
|
TextInputCustom,
|
||||||
ViewWrapper,
|
|
||||||
} 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";
|
||||||
@@ -31,7 +32,7 @@ export default function DonationEditNews() {
|
|||||||
useFocusEffect(
|
useFocusEffect(
|
||||||
useCallback(() => {
|
useCallback(() => {
|
||||||
onLoadData();
|
onLoadData();
|
||||||
}, [news])
|
}, [news]),
|
||||||
);
|
);
|
||||||
|
|
||||||
const onLoadData = async () => {
|
const onLoadData = async () => {
|
||||||
@@ -104,7 +105,23 @@ export default function DonationEditNews() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ViewWrapper>
|
<OS_Wrapper
|
||||||
|
enableKeyboardHandling
|
||||||
|
contentPaddingBottom={250}
|
||||||
|
footerComponent={
|
||||||
|
<BoxButtonOnFooter>
|
||||||
|
<ButtonCustom
|
||||||
|
disabled={!data?.title || !data?.deskripsi}
|
||||||
|
isLoading={isLoading}
|
||||||
|
onPress={() => {
|
||||||
|
handlerSubmitUpdate();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Update
|
||||||
|
</ButtonCustom>
|
||||||
|
</BoxButtonOnFooter>
|
||||||
|
}
|
||||||
|
>
|
||||||
<StackCustom gap={"xs"}>
|
<StackCustom gap={"xs"}>
|
||||||
<InformationBox text="Upload gambar bersifat opsional untuk melengkapi kabar terkait donasi Anda." />
|
<InformationBox text="Upload gambar bersifat opsional untuk melengkapi kabar terkait donasi Anda." />
|
||||||
<LandscapeFrameUploaded
|
<LandscapeFrameUploaded
|
||||||
@@ -148,17 +165,8 @@ export default function DonationEditNews() {
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<Spacing />
|
<Spacing />
|
||||||
<ButtonCustom
|
|
||||||
disabled={!data?.title || !data?.deskripsi}
|
|
||||||
isLoading={isLoading}
|
|
||||||
onPress={() => {
|
|
||||||
handlerSubmitUpdate();
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Update
|
|
||||||
</ButtonCustom>
|
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
<Spacing />
|
<Spacing />
|
||||||
</ViewWrapper>
|
</OS_Wrapper>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,10 +7,11 @@ import {
|
|||||||
DrawerCustom,
|
DrawerCustom,
|
||||||
DummyLandscapeImage,
|
DummyLandscapeImage,
|
||||||
MenuDrawerDynamicGrid,
|
MenuDrawerDynamicGrid,
|
||||||
|
OS_Wrapper,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
TextCustom,
|
TextCustom,
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import { IconEdit } from "@/components/_Icon";
|
import { IconEdit } from "@/components/_Icon";
|
||||||
import { IconTrash } from "@/components/_Icon/IconTrash";
|
import { IconTrash } from "@/components/_Icon/IconTrash";
|
||||||
import { useAuth } from "@/hooks/use-auth";
|
import { useAuth } from "@/hooks/use-auth";
|
||||||
@@ -27,6 +28,7 @@ import {
|
|||||||
} from "expo-router";
|
} from "expo-router";
|
||||||
import { useCallback, useState } from "react";
|
import { useCallback, useState } from "react";
|
||||||
import Toast from "react-native-toast-message";
|
import Toast from "react-native-toast-message";
|
||||||
|
import { dateTimeView } from "@/utils/dateTimeView";
|
||||||
|
|
||||||
export default function DonationNews() {
|
export default function DonationNews() {
|
||||||
const { user } = useAuth();
|
const { user } = useAuth();
|
||||||
@@ -57,19 +59,24 @@ export default function DonationNews() {
|
|||||||
<>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
title: "Detail Kabar",
|
header: () => (
|
||||||
headerLeft: () => <BackButton />,
|
<AppHeader
|
||||||
headerRight: () =>
|
title="Detail Kabar"
|
||||||
user?.id === data?.authorId && (
|
left={<BackButton />}
|
||||||
<DotButton onPress={() => setOpenDrawer(true)} />
|
right={
|
||||||
),
|
user?.id === data?.authorId && (
|
||||||
|
<DotButton onPress={() => setOpenDrawer(true)} />
|
||||||
|
)
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ViewWrapper>
|
<OS_Wrapper>
|
||||||
<BaseBox>
|
<BaseBox>
|
||||||
<StackCustom>
|
<StackCustom>
|
||||||
<TextCustom style={{ alignSelf: "flex-end" }}>
|
<TextCustom color="gray" size={"small"} style={{ alignSelf: "flex-end" }}>
|
||||||
{formatChatTime(data?.createdAt)}
|
{dateTimeView({date: data?.createdAt})}
|
||||||
</TextCustom>
|
</TextCustom>
|
||||||
|
|
||||||
{data && data.imageId && (
|
{data && data.imageId && (
|
||||||
@@ -83,7 +90,7 @@ export default function DonationNews() {
|
|||||||
<TextCustom>{data?.deskripsi || "-"}</TextCustom>
|
<TextCustom>{data?.deskripsi || "-"}</TextCustom>
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
</BaseBox>
|
</BaseBox>
|
||||||
</ViewWrapper>
|
</OS_Wrapper>
|
||||||
|
|
||||||
<DrawerCustom
|
<DrawerCustom
|
||||||
isVisible={openDrawer}
|
isVisible={openDrawer}
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
import {
|
import {
|
||||||
|
BoxButtonOnFooter,
|
||||||
ButtonCenteredOnly,
|
ButtonCenteredOnly,
|
||||||
ButtonCustom,
|
ButtonCustom,
|
||||||
InformationBox,
|
InformationBox,
|
||||||
LandscapeFrameUploaded,
|
LandscapeFrameUploaded,
|
||||||
|
OS_Wrapper,
|
||||||
Spacing,
|
Spacing,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
TextAreaCustom,
|
TextAreaCustom,
|
||||||
TextInputCustom,
|
TextInputCustom,
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import DIRECTORY_ID from "@/constants/directory-id";
|
import DIRECTORY_ID from "@/constants/directory-id";
|
||||||
import { apiDonationCreateNews } from "@/service/api-client/api-donation";
|
import { apiDonationCreateNews } from "@/service/api-client/api-donation";
|
||||||
@@ -53,7 +54,7 @@ export default function DonationAddNews() {
|
|||||||
text1: "Gagal menambah berita",
|
text1: "Gagal menambah berita",
|
||||||
});
|
});
|
||||||
|
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Toast.show({
|
Toast.show({
|
||||||
@@ -70,7 +71,23 @@ export default function DonationAddNews() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ViewWrapper>
|
<OS_Wrapper
|
||||||
|
enableKeyboardHandling
|
||||||
|
contentPaddingBottom={250}
|
||||||
|
footerComponent={
|
||||||
|
<BoxButtonOnFooter>
|
||||||
|
<ButtonCustom
|
||||||
|
disabled={!data.title || !data.deskripsi}
|
||||||
|
isLoading={isLoading}
|
||||||
|
onPress={() => {
|
||||||
|
handlerSubmit();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Simpan
|
||||||
|
</ButtonCustom>
|
||||||
|
</BoxButtonOnFooter>
|
||||||
|
}
|
||||||
|
>
|
||||||
<StackCustom gap={"xs"}>
|
<StackCustom gap={"xs"}>
|
||||||
<InformationBox text="Upload gambar bersifat opsional untuk melengkapi kabar terkait donasi Anda." />
|
<InformationBox text="Upload gambar bersifat opsional untuk melengkapi kabar terkait donasi Anda." />
|
||||||
<LandscapeFrameUploaded image={image?.uri} />
|
<LandscapeFrameUploaded image={image?.uri} />
|
||||||
@@ -116,17 +133,7 @@ export default function DonationAddNews() {
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<Spacing />
|
<Spacing />
|
||||||
<ButtonCustom
|
|
||||||
disabled={!data.title || !data.deskripsi}
|
|
||||||
isLoading={isLoading}
|
|
||||||
onPress={() => {
|
|
||||||
handlerSubmit();
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Simpan
|
|
||||||
</ButtonCustom>
|
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
<Spacing />
|
</OS_Wrapper>
|
||||||
</ViewWrapper>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,110 +1,8 @@
|
|||||||
/* eslint-disable react-hooks/exhaustive-deps */
|
import { useLocalSearchParams } from "expo-router";
|
||||||
import {
|
import Donation_ScreenListOfNews from "@/screens/Donation/ScreenListOfNews";
|
||||||
BackButton,
|
|
||||||
BaseBox,
|
|
||||||
DrawerCustom,
|
|
||||||
Grid,
|
|
||||||
LoaderCustom,
|
|
||||||
MenuDrawerDynamicGrid,
|
|
||||||
TextCustom,
|
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
|
||||||
import { IconPlus } from "@/components/_Icon";
|
|
||||||
import { apiDonationGetNewsById } from "@/service/api-client/api-donation";
|
|
||||||
import { formatChatTime } from "@/utils/formatChatTime";
|
|
||||||
import {
|
|
||||||
router,
|
|
||||||
Stack,
|
|
||||||
useFocusEffect,
|
|
||||||
useLocalSearchParams,
|
|
||||||
} from "expo-router";
|
|
||||||
import _ from "lodash";
|
|
||||||
import { useCallback, useState } from "react";
|
|
||||||
|
|
||||||
export default function DonationRecapOfNews() {
|
export default function DonationRecapOfNews() {
|
||||||
const { id } = useLocalSearchParams();
|
const { id } = useLocalSearchParams();
|
||||||
const [openDrawer, setOpenDrawer] = useState(false);
|
|
||||||
const [list, setList] = useState<any[] | null>(null);
|
return <Donation_ScreenListOfNews donationId={id as string} />;
|
||||||
const [loadList, setLoadList] = useState<boolean>(false);
|
|
||||||
|
|
||||||
useFocusEffect(
|
|
||||||
useCallback(() => {
|
|
||||||
onLoadList();
|
|
||||||
}, [id])
|
|
||||||
);
|
|
||||||
|
|
||||||
const onLoadList = async () => {
|
|
||||||
try {
|
|
||||||
setLoadList(true);
|
|
||||||
const response = await apiDonationGetNewsById({
|
|
||||||
id: id as string,
|
|
||||||
category: "get-all",
|
|
||||||
});
|
|
||||||
|
|
||||||
setList(response.data);
|
|
||||||
} catch (error) {
|
|
||||||
console.log("[ERROR]", error);
|
|
||||||
setList([]);
|
|
||||||
} finally {
|
|
||||||
setLoadList(false);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Stack.Screen
|
|
||||||
options={{
|
|
||||||
title: "Daftar Kabar",
|
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<ViewWrapper>
|
|
||||||
{loadList ? (
|
|
||||||
<LoaderCustom />
|
|
||||||
) : _.isEmpty(list) ? (
|
|
||||||
<TextCustom align="center" color="gray">
|
|
||||||
Tidak ada kabar
|
|
||||||
</TextCustom>
|
|
||||||
) : (
|
|
||||||
list?.map((item: any, index: number) => (
|
|
||||||
<BaseBox key={index} href={`/donation/[id]/(news)/${item.id}`}>
|
|
||||||
<Grid>
|
|
||||||
<Grid.Col span={8}>
|
|
||||||
<TextCustom truncate bold>
|
|
||||||
{item?.title || "-"}
|
|
||||||
</TextCustom>
|
|
||||||
</Grid.Col>
|
|
||||||
<Grid.Col span={4} style={{ alignItems: "flex-end" }}>
|
|
||||||
<TextCustom size="small">
|
|
||||||
{formatChatTime(item?.createdAt)}
|
|
||||||
</TextCustom>
|
|
||||||
</Grid.Col>
|
|
||||||
</Grid>
|
|
||||||
</BaseBox>
|
|
||||||
))
|
|
||||||
)}
|
|
||||||
</ViewWrapper>
|
|
||||||
|
|
||||||
<DrawerCustom
|
|
||||||
isVisible={openDrawer}
|
|
||||||
closeDrawer={() => setOpenDrawer(false)}
|
|
||||||
height={"auto"}
|
|
||||||
>
|
|
||||||
<MenuDrawerDynamicGrid
|
|
||||||
data={[
|
|
||||||
{
|
|
||||||
icon: <IconPlus />,
|
|
||||||
label: "Tambah Berita",
|
|
||||||
path: `/donation/${id}/(news)/add-news`,
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
onPressItem={(item) => {
|
|
||||||
console.log("PATH ", item.path);
|
|
||||||
router.navigate(item.path as any);
|
|
||||||
setOpenDrawer(false);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</DrawerCustom>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,112 +1,8 @@
|
|||||||
/* eslint-disable react-hooks/exhaustive-deps */
|
import { useLocalSearchParams } from "expo-router";
|
||||||
import {
|
import Donation_ScreenRecapOfNews from "@/screens/Donation/ScreenRecapOfNews";
|
||||||
BackButton,
|
|
||||||
BaseBox,
|
|
||||||
DotButton,
|
|
||||||
DrawerCustom,
|
|
||||||
Grid,
|
|
||||||
LoaderCustom,
|
|
||||||
MenuDrawerDynamicGrid,
|
|
||||||
TextCustom,
|
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
|
||||||
import { IconPlus } from "@/components/_Icon";
|
|
||||||
import { apiDonationGetNewsById } from "@/service/api-client/api-donation";
|
|
||||||
import { formatChatTime } from "@/utils/formatChatTime";
|
|
||||||
import {
|
|
||||||
router,
|
|
||||||
Stack,
|
|
||||||
useFocusEffect,
|
|
||||||
useLocalSearchParams,
|
|
||||||
} from "expo-router";
|
|
||||||
import _ from "lodash";
|
|
||||||
import { useCallback, useState } from "react";
|
|
||||||
|
|
||||||
export default function DonationRecapOfNews() {
|
export default function DonationRecapOfNews() {
|
||||||
const { id } = useLocalSearchParams();
|
const { id } = useLocalSearchParams();
|
||||||
const [openDrawer, setOpenDrawer] = useState(false);
|
|
||||||
const [list, setList] = useState<any[] | null>(null);
|
return <Donation_ScreenRecapOfNews donationId={id as string} />;
|
||||||
const [loadList, setLoadList] = useState<boolean>(false);
|
|
||||||
|
|
||||||
useFocusEffect(
|
|
||||||
useCallback(() => {
|
|
||||||
onLoadList();
|
|
||||||
}, [id])
|
|
||||||
);
|
|
||||||
|
|
||||||
const onLoadList = async () => {
|
|
||||||
try {
|
|
||||||
setLoadList(true);
|
|
||||||
const response = await apiDonationGetNewsById({
|
|
||||||
id: id as string,
|
|
||||||
category: "get-all",
|
|
||||||
});
|
|
||||||
|
|
||||||
setList(response.data);
|
|
||||||
} catch (error) {
|
|
||||||
console.log("[ERROR]", error);
|
|
||||||
setList([]);
|
|
||||||
} finally {
|
|
||||||
setLoadList(false);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Stack.Screen
|
|
||||||
options={{
|
|
||||||
title: "Rekap Kabar",
|
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
headerRight: () => <DotButton onPress={() => setOpenDrawer(true)} />,
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<ViewWrapper>
|
|
||||||
{loadList ? (
|
|
||||||
<LoaderCustom />
|
|
||||||
) : _.isEmpty(list) ? (
|
|
||||||
<TextCustom align="center" color="gray">
|
|
||||||
Tidak ada kabar
|
|
||||||
</TextCustom>
|
|
||||||
) : (
|
|
||||||
list?.map((item: any, index: number) => (
|
|
||||||
<BaseBox key={index} href={`/donation/[id]/(news)/${item.id}`}>
|
|
||||||
<Grid>
|
|
||||||
<Grid.Col span={8}>
|
|
||||||
<TextCustom truncate bold>
|
|
||||||
{item?.title || "-"}
|
|
||||||
</TextCustom>
|
|
||||||
</Grid.Col>
|
|
||||||
<Grid.Col span={4} style={{ alignItems: "flex-end" }}>
|
|
||||||
<TextCustom size="small">
|
|
||||||
{formatChatTime(item?.createdAt)}
|
|
||||||
</TextCustom>
|
|
||||||
</Grid.Col>
|
|
||||||
</Grid>
|
|
||||||
</BaseBox>
|
|
||||||
))
|
|
||||||
)}
|
|
||||||
</ViewWrapper>
|
|
||||||
|
|
||||||
<DrawerCustom
|
|
||||||
isVisible={openDrawer}
|
|
||||||
closeDrawer={() => setOpenDrawer(false)}
|
|
||||||
height={"auto"}
|
|
||||||
>
|
|
||||||
<MenuDrawerDynamicGrid
|
|
||||||
data={[
|
|
||||||
{
|
|
||||||
icon: <IconPlus />,
|
|
||||||
label: "Tambah Berita",
|
|
||||||
path: `/donation/${id}/(news)/add-news`,
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
onPressItem={(item) => {
|
|
||||||
console.log("PATH ", item.path);
|
|
||||||
router.navigate(item.path as any);
|
|
||||||
setOpenDrawer(false);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</DrawerCustom>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
import {
|
import {
|
||||||
BaseBox,
|
BaseBox,
|
||||||
Grid,
|
Grid,
|
||||||
|
OS_Wrapper,
|
||||||
Spacing,
|
Spacing,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
TextCustom,
|
TextCustom,
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
import { apiDonationGetInvoiceById } from "@/service/api-client/api-donation";
|
import { apiDonationGetInvoiceById } from "@/service/api-client/api-donation";
|
||||||
@@ -63,7 +63,7 @@ export default function DonasiFailed() {
|
|||||||
];
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ViewWrapper>
|
<OS_Wrapper>
|
||||||
<StackCustom>
|
<StackCustom>
|
||||||
<BaseBox>
|
<BaseBox>
|
||||||
<StackCustom>
|
<StackCustom>
|
||||||
@@ -105,6 +105,6 @@ export default function DonasiFailed() {
|
|||||||
</StackCustom>
|
</StackCustom>
|
||||||
</BaseBox>
|
</BaseBox>
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
</ViewWrapper>
|
</OS_Wrapper>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
/* eslint-disable react-hooks/exhaustive-deps */
|
/* eslint-disable react-hooks/exhaustive-deps */
|
||||||
import {
|
import {
|
||||||
BaseBox,
|
BaseBox,
|
||||||
|
BoxButtonOnFooter,
|
||||||
ButtonCenteredOnly,
|
ButtonCenteredOnly,
|
||||||
ButtonCustom,
|
ButtonCustom,
|
||||||
Grid,
|
Grid,
|
||||||
InformationBox,
|
InformationBox,
|
||||||
|
OS_Wrapper,
|
||||||
Spacing,
|
Spacing,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
TextCustom,
|
TextCustom,
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import CopyButton from "@/components/Button/CoyButton";
|
import CopyButton from "@/components/Button/CoyButton";
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
@@ -35,7 +36,7 @@ export default function DonationInvoice() {
|
|||||||
useFocusEffect(
|
useFocusEffect(
|
||||||
useCallback(() => {
|
useCallback(() => {
|
||||||
onLoadData();
|
onLoadData();
|
||||||
}, [invoiceId])
|
}, [invoiceId]),
|
||||||
);
|
);
|
||||||
|
|
||||||
const onLoadData = async () => {
|
const onLoadData = async () => {
|
||||||
@@ -100,7 +101,21 @@ export default function DonationInvoice() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ViewWrapper>
|
<OS_Wrapper
|
||||||
|
footerComponent={
|
||||||
|
<BoxButtonOnFooter>
|
||||||
|
<ButtonCustom
|
||||||
|
disabled={!image}
|
||||||
|
isLoading={isLoading}
|
||||||
|
onPress={() => {
|
||||||
|
handlerUpdateInvoice();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Simpan
|
||||||
|
</ButtonCustom>
|
||||||
|
</BoxButtonOnFooter>
|
||||||
|
}
|
||||||
|
>
|
||||||
<StackCustom>
|
<StackCustom>
|
||||||
<InformationBox
|
<InformationBox
|
||||||
text={`Mohon transfer donasi anda ke rekening dibawah`}
|
text={`Mohon transfer donasi anda ke rekening dibawah`}
|
||||||
@@ -204,19 +219,9 @@ export default function DonationInvoice() {
|
|||||||
</ButtonCenteredOnly>
|
</ButtonCenteredOnly>
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
</BaseBox>
|
</BaseBox>
|
||||||
|
|
||||||
<ButtonCustom
|
|
||||||
disabled={!image}
|
|
||||||
isLoading={isLoading}
|
|
||||||
onPress={() => {
|
|
||||||
handlerUpdateInvoice();
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Simpan
|
|
||||||
</ButtonCustom>
|
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
<Spacing />
|
<Spacing />
|
||||||
</ViewWrapper>
|
</OS_Wrapper>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import { BaseBox, StackCustom, TextCustom, ViewWrapper } from "@/components";
|
import { BaseBox, OS_Wrapper, StackCustom, TextCustom } from "@/components";
|
||||||
import MoneyTransferAnimation from "@/components/_ShareComponent/MoneyTransferAnimation";
|
import MoneyTransferAnimation from "@/components/_ShareComponent/MoneyTransferAnimation";
|
||||||
import { View } from "react-native";
|
import { View } from "react-native";
|
||||||
|
|
||||||
export default function DonationProcess() {
|
export default function DonationProcess() {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ViewWrapper>
|
<OS_Wrapper>
|
||||||
<BaseBox>
|
<BaseBox>
|
||||||
<StackCustom>
|
<StackCustom>
|
||||||
<TextCustom align="center" bold>
|
<TextCustom align="center" bold>
|
||||||
@@ -35,7 +35,7 @@ export default function DonationProcess() {
|
|||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
</Grid>
|
</Grid>
|
||||||
</BaseBox> */}
|
</BaseBox> */}
|
||||||
</ViewWrapper>
|
</OS_Wrapper>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
import {
|
import {
|
||||||
BaseBox,
|
BaseBox,
|
||||||
Grid,
|
Grid,
|
||||||
|
OS_Wrapper,
|
||||||
Spacing,
|
Spacing,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
TextCustom,
|
TextCustom,
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
import { apiDonationGetInvoiceById } from "@/service/api-client/api-donation";
|
import { apiDonationGetInvoiceById } from "@/service/api-client/api-donation";
|
||||||
@@ -63,7 +63,7 @@ export default function DonationSuccess() {
|
|||||||
];
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ViewWrapper>
|
<OS_Wrapper>
|
||||||
<StackCustom>
|
<StackCustom>
|
||||||
<BaseBox>
|
<BaseBox>
|
||||||
<StackCustom>
|
<StackCustom>
|
||||||
@@ -105,7 +105,7 @@ export default function DonationSuccess() {
|
|||||||
</StackCustom>
|
</StackCustom>
|
||||||
</BaseBox>
|
</BaseBox>
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
</ViewWrapper>
|
</OS_Wrapper>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,9 +3,9 @@ import {
|
|||||||
BoxButtonOnFooter,
|
BoxButtonOnFooter,
|
||||||
ButtonCustom,
|
ButtonCustom,
|
||||||
Grid,
|
Grid,
|
||||||
|
OS_Wrapper,
|
||||||
TextCustom,
|
TextCustom,
|
||||||
TextInputCustom,
|
TextInputCustom,
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
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";
|
||||||
@@ -64,7 +64,7 @@ export default function InvestmentInputDonation() {
|
|||||||
);
|
);
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ViewWrapper footerComponent={bottomComponent}>
|
<OS_Wrapper enableKeyboardHandling contentPaddingBottom={250} footerComponent={bottomComponent}>
|
||||||
{listData.map((item, i) => (
|
{listData.map((item, i) => (
|
||||||
<BaseBox key={i} onPress={() => setNominal(item.value)}>
|
<BaseBox key={i} onPress={() => setNominal(item.value)}>
|
||||||
<Grid>
|
<Grid>
|
||||||
@@ -98,7 +98,7 @@ export default function InvestmentInputDonation() {
|
|||||||
Minimal donasi Rp. 10.000
|
Minimal donasi Rp. 10.000
|
||||||
</TextCustom>
|
</TextCustom>
|
||||||
</BaseBox>
|
</BaseBox>
|
||||||
</ViewWrapper>
|
</OS_Wrapper>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import {
|
|||||||
BaseBox,
|
BaseBox,
|
||||||
BoxButtonOnFooter,
|
BoxButtonOnFooter,
|
||||||
ButtonCustom,
|
ButtonCustom,
|
||||||
ViewWrapper,
|
OS_Wrapper,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import { RadioCustom, RadioGroup } from "@/components/Radio/RadioCustom";
|
import { RadioCustom, RadioGroup } from "@/components/Radio/RadioCustom";
|
||||||
import { LOCAL_STORAGE_KEY } from "@/constants/local-storage-key";
|
import { LOCAL_STORAGE_KEY } from "@/constants/local-storage-key";
|
||||||
@@ -91,7 +91,7 @@ export default function DonationSelectBank() {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<ViewWrapper footerComponent={buttonSubmit()}>
|
<OS_Wrapper footerComponent={buttonSubmit()}>
|
||||||
<RadioGroup value={select} onChange={setSelect}>
|
<RadioGroup value={select} onChange={setSelect}>
|
||||||
{_.isEmpty(listBank)
|
{_.isEmpty(listBank)
|
||||||
? []
|
? []
|
||||||
@@ -101,6 +101,6 @@ export default function DonationSelectBank() {
|
|||||||
</BaseBox>
|
</BaseBox>
|
||||||
))}
|
))}
|
||||||
</RadioGroup>
|
</RadioGroup>
|
||||||
</ViewWrapper>
|
</OS_Wrapper>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,11 +4,13 @@ import {
|
|||||||
DotButton,
|
DotButton,
|
||||||
DrawerCustom,
|
DrawerCustom,
|
||||||
MenuDrawerDynamicGrid,
|
MenuDrawerDynamicGrid,
|
||||||
|
OS_Wrapper,
|
||||||
Spacing,
|
Spacing,
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import { IconEdit, IconNews } from "@/components/_Icon";
|
import { IconEdit, IconNews } from "@/components/_Icon";
|
||||||
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
||||||
|
import CustomSkeleton from "@/components/_ShareComponent/SkeletonCustom";
|
||||||
import { 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 Donation_ButtonStatusSection from "@/screens/Donation/ButtonStatusSection";
|
import Donation_ButtonStatusSection from "@/screens/Donation/ButtonStatusSection";
|
||||||
@@ -26,13 +28,14 @@ import {
|
|||||||
} from "expo-router";
|
} from "expo-router";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import { useCallback, useEffect, useState } from "react";
|
import { useCallback, useEffect, useState } from "react";
|
||||||
|
import { RefreshControl } from "react-native";
|
||||||
|
|
||||||
export default function DonasiDetailStatus() {
|
export default function DonasiDetailStatus() {
|
||||||
const { id, status } = useLocalSearchParams();
|
const { id, status } = useLocalSearchParams();
|
||||||
const [openDrawer, setOpenDrawer] = useState(false);
|
const [openDrawer, setOpenDrawer] = useState(false);
|
||||||
const [openDrawerPublish, setOpenDrawerPublish] = useState(false);
|
const [openDrawerPublish, setOpenDrawerPublish] = useState(false);
|
||||||
|
const [refreshing, setRefreshing] = useState(false);
|
||||||
const [data, setData] = useState<any>();
|
const [data, setData] = useState<any | null>(null);
|
||||||
|
|
||||||
useFocusEffect(
|
useFocusEffect(
|
||||||
useCallback(() => {
|
useCallback(() => {
|
||||||
@@ -80,46 +83,80 @@ export default function DonasiDetailStatus() {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const onRefresh = useCallback(() => {
|
||||||
|
try {
|
||||||
|
setRefreshing(true);
|
||||||
|
onLoadData();
|
||||||
|
} catch (error) {
|
||||||
|
console.log("Error refresh");
|
||||||
|
} finally {
|
||||||
|
setRefreshing(false);
|
||||||
|
}
|
||||||
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
title: `Detail ${_.startCase(status as string)}`,
|
header: () => (
|
||||||
headerLeft: () => <BackButton />,
|
<AppHeader
|
||||||
headerRight: () =>
|
title={`Detail ${_.startCase(status as string)}`}
|
||||||
status === "draft" ? (
|
left={<BackButton />}
|
||||||
<DotButton onPress={() => setOpenDrawer(true)} />
|
right={
|
||||||
) : status === "publish" ? (
|
status === "draft" ? (
|
||||||
<DotButton onPress={() => setOpenDrawerPublish(true)} />
|
<DotButton onPress={() => setOpenDrawer(true)} />
|
||||||
) : null,
|
) : status === "publish" ? (
|
||||||
|
<DotButton onPress={() => setOpenDrawerPublish(true)} />
|
||||||
|
) : null
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ViewWrapper>
|
<OS_Wrapper
|
||||||
<Donation_ComponentBoxDetailData
|
refreshControl={
|
||||||
sisaHari={value.sisa}
|
<RefreshControl
|
||||||
reminder={value.reminder}
|
refreshing={refreshing}
|
||||||
data={data}
|
onRefresh={onRefresh}
|
||||||
showSisaHari={status === "publish" ? true : false}
|
tintColor={MainColor.yellow}
|
||||||
bottomSection={
|
colors={[MainColor.yellow]}
|
||||||
status === "publish" && (
|
/>
|
||||||
<Donation_ProgressSection
|
}
|
||||||
|
>
|
||||||
|
{!data ? (
|
||||||
|
<CustomSkeleton height={400} />
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
<Donation_ComponentBoxDetailData
|
||||||
|
sisaHari={value.sisa}
|
||||||
|
reminder={value.reminder}
|
||||||
|
data={data}
|
||||||
|
showSisaHari={status === "publish" ? true : false}
|
||||||
|
bottomSection={
|
||||||
|
status === "publish" && (
|
||||||
|
<Donation_ProgressSection
|
||||||
|
id={id as string}
|
||||||
|
progres={Number(data?.progres) || 0}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
<Donation_ComponentStoryFunrising
|
||||||
|
id={id as string}
|
||||||
|
dataStory={data?.CeritaDonasi}
|
||||||
|
/>
|
||||||
|
<Spacing />
|
||||||
|
{data && (
|
||||||
|
<Donation_ButtonStatusSection
|
||||||
id={id as string}
|
id={id as string}
|
||||||
progres={Number(data?.progres) || 0}
|
status={status as string}
|
||||||
/>
|
/>
|
||||||
)
|
)}
|
||||||
}
|
|
||||||
/>
|
<Spacing />
|
||||||
<Donation_ComponentStoryFunrising
|
</>
|
||||||
id={id as string}
|
)}
|
||||||
dataStory={data?.CeritaDonasi}
|
</OS_Wrapper>
|
||||||
/>
|
|
||||||
<Spacing />
|
|
||||||
<Donation_ButtonStatusSection
|
|
||||||
id={id as string}
|
|
||||||
status={status as string}
|
|
||||||
/>
|
|
||||||
<Spacing />
|
|
||||||
</ViewWrapper>
|
|
||||||
|
|
||||||
<DrawerCustom
|
<DrawerCustom
|
||||||
isVisible={openDrawer}
|
isVisible={openDrawer}
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/* eslint-disable react-hooks/exhaustive-deps */
|
/* eslint-disable react-hooks/exhaustive-deps */
|
||||||
import {
|
import {
|
||||||
DummyLandscapeImage,
|
DummyLandscapeImage,
|
||||||
|
OS_Wrapper,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
TextCustom,
|
TextCustom,
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import { apiDonationGetOne } from "@/service/api-client/api-donation";
|
import { apiDonationGetOne } from "@/service/api-client/api-donation";
|
||||||
import { useFocusEffect, useLocalSearchParams } from "expo-router";
|
import { useFocusEffect, useLocalSearchParams } from "expo-router";
|
||||||
@@ -32,12 +32,12 @@ export default function DonationDetailStory() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<ViewWrapper>
|
<OS_Wrapper>
|
||||||
<StackCustom>
|
<StackCustom>
|
||||||
<TextCustom>{data?.pembukaan || "-"}</TextCustom>
|
<TextCustom>{data?.pembukaan || "-"}</TextCustom>
|
||||||
<DummyLandscapeImage imageId={data?.imageId} />
|
<DummyLandscapeImage imageId={data?.imageId} />
|
||||||
<TextCustom>{data?.cerita || "-"}</TextCustom>
|
<TextCustom>{data?.cerita || "-"}</TextCustom>
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
</ViewWrapper>
|
</OS_Wrapper>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/* eslint-disable react-hooks/exhaustive-deps */
|
/* eslint-disable react-hooks/exhaustive-deps */
|
||||||
import {
|
import {
|
||||||
ViewWrapper,
|
OS_Wrapper,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
InformationBox,
|
InformationBox,
|
||||||
TextInputCustom,
|
TextInputCustom,
|
||||||
@@ -76,7 +76,7 @@ export default function DonationEditRekening() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ViewWrapper>
|
<OS_Wrapper enableKeyboardHandling contentPaddingBottom={250}>
|
||||||
<StackCustom gap={"xs"}>
|
<StackCustom gap={"xs"}>
|
||||||
<InformationBox text="Pastikan Anda mengisi nama bank dan nomor rekening dengan benar. Informasi ini akan membantu admin memverifikasi dan memproses penggalangan dana Anda dengan cepat dan tepat setelah penggalangan dana dipublikasikan." />
|
<InformationBox text="Pastikan Anda mengisi nama bank dan nomor rekening dengan benar. Informasi ini akan membantu admin memverifikasi dan memproses penggalangan dana Anda dengan cepat dan tepat setelah penggalangan dana dipublikasikan." />
|
||||||
<TextInputCustom
|
<TextInputCustom
|
||||||
@@ -105,6 +105,6 @@ export default function DonationEditRekening() {
|
|||||||
</ButtonCustom>
|
</ButtonCustom>
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
<Spacing />
|
<Spacing />
|
||||||
</ViewWrapper>
|
</OS_Wrapper>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,10 +4,10 @@ import {
|
|||||||
ButtonCustom,
|
ButtonCustom,
|
||||||
InformationBox,
|
InformationBox,
|
||||||
LandscapeFrameUploaded,
|
LandscapeFrameUploaded,
|
||||||
|
OS_Wrapper,
|
||||||
Spacing,
|
Spacing,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
TextAreaCustom,
|
TextAreaCustom,
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import API_IMAGE from "@/constants/api-storage";
|
import API_IMAGE from "@/constants/api-storage";
|
||||||
import DIRECTORY_ID from "@/constants/directory-id";
|
import DIRECTORY_ID from "@/constants/directory-id";
|
||||||
@@ -93,7 +93,7 @@ export default function DonationEditStory() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ViewWrapper>
|
<OS_Wrapper enableKeyboardHandling contentPaddingBottom={250}>
|
||||||
<StackCustom gap={"xs"}>
|
<StackCustom gap={"xs"}>
|
||||||
<InformationBox text="Cerita Anda adalah kunci untuk menginspirasi kebaikan. Jelaskan dengan jujur dan jelas tujuan penggalangan dana ini agar calon donatur memahami dampak positif yang dapat mereka wujudkan melalui kontribusi mereka." />
|
<InformationBox text="Cerita Anda adalah kunci untuk menginspirasi kebaikan. Jelaskan dengan jujur dan jelas tujuan penggalangan dana ini agar calon donatur memahami dampak positif yang dapat mereka wujudkan melalui kontribusi mereka." />
|
||||||
<TextAreaCustom
|
<TextAreaCustom
|
||||||
@@ -146,6 +146,6 @@ export default function DonationEditStory() {
|
|||||||
</ButtonCustom>
|
</ButtonCustom>
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
<Spacing />
|
<Spacing />
|
||||||
</ViewWrapper>
|
</OS_Wrapper>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,13 +6,13 @@ import {
|
|||||||
InformationBox,
|
InformationBox,
|
||||||
LandscapeFrameUploaded,
|
LandscapeFrameUploaded,
|
||||||
LoaderCustom,
|
LoaderCustom,
|
||||||
NewWrapper,
|
OS_Wrapper,
|
||||||
SelectCustom,
|
SelectCustom,
|
||||||
Spacing,
|
Spacing,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
TextInputCustom,
|
TextInputCustom,
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
|
import ListSkeletonComponent from "@/components/_ShareComponent/ListSkeletonComponent";
|
||||||
import API_IMAGE from "@/constants/api-storage";
|
import API_IMAGE from "@/constants/api-storage";
|
||||||
import DIRECTORY_ID from "@/constants/directory-id";
|
import DIRECTORY_ID from "@/constants/directory-id";
|
||||||
import {
|
import {
|
||||||
@@ -183,8 +183,9 @@ export default function DonationEdit() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<NewWrapper
|
<OS_Wrapper
|
||||||
hideFooter
|
enableKeyboardHandling
|
||||||
|
contentPaddingBottom={250}
|
||||||
footerComponent={
|
footerComponent={
|
||||||
<BoxButtonOnFooter>
|
<BoxButtonOnFooter>
|
||||||
<ButtonCustom
|
<ButtonCustom
|
||||||
@@ -200,7 +201,7 @@ export default function DonationEdit() {
|
|||||||
>
|
>
|
||||||
<InformationBox text="Lengkapi semua data di bawah untuk selanjutnya mengisi cerita penggalangan dana." />
|
<InformationBox text="Lengkapi semua data di bawah untuk selanjutnya mengisi cerita penggalangan dana." />
|
||||||
{!data || loadList ? (
|
{!data || loadList ? (
|
||||||
<LoaderCustom />
|
<ListSkeletonComponent />
|
||||||
) : (
|
) : (
|
||||||
<StackCustom gap={"xs"}>
|
<StackCustom gap={"xs"}>
|
||||||
<TextInputCustom
|
<TextInputCustom
|
||||||
@@ -278,6 +279,6 @@ export default function DonationEdit() {
|
|||||||
</StackCustom>
|
</StackCustom>
|
||||||
)}
|
)}
|
||||||
<Spacing />
|
<Spacing />
|
||||||
</NewWrapper>
|
</OS_Wrapper>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,124 +1,8 @@
|
|||||||
/* eslint-disable react-hooks/exhaustive-deps */
|
import { useLocalSearchParams } from "expo-router";
|
||||||
import {
|
import Donation_ScreenFundDisbursement from "@/screens/Donation/ScreenFundDisbursement";
|
||||||
BaseBox,
|
|
||||||
ButtonCenteredOnly,
|
|
||||||
Grid,
|
|
||||||
InformationBox,
|
|
||||||
LoaderCustom,
|
|
||||||
StackCustom,
|
|
||||||
TextCustom,
|
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
|
||||||
import {
|
|
||||||
apiDonationDisbursementOfFundsListById,
|
|
||||||
apiDonationGetOne,
|
|
||||||
} from "@/service/api-client/api-donation";
|
|
||||||
import { formatCurrencyDisplay } from "@/utils/formatCurrencyDisplay";
|
|
||||||
import dayjs from "dayjs";
|
|
||||||
import { router, useFocusEffect, useLocalSearchParams } from "expo-router";
|
|
||||||
import _ from "lodash";
|
|
||||||
import React, { useState } from "react";
|
|
||||||
|
|
||||||
export default function DonationFundDisbursement() {
|
export default function DonationFundDisbursement() {
|
||||||
const { id } = useLocalSearchParams();
|
const { id } = useLocalSearchParams();
|
||||||
|
|
||||||
const [data, setData] = useState({
|
return <Donation_ScreenFundDisbursement donationId={id as string} />;
|
||||||
totalPencairan: 0,
|
|
||||||
akumulasiPencairan: 0,
|
|
||||||
});
|
|
||||||
|
|
||||||
const [listData, setListData] = React.useState<any[] | null>(null);
|
|
||||||
const [loadData, setLoadData] = React.useState(false);
|
|
||||||
|
|
||||||
useFocusEffect(
|
|
||||||
React.useCallback(() => {
|
|
||||||
onLoadData();
|
|
||||||
}, [id])
|
|
||||||
);
|
|
||||||
|
|
||||||
const onLoadData = async () => {
|
|
||||||
try {
|
|
||||||
setLoadData(true);
|
|
||||||
|
|
||||||
const responseData = await apiDonationGetOne({
|
|
||||||
id: id as string,
|
|
||||||
category: "permanent",
|
|
||||||
});
|
|
||||||
|
|
||||||
if (responseData.success) {
|
|
||||||
setData({
|
|
||||||
totalPencairan: responseData.data.totalPencairan,
|
|
||||||
akumulasiPencairan: responseData.data.akumulasiPencairan,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
const responseList = await apiDonationDisbursementOfFundsListById({
|
|
||||||
id: id as string,
|
|
||||||
});
|
|
||||||
|
|
||||||
if (responseList.success) {
|
|
||||||
setListData(responseList.data);
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.log("[ERROR]", error);
|
|
||||||
} finally {
|
|
||||||
setLoadData(false);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ViewWrapper>
|
|
||||||
<InformationBox text="Pencairan dana akan dilakukan oleh Admin HIPMI tanpa campur tangan pihak manapun, jika berita pencairan dana dibawah tidak sesuai dengan kabar yang diberikan oleh PENGGALANG DANA. Maka pegguna lain dapat melaporkannya pada Admin HIPMI !" />
|
|
||||||
<BaseBox>
|
|
||||||
<Grid>
|
|
||||||
<Grid.Col span={6}>
|
|
||||||
<TextCustom bold color="yellow">
|
|
||||||
Rp. {formatCurrencyDisplay(data?.totalPencairan)}
|
|
||||||
</TextCustom>
|
|
||||||
<TextCustom size="small">Total Pencairan Dana</TextCustom>
|
|
||||||
</Grid.Col>
|
|
||||||
<Grid.Col span={6}>
|
|
||||||
<TextCustom bold color="yellow">
|
|
||||||
{data?.akumulasiPencairan} kali
|
|
||||||
</TextCustom>
|
|
||||||
<TextCustom size="small">Akumulasi Pencairan</TextCustom>
|
|
||||||
</Grid.Col>
|
|
||||||
</Grid>
|
|
||||||
</BaseBox>
|
|
||||||
|
|
||||||
{loadData ? (
|
|
||||||
<LoaderCustom />
|
|
||||||
) : _.isEmpty(listData) ? (
|
|
||||||
<TextCustom align="center" color="gray">
|
|
||||||
Belum ada data
|
|
||||||
</TextCustom>
|
|
||||||
) : (
|
|
||||||
listData?.map((item, index) => (
|
|
||||||
<BaseBox key={index}>
|
|
||||||
<StackCustom>
|
|
||||||
<Grid>
|
|
||||||
<Grid.Col span={8}>
|
|
||||||
<TextCustom bold>{item?.title}</TextCustom>
|
|
||||||
</Grid.Col>
|
|
||||||
<Grid.Col span={4} style={{ alignItems: "flex-end" }}>
|
|
||||||
<TextCustom>{dayjs(item?.createdAt).format("DD MMM YYYY")}</TextCustom>
|
|
||||||
</Grid.Col>
|
|
||||||
</Grid>
|
|
||||||
<TextCustom>{item?.deskripsi}</TextCustom>
|
|
||||||
<ButtonCenteredOnly
|
|
||||||
onPress={() => {
|
|
||||||
router.navigate(`/(application)/(image)/preview-image/${item?.imageId}`);
|
|
||||||
}}
|
|
||||||
icon="file-text"
|
|
||||||
>
|
|
||||||
Bukti Transaksi
|
|
||||||
</ButtonCenteredOnly>
|
|
||||||
</StackCustom>
|
|
||||||
</BaseBox>
|
|
||||||
))
|
|
||||||
)}
|
|
||||||
</ViewWrapper>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,10 +6,12 @@ import {
|
|||||||
DotButton,
|
DotButton,
|
||||||
DrawerCustom,
|
DrawerCustom,
|
||||||
MenuDrawerDynamicGrid,
|
MenuDrawerDynamicGrid,
|
||||||
|
OS_Wrapper,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import { IconNews } from "@/components/_Icon";
|
import { IconNews } from "@/components/_Icon";
|
||||||
|
import CustomSkeleton from "@/components/_ShareComponent/SkeletonCustom";
|
||||||
import { useAuth } from "@/hooks/use-auth";
|
import { useAuth } from "@/hooks/use-auth";
|
||||||
import Donation_ComponentBoxDetailData from "@/screens/Donation/ComponentBoxDetailData";
|
import Donation_ComponentBoxDetailData from "@/screens/Donation/ComponentBoxDetailData";
|
||||||
import Donation_ComponentInfoFundrising from "@/screens/Donation/ComponentInfoFundrising";
|
import Donation_ComponentInfoFundrising from "@/screens/Donation/ComponentInfoFundrising";
|
||||||
@@ -34,7 +36,7 @@ export default function DonasiDetailBeranda() {
|
|||||||
useFocusEffect(
|
useFocusEffect(
|
||||||
useCallback(() => {
|
useCallback(() => {
|
||||||
onLoadData();
|
onLoadData();
|
||||||
}, [id])
|
}, [id]),
|
||||||
);
|
);
|
||||||
|
|
||||||
const onLoadData = async () => {
|
const onLoadData = async () => {
|
||||||
@@ -75,10 +77,10 @@ export default function DonasiDetailBeranda() {
|
|||||||
<>
|
<>
|
||||||
<BoxButtonOnFooter>
|
<BoxButtonOnFooter>
|
||||||
<ButtonCustom
|
<ButtonCustom
|
||||||
disabled={value?.reminder}
|
disabled={value?.reminder || !data}
|
||||||
onPress={() => router.navigate(`/donation/${id}/(transaction-flow)`)}
|
onPress={() => router.navigate(`/donation/${id}/(transaction-flow)`)}
|
||||||
>
|
>
|
||||||
{value?.reminder ? "Waktu berakhir" : "Donasi"}
|
{!data ? "Loading..." : value?.reminder ? "Waktu berakhir" : "Donasi"}
|
||||||
</ButtonCustom>
|
</ButtonCustom>
|
||||||
</BoxButtonOnFooter>
|
</BoxButtonOnFooter>
|
||||||
</>
|
</>
|
||||||
@@ -88,29 +90,43 @@ export default function DonasiDetailBeranda() {
|
|||||||
<>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
title: `Detail Donasi`,
|
header: () => (
|
||||||
headerLeft: () => <BackButton />,
|
<AppHeader
|
||||||
headerRight: () =>
|
title="Detail Donasi"
|
||||||
user?.id === data?.Author?.id ? (
|
left={<BackButton />}
|
||||||
<DotButton onPress={() => setOpenDrawer(true)} />
|
right={
|
||||||
) : null,
|
user?.id === data?.Author?.id ? (
|
||||||
|
<DotButton onPress={() => setOpenDrawer(true)} />
|
||||||
|
) : null
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ViewWrapper footerComponent={buttonSection}>
|
<OS_Wrapper footerComponent={buttonSection}>
|
||||||
<StackCustom>
|
{!data ? (
|
||||||
<Donation_ComponentBoxDetailData
|
<CustomSkeleton height={400} />
|
||||||
sisaHari={value.sisa}
|
) : (
|
||||||
reminder={value.reminder}
|
<StackCustom>
|
||||||
data={data}
|
<Donation_ComponentBoxDetailData
|
||||||
bottomSection={<Donation_ProgressSection id={id as string} progres={Number(data?.progres) || 0} />}
|
sisaHari={value.sisa}
|
||||||
/>
|
reminder={value.reminder}
|
||||||
<Donation_ComponentInfoFundrising dataAuthor={data?.Author} />
|
data={data}
|
||||||
<Donation_ComponentStoryFunrising
|
bottomSection={
|
||||||
id={id as string}
|
<Donation_ProgressSection
|
||||||
dataStory={data?.CeritaDonasi}
|
id={id as string}
|
||||||
/>
|
progres={Number(data?.progres) || 0}
|
||||||
</StackCustom>
|
/>
|
||||||
</ViewWrapper>
|
}
|
||||||
|
/>
|
||||||
|
<Donation_ComponentInfoFundrising dataAuthor={data?.Author} />
|
||||||
|
<Donation_ComponentStoryFunrising
|
||||||
|
id={id as string}
|
||||||
|
dataStory={data?.CeritaDonasi}
|
||||||
|
/>
|
||||||
|
</StackCustom>
|
||||||
|
)}
|
||||||
|
</OS_Wrapper>
|
||||||
|
|
||||||
<DrawerCustom
|
<DrawerCustom
|
||||||
isVisible={openDrawer}
|
isVisible={openDrawer}
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ import {
|
|||||||
ButtonCustom,
|
ButtonCustom,
|
||||||
Grid,
|
Grid,
|
||||||
LoaderCustom,
|
LoaderCustom,
|
||||||
|
OS_Wrapper,
|
||||||
Spacing,
|
Spacing,
|
||||||
TextCustom,
|
TextCustom,
|
||||||
ViewWrapper
|
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import Donation_BoxPublish from "@/screens/Donation/BoxPublish";
|
import Donation_BoxPublish from "@/screens/Donation/BoxPublish";
|
||||||
import { apiDonationFundrising } from "@/service/api-client/api-donation";
|
import { apiDonationFundrising } from "@/service/api-client/api-donation";
|
||||||
@@ -44,7 +44,7 @@ export default function DonationInformationFunrising() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ViewWrapper>
|
<OS_Wrapper>
|
||||||
<BaseBox>
|
<BaseBox>
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.Col span={6} style={{ justifyContent: "center" }}>
|
<Grid.Col span={6} style={{ justifyContent: "center" }}>
|
||||||
@@ -80,7 +80,7 @@ export default function DonationInformationFunrising() {
|
|||||||
<Donation_BoxPublish key={index} id={item?.id} data={item} />
|
<Donation_BoxPublish key={index} id={item?.id} data={item} />
|
||||||
))
|
))
|
||||||
)}
|
)}
|
||||||
</ViewWrapper>
|
</OS_Wrapper>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,94 +1,8 @@
|
|||||||
/* eslint-disable react-hooks/exhaustive-deps */
|
import { useLocalSearchParams } from "expo-router";
|
||||||
import {
|
import Donation_ScreenListOfDonatur from "@/screens/Donation/ScreenListOfDonatur";
|
||||||
BaseBox,
|
|
||||||
Grid,
|
|
||||||
LoaderCustom,
|
|
||||||
Spacing,
|
|
||||||
StackCustom,
|
|
||||||
TextCustom,
|
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
|
||||||
import { MainColor } from "@/constants/color-palet";
|
|
||||||
import { apiAdminDonationListOfDonaturById } from "@/service/api-admin/api-admin-donation";
|
|
||||||
import { formatCurrencyDisplay } from "@/utils/formatCurrencyDisplay";
|
|
||||||
import { FontAwesome6 } from "@expo/vector-icons";
|
|
||||||
import dayjs from "dayjs";
|
|
||||||
import { useFocusEffect, useLocalSearchParams } from "expo-router";
|
|
||||||
import _ from "lodash";
|
|
||||||
import { useCallback, useState } from "react";
|
|
||||||
|
|
||||||
export default function Donation_ListOfDonatur() {
|
export default function DonationListOfDonatur() {
|
||||||
const { id } = useLocalSearchParams();
|
const { id } = useLocalSearchParams();
|
||||||
const [listData, setListData] = useState<any[] | null>(null);
|
|
||||||
const [loadData, setLoadData] = useState(false);
|
return <Donation_ScreenListOfDonatur donationId={id as string} />;
|
||||||
|
|
||||||
useFocusEffect(
|
|
||||||
useCallback(() => {
|
|
||||||
onLoadData();
|
|
||||||
}, [id])
|
|
||||||
);
|
|
||||||
|
|
||||||
const onLoadData = async () => {
|
|
||||||
try {
|
|
||||||
setLoadData(true);
|
|
||||||
const response = await apiAdminDonationListOfDonaturById({
|
|
||||||
id: id as string,
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
if (response.success) {
|
|
||||||
setListData(response.data);
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.log("[ERROR]", error);
|
|
||||||
} finally {
|
|
||||||
setLoadData(false);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ViewWrapper>
|
|
||||||
{loadData ? (
|
|
||||||
<LoaderCustom />
|
|
||||||
) : _.isEmpty(listData) ? (
|
|
||||||
<TextCustom bold align="center">
|
|
||||||
Belum ada donatur
|
|
||||||
</TextCustom>
|
|
||||||
) : (
|
|
||||||
listData?.map((item: any, index: number) => (
|
|
||||||
<BaseBox key={index}>
|
|
||||||
<Grid>
|
|
||||||
<Grid.Col
|
|
||||||
span={3}
|
|
||||||
style={{ alignItems: "center", justifyContent: "center" }}
|
|
||||||
>
|
|
||||||
<FontAwesome6
|
|
||||||
name="face-smile-wink"
|
|
||||||
size={50}
|
|
||||||
style={{ color: MainColor.yellow }}
|
|
||||||
/>
|
|
||||||
</Grid.Col>
|
|
||||||
<Grid.Col span={9}>
|
|
||||||
<TextCustom bold size="large">
|
|
||||||
{item?.Author?.username || "-"}
|
|
||||||
</TextCustom>
|
|
||||||
<Spacing/>
|
|
||||||
<StackCustom gap={"xs"}>
|
|
||||||
<TextCustom size={"small"}>Berdonas sebesar </TextCustom>
|
|
||||||
<TextCustom bold size="large" color="yellow">
|
|
||||||
Rp. {formatCurrencyDisplay(item?.nominal)}
|
|
||||||
</TextCustom>
|
|
||||||
<TextCustom>
|
|
||||||
{dayjs(item?.createdAt).format("DD MMM YYYY, HH:mm")}
|
|
||||||
</TextCustom>
|
|
||||||
</StackCustom>
|
|
||||||
</Grid.Col>
|
|
||||||
</Grid>
|
|
||||||
</BaseBox>
|
|
||||||
))
|
|
||||||
)}
|
|
||||||
</ViewWrapper>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import {
|
|||||||
TextAreaCustom,
|
TextAreaCustom,
|
||||||
TextInputCustom,
|
TextInputCustom,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import NewWrapper from "@/components/_ShareComponent/NewWrapper";
|
import OS_Wrapper from "@/components/_ShareComponent/OS_Wrapper";
|
||||||
import DIRECTORY_ID from "@/constants/directory-id";
|
import DIRECTORY_ID from "@/constants/directory-id";
|
||||||
import { useAuth } from "@/hooks/use-auth";
|
import { useAuth } from "@/hooks/use-auth";
|
||||||
import {
|
import {
|
||||||
@@ -113,8 +113,9 @@ export default function DonationCreateStory() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<NewWrapper
|
<OS_Wrapper
|
||||||
hideFooter
|
enableKeyboardHandling
|
||||||
|
contentPaddingBottom={250}
|
||||||
footerComponent={
|
footerComponent={
|
||||||
<>
|
<>
|
||||||
<BoxButtonOnFooter>
|
<BoxButtonOnFooter>
|
||||||
@@ -185,6 +186,6 @@ export default function DonationCreateStory() {
|
|||||||
/>
|
/>
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
<Spacing />
|
<Spacing />
|
||||||
</NewWrapper>
|
</OS_Wrapper>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,12 +5,12 @@ import {
|
|||||||
InformationBox,
|
InformationBox,
|
||||||
LandscapeFrameUploaded,
|
LandscapeFrameUploaded,
|
||||||
LoaderCustom,
|
LoaderCustom,
|
||||||
|
OS_Wrapper,
|
||||||
SelectCustom,
|
SelectCustom,
|
||||||
Spacing,
|
Spacing,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
TextInputCustom,
|
TextInputCustom,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import NewWrapper from "@/components/_ShareComponent/NewWrapper";
|
|
||||||
import DIRECTORY_ID from "@/constants/directory-id";
|
import DIRECTORY_ID from "@/constants/directory-id";
|
||||||
import { apiDonationCreate } from "@/service/api-client/api-donation";
|
import { apiDonationCreate } from "@/service/api-client/api-donation";
|
||||||
import { apiMasterDonation } from "@/service/api-client/api-master";
|
import { apiMasterDonation } from "@/service/api-client/api-master";
|
||||||
@@ -126,8 +126,9 @@ export default function DonationCreate() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<NewWrapper
|
<OS_Wrapper
|
||||||
hideFooter
|
enableKeyboardHandling
|
||||||
|
contentPaddingBottom={250}
|
||||||
footerComponent={
|
footerComponent={
|
||||||
<>
|
<>
|
||||||
<BoxButtonOnFooter>
|
<BoxButtonOnFooter>
|
||||||
@@ -221,6 +222,6 @@ export default function DonationCreate() {
|
|||||||
)}
|
)}
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
<Spacing />
|
<Spacing />
|
||||||
</NewWrapper>
|
</OS_Wrapper>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,64 +4,87 @@ import {
|
|||||||
IconHome,
|
IconHome,
|
||||||
IconStatus,
|
IconStatus,
|
||||||
} from "@/components/_Icon";
|
} from "@/components/_Icon";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import BackButtonFromNotification from "@/components/Button/BackButtonFromNotification";
|
import BackButtonFromNotification from "@/components/Button/BackButtonFromNotification";
|
||||||
import { TabsStyles } from "@/styles/tabs-styles";
|
import { TabsStyles } from "@/styles/tabs-styles";
|
||||||
import { router, Tabs, useLocalSearchParams, useNavigation } from "expo-router";
|
import { router, Tabs, useLocalSearchParams } from "expo-router";
|
||||||
import { useLayoutEffect } from "react";
|
import { View } from "react-native";
|
||||||
|
import { MainColor } from "@/constants/color-palet";
|
||||||
export default function EventTabsLayout() {
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
||||||
const navigation = useNavigation();
|
import { Platform } from "react-native";
|
||||||
|
import { OS_ANDROID_HEIGHT, OS_IOS_HEIGHT } from "@/constants/constans-value";
|
||||||
|
|
||||||
|
function EventTabsWrapper() {
|
||||||
|
const insets = useSafeAreaInsets();
|
||||||
|
const paddingBottom = Platform.OS === "android" ? insets.bottom : 0;
|
||||||
const { from, category } = useLocalSearchParams<{
|
const { from, category } = useLocalSearchParams<{
|
||||||
from?: string;
|
from?: string;
|
||||||
category?: string;
|
category?: string;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
console.log("from", from);
|
|
||||||
console.log("category", category);
|
|
||||||
|
|
||||||
// Atur header secara dinamis
|
|
||||||
useLayoutEffect(() => {
|
|
||||||
navigation.setOptions({
|
|
||||||
headerLeft: () => (
|
|
||||||
<BackButtonFromNotification
|
|
||||||
from={from as string}
|
|
||||||
category={category as string}
|
|
||||||
/>
|
|
||||||
),
|
|
||||||
});
|
|
||||||
}, [from, router, navigation]);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Tabs screenOptions={TabsStyles}>
|
<View style={{ flex: 1, backgroundColor: MainColor.darkblue }}>
|
||||||
<Tabs.Screen
|
<Tabs
|
||||||
name="index"
|
screenOptions={{
|
||||||
options={{
|
...TabsStyles,
|
||||||
title: "Beranda",
|
tabBarStyle: Platform.select({
|
||||||
tabBarIcon: ({ color }) => <IconHome color={color} />,
|
ios: {
|
||||||
|
borderTopWidth: 0,
|
||||||
|
paddingTop: 12,
|
||||||
|
height: OS_IOS_HEIGHT,
|
||||||
|
},
|
||||||
|
android: {
|
||||||
|
borderTopWidth: 0,
|
||||||
|
paddingTop: 5,
|
||||||
|
height: OS_ANDROID_HEIGHT + paddingBottom,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
header: () => (
|
||||||
|
<AppHeader
|
||||||
|
title="Event"
|
||||||
|
left={
|
||||||
|
<BackButtonFromNotification
|
||||||
|
from={from || ""}
|
||||||
|
category={category}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
>
|
||||||
<Tabs.Screen
|
<Tabs.Screen
|
||||||
name="status"
|
name="index"
|
||||||
options={{
|
options={{
|
||||||
title: "Status",
|
title: "Beranda",
|
||||||
tabBarIcon: ({ color }) => <IconStatus color={color} />,
|
tabBarIcon: ({ color }) => <IconHome color={color} />,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Tabs.Screen
|
<Tabs.Screen
|
||||||
name="contribution"
|
name="status"
|
||||||
options={{
|
options={{
|
||||||
title: "Kontribusi",
|
title: "Status",
|
||||||
tabBarIcon: ({ color }) => <IconContribution color={color} />,
|
tabBarIcon: ({ color }) => <IconStatus color={color} />,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Tabs.Screen
|
<Tabs.Screen
|
||||||
name="history"
|
name="contribution"
|
||||||
options={{
|
options={{
|
||||||
title: "Riwayat",
|
title: "Kontribusi",
|
||||||
tabBarIcon: ({ color }) => <IconHistory color={color} />,
|
tabBarIcon: ({ color }) => <IconContribution color={color} />,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Tabs>
|
<Tabs.Screen
|
||||||
|
name="history"
|
||||||
|
options={{
|
||||||
|
title: "Riwayat",
|
||||||
|
tabBarIcon: ({ color }) => <IconHistory color={color} />,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Tabs>
|
||||||
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default function EventTabsLayout() {
|
||||||
|
return <EventTabsWrapper />;
|
||||||
|
}
|
||||||
|
|||||||
@@ -5,11 +5,12 @@ import {
|
|||||||
DrawerCustom,
|
DrawerCustom,
|
||||||
Grid,
|
Grid,
|
||||||
MenuDrawerDynamicGrid,
|
MenuDrawerDynamicGrid,
|
||||||
|
OS_Wrapper,
|
||||||
Spacing,
|
Spacing,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
TextCustom,
|
TextCustom,
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
||||||
import LeftButtonCustom from "@/components/Button/BackButton";
|
import LeftButtonCustom from "@/components/Button/BackButton";
|
||||||
import Event_ButtonStatusSection from "@/screens/Event/ButtonStatusSection";
|
import Event_ButtonStatusSection from "@/screens/Event/ButtonStatusSection";
|
||||||
@@ -81,15 +82,20 @@ export default function EventDetailStatus() {
|
|||||||
<>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
title: `Detail ${status === "publish" ? "" : status}`,
|
header: () => (
|
||||||
headerLeft: () => <LeftButtonCustom />,
|
<AppHeader
|
||||||
headerRight: () =>
|
title={`Detail ${status === "publish" ? "" : status}`}
|
||||||
status === "draft" ? (
|
left={<LeftButtonCustom />}
|
||||||
<DotButton onPress={() => setOpenDrawer(true)} />
|
right={
|
||||||
) : null,
|
status === "draft" ? (
|
||||||
|
<DotButton onPress={() => setOpenDrawer(true)} />
|
||||||
|
) : null
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ViewWrapper>
|
<OS_Wrapper>
|
||||||
<BaseBox>
|
<BaseBox>
|
||||||
<StackCustom>
|
<StackCustom>
|
||||||
<TextCustom bold align="center" size="xlarge">
|
<TextCustom bold align="center" size="xlarge">
|
||||||
@@ -112,7 +118,7 @@ export default function EventDetailStatus() {
|
|||||||
status={status as string}
|
status={status as string}
|
||||||
/>
|
/>
|
||||||
<Spacing />
|
<Spacing />
|
||||||
</ViewWrapper>
|
</OS_Wrapper>
|
||||||
|
|
||||||
<DrawerCustom
|
<DrawerCustom
|
||||||
isVisible={openDrawer}
|
isVisible={openDrawer}
|
||||||
|
|||||||
@@ -5,11 +5,12 @@ import {
|
|||||||
ButtonCustom,
|
ButtonCustom,
|
||||||
CenterCustom,
|
CenterCustom,
|
||||||
LoaderCustom,
|
LoaderCustom,
|
||||||
|
OS_Wrapper,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
TextCustom,
|
TextCustom,
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import { AccentColor, MainColor } from "@/constants/color-palet";
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
|
import { MainColor } from "@/constants/color-palet";
|
||||||
import { useAuth } from "@/hooks/use-auth";
|
import { useAuth } from "@/hooks/use-auth";
|
||||||
import {
|
import {
|
||||||
apiEventConfirmationAction,
|
apiEventConfirmationAction,
|
||||||
@@ -60,7 +61,7 @@ export default function UserEventConfirmation() {
|
|||||||
useFocusEffect(
|
useFocusEffect(
|
||||||
useCallback(() => {
|
useCallback(() => {
|
||||||
checkTokenAndDataParticipants() || console.log("Token is null");
|
checkTokenAndDataParticipants() || console.log("Token is null");
|
||||||
}, [token, id, user?.id])
|
}, [token, id, user?.id]),
|
||||||
);
|
);
|
||||||
|
|
||||||
const checkTokenAndDataParticipants = async () => {
|
const checkTokenAndDataParticipants = async () => {
|
||||||
@@ -113,7 +114,7 @@ export default function UserEventConfirmation() {
|
|||||||
confirmationStart,
|
confirmationStart,
|
||||||
confirmationEnd,
|
confirmationEnd,
|
||||||
null,
|
null,
|
||||||
"[]"
|
"[]",
|
||||||
);
|
);
|
||||||
|
|
||||||
// --- [4] Status waktu event (untuk pesan UI) ---
|
// --- [4] Status waktu event (untuk pesan UI) ---
|
||||||
@@ -218,9 +219,14 @@ export default function UserEventConfirmation() {
|
|||||||
if (isWithinConfirmationWindow) {
|
if (isWithinConfirmationWindow) {
|
||||||
if (konfirmasi === false) {
|
if (konfirmasi === false) {
|
||||||
return (
|
return (
|
||||||
<TamplateBox data={data}>
|
// <TamplateBox data={data}>
|
||||||
<TamplateText text="Konfirmasi Kehadiran" />
|
// <TamplateText text="Konfirmasi Kehadiran" />
|
||||||
</TamplateBox>
|
// </TamplateBox>
|
||||||
|
<UserParticipan_And_DuringEvent
|
||||||
|
id={data.id}
|
||||||
|
userId={user?.id as string}
|
||||||
|
data={data}
|
||||||
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
@@ -260,20 +266,22 @@ export default function UserEventConfirmation() {
|
|||||||
<>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
title: "Konfirmasi Event",
|
header: () => (
|
||||||
// headerLeft: () => (
|
<AppHeader
|
||||||
// <Ionicons
|
title="Konfirmasi Event"
|
||||||
// name="arrow-back"
|
left={
|
||||||
// size={20}
|
<Ionicons
|
||||||
// color={MainColor.yellow}
|
name="arrow-back"
|
||||||
// onPress={() =>
|
size={20}
|
||||||
// router.navigate("/(application)/(user)/event/create")
|
color={MainColor.yellow}
|
||||||
// }
|
onPress={() => router.navigate("/")}
|
||||||
// />
|
/>
|
||||||
// ),
|
}
|
||||||
}}
|
/>
|
||||||
|
),
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
<ViewWrapper>{handlerReturn()}</ViewWrapper>
|
<OS_Wrapper>{handlerReturn()}</OS_Wrapper>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -497,7 +505,6 @@ const UserNotParticipan_And_DuringEvent = ({
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// 🟡 ZONA ACARA BERLANGSUN
|
// 🟡 ZONA ACARA BERLANGSUN
|
||||||
// User sudah terdaftar & Event sedang berlangsung & user harus konfirmasi
|
// User sudah terdaftar & Event sedang berlangsung & user harus konfirmasi
|
||||||
const UserParticipan_And_DuringEvent = ({
|
const UserParticipan_And_DuringEvent = ({
|
||||||
|
|||||||
@@ -4,9 +4,10 @@ import {
|
|||||||
DrawerCustom,
|
DrawerCustom,
|
||||||
LoaderCustom,
|
LoaderCustom,
|
||||||
MenuDrawerDynamicGrid,
|
MenuDrawerDynamicGrid,
|
||||||
|
OS_Wrapper,
|
||||||
Spacing,
|
Spacing,
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
||||||
import LeftButtonCustom from "@/components/Button/BackButton";
|
import LeftButtonCustom from "@/components/Button/BackButton";
|
||||||
import Event_BoxDetailPublishSection from "@/screens/Event/BoxDetailPublishSection";
|
import Event_BoxDetailPublishSection from "@/screens/Event/BoxDetailPublishSection";
|
||||||
@@ -49,19 +50,23 @@ export default function EventDetailContribution() {
|
|||||||
<>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
title: `Detail kontribusi`,
|
header: () => (
|
||||||
headerLeft: () => <LeftButtonCustom />,
|
<AppHeader
|
||||||
headerRight: () => <DotButton onPress={() => setOpenDrawer(true)} />,
|
title="Detail kontribusi"
|
||||||
|
left={<LeftButtonCustom />}
|
||||||
|
right={<DotButton onPress={() => setOpenDrawer(true)} />}
|
||||||
|
/>
|
||||||
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ViewWrapper>
|
<OS_Wrapper>
|
||||||
{isLoadData ? (
|
{isLoadData ? (
|
||||||
<LoaderCustom />
|
<LoaderCustom />
|
||||||
) : (
|
) : (
|
||||||
<Event_BoxDetailPublishSection data={data} />
|
<Event_BoxDetailPublishSection data={data} />
|
||||||
)}
|
)}
|
||||||
<Spacing />
|
<Spacing />
|
||||||
</ViewWrapper>
|
</OS_Wrapper>
|
||||||
<DrawerCustom
|
<DrawerCustom
|
||||||
isVisible={openDrawer}
|
isVisible={openDrawer}
|
||||||
closeDrawer={() => setOpenDrawer(false)}
|
closeDrawer={() => setOpenDrawer(false)}
|
||||||
|
|||||||
@@ -3,14 +3,13 @@ import {
|
|||||||
BoxButtonOnFooter,
|
BoxButtonOnFooter,
|
||||||
ButtonCustom,
|
ButtonCustom,
|
||||||
LoaderCustom,
|
LoaderCustom,
|
||||||
NewWrapper,
|
OS_Wrapper,
|
||||||
SelectCustom,
|
SelectCustom,
|
||||||
Spacing,
|
Spacing,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
TextAreaCustom,
|
TextAreaCustom,
|
||||||
TextCustom,
|
TextCustom,
|
||||||
TextInputCustom,
|
TextInputCustom,
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import ListSkeletonComponent from "@/components/_ShareComponent/ListSkeletonComponent";
|
import ListSkeletonComponent from "@/components/_ShareComponent/ListSkeletonComponent";
|
||||||
import DateTimePickerCustom from "@/components/DateInput/DateTimePickerCustom";
|
import DateTimePickerCustom from "@/components/DateInput/DateTimePickerCustom";
|
||||||
@@ -186,7 +185,9 @@ export default function EventEdit() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<NewWrapper
|
<OS_Wrapper
|
||||||
|
enableKeyboardHandling
|
||||||
|
contentPaddingBottom={250}
|
||||||
footerComponent={
|
footerComponent={
|
||||||
<BoxButtonOnFooter>
|
<BoxButtonOnFooter>
|
||||||
<ButtonCustom
|
<ButtonCustom
|
||||||
@@ -283,7 +284,7 @@ export default function EventEdit() {
|
|||||||
/>
|
/>
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
)}
|
)}
|
||||||
</NewWrapper>
|
</OS_Wrapper>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,9 +3,10 @@ import {
|
|||||||
DotButton,
|
DotButton,
|
||||||
DrawerCustom,
|
DrawerCustom,
|
||||||
MenuDrawerDynamicGrid,
|
MenuDrawerDynamicGrid,
|
||||||
ViewWrapper,
|
OS_Wrapper,
|
||||||
Spacing,
|
Spacing,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
||||||
import LeftButtonCustom from "@/components/Button/BackButton";
|
import LeftButtonCustom from "@/components/Button/BackButton";
|
||||||
import Event_BoxDetailPublishSection from "@/screens/Event/BoxDetailPublishSection";
|
import Event_BoxDetailPublishSection from "@/screens/Event/BoxDetailPublishSection";
|
||||||
@@ -44,15 +45,19 @@ export default function EventDetailHistory() {
|
|||||||
<>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
title: `Detail riwayat`,
|
header: () => (
|
||||||
headerLeft: () => <LeftButtonCustom />,
|
<AppHeader
|
||||||
headerRight: () => <DotButton onPress={() => setOpenDrawer(true)} />,
|
title="Detail riwayat"
|
||||||
|
left={<LeftButtonCustom />}
|
||||||
|
right={<DotButton onPress={() => setOpenDrawer(true)} />}
|
||||||
|
/>
|
||||||
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ViewWrapper>
|
<OS_Wrapper>
|
||||||
<Event_BoxDetailPublishSection data={data} />
|
<Event_BoxDetailPublishSection data={data} />
|
||||||
<Spacing />
|
<Spacing />
|
||||||
</ViewWrapper>
|
</OS_Wrapper>
|
||||||
<DrawerCustom
|
<DrawerCustom
|
||||||
isVisible={openDrawer}
|
isVisible={openDrawer}
|
||||||
closeDrawer={() => setOpenDrawer(false)}
|
closeDrawer={() => setOpenDrawer(false)}
|
||||||
|
|||||||
@@ -6,8 +6,9 @@ import {
|
|||||||
DotButton,
|
DotButton,
|
||||||
DrawerCustom,
|
DrawerCustom,
|
||||||
MenuDrawerDynamicGrid,
|
MenuDrawerDynamicGrid,
|
||||||
ViewWrapper,
|
OS_Wrapper,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
||||||
import CustomSkeleton from "@/components/_ShareComponent/SkeletonCustom";
|
import CustomSkeleton from "@/components/_ShareComponent/SkeletonCustom";
|
||||||
import LeftButtonCustom from "@/components/Button/BackButton";
|
import LeftButtonCustom from "@/components/Button/BackButton";
|
||||||
@@ -121,9 +122,9 @@ export default function EventDetailPublish() {
|
|||||||
|
|
||||||
if (isEventFinished) {
|
if (isEventFinished) {
|
||||||
return (
|
return (
|
||||||
<ViewWrapper>
|
<OS_Wrapper>
|
||||||
<CustomSkeleton />
|
<CustomSkeleton />
|
||||||
</ViewWrapper>
|
</OS_Wrapper>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -156,12 +157,16 @@ export default function EventDetailPublish() {
|
|||||||
<>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
title: `Event Publish`,
|
header: () => (
|
||||||
headerLeft: () => <BackButton onPress={() => router.back()} />,
|
<AppHeader
|
||||||
headerRight: () => <DotButton onPress={() => setOpenDrawer(true)} />,
|
title="Event Publish"
|
||||||
|
left={<BackButton onPress={() => router.back()} />}
|
||||||
|
right={<DotButton onPress={() => setOpenDrawer(true)} />}
|
||||||
|
/>
|
||||||
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ViewWrapper>
|
<OS_Wrapper>
|
||||||
{isLoadingData ? (
|
{isLoadingData ? (
|
||||||
<CustomSkeleton height={400} />
|
<CustomSkeleton height={400} />
|
||||||
) : (
|
) : (
|
||||||
@@ -170,7 +175,7 @@ export default function EventDetailPublish() {
|
|||||||
footerButton={FooterButton()}
|
footerButton={FooterButton()}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</ViewWrapper>
|
</OS_Wrapper>
|
||||||
|
|
||||||
<DrawerCustom
|
<DrawerCustom
|
||||||
isVisible={openDrawer}
|
isVisible={openDrawer}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import {
|
import {
|
||||||
BoxButtonOnFooter,
|
BoxButtonOnFooter,
|
||||||
ButtonCustom,
|
ButtonCustom,
|
||||||
NewWrapper,
|
OS_Wrapper,
|
||||||
SelectCustom,
|
SelectCustom,
|
||||||
Spacing,
|
Spacing,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
@@ -112,7 +112,9 @@ export default function EventCreate() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<NewWrapper
|
<OS_Wrapper
|
||||||
|
enableKeyboardHandling
|
||||||
|
contentPaddingBottom={250}
|
||||||
footerComponent={<BoxButtonOnFooter>{buttonSubmit}</BoxButtonOnFooter>}
|
footerComponent={<BoxButtonOnFooter>{buttonSubmit}</BoxButtonOnFooter>}
|
||||||
>
|
>
|
||||||
<StackCustom gap={"xs"}>
|
<StackCustom gap={"xs"}>
|
||||||
@@ -182,7 +184,7 @@ export default function EventCreate() {
|
|||||||
/>
|
/>
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
</NewWrapper>
|
</OS_Wrapper>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import ViewWrapper from "@/components/_ShareComponent/ViewWrapper";
|
import { OS_Wrapper } from "@/components";
|
||||||
import { GStyles } from "@/styles/global-styles";
|
import { GStyles } from "@/styles/global-styles";
|
||||||
import { useLocalSearchParams } from "expo-router";
|
import { useLocalSearchParams } from "expo-router";
|
||||||
import { Text } from "react-native";
|
import { Text } from "react-native";
|
||||||
@@ -7,8 +7,8 @@ export default function DetailEvent() {
|
|||||||
const { id } = useLocalSearchParams();
|
const { id } = useLocalSearchParams();
|
||||||
console.log("id event >", id);
|
console.log("id event >", id);
|
||||||
return (
|
return (
|
||||||
<ViewWrapper>
|
<OS_Wrapper>
|
||||||
<Text style={GStyles.textLabel}>Detail Event {id}</Text>
|
<Text style={GStyles.textLabel}>Detail Event {id}</Text>
|
||||||
</ViewWrapper>
|
</OS_Wrapper>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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,117 +1,202 @@
|
|||||||
/* 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 { StackCustom, ViewWrapper } from "@/components";
|
import { BasicWrapper, Spacing, StackCustom, ViewWrapper } from "@/components";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
|
import CustomSkeleton from "@/components/_ShareComponent/SkeletonCustom";
|
||||||
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 { 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 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 { 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 { 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 } 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();
|
||||||
const [data, setData] = useState<any>();
|
const [data, setData] = useState<any>();
|
||||||
const [refreshing, setRefreshing] = useState(false);
|
const [refreshing, setRefreshing] = useState(false);
|
||||||
const { syncUnreadCount } = useNotificationStore();
|
const { syncUnreadCount } = useNotificationStore();
|
||||||
|
const [listData, setListData] = useState<any[] | null>(null);
|
||||||
|
const insets = useSafeAreaInsets();
|
||||||
|
const paddingBottom = Platform.OS === "android" ? insets.bottom : 0;
|
||||||
|
|
||||||
useFocusEffect(
|
useFocusEffect(
|
||||||
useCallback(() => {
|
useCallback(() => {
|
||||||
onLoadData();
|
onLoadData();
|
||||||
|
onLoadDataJob();
|
||||||
checkVersion();
|
checkVersion();
|
||||||
userData(token as string);
|
userData(token as string).catch((error) => {
|
||||||
|
console.log("[ERROR userData]", error?.message);
|
||||||
|
console.log("[ERROR userData Response]", error?.response?.data);
|
||||||
|
});
|
||||||
syncUnreadCount();
|
syncUnreadCount();
|
||||||
}, [user?.id, token])
|
}, [user?.id, token]),
|
||||||
);
|
);
|
||||||
|
|
||||||
async function onLoadData() {
|
async function onLoadData() {
|
||||||
const response = await apiUser(user?.id as string);
|
try {
|
||||||
console.log(
|
const response = await apiUser(user?.id as string);
|
||||||
"[Profile ID]>>",
|
setData(response.data);
|
||||||
JSON.stringify(response?.data?.Profile?.id, null, 2)
|
} catch (error: any) {
|
||||||
);
|
console.log("[ERROR onLoadData]", error?.message);
|
||||||
|
console.log("[ERROR Response]", error?.response?.data);
|
||||||
setData(response.data);
|
// Set data tetap agar UI tidak stuck di loading
|
||||||
|
setData(null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const onLoadDataJob = async () => {
|
||||||
|
try {
|
||||||
|
const response = await apiJobGetAll({
|
||||||
|
category: "beranda",
|
||||||
|
});
|
||||||
|
const result = response.data
|
||||||
|
.sort(
|
||||||
|
(a: any, b: any) =>
|
||||||
|
new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime(),
|
||||||
|
)
|
||||||
|
.slice(0, 2);
|
||||||
|
setListData(result);
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR]", error);
|
||||||
|
}
|
||||||
|
};
|
||||||
const checkVersion = async () => {
|
const checkVersion = async () => {
|
||||||
const response = await apiVersion();
|
try {
|
||||||
console.log("[Version] >>", JSON.stringify(response.data, null, 2));
|
const response = await apiVersion();
|
||||||
|
console.log("[Version] >>", JSON.stringify(response.data, null, 2));
|
||||||
|
} catch (error: any) {
|
||||||
|
console.log("[ERROR checkVersion]", error?.message);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const onRefresh = useCallback(() => {
|
const onRefresh = useCallback(() => {
|
||||||
setRefreshing(true);
|
setRefreshing(true);
|
||||||
onLoadData();
|
onLoadData();
|
||||||
|
onLoadDataJob();
|
||||||
checkVersion();
|
checkVersion();
|
||||||
setRefreshing(false);
|
setRefreshing(false);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
// if (user && user?.termsOfServiceAccepted === false) {
|
|
||||||
// console.log("User is not accept term service");
|
|
||||||
// return <Redirect href={`/terms-agreement`} />;
|
|
||||||
// }
|
|
||||||
|
|
||||||
if (data && data?.active === false) {
|
if (data && data?.active === false) {
|
||||||
console.log("User is not active");
|
console.warn("User is not active");
|
||||||
return <Redirect href={`/waiting-room`} />;
|
return (
|
||||||
|
<BasicWrapper>
|
||||||
|
<Redirect href={`/waiting-room`} />
|
||||||
|
</BasicWrapper>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data && data?.Profile === null) {
|
if (data && data?.Profile === null) {
|
||||||
console.log("Profile is null");
|
console.warn("Profile is null");
|
||||||
return <Redirect href={`/profile/create`} />;
|
return (
|
||||||
|
<BasicWrapper>
|
||||||
|
<Redirect href={`/profile/create`} />
|
||||||
|
</BasicWrapper>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
title: `HIPMI`,
|
header: () => (
|
||||||
headerLeft: () => (
|
<AppHeader
|
||||||
<Ionicons
|
title="HIPMI"
|
||||||
name="search"
|
showBack={false}
|
||||||
size={20}
|
left={
|
||||||
color={MainColor.yellow}
|
data ? (
|
||||||
onPress={() => {
|
<Ionicons
|
||||||
router.push("/user-search");
|
name="search"
|
||||||
}}
|
size={20}
|
||||||
|
color={MainColor.yellow}
|
||||||
|
onPress={() => {
|
||||||
|
router.push("/user-search");
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<CustomSkeleton height={30} width={30} radius={100} />
|
||||||
|
)
|
||||||
|
}
|
||||||
|
right={
|
||||||
|
data ? (
|
||||||
|
<HeaderBell />
|
||||||
|
) : (
|
||||||
|
<CustomSkeleton height={30} width={30} radius={100} />
|
||||||
|
)
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
headerRight: () => <HeaderBell />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ViewWrapper
|
|
||||||
refreshControl={
|
<View style={{ flex: 1, backgroundColor: MainColor.darkblue }}>
|
||||||
<RefreshControl refreshing={refreshing} onRefresh={onRefresh} />
|
<ScrollView
|
||||||
}
|
style={{ flex: 1 }}
|
||||||
footerComponent={
|
contentContainerStyle={{
|
||||||
<TabSection
|
flexGrow: 1,
|
||||||
|
paddingInline: 10,
|
||||||
|
paddingBottom: paddingBottom + 80, // Space for tabs + safe area
|
||||||
|
}}
|
||||||
|
refreshControl={
|
||||||
|
<RefreshControl
|
||||||
|
refreshing={refreshing}
|
||||||
|
onRefresh={onRefresh}
|
||||||
|
tintColor={MainColor.yellow}
|
||||||
|
colors={[MainColor.yellow]}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
keyboardShouldPersistTaps="handled"
|
||||||
|
>
|
||||||
|
<StackCustom>
|
||||||
|
<Home_ImageSection />
|
||||||
|
|
||||||
|
{data && data ? (
|
||||||
|
<Home_FeatureSection />
|
||||||
|
) : (
|
||||||
|
<View style={stylesHome.gridContainer}>
|
||||||
|
{Array.from({ length: 4 }).map((_, index) => (
|
||||||
|
<CustomSkeleton
|
||||||
|
key={index}
|
||||||
|
style={stylesHome.gridItem}
|
||||||
|
radius={50}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{data ? (
|
||||||
|
<Home_BottomFeatureSection listData={listData} />
|
||||||
|
) : (
|
||||||
|
<CustomSkeleton height={150} />
|
||||||
|
)}
|
||||||
|
</StackCustom>
|
||||||
|
</ScrollView>
|
||||||
|
|
||||||
|
{/* Home Tabs di bawah */}
|
||||||
|
{data && data ? (
|
||||||
|
<HomeTabs
|
||||||
tabs={tabsHome({
|
tabs={tabsHome({
|
||||||
acceptedForumTermsAt: data?.acceptedForumTermsAt,
|
acceptedForumTermsAt: data?.acceptedForumTermsAt,
|
||||||
profileId: data?.Profile?.id,
|
profileId: data?.Profile?.id,
|
||||||
})}
|
})}
|
||||||
/>
|
/>
|
||||||
}
|
) : (
|
||||||
>
|
<View style={{ height: 80 + paddingBottom, backgroundColor: MainColor.darkblue }} />
|
||||||
<StackCustom>
|
)}
|
||||||
{/* <ButtonCustom onPress={() => router.push("./test-notifications")}>
|
</View>
|
||||||
Test Notif
|
|
||||||
</ButtonCustom> */}
|
|
||||||
|
|
||||||
<Home_ImageSection />
|
|
||||||
|
|
||||||
<Home_FeatureSection />
|
|
||||||
|
|
||||||
<Home_BottomFeatureSection />
|
|
||||||
</StackCustom>
|
|
||||||
</ViewWrapper>
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,83 +1,108 @@
|
|||||||
import BackButtonFromNotification from "@/components/Button/BackButtonFromNotification";
|
import BackButtonFromNotification from "@/components/Button/BackButtonFromNotification";
|
||||||
import { ICON_SIZE_SMALL } from "@/constants/constans-value";
|
import { ICON_SIZE_SMALL, OS_ANDROID_HEIGHT, OS_IOS_HEIGHT } from "@/constants/constans-value";
|
||||||
import { TabsStyles } from "@/styles/tabs-styles";
|
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: OS_IOS_HEIGHT,
|
||||||
size={ICON_SIZE_SMALL}
|
},
|
||||||
/>
|
android: {
|
||||||
),
|
borderTopWidth: 0,
|
||||||
|
paddingTop: 5,
|
||||||
|
height: OS_ANDROID_HEIGHT + 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,11 +5,11 @@ import {
|
|||||||
ButtonCustom,
|
ButtonCustom,
|
||||||
CenterCustom,
|
CenterCustom,
|
||||||
InformationBox,
|
InformationBox,
|
||||||
|
OS_Wrapper,
|
||||||
Spacing,
|
Spacing,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
TextCustom,
|
TextCustom,
|
||||||
TextInputCustom,
|
TextInputCustom,
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
import DIRECTORY_ID from "@/constants/directory-id";
|
import DIRECTORY_ID from "@/constants/directory-id";
|
||||||
@@ -83,9 +83,12 @@ export default function InvestmentAddDocument() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<OS_Wrapper
|
||||||
<ViewWrapper footerComponent={buttonFooter}>
|
enableKeyboardHandling
|
||||||
<StackCustom gap={"xs"}>
|
contentPaddingBottom={250}
|
||||||
|
footerComponent={buttonFooter}
|
||||||
|
>
|
||||||
|
<StackCustom gap={"xs"}>
|
||||||
<InformationBox text="File dokumen bersifat opsional, jika memang ada file yang bisa membantu meyakinkan investor. Anda bisa mengupload nya." />
|
<InformationBox text="File dokumen bersifat opsional, jika memang ada file yang bisa membantu meyakinkan investor. Anda bisa mengupload nya." />
|
||||||
<Spacing />
|
<Spacing />
|
||||||
<TextInputCustom
|
<TextInputCustom
|
||||||
@@ -124,7 +127,6 @@ export default function InvestmentAddDocument() {
|
|||||||
Upload
|
Upload
|
||||||
</ButtonCenteredOnly>
|
</ButtonCenteredOnly>
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
</ViewWrapper>
|
</OS_Wrapper>
|
||||||
</>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,11 +6,11 @@ import {
|
|||||||
ButtonCustom,
|
ButtonCustom,
|
||||||
CenterCustom,
|
CenterCustom,
|
||||||
InformationBox,
|
InformationBox,
|
||||||
|
OS_Wrapper,
|
||||||
Spacing,
|
Spacing,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
TextCustom,
|
TextCustom,
|
||||||
TextInputCustom,
|
TextInputCustom,
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import DIRECTORY_ID from "@/constants/directory-id";
|
import DIRECTORY_ID from "@/constants/directory-id";
|
||||||
import {
|
import {
|
||||||
@@ -105,9 +105,12 @@ export default function InvestmentEditDocument() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<OS_Wrapper
|
||||||
<ViewWrapper footerComponent={buttonFooter}>
|
enableKeyboardHandling
|
||||||
<StackCustom gap={"xs"}>
|
contentPaddingBottom={250}
|
||||||
|
footerComponent={buttonFooter}
|
||||||
|
>
|
||||||
|
<StackCustom gap={"xs"}>
|
||||||
<InformationBox text="File dokumen bersifat opsional, jika memang ada file yang bisa membantu meyakinkan investor. Anda bisa mengupload nya." />
|
<InformationBox text="File dokumen bersifat opsional, jika memang ada file yang bisa membantu meyakinkan investor. Anda bisa mengupload nya." />
|
||||||
<Spacing />
|
<Spacing />
|
||||||
<TextInputCustom
|
<TextInputCustom
|
||||||
@@ -142,7 +145,6 @@ export default function InvestmentEditDocument() {
|
|||||||
Upload
|
Upload
|
||||||
</ButtonCenteredOnly>
|
</ButtonCenteredOnly>
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
</ViewWrapper>
|
</OS_Wrapper>
|
||||||
</>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,10 +6,11 @@ import {
|
|||||||
DrawerCustom,
|
DrawerCustom,
|
||||||
Grid,
|
Grid,
|
||||||
MenuDrawerDynamicGrid,
|
MenuDrawerDynamicGrid,
|
||||||
|
OS_Wrapper,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
TextCustom,
|
TextCustom,
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import { IconDocument, IconEdit, IconNews } from "@/components/_Icon";
|
import { IconDocument, IconEdit, IconNews } from "@/components/_Icon";
|
||||||
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
@@ -30,13 +31,13 @@ export default function InvestmentDetailHolding() {
|
|||||||
const [openDrawerDraft, setOpenDrawerDraft] = useState(false);
|
const [openDrawerDraft, setOpenDrawerDraft] = useState(false);
|
||||||
const [openDrawerPublish, setOpenDrawerPublish] = useState(false);
|
const [openDrawerPublish, setOpenDrawerPublish] = useState(false);
|
||||||
const [data, setData] = useState<any>(null);
|
const [data, setData] = useState<any>(null);
|
||||||
|
|
||||||
useFocusEffect(
|
useFocusEffect(
|
||||||
useCallback(() => {
|
useCallback(() => {
|
||||||
onLoadData();
|
onLoadData();
|
||||||
}, [id, status])
|
}, [id, status])
|
||||||
);
|
);
|
||||||
|
|
||||||
const onLoadData = async () => {
|
const onLoadData = async () => {
|
||||||
try {
|
try {
|
||||||
const response = await apiInvestmentGetInvoice({
|
const response = await apiInvestmentGetInvoice({
|
||||||
@@ -44,7 +45,7 @@ export default function InvestmentDetailHolding() {
|
|||||||
authorId: user?.id,
|
authorId: user?.id,
|
||||||
category: "invoice",
|
category: "invoice",
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log("[DATA]", JSON.stringify(response.data, null, 2));
|
console.log("[DATA]", JSON.stringify(response.data, null, 2));
|
||||||
setData(response.data);
|
setData(response.data);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -76,18 +77,23 @@ export default function InvestmentDetailHolding() {
|
|||||||
<>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
title: `Detail ${_.startCase(status as string)}`,
|
header: () => (
|
||||||
headerLeft: () => <BackButton />,
|
<AppHeader
|
||||||
headerRight: () =>
|
title={`Detail ${_.startCase(status as string)}`}
|
||||||
status === "draft" ? (
|
left={<BackButton />}
|
||||||
<DotButton onPress={() => setOpenDrawerDraft(true)} />
|
right={
|
||||||
) : status === "publish" ? (
|
status === "draft" ? (
|
||||||
<DotButton onPress={() => setOpenDrawerPublish(true)} />
|
<DotButton onPress={() => setOpenDrawerDraft(true)} />
|
||||||
) : null,
|
) : status === "publish" ? (
|
||||||
|
<DotButton onPress={() => setOpenDrawerPublish(true)} />
|
||||||
|
) : null
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<ViewWrapper>
|
<OS_Wrapper>
|
||||||
<BaseBox>
|
<BaseBox>
|
||||||
<StackCustom gap={"xs"}>
|
<StackCustom gap={"xs"}>
|
||||||
<Grid>
|
<Grid>
|
||||||
@@ -118,7 +124,7 @@ export default function InvestmentDetailHolding() {
|
|||||||
status={"publish"}
|
status={"publish"}
|
||||||
bottomSection={bottomSection}
|
bottomSection={bottomSection}
|
||||||
/>
|
/>
|
||||||
</ViewWrapper>
|
</OS_Wrapper>
|
||||||
|
|
||||||
{/* ========= Draft Drawer ========= */}
|
{/* ========= Draft Drawer ========= */}
|
||||||
<DrawerCustom
|
<DrawerCustom
|
||||||
|
|||||||
@@ -7,10 +7,11 @@ import {
|
|||||||
DrawerCustom,
|
DrawerCustom,
|
||||||
DummyLandscapeImage,
|
DummyLandscapeImage,
|
||||||
MenuDrawerDynamicGrid,
|
MenuDrawerDynamicGrid,
|
||||||
|
OS_Wrapper,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
TextCustom,
|
TextCustom,
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import { IconTrash } from "@/components/_Icon/IconTrash";
|
import { IconTrash } from "@/components/_Icon/IconTrash";
|
||||||
import { useAuth } from "@/hooks/use-auth";
|
import { useAuth } from "@/hooks/use-auth";
|
||||||
import {
|
import {
|
||||||
@@ -56,15 +57,20 @@ export default function InvestmentNews() {
|
|||||||
<>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
title: "Detail Berita",
|
header: () => (
|
||||||
headerLeft: () => <BackButton />,
|
<AppHeader
|
||||||
headerRight: () =>
|
title="Detail Berita"
|
||||||
user?.id === data?.authorId && (
|
left={<BackButton />}
|
||||||
<DotButton onPress={() => setOpenDrawer(true)} />
|
right={
|
||||||
),
|
user?.id === data?.authorId && (
|
||||||
|
<DotButton onPress={() => setOpenDrawer(true)} />
|
||||||
|
)
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ViewWrapper>
|
<OS_Wrapper>
|
||||||
<BaseBox>
|
<BaseBox>
|
||||||
<StackCustom>
|
<StackCustom>
|
||||||
{data && data?.imageId && (
|
{data && data?.imageId && (
|
||||||
@@ -76,7 +82,7 @@ export default function InvestmentNews() {
|
|||||||
<TextCustom>{(data && data?.deskripsi) || "-"}</TextCustom>
|
<TextCustom>{(data && data?.deskripsi) || "-"}</TextCustom>
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
</BaseBox>
|
</BaseBox>
|
||||||
</ViewWrapper>
|
</OS_Wrapper>
|
||||||
|
|
||||||
<DrawerCustom
|
<DrawerCustom
|
||||||
isVisible={openDrawer}
|
isVisible={openDrawer}
|
||||||
|
|||||||
@@ -3,11 +3,11 @@ import {
|
|||||||
ButtonCustom,
|
ButtonCustom,
|
||||||
InformationBox,
|
InformationBox,
|
||||||
LandscapeFrameUploaded,
|
LandscapeFrameUploaded,
|
||||||
|
OS_Wrapper,
|
||||||
Spacing,
|
Spacing,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
TextAreaCustom,
|
TextAreaCustom,
|
||||||
TextInputCustom,
|
TextInputCustom,
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import DIRECTORY_ID from "@/constants/directory-id";
|
import DIRECTORY_ID from "@/constants/directory-id";
|
||||||
import { apiInvestmentCreateNews } from "@/service/api-client/api-investment";
|
import { apiInvestmentCreateNews } from "@/service/api-client/api-investment";
|
||||||
@@ -80,7 +80,10 @@ export default function InvestmentAddNews() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ViewWrapper>
|
<OS_Wrapper
|
||||||
|
enableKeyboardHandling
|
||||||
|
contentPaddingBottom={250}
|
||||||
|
>
|
||||||
<StackCustom gap={"xs"}>
|
<StackCustom gap={"xs"}>
|
||||||
<InformationBox text="Pengunggahan foto ke aplikasi bersifat opsional dan tidak diwajibkan, Anda dapat menyimpan berita tanpa mengunggah foto." />
|
<InformationBox text="Pengunggahan foto ke aplikasi bersifat opsional dan tidak diwajibkan, Anda dapat menyimpan berita tanpa mengunggah foto." />
|
||||||
<LandscapeFrameUploaded image={image?.uri} />
|
<LandscapeFrameUploaded image={image?.uri} />
|
||||||
@@ -123,7 +126,6 @@ export default function InvestmentAddNews() {
|
|||||||
Simpan
|
Simpan
|
||||||
</ButtonCustom>
|
</ButtonCustom>
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
<Spacing />
|
</OS_Wrapper>
|
||||||
</ViewWrapper>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
import {
|
import {
|
||||||
BaseBox,
|
BaseBox,
|
||||||
Grid,
|
Grid,
|
||||||
|
OS_Wrapper,
|
||||||
Spacing,
|
Spacing,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
TextCustom,
|
TextCustom,
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
import { apiInvestmentGetInvoice } from "@/service/api-client/api-investment";
|
import { apiInvestmentGetInvoice } from "@/service/api-client/api-investment";
|
||||||
@@ -69,7 +69,7 @@ export default function InvestmentFailed() {
|
|||||||
];
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ViewWrapper>
|
<OS_Wrapper>
|
||||||
<StackCustom>
|
<StackCustom>
|
||||||
<BaseBox>
|
<BaseBox>
|
||||||
<StackCustom>
|
<StackCustom>
|
||||||
@@ -110,6 +110,6 @@ export default function InvestmentFailed() {
|
|||||||
</StackCustom>
|
</StackCustom>
|
||||||
</BaseBox>
|
</BaseBox>
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
</ViewWrapper>
|
</OS_Wrapper>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ import {
|
|||||||
ButtonCustom,
|
ButtonCustom,
|
||||||
Divider,
|
Divider,
|
||||||
Grid,
|
Grid,
|
||||||
|
OS_Wrapper,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
TextCustom,
|
TextCustom,
|
||||||
TextInputCustom,
|
TextInputCustom,
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import { LOCAL_STORAGE_KEY } from "@/constants/local-storage-key";
|
import { LOCAL_STORAGE_KEY } from "@/constants/local-storage-key";
|
||||||
import { apiInvestmentGetOne } from "@/service/api-client/api-investment";
|
import { apiInvestmentGetOne } from "@/service/api-client/api-investment";
|
||||||
@@ -99,9 +99,12 @@ export default function InvestmentInvest() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<OS_Wrapper
|
||||||
<ViewWrapper footerComponent={buttonSubmit()}>
|
enableKeyboardHandling
|
||||||
<BaseBox>
|
contentPaddingBottom={250}
|
||||||
|
footerComponent={buttonSubmit()}
|
||||||
|
>
|
||||||
|
<BaseBox>
|
||||||
<StackCustom gap={"xs"}>
|
<StackCustom gap={"xs"}>
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.Col span={6}>
|
<Grid.Col span={6}>
|
||||||
@@ -165,7 +168,6 @@ export default function InvestmentInvest() {
|
|||||||
</Grid>
|
</Grid>
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
</BaseBox>
|
</BaseBox>
|
||||||
</ViewWrapper>
|
</OS_Wrapper>
|
||||||
</>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import { BaseBox, StackCustom, TextCustom, ViewWrapper } from "@/components";
|
import { BaseBox, OS_Wrapper, StackCustom, TextCustom } from "@/components";
|
||||||
import MoneyTransferAnimation from "@/components/_ShareComponent/MoneyTransferAnimation";
|
import MoneyTransferAnimation from "@/components/_ShareComponent/MoneyTransferAnimation";
|
||||||
import { View } from "react-native";
|
import { View } from "react-native";
|
||||||
|
|
||||||
export default function InvestmentProcess() {
|
export default function InvestmentProcess() {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ViewWrapper>
|
<OS_Wrapper>
|
||||||
<BaseBox>
|
<BaseBox>
|
||||||
<StackCustom>
|
<StackCustom>
|
||||||
<TextCustom align="center" bold>
|
<TextCustom align="center" bold>
|
||||||
@@ -35,7 +35,7 @@ export default function InvestmentProcess() {
|
|||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
</Grid>
|
</Grid>
|
||||||
</BaseBox> */}
|
</BaseBox> */}
|
||||||
</ViewWrapper>
|
</OS_Wrapper>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import {
|
|||||||
BaseBox,
|
BaseBox,
|
||||||
BoxButtonOnFooter,
|
BoxButtonOnFooter,
|
||||||
ButtonCustom,
|
ButtonCustom,
|
||||||
ViewWrapper,
|
OS_Wrapper,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import { RadioCustom, RadioGroup } from "@/components/Radio/RadioCustom";
|
import { RadioCustom, RadioGroup } from "@/components/Radio/RadioCustom";
|
||||||
import { LOCAL_STORAGE_KEY } from "@/constants/local-storage-key";
|
import { LOCAL_STORAGE_KEY } from "@/constants/local-storage-key";
|
||||||
@@ -86,7 +86,7 @@ export default function InvestmentSelectBank() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ViewWrapper footerComponent={buttonSubmit()}>
|
<OS_Wrapper footerComponent={buttonSubmit()}>
|
||||||
<RadioGroup value={select} onChange={setSelect}>
|
<RadioGroup value={select} onChange={setSelect}>
|
||||||
{_.isEmpty(listBank)
|
{_.isEmpty(listBank)
|
||||||
? []
|
? []
|
||||||
@@ -96,6 +96,6 @@ export default function InvestmentSelectBank() {
|
|||||||
</BaseBox>
|
</BaseBox>
|
||||||
))}
|
))}
|
||||||
</RadioGroup>
|
</RadioGroup>
|
||||||
</ViewWrapper>
|
</OS_Wrapper>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
import {
|
import {
|
||||||
BaseBox,
|
BaseBox,
|
||||||
Grid,
|
Grid,
|
||||||
|
OS_Wrapper,
|
||||||
Spacing,
|
Spacing,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
TextCustom,
|
TextCustom,
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
import { apiInvestmentGetInvoice } from "@/service/api-client/api-investment";
|
import { apiInvestmentGetInvoice } from "@/service/api-client/api-investment";
|
||||||
@@ -69,7 +69,7 @@ export default function InvestmentSuccess() {
|
|||||||
];
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ViewWrapper>
|
<OS_Wrapper>
|
||||||
<StackCustom>
|
<StackCustom>
|
||||||
<BaseBox>
|
<BaseBox>
|
||||||
<StackCustom>
|
<StackCustom>
|
||||||
@@ -110,6 +110,6 @@ export default function InvestmentSuccess() {
|
|||||||
</StackCustom>
|
</StackCustom>
|
||||||
</BaseBox>
|
</BaseBox>
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
</ViewWrapper>
|
</OS_Wrapper>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,9 @@ import {
|
|||||||
DotButton,
|
DotButton,
|
||||||
DrawerCustom,
|
DrawerCustom,
|
||||||
MenuDrawerDynamicGrid,
|
MenuDrawerDynamicGrid,
|
||||||
ViewWrapper,
|
OS_Wrapper,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import { IconDocument, IconEdit, IconNews } from "@/components/_Icon";
|
import { IconDocument, IconEdit, IconNews } from "@/components/_Icon";
|
||||||
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
@@ -106,25 +107,30 @@ export default function InvestmentDetailStatus() {
|
|||||||
<>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
title: `Detail ${_.startCase(status as string)}`,
|
header: () => (
|
||||||
headerLeft: () => <BackButton />,
|
<AppHeader
|
||||||
headerRight: () =>
|
title={`Detail ${_.startCase(status as string)}`}
|
||||||
status === "draft" ? (
|
left={<BackButton />}
|
||||||
<DotButton onPress={() => setOpenDrawerDraft(true)} />
|
right={
|
||||||
) : status === "publish" ? (
|
status === "draft" ? (
|
||||||
<DotButton onPress={() => setOpenDrawerPublish(true)} />
|
<DotButton onPress={() => setOpenDrawerDraft(true)} />
|
||||||
) : null,
|
) : status === "publish" ? (
|
||||||
|
<DotButton onPress={() => setOpenDrawerPublish(true)} />
|
||||||
|
) : null
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<ViewWrapper>
|
<OS_Wrapper>
|
||||||
<Invesment_DetailDataPublishSection
|
<Invesment_DetailDataPublishSection
|
||||||
status={status as string}
|
status={status as string}
|
||||||
data={data}
|
data={data}
|
||||||
bottomSection={bottomSection}
|
bottomSection={bottomSection}
|
||||||
buttonSection={buttonSection}
|
buttonSection={buttonSection}
|
||||||
/>
|
/>
|
||||||
</ViewWrapper>
|
</OS_Wrapper>
|
||||||
|
|
||||||
{/* ========= Draft Drawer ========= */}
|
{/* ========= Draft Drawer ========= */}
|
||||||
<DrawerCustom
|
<DrawerCustom
|
||||||
|
|||||||
@@ -7,10 +7,10 @@ import {
|
|||||||
CenterCustom,
|
CenterCustom,
|
||||||
InformationBox,
|
InformationBox,
|
||||||
LoaderCustom,
|
LoaderCustom,
|
||||||
|
OS_Wrapper,
|
||||||
Spacing,
|
Spacing,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
TextCustom,
|
TextCustom,
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import DIRECTORY_ID from "@/constants/directory-id";
|
import DIRECTORY_ID from "@/constants/directory-id";
|
||||||
import {
|
import {
|
||||||
@@ -116,7 +116,7 @@ export default function InvestmentEditProspectus() {
|
|||||||
</BoxButtonOnFooter>
|
</BoxButtonOnFooter>
|
||||||
);
|
);
|
||||||
return (
|
return (
|
||||||
<ViewWrapper footerComponent={!loadingGet && buttonFooter}>
|
<OS_Wrapper footerComponent={!loadingGet && buttonFooter}>
|
||||||
<StackCustom gap={"xs"}>
|
<StackCustom gap={"xs"}>
|
||||||
<InformationBox text="File prospektus wajib untuk diupload, agar calon investor paham dengan prospek investasi yang akan anda jalankan kedepan." />
|
<InformationBox text="File prospektus wajib untuk diupload, agar calon investor paham dengan prospek investasi yang akan anda jalankan kedepan." />
|
||||||
<Spacing />
|
<Spacing />
|
||||||
@@ -153,6 +153,6 @@ export default function InvestmentEditProspectus() {
|
|||||||
Upload
|
Upload
|
||||||
</ButtonCenteredOnly>
|
</ButtonCenteredOnly>
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
</ViewWrapper>
|
</OS_Wrapper>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import {
|
|||||||
InformationBox,
|
InformationBox,
|
||||||
LandscapeFrameUploaded,
|
LandscapeFrameUploaded,
|
||||||
LoaderCustom,
|
LoaderCustom,
|
||||||
NewWrapper,
|
OS_Wrapper,
|
||||||
SelectCustom,
|
SelectCustom,
|
||||||
Spacing,
|
Spacing,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
@@ -199,7 +199,9 @@ export default function InvestmentEdit() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<NewWrapper
|
<OS_Wrapper
|
||||||
|
enableKeyboardHandling
|
||||||
|
contentPaddingBottom={250}
|
||||||
footerComponent={
|
footerComponent={
|
||||||
<BoxButtonOnFooter>
|
<BoxButtonOnFooter>
|
||||||
<ButtonCustom isLoading={isLoading} onPress={handleSubmitUpdate}>
|
<ButtonCustom isLoading={isLoading} onPress={handleSubmitUpdate}>
|
||||||
@@ -350,6 +352,6 @@ export default function InvestmentEdit() {
|
|||||||
|
|
||||||
<Spacing />
|
<Spacing />
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
</NewWrapper>
|
</OS_Wrapper>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,9 @@ import {
|
|||||||
DotButton,
|
DotButton,
|
||||||
DrawerCustom,
|
DrawerCustom,
|
||||||
MenuDrawerDynamicGrid,
|
MenuDrawerDynamicGrid,
|
||||||
ViewWrapper,
|
OS_Wrapper,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import { IconDocument, IconEdit, IconNews } from "@/components/_Icon";
|
import { IconDocument, IconEdit, IconNews } from "@/components/_Icon";
|
||||||
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
@@ -105,25 +106,30 @@ export default function InvestmentDetail() {
|
|||||||
<>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
title: `Detail ${_.startCase(status as string)}`,
|
header: () => (
|
||||||
headerLeft: () => <BackButton />,
|
<AppHeader
|
||||||
headerRight: () =>
|
title={`Detail ${_.startCase(status as string)}`}
|
||||||
status === "draft" ? (
|
left={<BackButton />}
|
||||||
<DotButton onPress={() => setOpenDrawerDraft(true)} />
|
right={
|
||||||
) : status === "publish" ? (
|
status === "draft" ? (
|
||||||
<DotButton onPress={() => setOpenDrawerPublish(true)} />
|
<DotButton onPress={() => setOpenDrawerDraft(true)} />
|
||||||
) : null,
|
) : status === "publish" ? (
|
||||||
|
<DotButton onPress={() => setOpenDrawerPublish(true)} />
|
||||||
|
) : null
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<ViewWrapper>
|
<OS_Wrapper>
|
||||||
<Invesment_DetailDataPublishSection
|
<Invesment_DetailDataPublishSection
|
||||||
status={"publish"}
|
status={"publish"}
|
||||||
data={data}
|
data={data}
|
||||||
bottomSection={bottomSection}
|
bottomSection={bottomSection}
|
||||||
buttonSection={buttonSection}
|
buttonSection={buttonSection}
|
||||||
/>
|
/>
|
||||||
</ViewWrapper>
|
</OS_Wrapper>
|
||||||
|
|
||||||
{/* ========= Draft Drawer ========= */}
|
{/* ========= Draft Drawer ========= */}
|
||||||
<DrawerCustom
|
<DrawerCustom
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import {
|
|||||||
CenterCustom,
|
CenterCustom,
|
||||||
InformationBox,
|
InformationBox,
|
||||||
LandscapeFrameUploaded,
|
LandscapeFrameUploaded,
|
||||||
NewWrapper,
|
OS_Wrapper,
|
||||||
SelectCustom,
|
SelectCustom,
|
||||||
Spacing,
|
Spacing,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
@@ -118,20 +118,7 @@ export default function InvestmentCreate() {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
setIsLoading(true);
|
setIsLoading(true);
|
||||||
const responseUploadImage = await uploadFileService({
|
|
||||||
imageUri: image,
|
|
||||||
dirId: DIRECTORY_ID.investasi_image,
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!responseUploadImage.success) {
|
|
||||||
Toast.show({
|
|
||||||
type: "error",
|
|
||||||
text1: "Gagal mengunggah gambar",
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const imageId = responseUploadImage.data.id;
|
|
||||||
const responseUploadPdf = await uploadFileService({
|
const responseUploadPdf = await uploadFileService({
|
||||||
imageUri: pdf.uri,
|
imageUri: pdf.uri,
|
||||||
dirId: DIRECTORY_ID.investasi_prospektus,
|
dirId: DIRECTORY_ID.investasi_prospektus,
|
||||||
@@ -144,8 +131,22 @@ export default function InvestmentCreate() {
|
|||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const pdfId = responseUploadPdf.data.id;
|
const pdfId = responseUploadPdf.data.id;
|
||||||
|
|
||||||
|
const responseUploadImage = await uploadFileService({
|
||||||
|
imageUri: image,
|
||||||
|
dirId: DIRECTORY_ID.investasi_image,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!responseUploadImage.success) {
|
||||||
|
Toast.show({
|
||||||
|
type: "error",
|
||||||
|
text1: "Gagal mengunggah gambar",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const imageId = responseUploadImage.data.id;
|
||||||
|
|
||||||
const newData = {
|
const newData = {
|
||||||
title: data.title,
|
title: data.title,
|
||||||
targetDana: data.targetDana,
|
targetDana: data.targetDana,
|
||||||
@@ -185,7 +186,9 @@ export default function InvestmentCreate() {
|
|||||||
|
|
||||||
// const [coba, setCoba] = useState("");
|
// const [coba, setCoba] = useState("");
|
||||||
return (
|
return (
|
||||||
<NewWrapper
|
<OS_Wrapper
|
||||||
|
enableKeyboardHandling
|
||||||
|
contentPaddingBottom={250}
|
||||||
footerComponent={
|
footerComponent={
|
||||||
<BoxButtonOnFooter>
|
<BoxButtonOnFooter>
|
||||||
<ButtonCustom
|
<ButtonCustom
|
||||||
@@ -373,7 +376,6 @@ export default function InvestmentCreate() {
|
|||||||
|
|
||||||
<Spacing />
|
<Spacing />
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
{/* <Spacing height={50} /> */}
|
</OS_Wrapper>
|
||||||
</NewWrapper>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,37 +1,60 @@
|
|||||||
/* eslint-disable react-hooks/exhaustive-deps */
|
/* eslint-disable react-hooks/exhaustive-deps */
|
||||||
import { BackButton } from "@/components";
|
import { BackButton } from "@/components";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import { IconHome, IconStatus } from "@/components/_Icon";
|
import { IconHome, IconStatus } from "@/components/_Icon";
|
||||||
import BackButtonFromNotification from "@/components/Button/BackButtonFromNotification";
|
import BackButtonFromNotification from "@/components/Button/BackButtonFromNotification";
|
||||||
import { TabsStyles } from "@/styles/tabs-styles";
|
import { TabsStyles } from "@/styles/tabs-styles";
|
||||||
import { Ionicons } from "@expo/vector-icons";
|
import { Ionicons } from "@expo/vector-icons";
|
||||||
|
import { router, Tabs, useLocalSearchParams } from "expo-router";
|
||||||
|
import { View } from "react-native";
|
||||||
|
import { MainColor } from "@/constants/color-palet";
|
||||||
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
||||||
|
import { Platform } from "react-native";
|
||||||
import {
|
import {
|
||||||
router,
|
OS_ANDROID_HEIGHT,
|
||||||
Tabs,
|
OS_ANDROID_PADDING_TOP,
|
||||||
useLocalSearchParams,
|
OS_IOS_HEIGHT,
|
||||||
useNavigation
|
OS_IOS_PADDING_TOP,
|
||||||
} from "expo-router";
|
} from "@/constants/constans-value";
|
||||||
import { useLayoutEffect } from "react";
|
|
||||||
|
|
||||||
export default function JobTabsLayout() {
|
|
||||||
const navigation = useNavigation();
|
|
||||||
|
|
||||||
|
function JobTabsWrapper() {
|
||||||
|
const insets = useSafeAreaInsets();
|
||||||
|
const paddingBottom = Platform.OS === "android" ? insets.bottom : 0;
|
||||||
const { from, category } = useLocalSearchParams<{
|
const { from, category } = useLocalSearchParams<{
|
||||||
from?: string;
|
from?: string;
|
||||||
category?: string;
|
category?: string;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
// Atur header secara dinamis
|
|
||||||
useLayoutEffect(() => {
|
|
||||||
navigation.setOptions({
|
|
||||||
headerLeft: () => (
|
|
||||||
<BackButtonFromNotification from={from as string} category={category as string} />
|
|
||||||
),
|
|
||||||
});
|
|
||||||
}, [from, router, navigation]);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<View style={{ flex: 1, backgroundColor: MainColor.darkblue }}>
|
||||||
<Tabs screenOptions={TabsStyles}>
|
<Tabs
|
||||||
|
screenOptions={{
|
||||||
|
...TabsStyles,
|
||||||
|
tabBarStyle: Platform.select({
|
||||||
|
ios: {
|
||||||
|
borderTopWidth: 0,
|
||||||
|
paddingTop: OS_IOS_PADDING_TOP,
|
||||||
|
height: OS_IOS_HEIGHT,
|
||||||
|
},
|
||||||
|
android: {
|
||||||
|
borderTopWidth: 0,
|
||||||
|
paddingTop: OS_ANDROID_PADDING_TOP,
|
||||||
|
height: OS_ANDROID_HEIGHT + paddingBottom,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
header: () => (
|
||||||
|
<AppHeader
|
||||||
|
title="Job Vacancy"
|
||||||
|
left={
|
||||||
|
<BackButtonFromNotification
|
||||||
|
from={from || ""}
|
||||||
|
category={category}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
}}
|
||||||
|
>
|
||||||
<Tabs.Screen
|
<Tabs.Screen
|
||||||
name="index"
|
name="index"
|
||||||
options={{
|
options={{
|
||||||
@@ -56,6 +79,10 @@ export default function JobTabsLayout() {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
</>
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default function JobTabsLayout() {
|
||||||
|
return <JobTabsWrapper />;
|
||||||
|
}
|
||||||
|
|||||||
@@ -5,10 +5,11 @@ import {
|
|||||||
DrawerCustom,
|
DrawerCustom,
|
||||||
LoaderCustom,
|
LoaderCustom,
|
||||||
MenuDrawerDynamicGrid,
|
MenuDrawerDynamicGrid,
|
||||||
|
OS_Wrapper,
|
||||||
Spacing,
|
Spacing,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import { IconEdit } from "@/components/_Icon";
|
import { IconEdit } from "@/components/_Icon";
|
||||||
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
||||||
import ReportBox from "@/components/Box/ReportBox";
|
import ReportBox from "@/components/Box/ReportBox";
|
||||||
@@ -22,6 +23,7 @@ import {
|
|||||||
useLocalSearchParams,
|
useLocalSearchParams,
|
||||||
} from "expo-router";
|
} from "expo-router";
|
||||||
import { useCallback, useState } from "react";
|
import { useCallback, useState } from "react";
|
||||||
|
import { PADDING_INLINE } from "@/constants/constans-value";
|
||||||
|
|
||||||
export default function JobDetailStatus() {
|
export default function JobDetailStatus() {
|
||||||
const { id, status } = useLocalSearchParams();
|
const { id, status } = useLocalSearchParams();
|
||||||
@@ -58,15 +60,20 @@ export default function JobDetailStatus() {
|
|||||||
<>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
title: `Detail`,
|
header: () => (
|
||||||
headerLeft: () => <BackButton />,
|
<AppHeader
|
||||||
headerRight: () =>
|
title="Detail"
|
||||||
status === "draft" ? (
|
left={<BackButton />}
|
||||||
<DotButton onPress={() => setOpenDrawer(true)} />
|
right={
|
||||||
) : null,
|
status === "draft" ? (
|
||||||
|
<DotButton onPress={() => setOpenDrawer(true)} />
|
||||||
|
) : null
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ViewWrapper>
|
<OS_Wrapper >
|
||||||
{isLoadData ? (
|
{isLoadData ? (
|
||||||
<LoaderCustom />
|
<LoaderCustom />
|
||||||
) : (
|
) : (
|
||||||
@@ -77,7 +84,7 @@ export default function JobDetailStatus() {
|
|||||||
(status === "draft" || status === "reject") && (
|
(status === "draft" || status === "reject") && (
|
||||||
<ReportBox text={data?.catatan} />
|
<ReportBox text={data?.catatan} />
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<Job_BoxDetailSection data={data} />
|
<Job_BoxDetailSection data={data} />
|
||||||
<Job_ButtonStatusSection
|
<Job_ButtonStatusSection
|
||||||
id={id as string}
|
id={id as string}
|
||||||
@@ -90,7 +97,7 @@ export default function JobDetailStatus() {
|
|||||||
<Spacing />
|
<Spacing />
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</ViewWrapper>
|
</OS_Wrapper>
|
||||||
|
|
||||||
<DrawerCustom
|
<DrawerCustom
|
||||||
isVisible={openDrawer}
|
isVisible={openDrawer}
|
||||||
|
|||||||
@@ -1,198 +1,5 @@
|
|||||||
/* eslint-disable react-hooks/exhaustive-deps */
|
import { Job_ScreenEdit } from "@/screens/Job/ScreenJobEdit";
|
||||||
import {
|
|
||||||
BaseBox,
|
|
||||||
ButtonCenteredOnly,
|
|
||||||
ButtonCustom,
|
|
||||||
DummyLandscapeImage,
|
|
||||||
InformationBox,
|
|
||||||
LandscapeFrameUploaded,
|
|
||||||
LoaderCustom,
|
|
||||||
Spacing,
|
|
||||||
StackCustom,
|
|
||||||
TextAreaCustom,
|
|
||||||
TextInputCustom,
|
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
|
||||||
import DIRECTORY_ID from "@/constants/directory-id";
|
|
||||||
import { apiJobGetOne, apiJobUpdateData } from "@/service/api-client/api-job";
|
|
||||||
import {
|
|
||||||
deleteFileService,
|
|
||||||
uploadFileService,
|
|
||||||
} from "@/service/upload-service";
|
|
||||||
import pickImage from "@/utils/pickImage";
|
|
||||||
import { router, useLocalSearchParams } from "expo-router";
|
|
||||||
import { useEffect, useState } from "react";
|
|
||||||
import Toast from "react-native-toast-message";
|
|
||||||
|
|
||||||
export default function JobEdit() {
|
export default function JobEdit() {
|
||||||
const { id } = useLocalSearchParams();
|
return <Job_ScreenEdit />;
|
||||||
const [data, setData] = useState<any>({
|
|
||||||
title: "",
|
|
||||||
content: "",
|
|
||||||
deskripsi: "",
|
|
||||||
});
|
|
||||||
const [isLoadData, setIsLoadData] = useState(false);
|
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
|
||||||
|
|
||||||
const [imageUri, setImageUri] = useState<string | null>(null);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
onLoadData();
|
|
||||||
}, [id]);
|
|
||||||
|
|
||||||
const onLoadData = async () => {
|
|
||||||
try {
|
|
||||||
setIsLoadData(true);
|
|
||||||
const response = await apiJobGetOne({ id: id as string });
|
|
||||||
if (response.success) {
|
|
||||||
setData(response.data);
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.log("[ERROR]", error);
|
|
||||||
} finally {
|
|
||||||
setIsLoadData(false);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const handlerOnUpdate = async () => {
|
|
||||||
if (!data.title || !data.content || !data.deskripsi) {
|
|
||||||
Toast.show({
|
|
||||||
type: "info",
|
|
||||||
text1: "Info",
|
|
||||||
text2: "Harap isi semua data",
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
setIsLoading(true);
|
|
||||||
let newImageId = "";
|
|
||||||
|
|
||||||
if (imageUri) {
|
|
||||||
const responseUploadImage = await uploadFileService({
|
|
||||||
imageUri: imageUri,
|
|
||||||
dirId: DIRECTORY_ID.job_image,
|
|
||||||
});
|
|
||||||
|
|
||||||
if (responseUploadImage.success) {
|
|
||||||
newImageId = responseUploadImage.data.id;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (data?.imageId) {
|
|
||||||
const responseDeleteImage = await deleteFileService({
|
|
||||||
id: data.imageId,
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!responseDeleteImage.success) {
|
|
||||||
console.log("[ERROR DELETE IMAGE]", responseDeleteImage.message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const newData = {
|
|
||||||
title: data.title,
|
|
||||||
content: data.content,
|
|
||||||
deskripsi: data.deskripsi,
|
|
||||||
imageId: newImageId,
|
|
||||||
};
|
|
||||||
|
|
||||||
const response = await apiJobUpdateData({
|
|
||||||
id: id as string,
|
|
||||||
data: newData,
|
|
||||||
category: "edit",
|
|
||||||
});
|
|
||||||
|
|
||||||
if (response.success) {
|
|
||||||
Toast.show({
|
|
||||||
type: "success",
|
|
||||||
text1: response.message,
|
|
||||||
});
|
|
||||||
router.back();
|
|
||||||
} else {
|
|
||||||
Toast.show({
|
|
||||||
type: "info",
|
|
||||||
text1: "Info",
|
|
||||||
text2: response.message,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.log("[ERROR]", error);
|
|
||||||
} finally {
|
|
||||||
setIsLoading(false);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const buttonSubmit = () => {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ButtonCustom isLoading={isLoading} onPress={() => handlerOnUpdate()}>
|
|
||||||
Update
|
|
||||||
</ButtonCustom>
|
|
||||||
<Spacing />
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<ViewWrapper>
|
|
||||||
{isLoadData ? (
|
|
||||||
<LoaderCustom />
|
|
||||||
) : (
|
|
||||||
<StackCustom gap={"xs"}>
|
|
||||||
<InformationBox text="Poster atau gambar lowongan kerja bersifat opsional, tidak wajib untuk dimasukkan dan upload lah gambar yang sesuai dengan deskripsi lowongan kerja." />
|
|
||||||
|
|
||||||
{imageUri ? (
|
|
||||||
<LandscapeFrameUploaded image={imageUri as any} />
|
|
||||||
) : (
|
|
||||||
<BaseBox>
|
|
||||||
<DummyLandscapeImage imageId={data?.imageId} />
|
|
||||||
</BaseBox>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<ButtonCenteredOnly
|
|
||||||
onPress={() => {
|
|
||||||
pickImage({
|
|
||||||
setImageUri,
|
|
||||||
});
|
|
||||||
}}
|
|
||||||
icon="upload"
|
|
||||||
>
|
|
||||||
Upload
|
|
||||||
</ButtonCenteredOnly>
|
|
||||||
|
|
||||||
<Spacing />
|
|
||||||
|
|
||||||
<TextInputCustom
|
|
||||||
label="Judul Lowongan"
|
|
||||||
placeholder="Masukan Judul Lowongan Kerja"
|
|
||||||
required
|
|
||||||
value={data.title}
|
|
||||||
onChangeText={(value) => setData({ ...data, title: value })}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<TextAreaCustom
|
|
||||||
label="Syarat & Kualifikasi"
|
|
||||||
placeholder="Masukan Syarat & Kualifikasi Lowongan Kerja"
|
|
||||||
required
|
|
||||||
showCount
|
|
||||||
maxLength={1000}
|
|
||||||
value={data.content}
|
|
||||||
onChangeText={(value) => setData({ ...data, content: value })}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<TextAreaCustom
|
|
||||||
label="Deskripsi Lowongan"
|
|
||||||
placeholder="Masukan Deskripsi Lowongan Kerja"
|
|
||||||
required
|
|
||||||
showCount
|
|
||||||
maxLength={1000}
|
|
||||||
value={data.deskripsi}
|
|
||||||
onChangeText={(value) => setData({ ...data, deskripsi: value })}
|
|
||||||
/>
|
|
||||||
|
|
||||||
{buttonSubmit()}
|
|
||||||
</StackCustom>
|
|
||||||
)}
|
|
||||||
</ViewWrapper>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,168 +1,5 @@
|
|||||||
import {
|
import { Job_ScreenCreate } from "@/screens/Job/ScreenJobCreate";
|
||||||
BoxButtonOnFooter,
|
|
||||||
ButtonCenteredOnly,
|
|
||||||
ButtonCustom,
|
|
||||||
InformationBox,
|
|
||||||
LandscapeFrameUploaded,
|
|
||||||
NewWrapper,
|
|
||||||
Spacing,
|
|
||||||
StackCustom,
|
|
||||||
TextAreaCustom,
|
|
||||||
TextInputCustom
|
|
||||||
} from "@/components";
|
|
||||||
import DIRECTORY_ID from "@/constants/directory-id";
|
|
||||||
import { useAuth } from "@/hooks/use-auth";
|
|
||||||
import { apiJobCreate } from "@/service/api-client/api-job";
|
|
||||||
import { uploadFileService } from "@/service/upload-service";
|
|
||||||
import pickImage from "@/utils/pickImage";
|
|
||||||
import { router } from "expo-router";
|
|
||||||
import { useState } from "react";
|
|
||||||
import Toast from "react-native-toast-message";
|
|
||||||
|
|
||||||
export default function JobCreate() {
|
export default function JobCreate() {
|
||||||
const nextUrl = "/(application)/(user)/job/(tabs)/status?status=review";
|
return <Job_ScreenCreate />;
|
||||||
const { user } = useAuth();
|
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
|
||||||
const [image, setImage] = useState<string | null>(null);
|
|
||||||
const [data, setData] = useState({
|
|
||||||
title: "",
|
|
||||||
content: "",
|
|
||||||
deskripsi: "",
|
|
||||||
authorId: "",
|
|
||||||
});
|
|
||||||
|
|
||||||
const handlerOnSubmit = async () => {
|
|
||||||
let imageId = "";
|
|
||||||
const newData = {
|
|
||||||
title: data.title,
|
|
||||||
content: data.content,
|
|
||||||
deskripsi: data.deskripsi,
|
|
||||||
authorId: user?.id,
|
|
||||||
imageId: "",
|
|
||||||
};
|
|
||||||
|
|
||||||
if (!data.title || !data.content || !data.deskripsi || !user?.id) {
|
|
||||||
Toast.show({
|
|
||||||
type: "info",
|
|
||||||
text1: "Info",
|
|
||||||
text2: "Harap isi semua data",
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
setIsLoading(true);
|
|
||||||
|
|
||||||
if (image === null || !image) {
|
|
||||||
const response = await apiJobCreate(newData);
|
|
||||||
if (response.success) {
|
|
||||||
Toast.show({
|
|
||||||
type: "success",
|
|
||||||
text1: "Berhasil",
|
|
||||||
text2: "Lowongan berhasil dibuat",
|
|
||||||
});
|
|
||||||
router.replace(nextUrl);
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const responseUploadImage = await uploadFileService({
|
|
||||||
imageUri: image,
|
|
||||||
dirId: DIRECTORY_ID.job_image,
|
|
||||||
});
|
|
||||||
|
|
||||||
if (responseUploadImage.success) {
|
|
||||||
imageId = responseUploadImage.data.id;
|
|
||||||
}
|
|
||||||
|
|
||||||
const fixData = {
|
|
||||||
...newData,
|
|
||||||
imageId: imageId,
|
|
||||||
};
|
|
||||||
|
|
||||||
const response = await apiJobCreate(fixData);
|
|
||||||
if (response.success) {
|
|
||||||
Toast.show({
|
|
||||||
type: "success",
|
|
||||||
text1: "Berhasil",
|
|
||||||
text2: "Lowongan berhasil dibuat",
|
|
||||||
});
|
|
||||||
router.replace(nextUrl);
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.log("[ERROR]", error);
|
|
||||||
} finally {
|
|
||||||
setIsLoading(false);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const buttonSubmit = () => {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<BoxButtonOnFooter>
|
|
||||||
<ButtonCustom isLoading={isLoading} onPress={() => handlerOnSubmit()}>
|
|
||||||
Simpan
|
|
||||||
</ButtonCustom>
|
|
||||||
</BoxButtonOnFooter>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<NewWrapper footerComponent={buttonSubmit()}>
|
|
||||||
<StackCustom gap={"xs"}>
|
|
||||||
<InformationBox text="Poster atau gambar lowongan kerja bersifat opsional, tidak wajib untuk dimasukkan dan upload lah gambar yang sesuai dengan deskripsi lowongan kerja." />
|
|
||||||
|
|
||||||
{/* <BaseBox>
|
|
||||||
<Image
|
|
||||||
source={image ? { uri: image } : DUMMY_IMAGE.dummy_image}
|
|
||||||
style={{ width: "100%", height: 200 }}
|
|
||||||
/>
|
|
||||||
</BaseBox> */}
|
|
||||||
<LandscapeFrameUploaded image={image as string} />
|
|
||||||
<ButtonCenteredOnly
|
|
||||||
onPress={() => {
|
|
||||||
// router.push("/(application)/(image)/take-picture/123");
|
|
||||||
pickImage({
|
|
||||||
setImageUri: setImage,
|
|
||||||
});
|
|
||||||
}}
|
|
||||||
icon="upload"
|
|
||||||
>
|
|
||||||
Upload
|
|
||||||
</ButtonCenteredOnly>
|
|
||||||
|
|
||||||
<Spacing />
|
|
||||||
|
|
||||||
<TextInputCustom
|
|
||||||
label="Judul Lowongan"
|
|
||||||
placeholder="Masukan Judul Lowongan Kerja"
|
|
||||||
required
|
|
||||||
value={data.title}
|
|
||||||
onChangeText={(value) => setData({ ...data, title: value })}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<TextAreaCustom
|
|
||||||
label="Syarat & Kualifikasi"
|
|
||||||
placeholder="Masukan Syarat & Kualifikasi Lowongan Kerja"
|
|
||||||
required
|
|
||||||
showCount
|
|
||||||
maxLength={1000}
|
|
||||||
value={data.content}
|
|
||||||
onChangeText={(value) => setData({ ...data, content: value })}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<TextAreaCustom
|
|
||||||
label="Deskripsi Lowongan"
|
|
||||||
placeholder="Masukan Deskripsi Lowongan Kerja"
|
|
||||||
required
|
|
||||||
showCount
|
|
||||||
maxLength={1000}
|
|
||||||
value={data.deskripsi}
|
|
||||||
onChangeText={(value) => setData({ ...data, deskripsi: value })}
|
|
||||||
/>
|
|
||||||
</StackCustom>
|
|
||||||
</NewWrapper>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,244 +1,5 @@
|
|||||||
/* eslint-disable react-hooks/exhaustive-deps */
|
import { Maps_ScreenMapsEdit } from "@/screens/Maps/ScreenMapsEdit";
|
||||||
import {
|
|
||||||
BoxButtonOnFooter,
|
|
||||||
ButtonCenteredOnly,
|
|
||||||
ButtonCustom,
|
|
||||||
InformationBox,
|
|
||||||
LandscapeFrameUploaded,
|
|
||||||
Spacing,
|
|
||||||
TextInputCustom,
|
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
|
||||||
import API_IMAGE from "@/constants/api-storage";
|
|
||||||
import DIRECTORY_ID from "@/constants/directory-id";
|
|
||||||
import { apiMapsGetOne, apiMapsUpdate } from "@/service/api-client/api-maps";
|
|
||||||
import { uploadFileService } from "@/service/upload-service";
|
|
||||||
import pickFile, { IFileData } from "@/utils/pickFile";
|
|
||||||
import { router, useFocusEffect, useLocalSearchParams } from "expo-router";
|
|
||||||
import { useCallback, useState } from "react";
|
|
||||||
import { StyleSheet, View } from "react-native";
|
|
||||||
import MapView, { LatLng, Marker } from "react-native-maps";
|
|
||||||
import Toast from "react-native-toast-message";
|
|
||||||
|
|
||||||
const defaultRegion = {
|
|
||||||
latitude: -8.737109,
|
|
||||||
longitude: 115.1756897,
|
|
||||||
latitudeDelta: 0.1,
|
|
||||||
longitudeDelta: 0.1,
|
|
||||||
};
|
|
||||||
export default function MapsEdit() {
|
export default function MapsEdit() {
|
||||||
const { id } = useLocalSearchParams();
|
return <Maps_ScreenMapsEdit />;
|
||||||
const [data, setData] = useState<any | null>({
|
|
||||||
id: "",
|
|
||||||
namePin: "",
|
|
||||||
latitude: "",
|
|
||||||
longitude: "",
|
|
||||||
imageId: "",
|
|
||||||
});
|
|
||||||
const [selectedLocation, setSelectedLocation] = useState<LatLng | null>(null);
|
|
||||||
const [image, setImage] = useState<IFileData | null>(null);
|
|
||||||
const [isLoading, setLoading] = useState(false);
|
|
||||||
|
|
||||||
useFocusEffect(
|
|
||||||
useCallback(() => {
|
|
||||||
onLoadData();
|
|
||||||
}, [id])
|
|
||||||
);
|
|
||||||
|
|
||||||
const onLoadData = async () => {
|
|
||||||
try {
|
|
||||||
const response = await apiMapsGetOne({ id: id as string });
|
|
||||||
|
|
||||||
if (response.success) {
|
|
||||||
setData({
|
|
||||||
id: response.data.id,
|
|
||||||
namePin: response.data.namePin,
|
|
||||||
latitude: response.data.latitude,
|
|
||||||
longitude: response.data.longitude,
|
|
||||||
imageId: response.data.imageId,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.log("[ERROR]", error);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleMapPress = (event: any) => {
|
|
||||||
const { latitude, longitude } = event.nativeEvent.coordinate;
|
|
||||||
const location = { latitude, longitude };
|
|
||||||
setSelectedLocation(location);
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleSubmit = async () => {
|
|
||||||
let newData: any;
|
|
||||||
if (!data.namePin) {
|
|
||||||
Toast.show({
|
|
||||||
type: "error",
|
|
||||||
text1: "Nama pin harus diisi",
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
newData = {
|
|
||||||
namePin: data?.namePin,
|
|
||||||
latitude: selectedLocation?.latitude || data?.latitude,
|
|
||||||
longitude: selectedLocation?.longitude || data?.longitude,
|
|
||||||
};
|
|
||||||
|
|
||||||
try {
|
|
||||||
setLoading(true);
|
|
||||||
if (image) {
|
|
||||||
const responseUpload = await uploadFileService({
|
|
||||||
dirId: DIRECTORY_ID.map_image,
|
|
||||||
imageUri: image?.uri,
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!responseUpload?.data?.id) {
|
|
||||||
Toast.show({
|
|
||||||
type: "error",
|
|
||||||
text1: "Gagal mengunggah gambar",
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const imageId = responseUpload?.data?.id;
|
|
||||||
|
|
||||||
newData = {
|
|
||||||
namePin: data?.namePin,
|
|
||||||
latitude: selectedLocation?.latitude,
|
|
||||||
longitude: selectedLocation?.longitude,
|
|
||||||
newImageId: imageId,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
const responseUpdate = await apiMapsUpdate({
|
|
||||||
id: data?.id,
|
|
||||||
data: newData,
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!responseUpdate.success) {
|
|
||||||
Toast.show({
|
|
||||||
type: "error",
|
|
||||||
text1: "Gagal mengupdate map",
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Toast.show({
|
|
||||||
type: "success",
|
|
||||||
text1: "Map berhasil diupdate",
|
|
||||||
});
|
|
||||||
router.back();
|
|
||||||
} catch (error) {
|
|
||||||
console.log("[ERROR]", error);
|
|
||||||
} finally {
|
|
||||||
setLoading(false);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const buttonFooter = (
|
|
||||||
<BoxButtonOnFooter>
|
|
||||||
<ButtonCustom
|
|
||||||
disabled={!data.namePin}
|
|
||||||
onPress={handleSubmit}
|
|
||||||
isLoading={isLoading}
|
|
||||||
>
|
|
||||||
Update
|
|
||||||
</ButtonCustom>
|
|
||||||
</BoxButtonOnFooter>
|
|
||||||
);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<ViewWrapper footerComponent={buttonFooter}>
|
|
||||||
<InformationBox text="Tentukan lokasi pin map dengan menekan pada map." />
|
|
||||||
|
|
||||||
<View style={[styles.container, { height: 400 }]}>
|
|
||||||
<MapView
|
|
||||||
style={styles.map}
|
|
||||||
initialRegion={
|
|
||||||
data?.latitude && data?.longitude
|
|
||||||
? {
|
|
||||||
latitude: data?.latitude,
|
|
||||||
longitude: data?.longitude,
|
|
||||||
latitudeDelta: 0.1,
|
|
||||||
longitudeDelta: 0.1,
|
|
||||||
}
|
|
||||||
: defaultRegion
|
|
||||||
}
|
|
||||||
onPress={handleMapPress}
|
|
||||||
showsUserLocation={true}
|
|
||||||
showsMyLocationButton={true}
|
|
||||||
loadingEnabled={true}
|
|
||||||
loadingIndicatorColor="#666"
|
|
||||||
loadingBackgroundColor="#f0f0f0"
|
|
||||||
>
|
|
||||||
{selectedLocation ? (
|
|
||||||
<Marker
|
|
||||||
coordinate={selectedLocation}
|
|
||||||
title="Lokasi Dipilih"
|
|
||||||
description={`Lat: ${selectedLocation.latitude.toFixed(
|
|
||||||
6
|
|
||||||
)}, Lng: ${selectedLocation.longitude.toFixed(6)}`}
|
|
||||||
pinColor="red"
|
|
||||||
/>
|
|
||||||
) : (
|
|
||||||
<Marker
|
|
||||||
coordinate={defaultRegion}
|
|
||||||
title="Lokasi Dipilih"
|
|
||||||
description={`Lat: ${defaultRegion.latitude.toFixed(
|
|
||||||
6
|
|
||||||
)}, Lng: ${defaultRegion.longitude.toFixed(6)}`}
|
|
||||||
pinColor="red"
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</MapView>
|
|
||||||
</View>
|
|
||||||
|
|
||||||
<TextInputCustom
|
|
||||||
required
|
|
||||||
label="Nama Pin"
|
|
||||||
placeholder="Masukkan nama pin maps"
|
|
||||||
value={data?.namePin}
|
|
||||||
onChangeText={(value) => setData({ ...data, namePin: value })}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<Spacing />
|
|
||||||
|
|
||||||
<InformationBox text="Upload foto lokasi bisnis anda untuk ditampilkan dalam detail maps." />
|
|
||||||
<LandscapeFrameUploaded
|
|
||||||
image={
|
|
||||||
image
|
|
||||||
? image?.uri
|
|
||||||
: API_IMAGE.GET({ fileId: data?.imageId as string })
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
<ButtonCenteredOnly
|
|
||||||
icon="upload"
|
|
||||||
onPress={() => {
|
|
||||||
pickFile({
|
|
||||||
allowedType: "image",
|
|
||||||
setImageUri(file) {
|
|
||||||
setImage(file);
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Upload
|
|
||||||
</ButtonCenteredOnly>
|
|
||||||
<Spacing height={50} />
|
|
||||||
</ViewWrapper>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
|
||||||
container: {
|
|
||||||
width: "100%",
|
|
||||||
backgroundColor: "#f5f5f5",
|
|
||||||
overflow: "hidden",
|
|
||||||
borderRadius: 8,
|
|
||||||
marginBottom: 20,
|
|
||||||
},
|
|
||||||
map: {
|
|
||||||
flex: 1,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|||||||
@@ -1,143 +1,9 @@
|
|||||||
import {
|
import Maps_ScreenMapsCreate from "@/screens/Maps/ScreenMapsCreate";
|
||||||
BaseBox,
|
|
||||||
BoxButtonOnFooter,
|
|
||||||
ButtonCenteredOnly,
|
|
||||||
ButtonCustom,
|
|
||||||
InformationBox,
|
|
||||||
LandscapeFrameUploaded,
|
|
||||||
Spacing,
|
|
||||||
TextInputCustom,
|
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
|
||||||
import MapSelected from "@/components/Map/MapSelected";
|
|
||||||
import DIRECTORY_ID from "@/constants/directory-id";
|
|
||||||
import { useAuth } from "@/hooks/use-auth";
|
|
||||||
import { apiMapsCreate } from "@/service/api-client/api-maps";
|
|
||||||
import { uploadFileService } from "@/service/upload-service";
|
|
||||||
import pickFile, { IFileData } from "@/utils/pickFile";
|
|
||||||
import { router, useLocalSearchParams } from "expo-router";
|
|
||||||
import { useState } from "react";
|
|
||||||
import { LatLng } from "react-native-maps";
|
|
||||||
import Toast from "react-native-toast-message";
|
|
||||||
|
|
||||||
export default function MapsCreate() {
|
export default function MapsCreate() {
|
||||||
const { user } = useAuth();
|
|
||||||
const { id } = useLocalSearchParams();
|
|
||||||
const [selectedLocation, setSelectedLocation] = useState<LatLng | null>(null);
|
|
||||||
const [name, setName] = useState<string>("");
|
|
||||||
const [image, setImage] = useState<IFileData | null>(null);
|
|
||||||
const [isLoading, setLoading] = useState(false);
|
|
||||||
|
|
||||||
const handleSubmit = async () => {
|
|
||||||
try {
|
|
||||||
setLoading(true);
|
|
||||||
let newData: any;
|
|
||||||
newData = {
|
|
||||||
authorId: user?.id,
|
|
||||||
portofolioId: id,
|
|
||||||
namePin: name,
|
|
||||||
latitude: selectedLocation?.latitude,
|
|
||||||
longitude: selectedLocation?.longitude,
|
|
||||||
};
|
|
||||||
|
|
||||||
if (image) {
|
|
||||||
const responseUpload = await uploadFileService({
|
|
||||||
dirId: DIRECTORY_ID.map_image,
|
|
||||||
imageUri: image?.uri,
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!responseUpload?.data?.id) {
|
|
||||||
Toast.show({
|
|
||||||
type: "error",
|
|
||||||
text1: "Gagal mengunggah gambar",
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const imageId = responseUpload?.data?.id;
|
|
||||||
|
|
||||||
newData = {
|
|
||||||
authorId: user?.id,
|
|
||||||
portofolioId: id,
|
|
||||||
namePin: name,
|
|
||||||
latitude: selectedLocation?.latitude,
|
|
||||||
longitude: selectedLocation?.longitude,
|
|
||||||
imageId: imageId,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
const response = await apiMapsCreate({
|
|
||||||
data: newData,
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!response.success) {
|
|
||||||
Toast.show({
|
|
||||||
type: "error",
|
|
||||||
text1: "Gagal menambahkan map",
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Toast.show({
|
|
||||||
type: "success",
|
|
||||||
text1: "Map berhasil ditambahkan",
|
|
||||||
});
|
|
||||||
router.back();
|
|
||||||
} catch (error) {
|
|
||||||
console.log("[ERROR]", error);
|
|
||||||
} finally {
|
|
||||||
setLoading(false);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const buttonFooter = (
|
|
||||||
<BoxButtonOnFooter>
|
|
||||||
<ButtonCustom
|
|
||||||
isLoading={isLoading}
|
|
||||||
disabled={!selectedLocation || name === ""}
|
|
||||||
onPress={handleSubmit}
|
|
||||||
>
|
|
||||||
Simpan
|
|
||||||
</ButtonCustom>
|
|
||||||
</BoxButtonOnFooter>
|
|
||||||
);
|
|
||||||
return (
|
return (
|
||||||
<ViewWrapper footerComponent={buttonFooter}>
|
<>
|
||||||
<InformationBox text="Tentukan lokasi pin map dengan menekan pada map." />
|
<Maps_ScreenMapsCreate />
|
||||||
|
</>
|
||||||
<BaseBox>
|
|
||||||
<MapSelected
|
|
||||||
selectedLocation={selectedLocation as any}
|
|
||||||
setSelectedLocation={setSelectedLocation}
|
|
||||||
/>
|
|
||||||
</BaseBox>
|
|
||||||
|
|
||||||
<TextInputCustom
|
|
||||||
required
|
|
||||||
label="Nama Pin"
|
|
||||||
placeholder="Masukkan nama pin maps"
|
|
||||||
value={name}
|
|
||||||
onChangeText={setName}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<Spacing height={50} />
|
|
||||||
|
|
||||||
<InformationBox text="Upload foto lokasi bisnis anda untuk ditampilkan dalam detail maps." />
|
|
||||||
<LandscapeFrameUploaded image={image?.uri} />
|
|
||||||
<ButtonCenteredOnly
|
|
||||||
icon="upload"
|
|
||||||
onPress={() => {
|
|
||||||
pickFile({
|
|
||||||
allowedType: "image",
|
|
||||||
setImageUri(file) {
|
|
||||||
setImage(file);
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Upload
|
|
||||||
</ButtonCenteredOnly>
|
|
||||||
<Spacing height={50} />
|
|
||||||
</ViewWrapper>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
import MapsView from "@/screens/Maps/MapsView";
|
|
||||||
import MapsView2 from "@/screens/Maps/MapsView2";
|
import MapsView2 from "@/screens/Maps/MapsView2";
|
||||||
import { Text, View } from "react-native";
|
|
||||||
|
|
||||||
export interface LocationItem {
|
export interface LocationItem {
|
||||||
id: string | number;
|
id: string | number;
|
||||||
@@ -13,8 +11,14 @@ export interface LocationItem {
|
|||||||
export default function Maps() {
|
export default function Maps() {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<MapsView />
|
{/* <Stack.Screen
|
||||||
{/* <MapsView2 />, */}
|
options={{
|
||||||
|
title: "Maps",
|
||||||
|
headerLeft: () => <BackButton />,
|
||||||
|
}}
|
||||||
|
/> */}
|
||||||
|
{/* {Platform.OS === "ios" ? <MapsView /> : <MapsView2 />} */}
|
||||||
|
<MapsView2 />
|
||||||
{/* <View style={{ flex: 1, backgroundColor: "gray" }}><Text style={{ color: "white" }}>Map disabled</Text></View> */}
|
{/* <View style={{ flex: 1, backgroundColor: "gray" }}><Text style={{ color: "white" }}>Map disabled</Text></View> */}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,365 +1,5 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-unused-vars */
|
import { ScreenPortofolioCreate } from "@/screens/Portofolio/ScreenPortofolioCreate";
|
||||||
import {
|
|
||||||
ActionIcon,
|
|
||||||
AvatarComp,
|
|
||||||
BaseBox,
|
|
||||||
ButtonCenteredOnly,
|
|
||||||
CenterCustom,
|
|
||||||
Grid,
|
|
||||||
InformationBox,
|
|
||||||
NewWrapper,
|
|
||||||
SelectCustom,
|
|
||||||
Spacing,
|
|
||||||
StackCustom,
|
|
||||||
TextAreaCustom,
|
|
||||||
TextCustom,
|
|
||||||
TextInputCustom,
|
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
|
||||||
import { IconPlus } from "@/components/_Icon";
|
|
||||||
import { MainColor } from "@/constants/color-palet";
|
|
||||||
import { ICON_SIZE_XLARGE } from "@/constants/constans-value";
|
|
||||||
import DUMMY_IMAGE from "@/constants/dummy-image-value";
|
|
||||||
import Portofolio_ButtonCreate from "@/screens/Portofolio/ButtonCreatePortofolio";
|
|
||||||
import {
|
|
||||||
apiMasterBidangBisnis,
|
|
||||||
apiMasterSubBidangBisnis,
|
|
||||||
} from "@/service/api-client/api-master";
|
|
||||||
import {
|
|
||||||
IMasterBidangBisnis,
|
|
||||||
IMasterSubBidangBisnis,
|
|
||||||
} from "@/types/Type-Master";
|
|
||||||
import pickImage from "@/utils/pickImage";
|
|
||||||
import { Ionicons } from "@expo/vector-icons";
|
|
||||||
import { Image } from "expo-image";
|
|
||||||
import { useFocusEffect, useLocalSearchParams } from "expo-router";
|
|
||||||
import _ from "lodash";
|
|
||||||
import { useCallback, useEffect, useState } from "react";
|
|
||||||
import { Text, TouchableOpacity, View } from "react-native";
|
|
||||||
import PhoneInput, { ICountry } from "react-native-international-phone-number";
|
|
||||||
import { Avatar } from "react-native-paper";
|
|
||||||
|
|
||||||
export default function PortofolioCreate() {
|
export default function PortofolioCreate() {
|
||||||
const { id } = useLocalSearchParams();
|
return <ScreenPortofolioCreate />;
|
||||||
const [selectedCountry, setSelectedCountry] = useState<null | ICountry>(null);
|
|
||||||
const [inputValue, setInputValue] = useState<string>("");
|
|
||||||
const [data, setData] = useState({
|
|
||||||
namaBisnis: "",
|
|
||||||
masterBidangBisnisId: "",
|
|
||||||
alamatKantor: "",
|
|
||||||
tlpn: "",
|
|
||||||
deskripsi: "",
|
|
||||||
});
|
|
||||||
const [imageUri, setImageUri] = useState<string | null>(null);
|
|
||||||
|
|
||||||
const [bidangBisnis, setBidangBisnis] = useState<IMasterBidangBisnis[]>([]);
|
|
||||||
const [subBidangBisnis, setSubBidangBisnis] = useState<
|
|
||||||
IMasterSubBidangBisnis[]
|
|
||||||
>([]);
|
|
||||||
|
|
||||||
const [selectedSubBidang, setSelectedSubBidang] = useState<string[]>([]);
|
|
||||||
const [listSubBidangSelected, setListSubBidangSelected] = useState([
|
|
||||||
{
|
|
||||||
id: "",
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
|
|
||||||
const [dataMedsos, setDataMedsos] = useState({
|
|
||||||
facebook: "",
|
|
||||||
twitter: "",
|
|
||||||
instagram: "",
|
|
||||||
youtube: "",
|
|
||||||
tiktok: "",
|
|
||||||
});
|
|
||||||
|
|
||||||
const [isLoadingCreate, setIsLoadingCreate] = useState(false);
|
|
||||||
|
|
||||||
function handleInputValue(phoneNumber: string) {
|
|
||||||
setInputValue(phoneNumber);
|
|
||||||
const callingCode = selectedCountry?.callingCode.replace(/^\+/, "") || "";
|
|
||||||
let fixNumber = inputValue.replace(/\s+/g, "").replace(/^0+/, "");
|
|
||||||
const realNumber = callingCode + fixNumber;
|
|
||||||
setData({ ...data, tlpn: realNumber });
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleSelectedCountry(country: ICountry) {
|
|
||||||
setSelectedCountry(country);
|
|
||||||
}
|
|
||||||
|
|
||||||
useFocusEffect(
|
|
||||||
useCallback(() => {
|
|
||||||
onLoadMaster();
|
|
||||||
onLoadMasterSubBidangBisnis();
|
|
||||||
}, [])
|
|
||||||
);
|
|
||||||
|
|
||||||
const onLoadMaster = async () => {
|
|
||||||
try {
|
|
||||||
const response = await apiMasterBidangBisnis();
|
|
||||||
setBidangBisnis(response.data);
|
|
||||||
} catch (error) {
|
|
||||||
setBidangBisnis([]);
|
|
||||||
console.log("Error onLoadMasterBidangBisnis", error);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const onLoadMasterSubBidangBisnis = async () => {
|
|
||||||
try {
|
|
||||||
const response = await apiMasterSubBidangBisnis({});
|
|
||||||
setSubBidangBisnis(response.data);
|
|
||||||
} catch (error) {
|
|
||||||
setSubBidangBisnis([]);
|
|
||||||
console.log("Error onLoadMasterBidangBisnis", error);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const handlerSelectedSubBidang = ({ id }: { id: string }) => {
|
|
||||||
const selectedList = subBidangBisnis?.filter(
|
|
||||||
(item) => (item?.masterBidangBisnisId as any) === id
|
|
||||||
);
|
|
||||||
setSelectedSubBidang(selectedList as any[]);
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<NewWrapper
|
|
||||||
footerComponent={
|
|
||||||
<Portofolio_ButtonCreate
|
|
||||||
id={id as string}
|
|
||||||
data={data}
|
|
||||||
dataMedsos={dataMedsos}
|
|
||||||
imageUri={imageUri}
|
|
||||||
subBidangSelected={listSubBidangSelected}
|
|
||||||
isLoadingCreate={isLoadingCreate}
|
|
||||||
setIsLoadingCreate={setIsLoadingCreate}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
>
|
|
||||||
{/* <TextCustom>Portofolio Create {id}</TextCustom> */}
|
|
||||||
<StackCustom gap={"xs"}>
|
|
||||||
<InformationBox text="Lengkapi data bisnis anda." />
|
|
||||||
<TextInputCustom
|
|
||||||
required
|
|
||||||
label="Nama Bisnis"
|
|
||||||
placeholder="Masukkan nama bisnis"
|
|
||||||
onChangeText={(value: any) => setData({ ...data, namaBisnis: value })}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<SelectCustom
|
|
||||||
label="Bidang Usaha"
|
|
||||||
required
|
|
||||||
data={bidangBisnis.map((item) => ({
|
|
||||||
label: item.name,
|
|
||||||
value: item.id,
|
|
||||||
}))}
|
|
||||||
value={data.masterBidangBisnisId}
|
|
||||||
onChange={(value) => {
|
|
||||||
const isSameBidang = data.masterBidangBisnisId === value;
|
|
||||||
|
|
||||||
if (!isSameBidang) {
|
|
||||||
setListSubBidangSelected([{ id: "" }]);
|
|
||||||
}
|
|
||||||
|
|
||||||
setData({ ...(data as any), masterBidangBisnisId: value });
|
|
||||||
handlerSelectedSubBidang({ id: value as string });
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
|
|
||||||
{listSubBidangSelected.map((item, index) => (
|
|
||||||
<SelectCustom
|
|
||||||
key={index}
|
|
||||||
disabled={data.masterBidangBisnisId === ""}
|
|
||||||
label="Sub Bidang Usaha"
|
|
||||||
required
|
|
||||||
data={_.map(selectedSubBidang as any)
|
|
||||||
.filter((option: any) => {
|
|
||||||
const selectedValues = listSubBidangSelected.map((s) => s.id);
|
|
||||||
return (
|
|
||||||
option.id === item.id || // biarkan tetap muncul kalau ini valuenya sendiri
|
|
||||||
!selectedValues.includes(option.id)
|
|
||||||
);
|
|
||||||
})
|
|
||||||
.map((e: any) => ({
|
|
||||||
value: e.id,
|
|
||||||
label: e.name,
|
|
||||||
}))}
|
|
||||||
value={item.id || null}
|
|
||||||
onChange={(value) => {
|
|
||||||
const list = _.clone(listSubBidangSelected);
|
|
||||||
list[index].id = value as any;
|
|
||||||
setListSubBidangSelected(list);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
|
|
||||||
<CenterCustom>
|
|
||||||
<View style={{ flexDirection: "row", alignItems: "center", gap: 10 }}>
|
|
||||||
<ActionIcon
|
|
||||||
disabled={
|
|
||||||
selectedSubBidang.length === listSubBidangSelected.length
|
|
||||||
}
|
|
||||||
onPress={() => {
|
|
||||||
setListSubBidangSelected([
|
|
||||||
...listSubBidangSelected,
|
|
||||||
{ id: "" },
|
|
||||||
]);
|
|
||||||
}}
|
|
||||||
icon={
|
|
||||||
<Ionicons
|
|
||||||
name="add-circle-outline"
|
|
||||||
size={ICON_SIZE_XLARGE}
|
|
||||||
color={MainColor.black}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
size="xl"
|
|
||||||
/>
|
|
||||||
<ActionIcon
|
|
||||||
disabled={listSubBidangSelected.length <= 1}
|
|
||||||
onPress={() => {
|
|
||||||
const list = _.clone(listSubBidangSelected);
|
|
||||||
list.pop();
|
|
||||||
setListSubBidangSelected(list);
|
|
||||||
}}
|
|
||||||
icon={
|
|
||||||
<Ionicons
|
|
||||||
name="remove-circle-outline"
|
|
||||||
size={ICON_SIZE_XLARGE}
|
|
||||||
color={MainColor.black}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
size="xl"
|
|
||||||
/>
|
|
||||||
</View>
|
|
||||||
</CenterCustom>
|
|
||||||
<Spacing />
|
|
||||||
|
|
||||||
{/* <SelectCustom
|
|
||||||
label="Bidang Usaha"
|
|
||||||
required
|
|
||||||
data={bidangBisnis.map((item) => ({
|
|
||||||
label: item.name,
|
|
||||||
value: item.id,
|
|
||||||
}))}
|
|
||||||
value={null}
|
|
||||||
onChange={(value) => {
|
|
||||||
setData({ ...(data as any), masterBidangBisnisId: value });
|
|
||||||
handlerSelectedSubBidang({ id: value as string });
|
|
||||||
}}
|
|
||||||
/> */}
|
|
||||||
|
|
||||||
{/* <ButtonCenteredOnly
|
|
||||||
onPress={() => {
|
|
||||||
setListSubBidangSelected([...listSubBidangSelected, { id: "" }]);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Tambah Pilihan
|
|
||||||
</ButtonCenteredOnly>
|
|
||||||
<Spacing /> */}
|
|
||||||
|
|
||||||
{/* <TextCustom>{JSON.stringify(bidangBisnis, null, 2)}</TextCustom> */}
|
|
||||||
|
|
||||||
<View>
|
|
||||||
<View style={{ flexDirection: "row", alignItems: "center" }}>
|
|
||||||
<TextCustom semiBold style={{ color: MainColor.white_gray }}>
|
|
||||||
Nomor Telepon
|
|
||||||
</TextCustom>
|
|
||||||
<Text style={{ color: "red" }}> *</Text>
|
|
||||||
</View>
|
|
||||||
<Spacing height={5} />
|
|
||||||
<PhoneInput
|
|
||||||
value={inputValue}
|
|
||||||
onChangePhoneNumber={handleInputValue}
|
|
||||||
selectedCountry={selectedCountry}
|
|
||||||
onChangeSelectedCountry={handleSelectedCountry}
|
|
||||||
defaultCountry="ID"
|
|
||||||
placeholder="xxx-xxx-xxx"
|
|
||||||
/>
|
|
||||||
</View>
|
|
||||||
<Spacing />
|
|
||||||
|
|
||||||
<TextInputCustom
|
|
||||||
required
|
|
||||||
label="Alamat Bisnis"
|
|
||||||
placeholder="Masukkan alamat bisnis"
|
|
||||||
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 />
|
|
||||||
|
|
||||||
{/* Logo */}
|
|
||||||
<InformationBox text="Upload logo bisnis anda untuk di tampilaka pada portofolio." />
|
|
||||||
|
|
||||||
<CenterCustom>
|
|
||||||
<Avatar.Image
|
|
||||||
source={imageUri ? { uri: imageUri } : DUMMY_IMAGE.dummy_image}
|
|
||||||
size={200}
|
|
||||||
/>
|
|
||||||
</CenterCustom>
|
|
||||||
<Spacing />
|
|
||||||
<ButtonCenteredOnly
|
|
||||||
icon="upload"
|
|
||||||
onPress={() => {
|
|
||||||
pickImage({
|
|
||||||
setImageUri,
|
|
||||||
});
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
Upload
|
|
||||||
</ButtonCenteredOnly>
|
|
||||||
<Spacing height={40} />
|
|
||||||
|
|
||||||
{/* Social Media */}
|
|
||||||
<InformationBox text="Isi hanya pada sosial media yang anda miliki." />
|
|
||||||
<TextInputCustom
|
|
||||||
label="Tiktok"
|
|
||||||
placeholder="Masukkan username tiktok"
|
|
||||||
onChangeText={(value: any) =>
|
|
||||||
setDataMedsos({ ...dataMedsos, tiktok: value })
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
<TextInputCustom
|
|
||||||
label="Facebook"
|
|
||||||
placeholder="Masukkan username facebook"
|
|
||||||
onChangeText={(value: any) =>
|
|
||||||
setDataMedsos({ ...dataMedsos, facebook: value })
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
<TextInputCustom
|
|
||||||
label="Instagram"
|
|
||||||
placeholder="Masukkan username instagram"
|
|
||||||
onChangeText={(value: any) =>
|
|
||||||
setDataMedsos({ ...dataMedsos, instagram: value })
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
<TextInputCustom
|
|
||||||
label="Twitter"
|
|
||||||
placeholder="Masukkan username twitter"
|
|
||||||
onChangeText={(value: any) =>
|
|
||||||
setDataMedsos({ ...dataMedsos, twitter: value })
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
<TextInputCustom
|
|
||||||
label="Youtube"
|
|
||||||
placeholder="Masukkan username youtube"
|
|
||||||
onChangeText={(value: any) =>
|
|
||||||
setDataMedsos({ ...dataMedsos, youtube: value })
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
{/* <Spacing /> */}
|
|
||||||
</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,8 @@ import {
|
|||||||
BoxButtonOnFooter,
|
BoxButtonOnFooter,
|
||||||
ButtonCustom,
|
ButtonCustom,
|
||||||
CenterCustom,
|
CenterCustom,
|
||||||
NewWrapper,
|
OS_Wrapper,
|
||||||
|
PhoneInputCustom,
|
||||||
SelectCustom,
|
SelectCustom,
|
||||||
Spacing,
|
Spacing,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
@@ -15,6 +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 {
|
import {
|
||||||
apiMasterBidangBisnis,
|
apiMasterBidangBisnis,
|
||||||
apiMasterSubBidangBisnis,
|
apiMasterSubBidangBisnis,
|
||||||
@@ -32,7 +38,6 @@ import { router, useLocalSearchParams } from "expo-router";
|
|||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { Text, View } from "react-native";
|
import { Text, View } from "react-native";
|
||||||
import PhoneInput, { ICountry } from "react-native-international-phone-number";
|
|
||||||
import { ActivityIndicator } from "react-native-paper";
|
import { ActivityIndicator } from "react-native-paper";
|
||||||
import Toast from "react-native-toast-message";
|
import Toast from "react-native-toast-message";
|
||||||
|
|
||||||
@@ -59,8 +64,9 @@ export default function PortofolioEdit() {
|
|||||||
const { id } = useLocalSearchParams();
|
const { id } = useLocalSearchParams();
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
const [data, setData] = useState<any>({});
|
const [data, setData] = useState<any>({});
|
||||||
|
const [phoneNumber, setPhoneNumber] = useState<string>("");
|
||||||
const [selectedCountry, setSelectedCountry] = useState<null | ICountry>(null);
|
const [selectedCountry, setSelectedCountry] =
|
||||||
|
useState<CountryData>(DEFAULT_COUNTRY);
|
||||||
const [bidangBisnis, setBidangBisnis] = useState<
|
const [bidangBisnis, setBidangBisnis] = useState<
|
||||||
IMasterBidangBisnis[] | null
|
IMasterBidangBisnis[] | null
|
||||||
>(null);
|
>(null);
|
||||||
@@ -72,12 +78,42 @@ export default function PortofolioEdit() {
|
|||||||
IListSubBidangSelected[]
|
IListSubBidangSelected[]
|
||||||
>([]);
|
>([]);
|
||||||
|
|
||||||
function handleInputValue(phoneNumber: string) {
|
function handlePhoneChange(phone: string) {
|
||||||
setData({ ...data, tlpn: phoneNumber });
|
setPhoneNumber(phone);
|
||||||
|
|
||||||
|
// Format phone number for API
|
||||||
|
const callingCode = selectedCountry.callingCode;
|
||||||
|
let fixNumber = phone.replace(/\s+/g, "").replace(/^0+/, "");
|
||||||
|
|
||||||
|
// Remove country code if already present
|
||||||
|
if (fixNumber.startsWith(callingCode)) {
|
||||||
|
fixNumber = fixNumber.substring(callingCode.length);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remove leading zero
|
||||||
|
fixNumber = fixNumber.replace(/^0+/, "");
|
||||||
|
|
||||||
|
const realNumber = callingCode + fixNumber;
|
||||||
|
setData({ ...data, tlpn: realNumber });
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleSelectedCountry(country: ICountry) {
|
function handleCountryChange(country: CountryData) {
|
||||||
setSelectedCountry(country);
|
setSelectedCountry(country);
|
||||||
|
|
||||||
|
// Re-format with new country code
|
||||||
|
const callingCode = country.callingCode;
|
||||||
|
let fixNumber = phoneNumber.replace(/\s+/g, "").replace(/^0+/, "");
|
||||||
|
|
||||||
|
// Remove country code if already present
|
||||||
|
if (fixNumber.startsWith(callingCode)) {
|
||||||
|
fixNumber = fixNumber.substring(callingCode.length);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remove leading zero
|
||||||
|
fixNumber = fixNumber.replace(/^0+/, "");
|
||||||
|
|
||||||
|
const realNumber = callingCode + fixNumber;
|
||||||
|
setData({ ...data, tlpn: realNumber });
|
||||||
}
|
}
|
||||||
|
|
||||||
const onLoadMasterBidang = async () => {
|
const onLoadMasterBidang = async () => {
|
||||||
@@ -122,8 +158,27 @@ export default function PortofolioEdit() {
|
|||||||
const response = await apiGetOnePortofolio({ id: id });
|
const response = await apiGetOnePortofolio({ id: id });
|
||||||
|
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
const fixNumber = response.data.tlpn.replace("62", "");
|
// Extract phone number without country code for display
|
||||||
setData({ ...response.data, tlpn: fixNumber });
|
const fullNumber = response.data.tlpn;
|
||||||
|
let displayNumber = fullNumber;
|
||||||
|
let detectedCountry = DEFAULT_COUNTRY;
|
||||||
|
|
||||||
|
// Try to detect country from calling code
|
||||||
|
for (const country of COUNTRIES) {
|
||||||
|
if (fullNumber.startsWith(country.callingCode)) {
|
||||||
|
detectedCountry = country;
|
||||||
|
displayNumber = fullNumber.substring(country.callingCode.length);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
setSelectedCountry(detectedCountry);
|
||||||
|
|
||||||
|
// Remove leading zero if present
|
||||||
|
displayNumber = displayNumber.replace(/^0+/, "");
|
||||||
|
|
||||||
|
setPhoneNumber(displayNumber);
|
||||||
|
setData({ ...response.data, tlpn: displayNumber });
|
||||||
|
|
||||||
// Cek apakah ada sub bidang bisnis yang terpilih
|
// Cek apakah ada sub bidang bisnis yang terpilih
|
||||||
const prevSubBidang = response.data.Portofolio_BidangDanSubBidangBisnis;
|
const prevSubBidang = response.data.Portofolio_BidangDanSubBidangBisnis;
|
||||||
@@ -244,15 +299,11 @@ export default function PortofolioEdit() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handleSubmitUpdate = async () => {
|
const handleSubmitUpdate = async () => {
|
||||||
const callingCode = selectedCountry?.callingCode.replace(/^\+/, "") || "";
|
|
||||||
let fixNumber = data.tlpn.replace(/\s+/g, "").replace(/^0+/, "");
|
|
||||||
const realNumber = callingCode + fixNumber;
|
|
||||||
|
|
||||||
const newData: IFormData = {
|
const newData: IFormData = {
|
||||||
id_Portofolio: data.id_Portofolio,
|
id_Portofolio: data.id_Portofolio,
|
||||||
namaBisnis: data.namaBisnis,
|
namaBisnis: data.namaBisnis,
|
||||||
alamatKantor: data.alamatKantor,
|
alamatKantor: data.alamatKantor,
|
||||||
tlpn: realNumber,
|
tlpn: data.tlpn, // Already formatted by PhoneInputCustom
|
||||||
deskripsi: data.deskripsi,
|
deskripsi: data.deskripsi,
|
||||||
masterBidangBisnisId: data.masterBidangBisnisId,
|
masterBidangBisnisId: data.masterBidangBisnisId,
|
||||||
subBidang: listSubBidangSelected,
|
subBidang: listSubBidangSelected,
|
||||||
@@ -317,162 +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} />
|
|
||||||
<PhoneInput
|
|
||||||
value={data.tlpn}
|
|
||||||
onChangePhoneNumber={handleInputValue}
|
|
||||||
selectedCountry={selectedCountry}
|
|
||||||
onChangeSelectedCountry={handleSelectedCountry}
|
|
||||||
defaultCountry="ID"
|
|
||||||
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,13 +4,15 @@ import {
|
|||||||
DrawerCustom,
|
DrawerCustom,
|
||||||
DummyLandscapeImage,
|
DummyLandscapeImage,
|
||||||
LoaderCustom,
|
LoaderCustom,
|
||||||
|
OS_Wrapper,
|
||||||
Spacing,
|
Spacing,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
TextCustom,
|
TextCustom,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import LeftButtonCustom from "@/components/Button/BackButton";
|
import LeftButtonCustom from "@/components/Button/BackButton";
|
||||||
import GridTwoView from "@/components/_ShareComponent/GridTwoView";
|
import GridTwoView from "@/components/_ShareComponent/GridTwoView";
|
||||||
import ViewWrapper from "@/components/_ShareComponent/ViewWrapper";
|
import CustomSkeleton from "@/components/_ShareComponent/SkeletonCustom";
|
||||||
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";
|
||||||
@@ -49,7 +51,7 @@ export default function Portofolio() {
|
|||||||
useCallback(() => {
|
useCallback(() => {
|
||||||
onLoadData(id as string);
|
onLoadData(id as string);
|
||||||
onLoadUserByToken();
|
onLoadUserByToken();
|
||||||
}, [id])
|
}, [id]),
|
||||||
);
|
);
|
||||||
|
|
||||||
async function onLoadData(id: string) {
|
async function onLoadData(id: string) {
|
||||||
@@ -64,41 +66,52 @@ export default function Portofolio() {
|
|||||||
setProfileId(response?.data?.Profile?.id);
|
setProfileId(response?.data?.Profile?.id);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{/* Header */}
|
{/* Header */}
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
title: "Portofolio",
|
header: () => (
|
||||||
headerLeft: () => <LeftButtonCustom />,
|
<AppHeader
|
||||||
headerRight: () =>
|
title="Portofolio"
|
||||||
data?.Profile?.id !== profileId ? null : (
|
left={<LeftButtonCustom />}
|
||||||
<TouchableOpacity onPress={openDrawer}>
|
right={
|
||||||
<Ionicons
|
data?.Profile?.id !== profileId ? null : (
|
||||||
name="ellipsis-vertical"
|
<TouchableOpacity onPress={openDrawer}>
|
||||||
size={20}
|
<Ionicons
|
||||||
color={MainColor.yellow}
|
name="ellipsis-vertical"
|
||||||
/>
|
size={20}
|
||||||
</TouchableOpacity>
|
color={MainColor.yellow}
|
||||||
),
|
/>
|
||||||
headerStyle: GStyles.headerStyle,
|
</TouchableOpacity>
|
||||||
headerTitleStyle: GStyles.headerTitleStyle,
|
)
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ViewWrapper>
|
<OS_Wrapper>
|
||||||
{!data || !profileId ? (
|
{!data || !profileId ? (
|
||||||
<LoaderCustom />
|
<StackCustom>
|
||||||
|
<CustomSkeleton height={400} />
|
||||||
|
<CustomSkeleton height={300} />
|
||||||
|
</StackCustom>
|
||||||
) : (
|
) : (
|
||||||
<StackCustom>
|
<StackCustom>
|
||||||
<Portofolio_Data
|
<Portofolio_Data
|
||||||
data={data}
|
data={data}
|
||||||
listSubBidang={data?.Portofolio_BidangDanSubBidangBisnis as any[]}
|
listSubBidang={data?.Portofolio_BidangDanSubBidangBisnis as any[]}
|
||||||
/>
|
/>
|
||||||
<Portofolio_BusinessLocation
|
{data?.BusinessMaps && (
|
||||||
data={data?.BusinessMaps}
|
<Portofolio_BusinessLocation
|
||||||
imageId={data?.logoId}
|
data={data?.BusinessMaps}
|
||||||
setOpenDrawerLocation={setOpenDrawerLocation}
|
imageId={data?.logoId}
|
||||||
/>
|
setOpenDrawerLocation={setOpenDrawerLocation}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
|
||||||
<Portofolio_SocialMediaSection
|
<Portofolio_SocialMediaSection
|
||||||
data={data?.Portofolio_MediaSosial}
|
data={data?.Portofolio_MediaSosial}
|
||||||
/>
|
/>
|
||||||
@@ -112,7 +125,7 @@ export default function Portofolio() {
|
|||||||
<Spacing />
|
<Spacing />
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
)}
|
)}
|
||||||
</ViewWrapper>
|
</OS_Wrapper>
|
||||||
|
|
||||||
{/* Drawer Komponen Eksternal */}
|
{/* Drawer Komponen Eksternal */}
|
||||||
<DrawerCustom
|
<DrawerCustom
|
||||||
@@ -135,36 +148,38 @@ export default function Portofolio() {
|
|||||||
closeDrawer={() => setOpenDrawerLocation(false)}
|
closeDrawer={() => setOpenDrawerLocation(false)}
|
||||||
height={"auto"}
|
height={"auto"}
|
||||||
>
|
>
|
||||||
<DummyLandscapeImage
|
{data?.BusinessMaps?.imageId && (
|
||||||
height={200}
|
<DummyLandscapeImage
|
||||||
imageId={data?.BusinessMaps?.imageId}
|
height={200}
|
||||||
/>
|
imageId={data?.BusinessMaps?.imageId}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
<Spacing />
|
<Spacing />
|
||||||
<StackCustom gap={"xs"}>
|
<StackCustom gap={"xs"}>
|
||||||
<GridTwoView
|
<GridTwoView
|
||||||
spanLeft={2}
|
spanLeft={2}
|
||||||
spanRight={10}
|
spanRight={10}
|
||||||
leftIcon={
|
leftItem={
|
||||||
<FontAwesome
|
<FontAwesome
|
||||||
name="building-o"
|
name="building-o"
|
||||||
size={ICON_SIZE_SMALL}
|
size={ICON_SIZE_SMALL}
|
||||||
color="white"
|
color="white"
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
rightIcon={<TextCustom>{data?.BusinessMaps?.namePin}</TextCustom>}
|
rightItem={<TextCustom>{data?.BusinessMaps?.namePin}</TextCustom>}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<GridTwoView
|
<GridTwoView
|
||||||
spanLeft={2}
|
spanLeft={2}
|
||||||
spanRight={10}
|
spanRight={10}
|
||||||
leftIcon={
|
leftItem={
|
||||||
<Ionicons
|
<Ionicons
|
||||||
name="list-outline"
|
name="list-outline"
|
||||||
size={ICON_SIZE_SMALL}
|
size={ICON_SIZE_SMALL}
|
||||||
color="white"
|
color="white"
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
rightIcon={
|
rightItem={
|
||||||
<TextCustom>{data?.MasterBidangBisnis?.name}</TextCustom>
|
<TextCustom>{data?.MasterBidangBisnis?.name}</TextCustom>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
@@ -172,26 +187,26 @@ export default function Portofolio() {
|
|||||||
<GridTwoView
|
<GridTwoView
|
||||||
spanLeft={2}
|
spanLeft={2}
|
||||||
spanRight={10}
|
spanRight={10}
|
||||||
leftIcon={
|
leftItem={
|
||||||
<Ionicons
|
<Ionicons
|
||||||
name="call-outline"
|
name="call-outline"
|
||||||
size={ICON_SIZE_SMALL}
|
size={ICON_SIZE_SMALL}
|
||||||
color="white"
|
color="white"
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
rightIcon={<TextCustom>{data?.tlpn}</TextCustom>}
|
rightItem={<TextCustom>{data?.tlpn}</TextCustom>}
|
||||||
/>
|
/>
|
||||||
<GridTwoView
|
<GridTwoView
|
||||||
spanLeft={2}
|
spanLeft={2}
|
||||||
spanRight={10}
|
spanRight={10}
|
||||||
leftIcon={
|
leftItem={
|
||||||
<Ionicons
|
<Ionicons
|
||||||
name="location-outline"
|
name="location-outline"
|
||||||
size={ICON_SIZE_SMALL}
|
size={ICON_SIZE_SMALL}
|
||||||
color="white"
|
color="white"
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
rightIcon={<TextCustom>{data?.alamatKantor}</TextCustom>}
|
rightItem={<TextCustom>{data?.alamatKantor}</TextCustom>}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Spacing />
|
<Spacing />
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import LeftButtonCustom from "@/components/Button/BackButton";
|
import LeftButtonCustom from "@/components/Button/BackButton";
|
||||||
import { HeaderStyles } from "@/styles/header-styles";
|
|
||||||
import { Stack } from "expo-router";
|
import { Stack } from "expo-router";
|
||||||
|
|
||||||
export default function PortofolioLayout() {
|
export default function PortofolioLayout() {
|
||||||
@@ -7,8 +7,9 @@ export default function PortofolioLayout() {
|
|||||||
<>
|
<>
|
||||||
<Stack
|
<Stack
|
||||||
screenOptions={{
|
screenOptions={{
|
||||||
...HeaderStyles,
|
header: () => (
|
||||||
headerLeft: () => <LeftButtonCustom />,
|
<AppHeader title="Portofolio" left={<LeftButtonCustom />} />
|
||||||
|
),
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{/* <Stack.Screen name="[id]/index" options={{ title: "Portofolio" }} /> */}
|
{/* <Stack.Screen name="[id]/index" options={{ title: "Portofolio" }} /> */}
|
||||||
|
|||||||
@@ -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,6 +1,7 @@
|
|||||||
/* eslint-disable react-hooks/exhaustive-deps */
|
/* eslint-disable react-hooks/exhaustive-deps */
|
||||||
import { LoaderCustom } from "@/components";
|
import { OS_Wrapper, StackCustom } from "@/components";
|
||||||
import ViewWrapper from "@/components/_ShareComponent/ViewWrapper";
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
|
import CustomSkeleton from "@/components/_ShareComponent/SkeletonCustom";
|
||||||
import LeftButtonCustom from "@/components/Button/BackButton";
|
import LeftButtonCustom from "@/components/Button/BackButton";
|
||||||
import DrawerCustom from "@/components/Drawer/DrawerCustom";
|
import DrawerCustom from "@/components/Drawer/DrawerCustom";
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
@@ -16,8 +17,8 @@ import { GStyles } from "@/styles/global-styles";
|
|||||||
import { IProfile } from "@/types/Type-Profile";
|
import { IProfile } from "@/types/Type-Profile";
|
||||||
import { Ionicons } from "@expo/vector-icons";
|
import { Ionicons } from "@expo/vector-icons";
|
||||||
import { Stack, useFocusEffect, useLocalSearchParams } from "expo-router";
|
import { Stack, useFocusEffect, useLocalSearchParams } from "expo-router";
|
||||||
import React, { useCallback, useState } from "react";
|
import { useCallback, useState } from "react";
|
||||||
import { TouchableOpacity } from "react-native";
|
import { RefreshControl, TouchableOpacity } from "react-native";
|
||||||
|
|
||||||
export default function Profile() {
|
export default function Profile() {
|
||||||
const { id } = useLocalSearchParams();
|
const { id } = useLocalSearchParams();
|
||||||
@@ -25,6 +26,7 @@ export default function Profile() {
|
|||||||
const [data, setData] = useState<IProfile>();
|
const [data, setData] = useState<IProfile>();
|
||||||
const [dataToken, setDataToken] = useState<IProfile>();
|
const [dataToken, setDataToken] = useState<IProfile>();
|
||||||
const [listPortofolio, setListPortofolio] = useState<any[]>();
|
const [listPortofolio, setListPortofolio] = useState<any[]>();
|
||||||
|
const [refreshing, setRefreshing] = useState(false);
|
||||||
|
|
||||||
const { token, logout, isAdmin, user, userData } = useAuth();
|
const { token, logout, isAdmin, user, userData } = useAuth();
|
||||||
|
|
||||||
@@ -43,7 +45,7 @@ export default function Profile() {
|
|||||||
onLoadUserByToken();
|
onLoadUserByToken();
|
||||||
isUserCheck();
|
isUserCheck();
|
||||||
userData(token as string);
|
userData(token as string);
|
||||||
}, [id, token])
|
}, [id, token]),
|
||||||
);
|
);
|
||||||
|
|
||||||
const isUserCheck = () => {
|
const isUserCheck = () => {
|
||||||
@@ -54,13 +56,21 @@ export default function Profile() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onLoadData = async (id: string) => {
|
const onLoadData = async (id: string) => {
|
||||||
const response = await apiProfile({ id: id });
|
try {
|
||||||
setData(response.data);
|
const response = await apiProfile({ id: id });
|
||||||
|
setData(response.data);
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR onLoadData]", error);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const onLoadUserByToken = async () => {
|
const onLoadUserByToken = async () => {
|
||||||
const response = await apiUser(user?.id as string);
|
try {
|
||||||
setDataToken(response?.data?.Profile);
|
const response = await apiUser(user?.id as string);
|
||||||
|
setDataToken(response?.data?.Profile);
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR onLoadUserByToken]", error);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const onLoadPortofolio = async (id: string) => {
|
const onLoadPortofolio = async (id: string) => {
|
||||||
@@ -69,37 +79,61 @@ export default function Profile() {
|
|||||||
const lastTwoByDate = response.data
|
const lastTwoByDate = response.data
|
||||||
.sort(
|
.sort(
|
||||||
(a: any, b: any) =>
|
(a: any, b: any) =>
|
||||||
new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime()
|
new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime(),
|
||||||
) // urut desc
|
) // urut desc
|
||||||
.slice(0, 2);
|
.slice(0, 2);
|
||||||
setListPortofolio(lastTwoByDate);
|
setListPortofolio(lastTwoByDate);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log("[ERROR]", error);
|
console.log("[ERROR onLoadPortofolio]", error);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const onRefresh = useCallback(() => {
|
||||||
|
setRefreshing(true);
|
||||||
|
onLoadData(id as string);
|
||||||
|
onLoadPortofolio(id as string);
|
||||||
|
onLoadUserByToken();
|
||||||
|
isUserCheck();
|
||||||
|
userData(token as string);
|
||||||
|
setRefreshing(false);
|
||||||
|
}, [id, token]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
options={{
|
options={{
|
||||||
title: `Profile`,
|
header: () => (
|
||||||
headerLeft: () => <LeftButtonCustom />,
|
<AppHeader
|
||||||
headerRight: () => (
|
title="Profile"
|
||||||
<ButtonnDot
|
left={<LeftButtonCustom />}
|
||||||
id={id as string}
|
right={
|
||||||
openDrawer={openDrawer}
|
<ButtonnDot
|
||||||
isUserCheck={isUserCheck()}
|
id={id as string}
|
||||||
logout={logout}
|
openDrawer={openDrawer}
|
||||||
|
isUserCheck={isUserCheck()}
|
||||||
|
logout={logout}
|
||||||
|
/>
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
headerStyle: GStyles.headerStyle,
|
|
||||||
headerTitleStyle: GStyles.headerTitleStyle,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
{/* Main View */}
|
{/* Main View */}
|
||||||
<ViewWrapper>
|
<OS_Wrapper
|
||||||
|
refreshControl={
|
||||||
|
<RefreshControl
|
||||||
|
refreshing={refreshing}
|
||||||
|
onRefresh={onRefresh}
|
||||||
|
tintColor={MainColor.yellow}
|
||||||
|
colors={[MainColor.yellow]}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
>
|
||||||
{!data || !dataToken ? (
|
{!data || !dataToken ? (
|
||||||
<LoaderCustom />
|
<StackCustom>
|
||||||
|
<CustomSkeleton height={400} />
|
||||||
|
<CustomSkeleton height={200} />
|
||||||
|
</StackCustom>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<ProfileSection data={data as any} />
|
<ProfileSection data={data as any} />
|
||||||
@@ -110,7 +144,7 @@ export default function Profile() {
|
|||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</ViewWrapper>
|
</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>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,47 +1,43 @@
|
|||||||
import { BackButton } from "@/components";
|
import { BackButton } from "@/components";
|
||||||
import { GStyles } from "@/styles/global-styles";
|
import AppHeader from "@/components/_ShareComponent/AppHeader";
|
||||||
import { Stack } from "expo-router";
|
import { Stack } from "expo-router";
|
||||||
|
|
||||||
export default function ProfileLayout() {
|
export default function ProfileLayout() {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack
|
<Stack>
|
||||||
screenOptions={{
|
|
||||||
headerStyle: GStyles.headerStyle,
|
|
||||||
headerTitleStyle: GStyles.headerTitleStyle,
|
|
||||||
headerTitleAlign: "center",
|
|
||||||
headerBackButtonDisplayMode: "minimal",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{/* <Stack.Screen name="[id]/index" options={{ headerShown: false }} /> */}
|
{/* <Stack.Screen name="[id]/index" options={{ headerShown: false }} /> */}
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="[id]/edit"
|
name="[id]/edit"
|
||||||
options={{ title: "Edit Profile", headerLeft: () => <BackButton /> }}
|
options={{ header: () => <AppHeader title="Edit Profile" /> }}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="[id]/update-photo"
|
name="[id]/update-photo"
|
||||||
options={{ title: "Update Foto", headerLeft: () => <BackButton /> }}
|
options={{ header: () => <AppHeader title="Update Foto" /> }}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="[id]/update-background"
|
name="[id]/update-background"
|
||||||
options={{
|
options={{
|
||||||
title: "Update Latar Belakang",
|
header: () => <AppHeader title="Update Latar Belakang" />,
|
||||||
headerLeft: () => <BackButton />,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="create"
|
name="create"
|
||||||
options={{ title: "Buat Profile", headerBackVisible: false }}
|
options={{
|
||||||
|
header: () => (
|
||||||
|
<AppHeader title="Tambah Profil" showBack={false} />
|
||||||
|
),
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="[id]/blocked-list"
|
name="[id]/blocked-list"
|
||||||
options={{ title: "Daftar Blokir", headerLeft: () => <BackButton /> }}
|
options={{ header: () => <AppHeader title="Daftar Blokir" /> }}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="[id]/detail-blocked"
|
name="[id]/detail-blocked"
|
||||||
options={{ title: "Detail Blokir", headerLeft: () => <BackButton /> }}
|
options={{ header: () => <AppHeader title="Detail Blokir" /> }}
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
</>
|
</>
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user