Compare commits
9 Commits
api-admin/
...
api/23-oct
| Author | SHA1 | Date | |
|---|---|---|---|
| 36dbfa3296 | |||
| 966e55597c | |||
| 4da55a5a8a | |||
| faf0f36e53 | |||
| 57285e5697 | |||
| 1fd9694ebf | |||
| d31df8c390 | |||
| 90cfb042d8 | |||
| b9f93ff46a |
42
.gitignore
vendored
42
.gitignore
vendored
@@ -40,3 +40,45 @@ app-example
|
|||||||
.qodo
|
.qodo
|
||||||
|
|
||||||
.env
|
.env
|
||||||
|
|
||||||
|
# @generated expo-cli sync-8d4afeec25ea8a192358fae2f8e2fc766bdce4ec
|
||||||
|
# The following patterns were generated by expo-cli
|
||||||
|
|
||||||
|
# Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files
|
||||||
|
|
||||||
|
# dependencies
|
||||||
|
node_modules/
|
||||||
|
|
||||||
|
# Expo
|
||||||
|
.expo/
|
||||||
|
dist/
|
||||||
|
web-build/
|
||||||
|
expo-env.d.ts
|
||||||
|
|
||||||
|
# Native
|
||||||
|
*.orig.*
|
||||||
|
*.jks
|
||||||
|
*.p8
|
||||||
|
*.p12
|
||||||
|
*.key
|
||||||
|
*.mobileprovision
|
||||||
|
|
||||||
|
# Metro
|
||||||
|
.metro-health-check*
|
||||||
|
|
||||||
|
# debug
|
||||||
|
npm-debug.*
|
||||||
|
yarn-debug.*
|
||||||
|
yarn-error.*
|
||||||
|
|
||||||
|
# macOS
|
||||||
|
.DS_Store
|
||||||
|
*.pem
|
||||||
|
|
||||||
|
# local env files
|
||||||
|
.env*.local
|
||||||
|
|
||||||
|
# typescript
|
||||||
|
*.tsbuildinfo
|
||||||
|
|
||||||
|
# @end expo-cli
|
||||||
@@ -64,9 +64,9 @@ react {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set this to true to Run Proguard on Release builds to minify the Java bytecode.
|
* Set this to true in release builds to optimize the app using [R8](https://developer.android.com/topic/performance/app-optimization/enable-app-optimization).
|
||||||
*/
|
*/
|
||||||
def enableProguardInReleaseBuilds = (findProperty('android.enableProguardInReleaseBuilds') ?: false).toBoolean()
|
def enableMinifyInReleaseBuilds = (findProperty('android.enableMinifyInReleaseBuilds') ?: false).toBoolean()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The preferred build flavor of JavaScriptCore (JSC)
|
* The preferred build flavor of JavaScriptCore (JSC)
|
||||||
@@ -94,6 +94,8 @@ android {
|
|||||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||||
versionCode 1
|
versionCode 1
|
||||||
versionName "1.0.0"
|
versionName "1.0.0"
|
||||||
|
|
||||||
|
buildConfigField "String", "REACT_NATIVE_RELEASE_LEVEL", "\"${findProperty('reactNativeReleaseLevel') ?: 'stable'}\""
|
||||||
}
|
}
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
debug {
|
debug {
|
||||||
@@ -111,15 +113,18 @@ android {
|
|||||||
// Caution! In production, you need to generate your own keystore file.
|
// Caution! In production, you need to generate your own keystore file.
|
||||||
// see https://reactnative.dev/docs/signed-apk-android.
|
// see https://reactnative.dev/docs/signed-apk-android.
|
||||||
signingConfig signingConfigs.debug
|
signingConfig signingConfigs.debug
|
||||||
shrinkResources (findProperty('android.enableShrinkResourcesInReleaseBuilds')?.toBoolean() ?: false)
|
def enableShrinkResources = findProperty('android.enableShrinkResourcesInReleaseBuilds') ?: 'false'
|
||||||
minifyEnabled enableProguardInReleaseBuilds
|
shrinkResources enableShrinkResources.toBoolean()
|
||||||
|
minifyEnabled enableMinifyInReleaseBuilds
|
||||||
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
|
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
|
||||||
crunchPngs (findProperty('android.enablePngCrunchInReleaseBuilds')?.toBoolean() ?: true)
|
def enablePngCrunchInRelease = findProperty('android.enablePngCrunchInReleaseBuilds') ?: 'true'
|
||||||
|
crunchPngs enablePngCrunchInRelease.toBoolean()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
packagingOptions {
|
packagingOptions {
|
||||||
jniLibs {
|
jniLibs {
|
||||||
useLegacyPackaging (findProperty('expo.useLegacyPackaging')?.toBoolean() ?: false)
|
def enableLegacyPackaging = findProperty('expo.useLegacyPackaging') ?: 'false'
|
||||||
|
useLegacyPackaging enableLegacyPackaging.toBoolean()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
androidResources {
|
androidResources {
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
<data android:scheme="https"/>
|
<data android:scheme="https"/>
|
||||||
</intent>
|
</intent>
|
||||||
</queries>
|
</queries>
|
||||||
<application android:name=".MainApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" android:allowBackup="true" android:theme="@style/AppTheme" android:supportsRtl="true">
|
<application android:name=".MainApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" android:allowBackup="true" android:theme="@style/AppTheme" android:supportsRtl="true" android:enableOnBackInvokedCallback="false">
|
||||||
<meta-data android:name="expo.modules.updates.ENABLED" android:value="false"/>
|
<meta-data android:name="expo.modules.updates.ENABLED" android:value="false"/>
|
||||||
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_CHECK_ON_LAUNCH" android:value="ALWAYS"/>
|
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_CHECK_ON_LAUNCH" android:value="ALWAYS"/>
|
||||||
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_LAUNCH_WAIT_MS" android:value="0"/>
|
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_LAUNCH_WAIT_MS" android:value="0"/>
|
||||||
|
|||||||
@@ -5,13 +5,13 @@ import android.content.res.Configuration
|
|||||||
|
|
||||||
import com.facebook.react.PackageList
|
import com.facebook.react.PackageList
|
||||||
import com.facebook.react.ReactApplication
|
import com.facebook.react.ReactApplication
|
||||||
|
import com.facebook.react.ReactNativeApplicationEntryPoint.loadReactNative
|
||||||
import com.facebook.react.ReactNativeHost
|
import com.facebook.react.ReactNativeHost
|
||||||
import com.facebook.react.ReactPackage
|
import com.facebook.react.ReactPackage
|
||||||
import com.facebook.react.ReactHost
|
import com.facebook.react.ReactHost
|
||||||
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
|
import com.facebook.react.common.ReleaseLevel
|
||||||
|
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint
|
||||||
import com.facebook.react.defaults.DefaultReactNativeHost
|
import com.facebook.react.defaults.DefaultReactNativeHost
|
||||||
import com.facebook.react.soloader.OpenSourceMergedSoMapping
|
|
||||||
import com.facebook.soloader.SoLoader
|
|
||||||
|
|
||||||
import expo.modules.ApplicationLifecycleDispatcher
|
import expo.modules.ApplicationLifecycleDispatcher
|
||||||
import expo.modules.ReactNativeHostWrapper
|
import expo.modules.ReactNativeHostWrapper
|
||||||
@@ -19,21 +19,19 @@ import expo.modules.ReactNativeHostWrapper
|
|||||||
class MainApplication : Application(), ReactApplication {
|
class MainApplication : Application(), ReactApplication {
|
||||||
|
|
||||||
override val reactNativeHost: ReactNativeHost = ReactNativeHostWrapper(
|
override val reactNativeHost: ReactNativeHost = ReactNativeHostWrapper(
|
||||||
this,
|
this,
|
||||||
object : DefaultReactNativeHost(this) {
|
object : DefaultReactNativeHost(this) {
|
||||||
override fun getPackages(): List<ReactPackage> {
|
override fun getPackages(): List<ReactPackage> =
|
||||||
val packages = PackageList(this).packages
|
PackageList(this).packages.apply {
|
||||||
// Packages that cannot be autolinked yet can be added manually here, for example:
|
// Packages that cannot be autolinked yet can be added manually here, for example:
|
||||||
// packages.add(MyReactNativePackage())
|
// add(MyReactNativePackage())
|
||||||
return packages
|
}
|
||||||
}
|
|
||||||
|
|
||||||
override fun getJSMainModuleName(): String = ".expo/.virtual-metro-entry"
|
override fun getJSMainModuleName(): String = ".expo/.virtual-metro-entry"
|
||||||
|
|
||||||
override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG
|
override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG
|
||||||
|
|
||||||
override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
|
override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
|
||||||
override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -42,11 +40,12 @@ class MainApplication : Application(), ReactApplication {
|
|||||||
|
|
||||||
override fun onCreate() {
|
override fun onCreate() {
|
||||||
super.onCreate()
|
super.onCreate()
|
||||||
SoLoader.init(this, OpenSourceMergedSoMapping)
|
DefaultNewArchitectureEntryPoint.releaseLevel = try {
|
||||||
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
|
ReleaseLevel.valueOf(BuildConfig.REACT_NATIVE_RELEASE_LEVEL.uppercase())
|
||||||
// If you opted-in for the New Architecture, we load the native entry point for this app.
|
} catch (e: IllegalArgumentException) {
|
||||||
load()
|
ReleaseLevel.STABLE
|
||||||
}
|
}
|
||||||
|
loadReactNative(this)
|
||||||
ApplicationLifecycleDispatcher.onApplicationCreate(this)
|
ApplicationLifecycleDispatcher.onApplicationCreate(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||||
<style name="AppTheme" parent="Theme.EdgeToEdge">
|
<style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
|
||||||
|
<item name="android:enforceNavigationBarContrast" tools:targetApi="29">true</item>
|
||||||
<item name="android:editTextBackground">@drawable/rn_edit_text_material</item>
|
<item name="android:editTextBackground">@drawable/rn_edit_text_material</item>
|
||||||
<item name="colorPrimary">@color/colorPrimary</item>
|
<item name="colorPrimary">@color/colorPrimary</item>
|
||||||
<item name="android:statusBarColor">#ffffff</item>
|
<item name="android:statusBarColor">#ffffff</item>
|
||||||
@@ -8,5 +9,6 @@
|
|||||||
<item name="windowSplashScreenBackground">@color/splashscreen_background</item>
|
<item name="windowSplashScreenBackground">@color/splashscreen_background</item>
|
||||||
<item name="windowSplashScreenAnimatedIcon">@drawable/splashscreen_logo</item>
|
<item name="windowSplashScreenAnimatedIcon">@drawable/splashscreen_logo</item>
|
||||||
<item name="postSplashScreenTheme">@style/AppTheme</item>
|
<item name="postSplashScreenTheme">@style/AppTheme</item>
|
||||||
|
<item name="android:windowSplashScreenBehavior">icon_preferred</item>
|
||||||
</style>
|
</style>
|
||||||
</resources>
|
</resources>
|
||||||
@@ -12,21 +12,8 @@ buildscript {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def reactNativeAndroidDir = new File(
|
|
||||||
providers.exec {
|
|
||||||
workingDir(rootDir)
|
|
||||||
commandLine("node", "--print", "require.resolve('react-native/package.json')")
|
|
||||||
}.standardOutput.asText.get().trim(),
|
|
||||||
"../android"
|
|
||||||
)
|
|
||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
repositories {
|
repositories {
|
||||||
maven {
|
|
||||||
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
|
|
||||||
url(reactNativeAndroidDir)
|
|
||||||
}
|
|
||||||
|
|
||||||
google()
|
google()
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
maven { url 'https://www.jitpack.io' }
|
maven { url 'https://www.jitpack.io' }
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
|
|||||||
# When configured, Gradle will run in incubating parallel mode.
|
# When configured, Gradle will run in incubating parallel mode.
|
||||||
# This option should only be used with decoupled projects. More details, visit
|
# This option should only be used with decoupled projects. More details, visit
|
||||||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
||||||
# org.gradle.parallel=true
|
org.gradle.parallel=true
|
||||||
|
|
||||||
# AndroidX package structure to make it clearer which packages are bundled with the
|
# AndroidX package structure to make it clearer which packages are bundled with the
|
||||||
# Android operating system, and which are packaged with your app's APK
|
# Android operating system, and which are packaged with your app's APK
|
||||||
@@ -41,6 +41,11 @@ newArchEnabled=true
|
|||||||
# If set to false, you will be using JSC instead.
|
# If set to false, you will be using JSC instead.
|
||||||
hermesEnabled=true
|
hermesEnabled=true
|
||||||
|
|
||||||
|
# Use this property to enable edge-to-edge display support.
|
||||||
|
# This allows your app to draw behind system bars for an immersive UI.
|
||||||
|
# Note: Only works with ReactActivity and should not be used with custom Activity.
|
||||||
|
edgeToEdgeEnabled=true
|
||||||
|
|
||||||
# Enable GIF support in React Native images (~200 B increase)
|
# Enable GIF support in React Native images (~200 B increase)
|
||||||
expo.gif.enabled=true
|
expo.gif.enabled=true
|
||||||
# Enable webp support in React Native images (~85 KB increase)
|
# Enable webp support in React Native images (~85 KB increase)
|
||||||
@@ -55,5 +60,6 @@ EX_DEV_CLIENT_NETWORK_INSPECTOR=true
|
|||||||
# Use legacy packaging to compress native libraries in the resulting APK.
|
# Use legacy packaging to compress native libraries in the resulting APK.
|
||||||
expo.useLegacyPackaging=false
|
expo.useLegacyPackaging=false
|
||||||
|
|
||||||
# Whether the app is configured to use edge-to-edge via the app config or `react-native-edge-to-edge` plugin
|
# Specifies whether the app is configured to use edge-to-edge via the app config or plugin
|
||||||
expo.edgeToEdgeEnabled=true
|
# WARNING: This property has been deprecated and will be removed in Expo SDK 55. Use `edgeToEdgeEnabled` or `react.edgeToEdgeEnabled` to determine whether the project is using edge-to-edge.
|
||||||
|
expo.edgeToEdgeEnabled=true
|
||||||
|
|||||||
BIN
android/gradle/wrapper/gradle-wrapper.jar
vendored
BIN
android/gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
@@ -1,6 +1,6 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
validateDistributionUrl=true
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
|||||||
4
android/gradlew
vendored
4
android/gradlew
vendored
@@ -114,7 +114,7 @@ case "$( uname )" in #(
|
|||||||
NONSTOP* ) nonstop=true ;;
|
NONSTOP* ) nonstop=true ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
CLASSPATH="\\\"\\\""
|
||||||
|
|
||||||
|
|
||||||
# Determine the Java command to use to start the JVM.
|
# Determine the Java command to use to start the JVM.
|
||||||
@@ -213,7 +213,7 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
|||||||
set -- \
|
set -- \
|
||||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||||
-classpath "$CLASSPATH" \
|
-classpath "$CLASSPATH" \
|
||||||
org.gradle.wrapper.GradleWrapperMain \
|
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
||||||
"$@"
|
"$@"
|
||||||
|
|
||||||
# Stop when "xargs" is not available.
|
# Stop when "xargs" is not available.
|
||||||
|
|||||||
4
android/gradlew.bat
vendored
4
android/gradlew.bat
vendored
@@ -70,11 +70,11 @@ goto fail
|
|||||||
:execute
|
:execute
|
||||||
@rem Setup the command line
|
@rem Setup the command line
|
||||||
|
|
||||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
set CLASSPATH=
|
||||||
|
|
||||||
|
|
||||||
@rem Execute Gradle
|
@rem Execute Gradle
|
||||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
||||||
|
|
||||||
:end
|
:end
|
||||||
@rem End local scope for the variables with windows NT shell
|
@rem End local scope for the variables with windows NT shell
|
||||||
|
|||||||
@@ -70,5 +70,6 @@ export default {
|
|||||||
// Tambahkan environment variables ke sini
|
// Tambahkan environment variables ke sini
|
||||||
API_BASE_URL: process.env.API_BASE_URL,
|
API_BASE_URL: process.env.API_BASE_URL,
|
||||||
BASE_URL: process.env.BASE_URL,
|
BASE_URL: process.env.BASE_URL,
|
||||||
|
DEEP_LINK_URL: process.env.DEEP_LINK_URL,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -44,6 +44,8 @@ export default function EventBeranda() {
|
|||||||
<TextCustom align="center">Belum ada event</TextCustom>
|
<TextCustom align="center">Belum ada event</TextCustom>
|
||||||
) : (
|
) : (
|
||||||
listData.map((item: any, index) => (
|
listData.map((item: any, index) => (
|
||||||
|
|
||||||
|
|
||||||
<Event_BoxPublishSection
|
<Event_BoxPublishSection
|
||||||
key={index}
|
key={index}
|
||||||
href={`/event/${item.id}/publish`}
|
href={`/event/${item.id}/publish`}
|
||||||
|
|||||||
500
app/(application)/(user)/event/[id]/confirmation.tsx
Normal file
500
app/(application)/(user)/event/[id]/confirmation.tsx
Normal file
@@ -0,0 +1,500 @@
|
|||||||
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||||
|
/* eslint-disable react-hooks/exhaustive-deps */
|
||||||
|
import {
|
||||||
|
BaseBox,
|
||||||
|
ButtonCustom,
|
||||||
|
CenterCustom,
|
||||||
|
LoaderCustom,
|
||||||
|
StackCustom,
|
||||||
|
TextCustom,
|
||||||
|
ViewWrapper,
|
||||||
|
} from "@/components";
|
||||||
|
import { AccentColor, MainColor } from "@/constants/color-palet";
|
||||||
|
import { useAuth } from "@/hooks/use-auth";
|
||||||
|
import {
|
||||||
|
apiEventConfirmationAction,
|
||||||
|
apiEventGetConfirmation,
|
||||||
|
apiEventJoin,
|
||||||
|
} from "@/service/api-client/api-event";
|
||||||
|
import { Ionicons } from "@expo/vector-icons";
|
||||||
|
import dayjs from "dayjs";
|
||||||
|
import isBetween from "dayjs/plugin/isBetween";
|
||||||
|
import {
|
||||||
|
Redirect,
|
||||||
|
router,
|
||||||
|
Stack,
|
||||||
|
useFocusEffect,
|
||||||
|
useLocalSearchParams,
|
||||||
|
} from "expo-router";
|
||||||
|
import React, { useCallback, useState } from "react";
|
||||||
|
import { View } from "react-native";
|
||||||
|
import Toast from "react-native-toast-message";
|
||||||
|
|
||||||
|
// Extend Day.js dengan plugin isBetween
|
||||||
|
dayjs.extend(isBetween);
|
||||||
|
|
||||||
|
interface DataEvent {
|
||||||
|
id: string;
|
||||||
|
title: string;
|
||||||
|
tanggal: Date;
|
||||||
|
tanggalSelesai: Date;
|
||||||
|
lokasi: string;
|
||||||
|
Author: {
|
||||||
|
id: string;
|
||||||
|
username: string;
|
||||||
|
Profile: {
|
||||||
|
id: string;
|
||||||
|
name: string;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function UserEventConfirmation() {
|
||||||
|
const { token } = useAuth();
|
||||||
|
const { id, userId: authorId } = useLocalSearchParams();
|
||||||
|
const { user } = useAuth();
|
||||||
|
const [data, setData] = useState<DataEvent | null>(null);
|
||||||
|
const [peserta, setPeserta] = useState<boolean | null>(null);
|
||||||
|
const [konfirmasi, setKonfirmasi] = useState<boolean | null>(null);
|
||||||
|
|
||||||
|
useFocusEffect(
|
||||||
|
useCallback(() => {
|
||||||
|
checkTokenAndDataParticipants() || console.log("Token is null");
|
||||||
|
}, [token, id, user?.id])
|
||||||
|
);
|
||||||
|
|
||||||
|
const checkTokenAndDataParticipants = async () => {
|
||||||
|
if (!token) {
|
||||||
|
return <Redirect href={`/`} />;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const response = await apiEventGetConfirmation({
|
||||||
|
id: id as string,
|
||||||
|
userId: user?.id as string,
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log("[RES CONFIRMATION]", JSON.stringify(response, null, 2));
|
||||||
|
|
||||||
|
if (response.success) {
|
||||||
|
setData(response.data?.dataEvent);
|
||||||
|
setPeserta(response.data?.peserta);
|
||||||
|
setKonfirmasi(response.data?.kehadiran);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR CONFIRMATION]", error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handlerReturn = () => {
|
||||||
|
const now = dayjs(); // asumsi: UTC, sesuai dengan API
|
||||||
|
|
||||||
|
// --- [1] Loading & Data tidak ditemukan ---
|
||||||
|
if (data === undefined || data === null) {
|
||||||
|
if (peserta === null && konfirmasi === null) {
|
||||||
|
return <LoaderCustom />;
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
<BaseBox>
|
||||||
|
<TextCustom bold align="center" size={"large"}>
|
||||||
|
Data Tidak Ditemukan
|
||||||
|
</TextCustom>
|
||||||
|
<BackToOtherPath path="home" />
|
||||||
|
</BaseBox>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// --- [2] Ambil waktu event dari `data` ---
|
||||||
|
const eventStart = dayjs(data.tanggal);
|
||||||
|
const eventEnd = dayjs(data.tanggalSelesai);
|
||||||
|
|
||||||
|
// --- [3] Definisikan jendela konfirmasi: 1 jam sebelum mulai → 1 jam setelah selesai ---
|
||||||
|
const confirmationStart = eventStart.subtract(1, "hour");
|
||||||
|
const confirmationEnd = eventEnd.add(1, "hour");
|
||||||
|
const isWithinConfirmationWindow = now.isBetween(
|
||||||
|
confirmationStart,
|
||||||
|
confirmationEnd,
|
||||||
|
null,
|
||||||
|
"[]"
|
||||||
|
);
|
||||||
|
|
||||||
|
// --- [4] Status waktu event (untuk pesan UI) ---
|
||||||
|
const isBeforeEvent = now.isBefore(eventStart);
|
||||||
|
const isAfterEvent = now.isAfter(eventEnd);
|
||||||
|
const isDuringEvent = !isBeforeEvent && !isAfterEvent;
|
||||||
|
|
||||||
|
// --- [5] Handle berdasarkan waktu dan status peserta/konfirmasi ---
|
||||||
|
|
||||||
|
// 🟢 Acara sudah selesai
|
||||||
|
if (isAfterEvent) {
|
||||||
|
if (peserta === false) {
|
||||||
|
return (
|
||||||
|
<TamplateBox data={data}>
|
||||||
|
<TamplateText text="Event telah selesai, sehingga konfirmasi kehadiran sudah tidak dapat dilakukan. Terima kasih atas perhatian dan minat Anda. Kami berharap dapat bertemu di acara kami berikutnya." />
|
||||||
|
<BackToOtherPath
|
||||||
|
path="event"
|
||||||
|
id={data.id}
|
||||||
|
isAfterEvent={isAfterEvent}
|
||||||
|
/>
|
||||||
|
</TamplateBox>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
<TamplateBox data={data}>
|
||||||
|
<TamplateText
|
||||||
|
text={`Event telah selesai, anda terdaftar sebagai peserta dan${
|
||||||
|
konfirmasi
|
||||||
|
? "Anda telah mengonfirmasi kehadiran."
|
||||||
|
: "Anda tidak mengonfirmasi kehadiran."
|
||||||
|
}. Terima kasih atas perhatian dan minat Anda. Kami berharap dapat bertemu di acara kami berikutnya.`}
|
||||||
|
/>
|
||||||
|
<BackToOtherPath
|
||||||
|
path="event"
|
||||||
|
id={data.id}
|
||||||
|
isAfterEvent={isAfterEvent}
|
||||||
|
/>
|
||||||
|
</TamplateBox>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 🔵 Acara belum mulai & belum terdaftar
|
||||||
|
if (isBeforeEvent) {
|
||||||
|
if (peserta === false) {
|
||||||
|
return (
|
||||||
|
<NotStarted_And_UserNotParticipan
|
||||||
|
id={data.id}
|
||||||
|
userId={user?.id as string}
|
||||||
|
data={data}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Peserta sudah daftar → cek apakah sudah boleh konfirmasi
|
||||||
|
if (isWithinConfirmationWindow && peserta === true) {
|
||||||
|
if (konfirmasi === false) {
|
||||||
|
return (
|
||||||
|
<TamplateBox data={data}>
|
||||||
|
<TamplateText text="Konfirmasi Kehadiran" />
|
||||||
|
</TamplateBox>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
<TamplateBox data={data}>
|
||||||
|
<TamplateText text="Anda telah mengonfirmasi kehadiran." />
|
||||||
|
<BackToOtherPath
|
||||||
|
path="event"
|
||||||
|
id={data.id}
|
||||||
|
isAfterEvent={isAfterEvent}
|
||||||
|
/>
|
||||||
|
</TamplateBox>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<TamplateBox data={data}>
|
||||||
|
<TamplateText text="Anda terdaftar sebagai peserta. Konfirmasi kehadiran dibuka 1 jam sebelum acara dimulai." />
|
||||||
|
<BackToOtherPath
|
||||||
|
path="event"
|
||||||
|
id={data.id}
|
||||||
|
isAfterEvent={isAfterEvent}
|
||||||
|
/>
|
||||||
|
</TamplateBox>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 🟡 Acara sedang berlangsung & belum terdaftar
|
||||||
|
if (isDuringEvent) {
|
||||||
|
if (peserta === false) {
|
||||||
|
return (
|
||||||
|
<UserNotParticipan_And_DuringEvent
|
||||||
|
id={data.id}
|
||||||
|
userId={user?.id as string}
|
||||||
|
data={data}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (peserta === true) {
|
||||||
|
if (isWithinConfirmationWindow) {
|
||||||
|
if (konfirmasi === false) {
|
||||||
|
return (
|
||||||
|
<TamplateBox data={data}>
|
||||||
|
<TamplateText text="Konfirmasi Kehadiran" />
|
||||||
|
</TamplateBox>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
<TamplateBox data={data}>
|
||||||
|
<TamplateText text="Anda telah mengonfirmasi kehadiran dalam event ini. Terima kasih dan selamat menikmati acara. Have fun!" />
|
||||||
|
<BackToOtherPath
|
||||||
|
path="event"
|
||||||
|
id={data.id}
|
||||||
|
isAfterEvent={isAfterEvent}
|
||||||
|
/>
|
||||||
|
</TamplateBox>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Ini sangat jarang terjadi selama event berlangsung, tapi aman
|
||||||
|
return (
|
||||||
|
<TamplateBox data={data}>
|
||||||
|
<TamplateText text="Konfirmasi kehadiran tidak tersedia saat ini." />
|
||||||
|
<BackToOtherPath path="home" />
|
||||||
|
</TamplateBox>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 🛑 Fallback aman
|
||||||
|
return (
|
||||||
|
<BaseBox>
|
||||||
|
<StackCustom>
|
||||||
|
<TamplateText text="Terjadi kesalahan tak terduga pada logika waktu." />
|
||||||
|
<BackToOtherPath path="home" />
|
||||||
|
</StackCustom>
|
||||||
|
</BaseBox>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Stack.Screen
|
||||||
|
options={{
|
||||||
|
title: "Konfirmasi Event",
|
||||||
|
headerLeft: () => (
|
||||||
|
<Ionicons
|
||||||
|
name="arrow-back"
|
||||||
|
size={20}
|
||||||
|
color={MainColor.yellow}
|
||||||
|
onPress={() =>
|
||||||
|
router.navigate("/(application)/(user)/event/create")
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<ViewWrapper>{handlerReturn()}</ViewWrapper>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const TamplateBox = ({
|
||||||
|
data,
|
||||||
|
children,
|
||||||
|
}: {
|
||||||
|
data: DataEvent;
|
||||||
|
children: React.ReactNode;
|
||||||
|
}) => {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<CenterCustom>
|
||||||
|
<BaseBox>
|
||||||
|
<StackCustom gap={"lg"}>
|
||||||
|
<StackCustom gap={"sm"}>
|
||||||
|
<TextCustom bold align="center" size={"large"}>
|
||||||
|
{data?.title}
|
||||||
|
</TextCustom>
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
justifyContent: "center",
|
||||||
|
// backgroundColor: AccentColor.blue,
|
||||||
|
// borderColor: AccentColor.blue,
|
||||||
|
// borderWidth: 1,
|
||||||
|
// borderRadius: 4,
|
||||||
|
// padding: 3
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<TextCustom align="center" size="small" bold>
|
||||||
|
{dayjs(data?.tanggal).format("DD MMM YYYY: HH:mm")}
|
||||||
|
</TextCustom>
|
||||||
|
<TextCustom align="center" size="small" bold>
|
||||||
|
{" "}
|
||||||
|
-{" "}
|
||||||
|
</TextCustom>
|
||||||
|
<TextCustom align="center" size="small" bold>
|
||||||
|
{dayjs(data?.tanggalSelesai).format("DD MMM YYYY: HH:mm")}
|
||||||
|
</TextCustom>
|
||||||
|
</View>
|
||||||
|
</StackCustom>
|
||||||
|
|
||||||
|
{children}
|
||||||
|
</StackCustom>
|
||||||
|
</BaseBox>
|
||||||
|
</CenterCustom>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const TamplateText = ({ text }: { text: string }) => {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<TextCustom align="center">{text}</TextCustom>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
type BackToOtherPathProps =
|
||||||
|
| { path: "home" | "beranda-event"; id?: never; isAfterEvent?: never }
|
||||||
|
| { path: "event"; id: string; isAfterEvent: boolean };
|
||||||
|
|
||||||
|
const BackToOtherPath = ({ path, id, isAfterEvent }: BackToOtherPathProps) => {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{path === "home" ? (
|
||||||
|
<ButtonCustom
|
||||||
|
onPress={() => {
|
||||||
|
router.replace("/(application)/home");
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Home
|
||||||
|
</ButtonCustom>
|
||||||
|
) : (
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
flexDirection: "row",
|
||||||
|
gap: 10,
|
||||||
|
|
||||||
|
justifyContent: "center",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<ButtonCustom
|
||||||
|
onPress={() => {
|
||||||
|
router.replace("/(application)/home");
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Home
|
||||||
|
</ButtonCustom>
|
||||||
|
<ButtonCustom
|
||||||
|
onPress={() => {
|
||||||
|
if (path === "event") {
|
||||||
|
if (isAfterEvent) {
|
||||||
|
router.push(`/(application)/(user)/event/${id}/history`);
|
||||||
|
} else {
|
||||||
|
router.push(`/(application)/(user)/event/${id}/publish`);
|
||||||
|
}
|
||||||
|
} else if (path === "beranda-event") {
|
||||||
|
router.push(`/(application)/(user)/event`);
|
||||||
|
} else {
|
||||||
|
console.log("[PATH]", path);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Lihat {path === "event" ? "Event" : "Beranda Event"}
|
||||||
|
</ButtonCustom>
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 🔵 Acara belum mulai & belum terdaftar
|
||||||
|
const NotStarted_And_UserNotParticipan = ({
|
||||||
|
id,
|
||||||
|
userId,
|
||||||
|
data,
|
||||||
|
}: {
|
||||||
|
id: string;
|
||||||
|
userId: string;
|
||||||
|
data: DataEvent;
|
||||||
|
}) => {
|
||||||
|
const [isLoading, setIsLoading] = useState<boolean>(false);
|
||||||
|
|
||||||
|
const handlerJoinEvent = async () => {
|
||||||
|
try {
|
||||||
|
setIsLoading(true);
|
||||||
|
|
||||||
|
const response = await apiEventJoin({
|
||||||
|
id: id as string,
|
||||||
|
userId: userId as string,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!response.success) {
|
||||||
|
Toast.show({
|
||||||
|
type: "error",
|
||||||
|
text1: "Anda gagal join",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Toast.show({
|
||||||
|
type: "success",
|
||||||
|
text1: "Anda berhasil join",
|
||||||
|
});
|
||||||
|
router.navigate(`/(application)/(user)/event/${id}/publish`);
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR JOIN EVENT]", error);
|
||||||
|
} finally {
|
||||||
|
setIsLoading(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<TamplateBox data={data}>
|
||||||
|
<TamplateText text="Anda belum terdaftar sebagai peserta & Event belum dimulai. Silahkan daftarkan diri anda terlebih dahulu" />
|
||||||
|
<ButtonCustom onPress={handlerJoinEvent} isLoading={isLoading}>
|
||||||
|
Join
|
||||||
|
</ButtonCustom>
|
||||||
|
</TamplateBox>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 🟡 ZONA ACARA BERLANGSUNG
|
||||||
|
// Acara sedang berlangsung & belum terdaftar
|
||||||
|
const UserNotParticipan_And_DuringEvent = ({
|
||||||
|
id,
|
||||||
|
userId,
|
||||||
|
data,
|
||||||
|
}: {
|
||||||
|
id: string;
|
||||||
|
userId: string;
|
||||||
|
data: DataEvent;
|
||||||
|
}) => {
|
||||||
|
const [isLoading, setIsLoading] = useState<boolean>(false);
|
||||||
|
|
||||||
|
const handlerSubmit = async () => {
|
||||||
|
try {
|
||||||
|
setIsLoading(true);
|
||||||
|
|
||||||
|
const response = await apiEventConfirmationAction({
|
||||||
|
id: id as string,
|
||||||
|
userId: userId as string,
|
||||||
|
category: "join_and_confirm",
|
||||||
|
});
|
||||||
|
|
||||||
|
// console.log("[RES JOIN & CONFIRMATION EVENT]", response);
|
||||||
|
|
||||||
|
if (!response.success) {
|
||||||
|
Toast.show({
|
||||||
|
type: "error",
|
||||||
|
text1: "Anda gagal join & konfirmasi",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Toast.show({
|
||||||
|
type: "success",
|
||||||
|
text1: "Anda berhasil join & konfirmasi",
|
||||||
|
});
|
||||||
|
router.navigate(`/(application)/(user)/event/${id}/publish`);
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR JOIN & CONFIRMATION EVENT]", error);
|
||||||
|
} finally {
|
||||||
|
setIsLoading(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<TamplateBox data={data}>
|
||||||
|
<TamplateText text="Anda belum terdaftar sebagai peserta & Event sedang berlangsung. Silahkan daftarkan diri anda & Konfirmasi kehadiran" />
|
||||||
|
|
||||||
|
<ButtonCustom onPress={() => handlerSubmit()} isLoading={isLoading}>
|
||||||
|
Join & Konfirmasi
|
||||||
|
</ButtonCustom>
|
||||||
|
</TamplateBox>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -55,6 +55,8 @@ export default function EventDetailPublish() {
|
|||||||
userId: user?.id as string,
|
userId: user?.id as string,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
console.log("[RES CHECK PARTICIPANTS]", responseCheckParticipants);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
responseCheckParticipants.success &&
|
responseCheckParticipants.success &&
|
||||||
responseCheckParticipants.data
|
responseCheckParticipants.data
|
||||||
@@ -69,6 +71,8 @@ export default function EventDetailPublish() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log("[participans]", isParticipant);
|
||||||
|
|
||||||
const handlePress = (item: IMenuDrawerItem) => {
|
const handlePress = (item: IMenuDrawerItem) => {
|
||||||
console.log("PATH ", item.path);
|
console.log("PATH ", item.path);
|
||||||
router.navigate(item.path as any);
|
router.navigate(item.path as any);
|
||||||
|
|||||||
@@ -191,7 +191,7 @@ export default function EventCreate() {
|
|||||||
placeholder="Masukkan deskripsi event"
|
placeholder="Masukkan deskripsi event"
|
||||||
required
|
required
|
||||||
showCount
|
showCount
|
||||||
maxLength={100}
|
maxLength={1000}
|
||||||
onChangeText={(value: any) =>
|
onChangeText={(value: any) =>
|
||||||
setData({ ...data, deskripsi: value })
|
setData({ ...data, deskripsi: value })
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import {
|
|||||||
} from "@/components";
|
} from "@/components";
|
||||||
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 Job_BoxDetailSection from "@/screens/Job/BoxDetailSection";
|
import Job_BoxDetailSection from "@/screens/Job/BoxDetailSection";
|
||||||
import Job_ButtonStatusSection from "@/screens/Job/ButtonStatusSection";
|
import Job_ButtonStatusSection from "@/screens/Job/ButtonStatusSection";
|
||||||
import { apiJobGetOne } from "@/service/api-client/api-job";
|
import { apiJobGetOne } from "@/service/api-client/api-job";
|
||||||
@@ -70,7 +71,13 @@ export default function JobDetailStatus() {
|
|||||||
<LoaderCustom />
|
<LoaderCustom />
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<StackCustom>
|
<StackCustom gap={"xs"}>
|
||||||
|
{data &&
|
||||||
|
data?.catatan &&
|
||||||
|
(status === "draft" || status === "rejected") && (
|
||||||
|
<ReportBox text={data?.catatan} />
|
||||||
|
)}
|
||||||
|
|
||||||
<Job_BoxDetailSection data={data} />
|
<Job_BoxDetailSection data={data} />
|
||||||
<Job_ButtonStatusSection
|
<Job_ButtonStatusSection
|
||||||
id={id as string}
|
id={id as string}
|
||||||
|
|||||||
@@ -8,11 +8,13 @@ import {
|
|||||||
LoaderCustom,
|
LoaderCustom,
|
||||||
MenuDrawerDynamicGrid,
|
MenuDrawerDynamicGrid,
|
||||||
Spacing,
|
Spacing,
|
||||||
|
StackCustom,
|
||||||
TextCustom,
|
TextCustom,
|
||||||
ViewWrapper,
|
ViewWrapper,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import { IconArchive, IconContribution, IconEdit } from "@/components/_Icon";
|
import { IconArchive, IconContribution, IconEdit } from "@/components/_Icon";
|
||||||
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
import { IMenuDrawerItem } from "@/components/_Interface/types";
|
||||||
|
import ReportBox from "@/components/Box/ReportBox";
|
||||||
import Voting_BoxDetailHasilVotingSection from "@/screens/Voting/BoxDetailHasilVotingSection";
|
import Voting_BoxDetailHasilVotingSection from "@/screens/Voting/BoxDetailHasilVotingSection";
|
||||||
import { Voting_BoxDetailSection } from "@/screens/Voting/BoxDetailSection";
|
import { Voting_BoxDetailSection } from "@/screens/Voting/BoxDetailSection";
|
||||||
import Voting_ButtonStatusSection from "@/screens/Voting/ButtonStatusSection";
|
import Voting_ButtonStatusSection from "@/screens/Voting/ButtonStatusSection";
|
||||||
@@ -49,6 +51,8 @@ export default function VotingDetailStatus() {
|
|||||||
setLoadingGetData(true);
|
setLoadingGetData(true);
|
||||||
const response = await apiVotingGetOne({ id: id as string });
|
const response = await apiVotingGetOne({ id: id as string });
|
||||||
|
|
||||||
|
console.log("[DATA BY ID]", JSON.stringify(response, null, 2));
|
||||||
|
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
setData(response.data);
|
setData(response.data);
|
||||||
}
|
}
|
||||||
@@ -127,6 +131,13 @@ export default function VotingDetailStatus() {
|
|||||||
</BaseBox>
|
</BaseBox>
|
||||||
)}
|
)}
|
||||||
<Spacing height={0} />
|
<Spacing height={0} />
|
||||||
|
|
||||||
|
{data &&
|
||||||
|
data?.catatan &&
|
||||||
|
(status === "draft" || status === "rejected") && (
|
||||||
|
<ReportBox text={data?.catatan} />
|
||||||
|
)}
|
||||||
|
|
||||||
<Voting_BoxDetailSection data={data as any} />
|
<Voting_BoxDetailSection data={data as any} />
|
||||||
{status === "publish" ? (
|
{status === "publish" ? (
|
||||||
<Voting_BoxDetailHasilVotingSection
|
<Voting_BoxDetailHasilVotingSection
|
||||||
|
|||||||
@@ -22,8 +22,6 @@ export default function AdminCollaboration() {
|
|||||||
category: "dashboard",
|
category: "dashboard",
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log("[RESPONSE]", JSON.stringify(response, null, 2));
|
|
||||||
|
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
setList(response.data);
|
setList(response.data);
|
||||||
}
|
}
|
||||||
@@ -46,7 +44,6 @@ export default function AdminCollaboration() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const listData = (list: any) => {
|
const listData = (list: any) => {
|
||||||
console.log("[LIST masuk]", JSON.stringify(list, null, 2));
|
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
label: "Publish",
|
label: "Publish",
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
/* eslint-disable react-hooks/exhaustive-deps */
|
||||||
import {
|
import {
|
||||||
ActionIcon,
|
ActionIcon,
|
||||||
AlertDefaultSystem,
|
AlertDefaultSystem,
|
||||||
@@ -15,98 +16,96 @@ import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButt
|
|||||||
import AdminButtonReject from "@/components/_ShareComponent/Admin/ButtonReject";
|
import AdminButtonReject from "@/components/_ShareComponent/Admin/ButtonReject";
|
||||||
import AdminButtonReview from "@/components/_ShareComponent/Admin/ButtonReview";
|
import AdminButtonReview from "@/components/_ShareComponent/Admin/ButtonReview";
|
||||||
import { GridDetail_4_8 } from "@/components/_ShareComponent/GridDetail_4_8";
|
import { GridDetail_4_8 } from "@/components/_ShareComponent/GridDetail_4_8";
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import ReportBox from "@/components/Box/ReportBox";
|
||||||
import { ICON_SIZE_BUTTON } from "@/constants/constans-value";
|
import { ICON_SIZE_BUTTON } from "@/constants/constans-value";
|
||||||
import dayjs from "dayjs";
|
import { useAuth } from "@/hooks/use-auth";
|
||||||
import { router, useLocalSearchParams } from "expo-router";
|
import { funUpdateStatusEvent } from "@/screens/Admin/Event/funUpdateStatus";
|
||||||
|
import { apiAdminEventById } from "@/service/api-admin/api-admin-event";
|
||||||
|
import { DEEP_LINK_URL } from "@/service/api-config";
|
||||||
|
import { colorBadge } from "@/utils/colorBadge";
|
||||||
|
import { dateTimeView } from "@/utils/dateTimeView";
|
||||||
|
import { router, useFocusEffect, useLocalSearchParams } from "expo-router";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import React from "react";
|
import React, { useCallback } from "react";
|
||||||
import QRCode from "react-native-qrcode-svg";
|
import QRCode from "react-native-qrcode-svg";
|
||||||
|
|
||||||
export default function AdminEventDetail() {
|
export default function AdminEventDetail() {
|
||||||
|
const { user } = useAuth();
|
||||||
const { id, status } = useLocalSearchParams();
|
const { id, status } = useLocalSearchParams();
|
||||||
const [openDrawer, setOpenDrawer] = React.useState(false);
|
|
||||||
|
|
||||||
const colorBadge = () => {
|
console.log("[ID QRCODE]", id);
|
||||||
if (status === "publish") {
|
console.log("[STATUS Detail]", status);
|
||||||
return MainColor.green;
|
const [openDrawer, setOpenDrawer] = React.useState(false);
|
||||||
} else if (status === "review") {
|
const newURL = DEEP_LINK_URL
|
||||||
return MainColor.orange;
|
console.log("[DEEP LINK URL]", newURL);
|
||||||
} else if (status === "reject") {
|
|
||||||
return MainColor.red;
|
const [data, setData] = React.useState<any | null>(null);
|
||||||
} else {
|
const deepLinkURL = `${DEEP_LINK_URL}/--/event/${id}/confirmation?userId=${user?.id}`;
|
||||||
return MainColor.placeholder;
|
useFocusEffect(
|
||||||
|
useCallback(() => {
|
||||||
|
onLoadData();
|
||||||
|
}, [id])
|
||||||
|
);
|
||||||
|
const onLoadData = async () => {
|
||||||
|
try {
|
||||||
|
const response = await apiAdminEventById({
|
||||||
|
id: id as string,
|
||||||
|
});
|
||||||
|
|
||||||
|
// console.log(`[RES DATA BY ID: ${id}]`, JSON.stringify(response, null, 2));
|
||||||
|
|
||||||
|
if (response.success) {
|
||||||
|
setData(response.data);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR]", error);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const listData = [
|
const listData = [
|
||||||
{
|
{
|
||||||
label: "Pembuat Event",
|
label: "Pembuat Event",
|
||||||
value: `Bagas Banuna ${id}`,
|
value: (data && data?.Author?.username) || "-",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Judul Event",
|
label: "Judul Event",
|
||||||
value: `Event 123`,
|
value: (data && data?.title) || "-",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Status",
|
label: "Status",
|
||||||
value: (
|
value:
|
||||||
<BadgeCustom color={colorBadge()}>
|
(data && (
|
||||||
{_.startCase(status as string)}
|
<BadgeCustom color={colorBadge({ status: status as string })}>
|
||||||
</BadgeCustom>
|
{_.startCase(status as string)}
|
||||||
),
|
</BadgeCustom>
|
||||||
|
)) ||
|
||||||
|
"-",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Lokasi",
|
label: "Lokasi",
|
||||||
value: "Lokasi Event",
|
value: (data && data?.lokasi) || "-",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Tipe Acara",
|
label: "Tipe Acara",
|
||||||
value: "Tipe Acara",
|
value: (data && data?.EventMaster_TipeAcara?.name) || "-",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Mulai Event",
|
label: "Mulai Event",
|
||||||
value: dayjs().format("DD/MM/YYYY HH:mm:ss"),
|
value:
|
||||||
|
(data && data?.tanggal && dateTimeView({ date: data?.tanggal })) || "-",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Event Berakhir",
|
label: "Event Berakhir",
|
||||||
value: dayjs().add(3, "day").format("DD/MM/YYYY HH:mm:ss"),
|
value:
|
||||||
|
(data &&
|
||||||
|
data?.tanggalSelesai &&
|
||||||
|
dateTimeView({ date: data?.tanggalSelesai })) ||
|
||||||
|
"-",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Deskripsi",
|
label: "Deskripsi",
|
||||||
value: "Lorem ipsum dolor sit amet consectetur adipisicing elit.",
|
value: (data && data?.deskripsi) || "-",
|
||||||
},
|
},
|
||||||
// {
|
|
||||||
// label: "Daftar Tipe Acara",
|
|
||||||
// value: (
|
|
||||||
// <>
|
|
||||||
// <List.Item
|
|
||||||
// title={<TextCustom>Pilihan 1</TextCustom>}
|
|
||||||
// left={(props) => (
|
|
||||||
// <List.Icon {...props} icon="circle" color={MainColor.yellow} />
|
|
||||||
// )}
|
|
||||||
// />
|
|
||||||
// <List.Item
|
|
||||||
// title={<TextCustom>Pilihan 2</TextCustom>}
|
|
||||||
// left={(props) => (
|
|
||||||
// <List.Icon {...props} icon="circle" color={MainColor.yellow} />
|
|
||||||
// )}
|
|
||||||
// />
|
|
||||||
// <List.Item
|
|
||||||
// title={<TextCustom>Pilihan 3</TextCustom>}
|
|
||||||
// left={(props) => (
|
|
||||||
// <List.Icon {...props} icon="circle" color={MainColor.yellow} />
|
|
||||||
// )}
|
|
||||||
// />
|
|
||||||
// <List.Item
|
|
||||||
// title={<TextCustom>Pilihan 4</TextCustom>}
|
|
||||||
// left={(props) => (
|
|
||||||
// <List.Icon {...props} icon="circle" color={MainColor.yellow} />
|
|
||||||
// )}
|
|
||||||
// />
|
|
||||||
// </>
|
|
||||||
// ),
|
|
||||||
// },
|
|
||||||
];
|
];
|
||||||
|
|
||||||
const rightComponent = (
|
const rightComponent = (
|
||||||
@@ -118,6 +117,23 @@ export default function AdminEventDetail() {
|
|||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const handlerSubmit = async () => {
|
||||||
|
try {
|
||||||
|
const response = await funUpdateStatusEvent({
|
||||||
|
id: id as string,
|
||||||
|
changeStatus: "publish",
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log("[RES PUBLISH]", JSON.stringify(response, null, 2));
|
||||||
|
|
||||||
|
if (response.success) {
|
||||||
|
router.back();
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR]", error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ViewWrapper
|
<ViewWrapper
|
||||||
@@ -125,7 +141,7 @@ export default function AdminEventDetail() {
|
|||||||
<AdminBackButtonAntTitle
|
<AdminBackButtonAntTitle
|
||||||
title={`Detail Data`}
|
title={`Detail Data`}
|
||||||
rightComponent={
|
rightComponent={
|
||||||
(status === "publish" || status === "riwayat") && rightComponent
|
(status === "publish" || status === "history") && rightComponent
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
@@ -143,12 +159,19 @@ export default function AdminEventDetail() {
|
|||||||
|
|
||||||
<Spacing />
|
<Spacing />
|
||||||
</BaseBox>
|
</BaseBox>
|
||||||
{(status === "publish" || status === "riwayat") && (
|
|
||||||
|
{data &&
|
||||||
|
data?.catatan &&
|
||||||
|
(status === "reject" || status === "review") && (
|
||||||
|
<ReportBox text={data?.catatan} />
|
||||||
|
)}
|
||||||
|
|
||||||
|
{(status === "publish" || status === "history") && (
|
||||||
<BaseBox>
|
<BaseBox>
|
||||||
<StackCustom style={{ alignItems: "center" }}>
|
<StackCustom style={{ alignItems: "center" }}>
|
||||||
<TextCustom bold>QR Code Event</TextCustom>
|
<TextCustom bold>QR Code Event</TextCustom>
|
||||||
<QRCode
|
<QRCode
|
||||||
value="https://google.com"
|
value={deepLinkURL}
|
||||||
size={200}
|
size={200}
|
||||||
// logo={require("@/assets/images/logo-hipmi.png")}
|
// logo={require("@/assets/images/logo-hipmi.png")}
|
||||||
// logoSize={70}
|
// logoSize={70}
|
||||||
@@ -168,16 +191,11 @@ export default function AdminEventDetail() {
|
|||||||
message: "Apakah anda yakin ingin mempublikasikan data ini?",
|
message: "Apakah anda yakin ingin mempublikasikan data ini?",
|
||||||
textLeft: "Batal",
|
textLeft: "Batal",
|
||||||
textRight: "Ya",
|
textRight: "Ya",
|
||||||
onPressLeft: () => {
|
onPressRight: () => handlerSubmit(),
|
||||||
router.back();
|
|
||||||
},
|
|
||||||
onPressRight: () => {
|
|
||||||
router.back();
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
onReject={() => {
|
onReject={() => {
|
||||||
router.push(`/admin/event/${id}/reject-input`);
|
router.push(`/admin/event/${id}/reject-input?status=${status}`);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
@@ -186,7 +204,7 @@ export default function AdminEventDetail() {
|
|||||||
<AdminButtonReject
|
<AdminButtonReject
|
||||||
title="Tambah Catatan"
|
title="Tambah Catatan"
|
||||||
onReject={() => {
|
onReject={() => {
|
||||||
router.push(`/admin/event/${id}/reject-input`);
|
router.push(`/admin/event/${id}/reject-input?status=${status}`);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
/* eslint-disable react-hooks/exhaustive-deps */
|
||||||
import {
|
import {
|
||||||
AlertDefaultSystem,
|
AlertDefaultSystem,
|
||||||
BoxButtonOnFooter,
|
BoxButtonOnFooter,
|
||||||
@@ -6,15 +7,78 @@ import {
|
|||||||
} from "@/components";
|
} from "@/components";
|
||||||
import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle";
|
import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle";
|
||||||
import AdminButtonReject from "@/components/_ShareComponent/Admin/ButtonReject";
|
import AdminButtonReject from "@/components/_ShareComponent/Admin/ButtonReject";
|
||||||
import { router, useLocalSearchParams } from "expo-router";
|
import { funUpdateStatusEvent } from "@/screens/Admin/Event/funUpdateStatus";
|
||||||
import { useState } from "react";
|
import { apiAdminEventById } from "@/service/api-admin/api-admin-event";
|
||||||
|
import { router, useFocusEffect, useLocalSearchParams } from "expo-router";
|
||||||
|
import { useCallback, useState } from "react";
|
||||||
|
import Toast from "react-native-toast-message";
|
||||||
|
|
||||||
export default function AdminEventRejectInput() {
|
export default function AdminEventRejectInput() {
|
||||||
const { id } = useLocalSearchParams();
|
const { id, status } = useLocalSearchParams();
|
||||||
const [value, setValue] = useState(id as string);
|
|
||||||
|
const [data, setData] = useState<any>("");
|
||||||
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
|
|
||||||
|
useFocusEffect(
|
||||||
|
useCallback(() => {
|
||||||
|
onLoadData();
|
||||||
|
}, [id])
|
||||||
|
);
|
||||||
|
const onLoadData = async () => {
|
||||||
|
try {
|
||||||
|
const response = await apiAdminEventById({
|
||||||
|
id: id as string,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (response.success) {
|
||||||
|
setData(response.data.catatan);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR]", error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleUpdate = async ({
|
||||||
|
changeStatus,
|
||||||
|
}: {
|
||||||
|
changeStatus: "publish" | "review" | "reject";
|
||||||
|
}) => {
|
||||||
|
try {
|
||||||
|
setIsLoading(true);
|
||||||
|
const response = await funUpdateStatusEvent({
|
||||||
|
id: id as string,
|
||||||
|
changeStatus,
|
||||||
|
data: data,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!response.success) {
|
||||||
|
Toast.show({
|
||||||
|
type: "error",
|
||||||
|
text1: "Report gagal",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Toast.show({
|
||||||
|
type: "success",
|
||||||
|
text1: "Report berhasil",
|
||||||
|
});
|
||||||
|
|
||||||
|
if (status === "review") {
|
||||||
|
router.replace(`/admin/event/reject/status`);
|
||||||
|
} else if (status === "reject") {
|
||||||
|
router.back();
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR]", error);
|
||||||
|
} finally {
|
||||||
|
setIsLoading(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const buttonSubmit = (
|
const buttonSubmit = (
|
||||||
<BoxButtonOnFooter>
|
<BoxButtonOnFooter>
|
||||||
<AdminButtonReject
|
<AdminButtonReject
|
||||||
|
isLoading={isLoading}
|
||||||
title="Reject"
|
title="Reject"
|
||||||
onReject={() =>
|
onReject={() =>
|
||||||
AlertDefaultSystem({
|
AlertDefaultSystem({
|
||||||
@@ -22,12 +86,8 @@ export default function AdminEventRejectInput() {
|
|||||||
message: "Apakah anda yakin ingin menolak data ini?",
|
message: "Apakah anda yakin ingin menolak data ini?",
|
||||||
textLeft: "Batal",
|
textLeft: "Batal",
|
||||||
textRight: "Ya",
|
textRight: "Ya",
|
||||||
onPressLeft: () => {
|
|
||||||
router.back();
|
|
||||||
},
|
|
||||||
onPressRight: () => {
|
onPressRight: () => {
|
||||||
console.log("value:", value);
|
handleUpdate({ changeStatus: "reject" });
|
||||||
router.replace(`/admin/event/reject/status`);
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -42,8 +102,8 @@ export default function AdminEventRejectInput() {
|
|||||||
headerComponent={<AdminBackButtonAntTitle title="Penolakan Event" />}
|
headerComponent={<AdminBackButtonAntTitle title="Penolakan Event" />}
|
||||||
>
|
>
|
||||||
<TextAreaCustom
|
<TextAreaCustom
|
||||||
value={value}
|
value={data}
|
||||||
onChangeText={setValue}
|
onChangeText={setData}
|
||||||
placeholder="Masukan alasan"
|
placeholder="Masukan alasan"
|
||||||
required
|
required
|
||||||
showCount
|
showCount
|
||||||
|
|||||||
@@ -1,27 +1,67 @@
|
|||||||
|
/* eslint-disable react-hooks/exhaustive-deps */
|
||||||
import {
|
import {
|
||||||
ActionIcon,
|
ActionIcon,
|
||||||
BaseBox,
|
LoaderCustom,
|
||||||
SearchInput,
|
SearchInput,
|
||||||
Spacing,
|
StackCustom,
|
||||||
TextCustom,
|
TextCustom,
|
||||||
ViewWrapper,
|
ViewWrapper
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import AdminComp_BoxTitle from "@/components/_ShareComponent/Admin/BoxTitlePage";
|
import AdminComp_BoxTitle from "@/components/_ShareComponent/Admin/BoxTitlePage";
|
||||||
import AdminTitleTable from "@/components/_ShareComponent/Admin/TableTitle";
|
import AdminTitleTable from "@/components/_ShareComponent/Admin/TableTitle";
|
||||||
import AdminTableValue from "@/components/_ShareComponent/Admin/TableValue";
|
import AdminTableValue from "@/components/_ShareComponent/Admin/TableValue";
|
||||||
import AdminTitlePage from "@/components/_ShareComponent/Admin/TitlePage";
|
import AdminTitlePage from "@/components/_ShareComponent/Admin/TitlePage";
|
||||||
import { ICON_SIZE_BUTTON } from "@/constants/constans-value";
|
import { ICON_SIZE_BUTTON } from "@/constants/constans-value";
|
||||||
|
import { apiAdminEvent } from "@/service/api-admin/api-admin-event";
|
||||||
import { Octicons } from "@expo/vector-icons";
|
import { Octicons } from "@expo/vector-icons";
|
||||||
import { router, useLocalSearchParams } from "expo-router";
|
import { router, useFocusEffect, useLocalSearchParams } from "expo-router";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
|
import { useCallback, useState } from "react";
|
||||||
import { Divider } from "react-native-paper";
|
import { Divider } from "react-native-paper";
|
||||||
|
|
||||||
export default function AdminEventStatus() {
|
export default function AdminEventStatus() {
|
||||||
const { status } = useLocalSearchParams();
|
const { status } = useLocalSearchParams();
|
||||||
|
console.log("[STATUS EVENT]", status);
|
||||||
|
|
||||||
|
const [listData, setListData] = useState<any[] | null>(null);
|
||||||
|
const [loadData, setLoadData] = useState(false);
|
||||||
|
const [search, setSearch] = useState<string>("");
|
||||||
|
|
||||||
|
useFocusEffect(
|
||||||
|
useCallback(() => {
|
||||||
|
onLoadData();
|
||||||
|
}, [status, search])
|
||||||
|
);
|
||||||
|
|
||||||
|
const onLoadData = async () => {
|
||||||
|
try {
|
||||||
|
setLoadData(true);
|
||||||
|
const response = await apiAdminEvent({
|
||||||
|
category: status as "publish" | "review" | "reject" | "history" as any,
|
||||||
|
search,
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log(
|
||||||
|
`[RES LIST BY STATUS: ${status}]`,
|
||||||
|
JSON.stringify(response, null, 2)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (response.success) {
|
||||||
|
setListData(response.data);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR]", error);
|
||||||
|
} finally {
|
||||||
|
setLoadData(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const rightComponent = (
|
const rightComponent = (
|
||||||
<SearchInput
|
<SearchInput
|
||||||
containerStyle={{ width: "100%", marginBottom: 0 }}
|
containerStyle={{ width: "100%", marginBottom: 0 }}
|
||||||
placeholder="Cari"
|
placeholder="Cari"
|
||||||
|
value={search}
|
||||||
|
onChangeText={(value) => setSearch(value)}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
return (
|
return (
|
||||||
@@ -32,44 +72,50 @@ export default function AdminEventStatus() {
|
|||||||
rightComponent={rightComponent}
|
rightComponent={rightComponent}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<BaseBox>
|
<StackCustom gap={"sm"}>
|
||||||
<AdminTitleTable
|
<AdminTitleTable
|
||||||
title1="Aksi"
|
title1="Aksi"
|
||||||
title2="Username"
|
title2="Username"
|
||||||
title3="Judul Event"
|
title3="Judul Event"
|
||||||
/>
|
/>
|
||||||
<Spacing />
|
|
||||||
<Divider />
|
<Divider />
|
||||||
|
|
||||||
{Array.from({ length: 10 }).map((_, index) => (
|
{loadData ? (
|
||||||
<AdminTableValue
|
<LoaderCustom />
|
||||||
key={index}
|
) : _.isEmpty(listData) ? (
|
||||||
value1={
|
<TextCustom align="center" size="small" color="gray">Belum ada data</TextCustom>
|
||||||
<ActionIcon
|
) : (
|
||||||
icon={
|
listData?.map((item, index) => (
|
||||||
<Octicons
|
<AdminTableValue
|
||||||
name="eye"
|
key={index}
|
||||||
size={ICON_SIZE_BUTTON}
|
value1={
|
||||||
color="black"
|
<ActionIcon
|
||||||
/>
|
icon={
|
||||||
}
|
<Octicons
|
||||||
onPress={() => {
|
name="eye"
|
||||||
router.push(`/admin/event/${index}/${status}`);
|
size={ICON_SIZE_BUTTON}
|
||||||
}}
|
color="black"
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
value2={<TextCustom truncate={1}>Username username</TextCustom>}
|
onPress={() => {
|
||||||
value3={
|
router.push(`/admin/event/${item.id}/${status}`);
|
||||||
<TextCustom truncate={2}>
|
}}
|
||||||
Lorem ipsum dolor sit amet consectetur adipisicing elit.
|
/>
|
||||||
Blanditiis asperiores quidem deleniti architecto eaque et
|
}
|
||||||
nostrum, ad consequuntur eveniet quisquam quae voluptatum
|
value2={
|
||||||
ducimus! Dolorem nobis modi officia debitis, beatae mollitia.
|
<TextCustom truncate={1}>
|
||||||
</TextCustom>
|
{item?.Author?.username || "-"}
|
||||||
}
|
</TextCustom>
|
||||||
/>
|
}
|
||||||
))}
|
value3={
|
||||||
</BaseBox>
|
<TextCustom align="center" truncate={2}>
|
||||||
|
{item?.title || "-"}
|
||||||
|
</TextCustom>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
))
|
||||||
|
)}
|
||||||
|
</StackCustom>
|
||||||
</ViewWrapper>
|
</ViewWrapper>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -9,13 +9,67 @@ import {
|
|||||||
import AdminComp_BoxDashboard from "@/components/_ShareComponent/Admin/BoxDashboard";
|
import AdminComp_BoxDashboard from "@/components/_ShareComponent/Admin/BoxDashboard";
|
||||||
import AdminTitlePage from "@/components/_ShareComponent/Admin/TitlePage";
|
import AdminTitlePage from "@/components/_ShareComponent/Admin/TitlePage";
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
|
import { apiAdminEvent } from "@/service/api-admin/api-admin-event";
|
||||||
|
import { useFocusEffect } from "expo-router";
|
||||||
|
import { useCallback, useState } from "react";
|
||||||
|
|
||||||
export default function AdminVoting() {
|
export default function AdminVoting() {
|
||||||
|
const [data, setData] = useState<any | null>(null);
|
||||||
|
|
||||||
|
useFocusEffect(
|
||||||
|
useCallback(() => {
|
||||||
|
onLoadData();
|
||||||
|
}, [])
|
||||||
|
);
|
||||||
|
|
||||||
|
const onLoadData = async () => {
|
||||||
|
try {
|
||||||
|
const response = await apiAdminEvent({
|
||||||
|
category: "dashboard",
|
||||||
|
});
|
||||||
|
|
||||||
|
if (response.success) {
|
||||||
|
setData(response.data);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR]", error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const listData = [
|
||||||
|
{
|
||||||
|
label: "Publish",
|
||||||
|
value: (data && data.publish) || 0,
|
||||||
|
icon: <IconPublish size={25} color={MainColor.green} />,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Review",
|
||||||
|
value: (data && data.review) || 0,
|
||||||
|
icon: <IconReview size={25} color={MainColor.orange} />,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Reject",
|
||||||
|
value: (data && data.reject) || 0,
|
||||||
|
icon: <IconReject size={25} color={MainColor.red} />,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Riwayat",
|
||||||
|
value: (data && data.history) || 0,
|
||||||
|
icon: <IconArchive size={25} color={MainColor.placeholder} />,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Tipe Acara",
|
||||||
|
value: (data && data.typeOfEvent) || 0,
|
||||||
|
icon: <IconList size={25} color={MainColor.placeholder} />,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ViewWrapper>
|
<ViewWrapper>
|
||||||
<AdminTitlePage title="Event" />
|
<AdminTitlePage title="Event" />
|
||||||
<Spacing />
|
<Spacing />
|
||||||
|
|
||||||
<StackCustom gap={"xs"}>
|
<StackCustom gap={"xs"}>
|
||||||
{listData.map((item, i) => (
|
{listData.map((item, i) => (
|
||||||
<AdminComp_BoxDashboard key={i} item={item} />
|
<AdminComp_BoxDashboard key={i} item={item} />
|
||||||
@@ -25,31 +79,3 @@ export default function AdminVoting() {
|
|||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const listData = [
|
|
||||||
{
|
|
||||||
label: "Publish",
|
|
||||||
value: 3,
|
|
||||||
icon: <IconPublish size={25} color={MainColor.green} />,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "Review",
|
|
||||||
value: 8,
|
|
||||||
icon: <IconReview size={25} color={MainColor.orange} />,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "Reject",
|
|
||||||
value: 4,
|
|
||||||
icon: <IconReject size={25} color={MainColor.red} />,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "Riwayat",
|
|
||||||
value: 6,
|
|
||||||
icon: <IconArchive size={25} color={MainColor.placeholder} />,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "Tipe Acara",
|
|
||||||
value: 7,
|
|
||||||
icon: <IconList size={25} color={MainColor.placeholder} />,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|||||||
@@ -1,58 +1,79 @@
|
|||||||
|
/* eslint-disable react-hooks/exhaustive-deps */
|
||||||
import {
|
import {
|
||||||
ActionIcon,
|
ActionIcon,
|
||||||
AlertDefaultSystem,
|
|
||||||
BadgeCustom,
|
BadgeCustom,
|
||||||
BaseBox,
|
BaseBox,
|
||||||
DrawerCustom,
|
DrawerCustom,
|
||||||
MenuDrawerDynamicGrid,
|
MenuDrawerDynamicGrid,
|
||||||
Spacing,
|
|
||||||
StackCustom,
|
StackCustom,
|
||||||
TextCustom,
|
TextCustom,
|
||||||
ViewWrapper,
|
ViewWrapper,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import { IconDot, IconView } from "@/components/_Icon/IconComponent";
|
import { IconDot } from "@/components/_Icon/IconComponent";
|
||||||
import { IconTrash } from "@/components/_Icon/IconTrash";
|
|
||||||
import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle";
|
import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle";
|
||||||
import AdminTitleTable from "@/components/_ShareComponent/Admin/TableTitle";
|
|
||||||
import AdminTableValue from "@/components/_ShareComponent/Admin/TableValue";
|
|
||||||
import { GridDetail_4_8 } from "@/components/_ShareComponent/GridDetail_4_8";
|
import { GridDetail_4_8 } from "@/components/_ShareComponent/GridDetail_4_8";
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
import {
|
import { ICON_SIZE_XLARGE } from "@/constants/constans-value";
|
||||||
ICON_SIZE_BUTTON,
|
import { apiAdminForumPostingById } from "@/service/api-admin/api-admin-forum";
|
||||||
ICON_SIZE_MEDIUM,
|
|
||||||
ICON_SIZE_XLARGE,
|
|
||||||
} from "@/constants/constans-value";
|
|
||||||
import { Ionicons } from "@expo/vector-icons";
|
import { Ionicons } from "@expo/vector-icons";
|
||||||
import { router } from "expo-router";
|
import { router, useFocusEffect, useLocalSearchParams } from "expo-router";
|
||||||
import { useState } from "react";
|
import { useCallback, useState } from "react";
|
||||||
import { Divider } from "react-native-paper";
|
|
||||||
import Toast from "react-native-toast-message";
|
|
||||||
|
|
||||||
export default function AdminForumDetailPosting() {
|
export default function AdminForumDetailPosting() {
|
||||||
|
const { id } = useLocalSearchParams();
|
||||||
const [openDrawerPage, setOpenDrawerPage] = useState(false);
|
const [openDrawerPage, setOpenDrawerPage] = useState(false);
|
||||||
const [openDrawerAction, setOpenDrawerAction] = useState(false);
|
const [data, setData] = useState<any | null>(null);
|
||||||
const [id, setId] = useState<any>();
|
useFocusEffect(
|
||||||
|
useCallback(() => {
|
||||||
|
onLoadData();
|
||||||
|
}, [id])
|
||||||
|
);
|
||||||
|
|
||||||
const handlerAction = (item: { value: string; path: string }) => {
|
const onLoadData = async () => {
|
||||||
if (item.value === "delete") {
|
try {
|
||||||
AlertDefaultSystem({
|
const response = await apiAdminForumPostingById({
|
||||||
title: "Hapus Posting",
|
id: id as string,
|
||||||
message: "Apakah Anda yakin ingin menghapus posting ini?",
|
|
||||||
textLeft: "Batal",
|
|
||||||
textRight: "Hapus",
|
|
||||||
onPressRight: () => {
|
|
||||||
Toast.show({
|
|
||||||
type: "success",
|
|
||||||
text1: "Posting berhasil dihapus",
|
|
||||||
});
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
} else {
|
|
||||||
router.navigate(item.path as any);
|
if (response.success) {
|
||||||
|
setData(response.data);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR]", error);
|
||||||
}
|
}
|
||||||
setOpenDrawerAction(false);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const listDataAction = [
|
||||||
|
{
|
||||||
|
label: "Username",
|
||||||
|
value: data?.Author?.username || "-",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Status",
|
||||||
|
value:
|
||||||
|
(data && (
|
||||||
|
<BadgeCustom
|
||||||
|
color={
|
||||||
|
data?.ForumMaster_StatusPosting?.status === "Open"
|
||||||
|
? MainColor.green
|
||||||
|
: MainColor.red
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{data?.ForumMaster_StatusPosting?.status || "-"}
|
||||||
|
</BadgeCustom>
|
||||||
|
)) ||
|
||||||
|
"-",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Komentar",
|
||||||
|
value: data?.JumlahKomentar || 0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Total Report",
|
||||||
|
value: data?.JumlahReportPosting || 0,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ViewWrapper
|
<ViewWrapper
|
||||||
@@ -60,14 +81,25 @@ export default function AdminForumDetailPosting() {
|
|||||||
<AdminBackButtonAntTitle
|
<AdminBackButtonAntTitle
|
||||||
title="Detail Posting"
|
title="Detail Posting"
|
||||||
rightComponent={
|
rightComponent={
|
||||||
<ActionIcon
|
data &&
|
||||||
icon={<IconDot size={16} color={MainColor.darkblue} />}
|
data?.isActive && (
|
||||||
onPress={() => setOpenDrawerPage(true)}
|
<ActionIcon
|
||||||
/>
|
icon={<IconDot size={16} color={MainColor.darkblue} />}
|
||||||
|
onPress={() => setOpenDrawerPage(true)}
|
||||||
|
/>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
|
{data && !data?.isActive && (
|
||||||
|
<BaseBox>
|
||||||
|
<TextCustom bold align="center" color="red">
|
||||||
|
Postingan ini telah di nonaktifkan
|
||||||
|
</TextCustom>
|
||||||
|
</BaseBox>
|
||||||
|
)}
|
||||||
|
|
||||||
<BaseBox>
|
<BaseBox>
|
||||||
<StackCustom gap={"sm"}>
|
<StackCustom gap={"sm"}>
|
||||||
{listDataAction.map((item, i) => (
|
{listDataAction.map((item, i) => (
|
||||||
@@ -77,50 +109,14 @@ export default function AdminForumDetailPosting() {
|
|||||||
value={<TextCustom>{item.value}</TextCustom>}
|
value={<TextCustom>{item.value}</TextCustom>}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
<TextCustom bold>Posting</TextCustom>
|
|
||||||
<TextCustom>
|
|
||||||
Lorem ipsum dolor sit amet consectetur adipisicing elit.
|
|
||||||
Asperiores cupiditate nobis dignissimos explicabo quo unde dolorum
|
|
||||||
numquam eos ab laborum fugiat illo nam velit quibusdam, maxime
|
|
||||||
assumenda aut vero provident!
|
|
||||||
</TextCustom>
|
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
</BaseBox>
|
</BaseBox>
|
||||||
|
|
||||||
{/* <AdminComp_BoxTitle title="Komentar" rightComponent={rightComponent} /> */}
|
|
||||||
<BaseBox>
|
<BaseBox>
|
||||||
<AdminTitleTable title1="Aksi" title2="Username" title3="Komentar" />
|
<StackCustom gap={"sm"}>
|
||||||
<Spacing />
|
<TextCustom bold>Postingan</TextCustom>
|
||||||
<Divider />
|
<TextCustom>{(data && data?.diskusi) || "-"}</TextCustom>
|
||||||
{Array.from({ length: 10 }).map((_, index) => (
|
</StackCustom>
|
||||||
<AdminTableValue
|
|
||||||
key={index}
|
|
||||||
value1={
|
|
||||||
<ActionIcon
|
|
||||||
icon={
|
|
||||||
<Ionicons
|
|
||||||
name="ellipsis-vertical-outline"
|
|
||||||
size={ICON_SIZE_BUTTON}
|
|
||||||
color="black"
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
onPress={() => {
|
|
||||||
setOpenDrawerAction(true);
|
|
||||||
setId(index + 1);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
value2={<TextCustom truncate={1}>Username username</TextCustom>}
|
|
||||||
value3={
|
|
||||||
<TextCustom truncate={2}>
|
|
||||||
Lorem ipsum dolor sit amet consectetur adipisicing elit.
|
|
||||||
Blanditiis asperiores quidem deleniti architecto eaque et
|
|
||||||
nostrum, ad consequuntur eveniet quisquam quae voluptatum
|
|
||||||
ducimus! Dolorem nobis modi officia debitis, beatae mollitia.
|
|
||||||
</TextCustom>
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
))}
|
|
||||||
</BaseBox>
|
</BaseBox>
|
||||||
</ViewWrapper>
|
</ViewWrapper>
|
||||||
|
|
||||||
@@ -143,6 +139,18 @@ export default function AdminForumDetailPosting() {
|
|||||||
value: "detail",
|
value: "detail",
|
||||||
path: `/admin/forum/${id}/list-report-posting`,
|
path: `/admin/forum/${id}/list-report-posting`,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
icon: (
|
||||||
|
<Ionicons
|
||||||
|
name="list"
|
||||||
|
size={ICON_SIZE_XLARGE}
|
||||||
|
color={MainColor.white}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
label: "Daftar Komentar",
|
||||||
|
value: "detail",
|
||||||
|
path: `/admin/forum/${id}/list-comment`,
|
||||||
|
},
|
||||||
]}
|
]}
|
||||||
onPressItem={(item) => {
|
onPressItem={(item) => {
|
||||||
router.navigate(item.path as any);
|
router.navigate(item.path as any);
|
||||||
@@ -150,54 +158,6 @@ export default function AdminForumDetailPosting() {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</DrawerCustom>
|
</DrawerCustom>
|
||||||
|
|
||||||
<DrawerCustom
|
|
||||||
isVisible={openDrawerAction}
|
|
||||||
closeDrawer={() => setOpenDrawerAction(false)}
|
|
||||||
height={"auto"}
|
|
||||||
>
|
|
||||||
<MenuDrawerDynamicGrid
|
|
||||||
data={[
|
|
||||||
{
|
|
||||||
icon: <IconView />,
|
|
||||||
label: "Detail Komentar",
|
|
||||||
value: "detail",
|
|
||||||
path: `admin/forum/${id}/list-report-comment`,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
icon: (
|
|
||||||
<IconTrash size={ICON_SIZE_MEDIUM} color={MainColor.white} />
|
|
||||||
),
|
|
||||||
label: "Hapus Komentar",
|
|
||||||
value: "delete",
|
|
||||||
path: "",
|
|
||||||
color: MainColor.red,
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
onPressItem={(item) => {
|
|
||||||
handlerAction(item as any);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</DrawerCustom>
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const listDataAction = [
|
|
||||||
{
|
|
||||||
label: "Username",
|
|
||||||
value: "Username",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "Status",
|
|
||||||
value: <BadgeCustom color={MainColor.green}>Open</BadgeCustom>,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "Komentar",
|
|
||||||
value: "10",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "Total Report",
|
|
||||||
value: "1",
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|||||||
91
app/(application)/admin/forum/[id]/list-comment.tsx
Normal file
91
app/(application)/admin/forum/[id]/list-comment.tsx
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
/* eslint-disable react-hooks/exhaustive-deps */
|
||||||
|
import {
|
||||||
|
LoaderCustom,
|
||||||
|
StackCustom,
|
||||||
|
TextCustom,
|
||||||
|
ViewWrapper
|
||||||
|
} from "@/components";
|
||||||
|
import { IconOpenTo } from "@/components/_Icon/IconOpenTo";
|
||||||
|
import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle";
|
||||||
|
import AdminTitleTable from "@/components/_ShareComponent/Admin/TableTitle";
|
||||||
|
import AdminTableValue from "@/components/_ShareComponent/Admin/TableValue";
|
||||||
|
import { apiAdminForumCommentById } from "@/service/api-admin/api-admin-forum";
|
||||||
|
import { router, useFocusEffect, useLocalSearchParams } from "expo-router";
|
||||||
|
import _ from "lodash";
|
||||||
|
import { useCallback, useState } from "react";
|
||||||
|
import { Divider } from "react-native-paper";
|
||||||
|
|
||||||
|
export default function AdminForumListComment() {
|
||||||
|
const { id } = useLocalSearchParams();
|
||||||
|
const [listComment, setListComment] = useState<any[] | null>(null);
|
||||||
|
const [loadList, setLoadList] = useState(false);
|
||||||
|
|
||||||
|
useFocusEffect(
|
||||||
|
useCallback(() => {
|
||||||
|
onLoadComment();
|
||||||
|
}, [id])
|
||||||
|
);
|
||||||
|
|
||||||
|
const onLoadComment = async () => {
|
||||||
|
try {
|
||||||
|
setLoadList(true);
|
||||||
|
const response = await apiAdminForumCommentById({
|
||||||
|
id: id as string,
|
||||||
|
category: "get-all",
|
||||||
|
});
|
||||||
|
|
||||||
|
if (response.success) {
|
||||||
|
setListComment(response.data);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR]", error);
|
||||||
|
setListComment([]);
|
||||||
|
} finally {
|
||||||
|
setLoadList(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<ViewWrapper
|
||||||
|
headerComponent={<AdminBackButtonAntTitle title="Daftar Komentar" />}
|
||||||
|
>
|
||||||
|
<StackCustom>
|
||||||
|
<AdminTitleTable title1="Aksi" title2="Report" title3="Komentar" />
|
||||||
|
<Divider />
|
||||||
|
{loadList ? (
|
||||||
|
<LoaderCustom />
|
||||||
|
) : _.isEmpty(listComment) ? (
|
||||||
|
<TextCustom align="center" color="gray">
|
||||||
|
Tidak ada komentar
|
||||||
|
</TextCustom>
|
||||||
|
) : (
|
||||||
|
listComment?.map((item: any, index: number) => (
|
||||||
|
<AdminTableValue
|
||||||
|
key={index}
|
||||||
|
value1={
|
||||||
|
<IconOpenTo
|
||||||
|
onPress={() => {
|
||||||
|
router.push(
|
||||||
|
`/admin/forum/${item.id}/list-report-comment`
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
value2={
|
||||||
|
<TextCustom truncate={1}>
|
||||||
|
{item?.countReport || 0}
|
||||||
|
</TextCustom>
|
||||||
|
}
|
||||||
|
value3={
|
||||||
|
<TextCustom truncate={2}>{item?.komentar || "-"}</TextCustom>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
))
|
||||||
|
)}
|
||||||
|
</StackCustom>
|
||||||
|
</ViewWrapper>
|
||||||
|
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,10 +1,11 @@
|
|||||||
|
/* eslint-disable react-hooks/exhaustive-deps */
|
||||||
import {
|
import {
|
||||||
ActionIcon,
|
ActionIcon,
|
||||||
AlertDefaultSystem,
|
AlertDefaultSystem,
|
||||||
BaseBox,
|
BaseBox,
|
||||||
DrawerCustom,
|
DrawerCustom,
|
||||||
|
LoaderCustom,
|
||||||
MenuDrawerDynamicGrid,
|
MenuDrawerDynamicGrid,
|
||||||
Spacing,
|
|
||||||
StackCustom,
|
StackCustom,
|
||||||
TextCustom,
|
TextCustom,
|
||||||
ViewWrapper,
|
ViewWrapper,
|
||||||
@@ -18,14 +19,64 @@ import AdminTableValue from "@/components/_ShareComponent/Admin/TableValue";
|
|||||||
import { GridDetail_4_8 } from "@/components/_ShareComponent/GridDetail_4_8";
|
import { GridDetail_4_8 } from "@/components/_ShareComponent/GridDetail_4_8";
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
import { ICON_SIZE_BUTTON } from "@/constants/constans-value";
|
import { ICON_SIZE_BUTTON } from "@/constants/constans-value";
|
||||||
import { router } from "expo-router";
|
import {
|
||||||
import { useState } from "react";
|
apiAdminForumCommentById,
|
||||||
|
apiAdminForumDeactivateComment,
|
||||||
|
apiAdminForumListReportCommentById,
|
||||||
|
} from "@/service/api-admin/api-admin-forum";
|
||||||
|
import { router, useFocusEffect, useLocalSearchParams } from "expo-router";
|
||||||
|
import _ from "lodash";
|
||||||
|
import { useCallback, useState } from "react";
|
||||||
import { Divider } from "react-native-paper";
|
import { Divider } from "react-native-paper";
|
||||||
import Toast from "react-native-toast-message";
|
import Toast from "react-native-toast-message";
|
||||||
|
|
||||||
export default function AdminForumReportComment() {
|
export default function AdminForumReportComment() {
|
||||||
|
const { id } = useLocalSearchParams();
|
||||||
|
const [data, setData] = useState<any | null>(null);
|
||||||
|
const [listReport, setListReport] = useState<any[] | null>(null);
|
||||||
|
const [loadList, setLoadList] = useState(false);
|
||||||
const [openDrawer, setOpenDrawer] = useState(false);
|
const [openDrawer, setOpenDrawer] = useState(false);
|
||||||
const [openDrawerAction, setOpenDrawerAction] = useState(false);
|
const [openDrawerAction, setOpenDrawerAction] = useState(false);
|
||||||
|
const [selectedReport, setSelectedReport] = useState({
|
||||||
|
id: "",
|
||||||
|
username: "",
|
||||||
|
kategori: "",
|
||||||
|
keterangan: "",
|
||||||
|
deskripsi: "",
|
||||||
|
});
|
||||||
|
|
||||||
|
useFocusEffect(
|
||||||
|
useCallback(() => {
|
||||||
|
onLoadData();
|
||||||
|
}, [id])
|
||||||
|
);
|
||||||
|
|
||||||
|
const onLoadData = async () => {
|
||||||
|
try {
|
||||||
|
setLoadList(true);
|
||||||
|
const response = await apiAdminForumCommentById({
|
||||||
|
id: id as string,
|
||||||
|
category: "get-one",
|
||||||
|
});
|
||||||
|
|
||||||
|
const responseReport = await apiAdminForumListReportCommentById({
|
||||||
|
id: id as string,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (response.success) {
|
||||||
|
setData(response.data);
|
||||||
|
}
|
||||||
|
if (responseReport.success) {
|
||||||
|
setListReport(responseReport.data);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR]", error);
|
||||||
|
setData(null);
|
||||||
|
setListReport([]);
|
||||||
|
} finally {
|
||||||
|
setLoadList(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -44,53 +95,65 @@ export default function AdminForumReportComment() {
|
|||||||
>
|
>
|
||||||
<BaseBox>
|
<BaseBox>
|
||||||
<StackCustom gap={"sm"}>
|
<StackCustom gap={"sm"}>
|
||||||
{listData.map((item, i) => (
|
<GridDetail_4_8
|
||||||
<GridDetail_4_8
|
label={<TextCustom bold>Username</TextCustom>}
|
||||||
key={i}
|
value={<TextCustom>{data?.Author?.username || "-"}</TextCustom>}
|
||||||
label={<TextCustom bold>{item.label}</TextCustom>}
|
/>
|
||||||
value={<TextCustom>{item.value}</TextCustom>}
|
<GridDetail_4_8
|
||||||
/>
|
label={<TextCustom bold>Komentar</TextCustom>}
|
||||||
))}
|
value={<TextCustom>{data?.komentar || "-"}</TextCustom>}
|
||||||
<TextCustom bold>Posting</TextCustom>
|
/>
|
||||||
<TextCustom>
|
|
||||||
Lorem ipsum dolor sit amet consectetur adipisicing elit.
|
|
||||||
Asperiores cupiditate nobis dignissimos explicabo quo unde dolorum
|
|
||||||
numquam eos ab laborum fugiat illo nam velit quibusdam, maxime
|
|
||||||
assumenda aut vero provident!
|
|
||||||
</TextCustom>
|
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
</BaseBox>
|
</BaseBox>
|
||||||
|
|
||||||
<AdminComp_BoxTitle title="Daftar Report Komentar" />
|
<AdminComp_BoxTitle title="Daftar Report Komentar" />
|
||||||
|
|
||||||
<BaseBox>
|
<StackCustom>
|
||||||
<AdminTitleTable
|
<AdminTitleTable
|
||||||
title1="Aksi"
|
title1="Aksi"
|
||||||
title2="Username"
|
title2="Pelapor"
|
||||||
title3="Kategori Report"
|
title3="Kategori Report"
|
||||||
/>
|
/>
|
||||||
<Spacing />
|
|
||||||
<Divider />
|
<Divider />
|
||||||
{Array.from({ length: 5 }).map((_, index) => (
|
{loadList ? (
|
||||||
<AdminTableValue
|
<LoaderCustom />
|
||||||
key={index}
|
) : _.isEmpty(listReport) ? (
|
||||||
value1={
|
<TextCustom align="center" color="gray">
|
||||||
<ActionIcon
|
Tidak ada report
|
||||||
icon={<IconView size={ICON_SIZE_BUTTON} color="black" />}
|
</TextCustom>
|
||||||
onPress={() => {
|
) : (
|
||||||
setOpenDrawerAction(true);
|
listReport?.map((item: any, index: number) => (
|
||||||
}}
|
<AdminTableValue
|
||||||
/>
|
key={index}
|
||||||
}
|
value1={
|
||||||
value2={<TextCustom truncate={1}>Username username</TextCustom>}
|
<ActionIcon
|
||||||
value3={
|
icon={<IconView size={ICON_SIZE_BUTTON} color="black" />}
|
||||||
<TextCustom truncate={2} align="center">
|
onPress={() => {
|
||||||
SPAM
|
setOpenDrawerAction(true);
|
||||||
</TextCustom>
|
setSelectedReport({
|
||||||
}
|
id: item.id,
|
||||||
/>
|
username: item.User?.username,
|
||||||
))}
|
kategori: item.ForumMaster_KategoriReport?.title,
|
||||||
</BaseBox>
|
keterangan: item.ForumMaster_KategoriReport?.deskripsi,
|
||||||
|
deskripsi: item.deskripsi,
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
value2={
|
||||||
|
<TextCustom truncate={1}>
|
||||||
|
{item?.User?.username || "-"}
|
||||||
|
</TextCustom>
|
||||||
|
}
|
||||||
|
value3={
|
||||||
|
<TextCustom truncate={2} align="center">
|
||||||
|
{item?.ForumMaster_KategoriReport?.title || "-"}
|
||||||
|
</TextCustom>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
))
|
||||||
|
)}
|
||||||
|
</StackCustom>
|
||||||
</ViewWrapper>
|
</ViewWrapper>
|
||||||
|
|
||||||
<DrawerCustom
|
<DrawerCustom
|
||||||
@@ -114,7 +177,19 @@ export default function AdminForumReportComment() {
|
|||||||
message: "Apakah Anda yakin ingin menghapus komentar ini?",
|
message: "Apakah Anda yakin ingin menghapus komentar ini?",
|
||||||
textLeft: "Batal",
|
textLeft: "Batal",
|
||||||
textRight: "Hapus",
|
textRight: "Hapus",
|
||||||
onPressRight: () => {
|
onPressRight: async () => {
|
||||||
|
const deleteComment = await apiAdminForumDeactivateComment({
|
||||||
|
id: id as string,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!deleteComment.success) {
|
||||||
|
Toast.show({
|
||||||
|
type: "error",
|
||||||
|
text1: "Komentar gagal dihapus",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
setOpenDrawer(false);
|
setOpenDrawer(false);
|
||||||
Toast.show({
|
Toast.show({
|
||||||
type: "success",
|
type: "success",
|
||||||
@@ -132,37 +207,39 @@ export default function AdminForumReportComment() {
|
|||||||
closeDrawer={() => setOpenDrawerAction(false)}
|
closeDrawer={() => setOpenDrawerAction(false)}
|
||||||
height={"auto"}
|
height={"auto"}
|
||||||
>
|
>
|
||||||
{listDataAction.map((item, i) => (
|
<StackCustom>
|
||||||
<GridDetail_4_8
|
<GridDetail_4_8
|
||||||
key={i}
|
label={<TextCustom bold>Pelapor</TextCustom>}
|
||||||
label={<TextCustom bold>{item.label}</TextCustom>}
|
value={<TextCustom>{selectedReport?.username || "-"}</TextCustom>}
|
||||||
value={<TextCustom>{item.value}</TextCustom>}
|
|
||||||
/>
|
/>
|
||||||
))}
|
|
||||||
|
{selectedReport?.kategori && (
|
||||||
|
<>
|
||||||
|
<GridDetail_4_8
|
||||||
|
label={<TextCustom bold>Kategori Report</TextCustom>}
|
||||||
|
value={
|
||||||
|
<TextCustom>{selectedReport?.kategori || "-"}</TextCustom>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
<GridDetail_4_8
|
||||||
|
label={<TextCustom bold>Keterangan</TextCustom>}
|
||||||
|
value={
|
||||||
|
<TextCustom>{selectedReport?.keterangan || "-"}</TextCustom>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{selectedReport?.deskripsi && (
|
||||||
|
<GridDetail_4_8
|
||||||
|
label={<TextCustom bold>Deskripsi</TextCustom>}
|
||||||
|
value={
|
||||||
|
<TextCustom>{selectedReport?.deskripsi || "-"}</TextCustom>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</StackCustom>
|
||||||
</DrawerCustom>
|
</DrawerCustom>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const listData = [
|
|
||||||
{
|
|
||||||
label: "Username",
|
|
||||||
value: "Username",
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
const listDataAction = [
|
|
||||||
{
|
|
||||||
label: "Username",
|
|
||||||
value: "Riyusa",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "Kategori Report",
|
|
||||||
value: "SPAM",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "Deskripsi",
|
|
||||||
value:
|
|
||||||
"Lorem ipsum dolor sit amet consectetur adipisicing elit. Blanditiis asperiores quidem deleniti architecto eaque et nostrum, ad consequuntur eveniet quisquam quae voluptatum ducimus! Dolorem nobis modi officia debitis, beatae mollitia.",
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
|
/* eslint-disable react-hooks/exhaustive-deps */
|
||||||
import {
|
import {
|
||||||
ActionIcon,
|
ActionIcon,
|
||||||
AlertDefaultSystem,
|
AlertDefaultSystem,
|
||||||
BadgeCustom,
|
BadgeCustom,
|
||||||
BaseBox,
|
BaseBox,
|
||||||
DrawerCustom,
|
DrawerCustom,
|
||||||
|
LoaderCustom,
|
||||||
MenuDrawerDynamicGrid,
|
MenuDrawerDynamicGrid,
|
||||||
Spacing,
|
|
||||||
StackCustom,
|
StackCustom,
|
||||||
TextCustom,
|
TextCustom,
|
||||||
ViewWrapper,
|
ViewWrapper,
|
||||||
@@ -19,15 +20,64 @@ import AdminTableValue from "@/components/_ShareComponent/Admin/TableValue";
|
|||||||
import { GridDetail_4_8 } from "@/components/_ShareComponent/GridDetail_4_8";
|
import { GridDetail_4_8 } from "@/components/_ShareComponent/GridDetail_4_8";
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
import { ICON_SIZE_BUTTON } from "@/constants/constans-value";
|
import { ICON_SIZE_BUTTON } from "@/constants/constans-value";
|
||||||
import { router } from "expo-router";
|
import {
|
||||||
import { useState } from "react";
|
apiAdminForumDeactivatePosting,
|
||||||
|
apiAdminForumListReportPostingById,
|
||||||
|
apiAdminForumPostingById,
|
||||||
|
} from "@/service/api-admin/api-admin-forum";
|
||||||
|
import { router, useFocusEffect, useLocalSearchParams } from "expo-router";
|
||||||
|
import _ from "lodash";
|
||||||
|
import { useCallback, useState } from "react";
|
||||||
import { Divider } from "react-native-paper";
|
import { Divider } from "react-native-paper";
|
||||||
import Toast from "react-native-toast-message";
|
import Toast from "react-native-toast-message";
|
||||||
|
|
||||||
export default function AdminForumReportPosting() {
|
export default function AdminForumReportPosting() {
|
||||||
|
const { id } = useLocalSearchParams();
|
||||||
const [openDrawerPage, setOpenDrawerPage] = useState(false);
|
const [openDrawerPage, setOpenDrawerPage] = useState(false);
|
||||||
const [openDrawerAction, setOpenDrawerAction] = useState(false);
|
const [openDrawerAction, setOpenDrawerAction] = useState(false);
|
||||||
|
|
||||||
|
const [data, setData] = useState<any | null>(null);
|
||||||
|
const [listReport, setListReport] = useState<any[] | null>(null);
|
||||||
|
const [loadListReport, setLoadListReport] = useState(false);
|
||||||
|
const [selectedReport, setSelectedReport] = useState({
|
||||||
|
id: "",
|
||||||
|
username: "",
|
||||||
|
kategori: "",
|
||||||
|
keterangan: "",
|
||||||
|
deskripsi: "",
|
||||||
|
});
|
||||||
|
|
||||||
|
useFocusEffect(
|
||||||
|
useCallback(() => {
|
||||||
|
onLoadData();
|
||||||
|
}, [id])
|
||||||
|
);
|
||||||
|
|
||||||
|
const onLoadData = async () => {
|
||||||
|
try {
|
||||||
|
setLoadListReport(true);
|
||||||
|
const response = await apiAdminForumPostingById({
|
||||||
|
id: id as string,
|
||||||
|
});
|
||||||
|
|
||||||
|
const responseReport = await apiAdminForumListReportPostingById({
|
||||||
|
id: id as string,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (response.success) {
|
||||||
|
setData(response.data);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (responseReport.success) {
|
||||||
|
setListReport(responseReport.data);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR]", error);
|
||||||
|
} finally {
|
||||||
|
setLoadListReport(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ViewWrapper
|
<ViewWrapper
|
||||||
@@ -45,50 +95,86 @@ export default function AdminForumReportPosting() {
|
|||||||
>
|
>
|
||||||
<BaseBox>
|
<BaseBox>
|
||||||
<StackCustom gap={"sm"}>
|
<StackCustom gap={"sm"}>
|
||||||
{listData.map((item, i) => (
|
<GridDetail_4_8
|
||||||
<GridDetail_4_8
|
label={<TextCustom bold>Username</TextCustom>}
|
||||||
key={i}
|
value={<TextCustom>{data?.Author?.username || "-"}</TextCustom>}
|
||||||
label={<TextCustom bold>{item.label}</TextCustom>}
|
/>
|
||||||
value={<TextCustom>{item.value}</TextCustom>}
|
|
||||||
/>
|
<GridDetail_4_8
|
||||||
))}
|
label={<TextCustom bold>Status</TextCustom>}
|
||||||
<TextCustom bold>Posting</TextCustom>
|
value={
|
||||||
<TextCustom>
|
data && data?.ForumMaster_StatusPosting?.status ? (
|
||||||
Lorem ipsum dolor sit amet consectetur adipisicing elit.
|
<BadgeCustom
|
||||||
Asperiores cupiditate nobis dignissimos explicabo quo unde dolorum
|
color={
|
||||||
numquam eos ab laborum fugiat illo nam velit quibusdam, maxime
|
data?.ForumMaster_StatusPosting?.status === "Open"
|
||||||
assumenda aut vero provident!
|
? MainColor.green
|
||||||
</TextCustom>
|
: MainColor.red
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{data?.ForumMaster_StatusPosting?.status === "Open"
|
||||||
|
? "Open"
|
||||||
|
: "Close"}
|
||||||
|
</BadgeCustom>
|
||||||
|
) : (
|
||||||
|
<TextCustom>{"-"}</TextCustom>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<GridDetail_4_8
|
||||||
|
label={<TextCustom bold>Postingan</TextCustom>}
|
||||||
|
value={<TextCustom>{data?.diskusi || "-"}</TextCustom>}
|
||||||
|
/>
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
</BaseBox>
|
</BaseBox>
|
||||||
|
|
||||||
<AdminComp_BoxTitle title="Daftar Report Posting" />
|
<AdminComp_BoxTitle title="Daftar Report Posting" />
|
||||||
<BaseBox>
|
<StackCustom gap={"sm"}>
|
||||||
<AdminTitleTable
|
<AdminTitleTable
|
||||||
title1="Aksi"
|
title1="Aksi"
|
||||||
title2="Username"
|
title2="Pelapor"
|
||||||
title3="Kategori Report"
|
title3="Kategori Report"
|
||||||
/>
|
/>
|
||||||
<Spacing />
|
|
||||||
<Divider />
|
<Divider />
|
||||||
{Array.from({ length: 5 }).map((_, index) => (
|
{loadListReport ? (
|
||||||
<AdminTableValue
|
<LoaderCustom />
|
||||||
key={index}
|
) : _.isEmpty(listReport) ? (
|
||||||
value1={
|
<TextCustom align="center" color={"gray"}>
|
||||||
<ActionIcon
|
Belum ada report
|
||||||
icon={<IconView size={ICON_SIZE_BUTTON} color="black" />}
|
</TextCustom>
|
||||||
onPress={() => setOpenDrawerAction(true)}
|
) : (
|
||||||
/>
|
listReport?.map((item: any, index: number) => (
|
||||||
}
|
<AdminTableValue
|
||||||
value2={<TextCustom truncate={1}>Username username</TextCustom>}
|
key={index}
|
||||||
value3={
|
value1={
|
||||||
<TextCustom truncate={2} align="center">
|
<ActionIcon
|
||||||
SPAM
|
icon={<IconView size={ICON_SIZE_BUTTON} color="black" />}
|
||||||
</TextCustom>
|
onPress={() => {
|
||||||
}
|
setOpenDrawerAction(true);
|
||||||
/>
|
setSelectedReport({
|
||||||
))}
|
id: item?.id,
|
||||||
</BaseBox>
|
username: item?.User?.username,
|
||||||
|
kategori: item?.ForumMaster_KategoriReport?.title,
|
||||||
|
keterangan: item?.ForumMaster_KategoriReport?.deskripsi,
|
||||||
|
deskripsi: item?.deskripsi,
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
value2={
|
||||||
|
<TextCustom truncate={1}>
|
||||||
|
{item?.User?.username || "-"}
|
||||||
|
</TextCustom>
|
||||||
|
}
|
||||||
|
value3={
|
||||||
|
<TextCustom truncate={2} align="center">
|
||||||
|
{item?.ForumMaster_KategoriReport?.title || "-"}
|
||||||
|
</TextCustom>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
))
|
||||||
|
)}
|
||||||
|
</StackCustom>
|
||||||
</ViewWrapper>
|
</ViewWrapper>
|
||||||
|
|
||||||
<DrawerCustom
|
<DrawerCustom
|
||||||
@@ -112,13 +198,25 @@ export default function AdminForumReportPosting() {
|
|||||||
message: "Apakah Anda yakin ingin menghapus posting ini?",
|
message: "Apakah Anda yakin ingin menghapus posting ini?",
|
||||||
textLeft: "Batal",
|
textLeft: "Batal",
|
||||||
textRight: "Hapus",
|
textRight: "Hapus",
|
||||||
onPressRight: () => {
|
onPressRight: async () => {
|
||||||
|
const response = await apiAdminForumDeactivatePosting({
|
||||||
|
id: id as string,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!response.success) {
|
||||||
|
Toast.show({
|
||||||
|
type: "error",
|
||||||
|
text1: "Posting gagal dihapus",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
setOpenDrawerPage(false);
|
setOpenDrawerPage(false);
|
||||||
Toast.show({
|
Toast.show({
|
||||||
type: "success",
|
type: "success",
|
||||||
text1: "Posting berhasil dihapus",
|
text1: "Posting berhasil dihapus",
|
||||||
});
|
});
|
||||||
router.back()
|
router.back();
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
@@ -130,41 +228,39 @@ export default function AdminForumReportPosting() {
|
|||||||
closeDrawer={() => setOpenDrawerAction(false)}
|
closeDrawer={() => setOpenDrawerAction(false)}
|
||||||
height={"auto"}
|
height={"auto"}
|
||||||
>
|
>
|
||||||
{listDataAction.map((item, i) => (
|
<StackCustom>
|
||||||
<GridDetail_4_8
|
<GridDetail_4_8
|
||||||
key={i}
|
label={<TextCustom bold>Pelapor</TextCustom>}
|
||||||
label={<TextCustom bold>{item.label}</TextCustom>}
|
value={<TextCustom>{selectedReport?.username || "-"}</TextCustom>}
|
||||||
value={<TextCustom>{item.value}</TextCustom>}
|
|
||||||
/>
|
/>
|
||||||
))}
|
|
||||||
|
{selectedReport?.kategori && (
|
||||||
|
<>
|
||||||
|
<GridDetail_4_8
|
||||||
|
label={<TextCustom bold>Kategori Report</TextCustom>}
|
||||||
|
value={
|
||||||
|
<TextCustom>{selectedReport?.kategori || "-"}</TextCustom>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
<GridDetail_4_8
|
||||||
|
label={<TextCustom bold>Keterangan</TextCustom>}
|
||||||
|
value={
|
||||||
|
<TextCustom>{selectedReport?.keterangan || "-"}</TextCustom>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{selectedReport?.deskripsi && (
|
||||||
|
<GridDetail_4_8
|
||||||
|
label={<TextCustom bold>Deskripsi</TextCustom>}
|
||||||
|
value={
|
||||||
|
<TextCustom>{selectedReport?.deskripsi || "-"}</TextCustom>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</StackCustom>
|
||||||
</DrawerCustom>
|
</DrawerCustom>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const listData = [
|
|
||||||
{
|
|
||||||
label: "Username",
|
|
||||||
value: "Username",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "Status",
|
|
||||||
value: <BadgeCustom color={MainColor.green}>Open</BadgeCustom>,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
const listDataAction = [
|
|
||||||
{
|
|
||||||
label: "Username",
|
|
||||||
value: "Firman Nusantara",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "Kategori Report",
|
|
||||||
value: "SPAM",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "Deskripsi",
|
|
||||||
value:
|
|
||||||
"Lorem ipsum dolor sit amet consectetur adipisicing elit. Blanditiis asperiores quidem deleniti architecto eaque et nostrum, ad consequuntur eveniet quisquam quae voluptatum ducimus! Dolorem nobis modi officia debitis, beatae mollitia.",
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|||||||
@@ -1,13 +1,53 @@
|
|||||||
import { Spacing, StackCustom, ViewWrapper } from "@/components";
|
import { Spacing, StackCustom, ViewWrapper } from "@/components";
|
||||||
import {
|
import { IconPublish, IconReport } from "@/components/_Icon/IconComponent";
|
||||||
IconPublish,
|
|
||||||
IconReport,
|
|
||||||
} from "@/components/_Icon/IconComponent";
|
|
||||||
import AdminComp_BoxDashboard from "@/components/_ShareComponent/Admin/BoxDashboard";
|
import AdminComp_BoxDashboard from "@/components/_ShareComponent/Admin/BoxDashboard";
|
||||||
import AdminTitlePage from "@/components/_ShareComponent/Admin/TitlePage";
|
import AdminTitlePage from "@/components/_ShareComponent/Admin/TitlePage";
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
|
import { apiAdminForum } from "@/service/api-admin/api-admin-forum";
|
||||||
|
import { useFocusEffect } from "expo-router";
|
||||||
|
import { useCallback, useState } from "react";
|
||||||
|
|
||||||
export default function AdminForum() {
|
export default function AdminForum() {
|
||||||
|
const [data, setData] = useState<any | null>(null);
|
||||||
|
|
||||||
|
useFocusEffect(
|
||||||
|
useCallback(() => {
|
||||||
|
handlerLoadList();
|
||||||
|
}, [])
|
||||||
|
);
|
||||||
|
|
||||||
|
const handlerLoadList = async () => {
|
||||||
|
try {
|
||||||
|
const response = await apiAdminForum({
|
||||||
|
category: "dashboard",
|
||||||
|
});
|
||||||
|
|
||||||
|
if (response.success) {
|
||||||
|
setData(response.data);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR]", error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const listData = [
|
||||||
|
{
|
||||||
|
label: "Posting",
|
||||||
|
value: data?.posting || 0,
|
||||||
|
icon: <IconPublish size={25} color={MainColor.green} />,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Report Posting",
|
||||||
|
value: data?.reportPosting || 0,
|
||||||
|
icon: <IconReport size={25} color={MainColor.orange} />,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Report Comment",
|
||||||
|
value: data?.reportComment || 0,
|
||||||
|
icon: <IconReport size={25} color={MainColor.red} />,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ViewWrapper>
|
<ViewWrapper>
|
||||||
@@ -22,21 +62,3 @@ export default function AdminForum() {
|
|||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const listData = [
|
|
||||||
{
|
|
||||||
label: "Posting",
|
|
||||||
value: 4,
|
|
||||||
icon: <IconPublish size={25} color={MainColor.green} />,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "Report Posting",
|
|
||||||
value: 7,
|
|
||||||
icon: <IconReport size={25} color={MainColor.orange} />,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "Report Comment",
|
|
||||||
value: 5,
|
|
||||||
icon: <IconReport size={25} color={MainColor.red} />,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
|
/* eslint-disable react-hooks/exhaustive-deps */
|
||||||
import {
|
import {
|
||||||
ActionIcon,
|
ActionIcon,
|
||||||
BaseBox,
|
LoaderCustom,
|
||||||
SearchInput,
|
SearchInput,
|
||||||
Spacing,
|
StackCustom,
|
||||||
TextCustom,
|
TextCustom,
|
||||||
ViewWrapper,
|
ViewWrapper,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
@@ -12,15 +13,47 @@ import AdminTitleTable from "@/components/_ShareComponent/Admin/TableTitle";
|
|||||||
import AdminTableValue from "@/components/_ShareComponent/Admin/TableValue";
|
import AdminTableValue from "@/components/_ShareComponent/Admin/TableValue";
|
||||||
import AdminTitlePage from "@/components/_ShareComponent/Admin/TitlePage";
|
import AdminTitlePage from "@/components/_ShareComponent/Admin/TitlePage";
|
||||||
import { ICON_SIZE_BUTTON } from "@/constants/constans-value";
|
import { ICON_SIZE_BUTTON } from "@/constants/constans-value";
|
||||||
import { router } from "expo-router";
|
import { apiAdminForum } from "@/service/api-admin/api-admin-forum";
|
||||||
import React from "react";
|
import { router, useFocusEffect } from "expo-router";
|
||||||
|
import _ from "lodash";
|
||||||
|
import React, { useCallback, useState } from "react";
|
||||||
import { Divider } from "react-native-paper";
|
import { Divider } from "react-native-paper";
|
||||||
|
|
||||||
export default function AdminForumPosting() {
|
export default function AdminForumPosting() {
|
||||||
|
const [list, setList] = useState<any | null>(null);
|
||||||
|
const [loadList, setLoadList] = useState(false);
|
||||||
|
const [search, setSearch] = useState("");
|
||||||
|
|
||||||
|
useFocusEffect(
|
||||||
|
useCallback(() => {
|
||||||
|
handlerLoadList();
|
||||||
|
}, [search])
|
||||||
|
);
|
||||||
|
|
||||||
|
const handlerLoadList = async () => {
|
||||||
|
try {
|
||||||
|
setLoadList(true);
|
||||||
|
const response = await apiAdminForum({
|
||||||
|
category: "posting",
|
||||||
|
search: search,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (response.success) {
|
||||||
|
setList(response.data);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR]", error);
|
||||||
|
} finally {
|
||||||
|
setLoadList(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const rightComponent = (
|
const rightComponent = (
|
||||||
<SearchInput
|
<SearchInput
|
||||||
containerStyle={{ width: "100%", marginBottom: 0 }}
|
containerStyle={{ width: "100%", marginBottom: 0 }}
|
||||||
placeholder="Cari"
|
placeholder="Cari"
|
||||||
|
value={search}
|
||||||
|
onChangeText={setSearch}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -28,33 +61,39 @@ export default function AdminForumPosting() {
|
|||||||
<>
|
<>
|
||||||
<ViewWrapper headerComponent={<AdminTitlePage title="Forum" />}>
|
<ViewWrapper headerComponent={<AdminTitlePage title="Forum" />}>
|
||||||
<AdminComp_BoxTitle title={"Posting"} rightComponent={rightComponent} />
|
<AdminComp_BoxTitle title={"Posting"} rightComponent={rightComponent} />
|
||||||
<BaseBox>
|
<StackCustom>
|
||||||
<AdminTitleTable title1="Aksi" title2="Username" title3="Postingan" />
|
<AdminTitleTable title1="Aksi" title2="Username" title3="Postingan" />
|
||||||
<Spacing />
|
|
||||||
<Divider />
|
<Divider />
|
||||||
{Array.from({ length: 10 }).map((_, index) => (
|
{loadList ? (
|
||||||
<AdminTableValue
|
<LoaderCustom />
|
||||||
key={index}
|
) : _.isEmpty(list) ? (
|
||||||
value1={
|
<TextCustom align="center" color="gray">
|
||||||
<ActionIcon
|
Belum ada data
|
||||||
icon={<IconView size={ICON_SIZE_BUTTON} color="black" />}
|
</TextCustom>
|
||||||
onPress={() => {
|
) : (
|
||||||
router.push(`/admin/forum/${index + 1}`);
|
list?.map((item: any, index: number) => (
|
||||||
}}
|
<AdminTableValue
|
||||||
/>
|
key={index}
|
||||||
}
|
value1={
|
||||||
value2={<TextCustom truncate={1}>Username username</TextCustom>}
|
<ActionIcon
|
||||||
value3={
|
icon={<IconView size={ICON_SIZE_BUTTON} color="black" />}
|
||||||
<TextCustom truncate={2}>
|
onPress={() => {
|
||||||
Lorem ipsum dolor sit amet consectetur adipisicing elit.
|
router.push(`/admin/forum/${item?.id}`);
|
||||||
Blanditiis asperiores quidem deleniti architecto eaque et
|
}}
|
||||||
nostrum, ad consequuntur eveniet quisquam quae voluptatum
|
/>
|
||||||
ducimus! Dolorem nobis modi officia debitis, beatae mollitia.
|
}
|
||||||
</TextCustom>
|
value2={
|
||||||
}
|
<TextCustom truncate={1}>
|
||||||
/>
|
{item?.Author?.username || "-"}
|
||||||
))}
|
</TextCustom>
|
||||||
</BaseBox>
|
}
|
||||||
|
value3={
|
||||||
|
<TextCustom truncate={2}>{item?.diskusi || "-"}</TextCustom>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
))
|
||||||
|
)}
|
||||||
|
</StackCustom>
|
||||||
</ViewWrapper>
|
</ViewWrapper>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
|
/* eslint-disable react-hooks/exhaustive-deps */
|
||||||
import {
|
import {
|
||||||
ActionIcon,
|
ActionIcon,
|
||||||
BaseBox,
|
LoaderCustom,
|
||||||
Divider,
|
|
||||||
SearchInput,
|
SearchInput,
|
||||||
Spacing,
|
StackCustom,
|
||||||
TextCustom,
|
TextCustom,
|
||||||
ViewWrapper,
|
ViewWrapper,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
@@ -14,14 +14,48 @@ import AdminTableValue from "@/components/_ShareComponent/Admin/TableValue";
|
|||||||
import AdminTitlePage from "@/components/_ShareComponent/Admin/TitlePage";
|
import AdminTitlePage from "@/components/_ShareComponent/Admin/TitlePage";
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
import { ICON_SIZE_BUTTON } from "@/constants/constans-value";
|
import { ICON_SIZE_BUTTON } from "@/constants/constans-value";
|
||||||
import { router } from "expo-router";
|
import { apiAdminForum } from "@/service/api-admin/api-admin-forum";
|
||||||
|
import { router, useFocusEffect } from "expo-router";
|
||||||
|
import _ from "lodash";
|
||||||
|
import { useCallback, useState } from "react";
|
||||||
|
import { Divider } from "react-native-paper";
|
||||||
|
|
||||||
export default function AdminForumReportComment() {
|
export default function AdminForumReportComment() {
|
||||||
|
const [listData, setListData] = useState<any[] | null>(null);
|
||||||
|
const [loadList, setLoadList] = useState<boolean>(false);
|
||||||
|
const [search, setSearch] = useState<string>("");
|
||||||
|
|
||||||
|
useFocusEffect(
|
||||||
|
useCallback(() => {
|
||||||
|
onLoadData();
|
||||||
|
}, [search])
|
||||||
|
);
|
||||||
|
|
||||||
|
const onLoadData = async () => {
|
||||||
|
try {
|
||||||
|
setLoadList(true);
|
||||||
|
|
||||||
|
const response = await apiAdminForum({
|
||||||
|
category: "report_comment",
|
||||||
|
search: search,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (response.success) {
|
||||||
|
setListData(response.data);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR]", error);
|
||||||
|
} finally {
|
||||||
|
setLoadList(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const rightComponent = (
|
const rightComponent = (
|
||||||
<SearchInput
|
<SearchInput
|
||||||
containerStyle={{ width: "100%", marginBottom: 0 }}
|
containerStyle={{ width: "100%", marginBottom: 0 }}
|
||||||
placeholder="Cari Komentar"
|
placeholder="Cari Komentar"
|
||||||
|
value={search}
|
||||||
|
onChangeText={setSearch}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -29,36 +63,56 @@ export default function AdminForumReportComment() {
|
|||||||
<>
|
<>
|
||||||
<ViewWrapper headerComponent={<AdminTitlePage title="Forum" />}>
|
<ViewWrapper headerComponent={<AdminTitlePage title="Forum" />}>
|
||||||
<AdminComp_BoxTitle
|
<AdminComp_BoxTitle
|
||||||
title="Report Comment"
|
title="Report Komentar"
|
||||||
rightComponent={rightComponent}
|
rightComponent={rightComponent}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<BaseBox>
|
<StackCustom gap={"sm"}>
|
||||||
<AdminTitleTable title1="Aksi" title2="Pelapor" title3="Jenis Laporan" />
|
<AdminTitleTable
|
||||||
<Spacing />
|
title1="Aksi"
|
||||||
|
title2="Pelapor"
|
||||||
|
title3="Jenis Laporan"
|
||||||
|
/>
|
||||||
<Divider />
|
<Divider />
|
||||||
{Array.from({ length: 10 }).map((_, index) => (
|
{loadList ? (
|
||||||
<AdminTableValue
|
<LoaderCustom />
|
||||||
key={index}
|
) : _.isEmpty(listData) ? (
|
||||||
value1={
|
<TextCustom align="center" color="gray">
|
||||||
<ActionIcon
|
Belum ada data
|
||||||
icon={
|
</TextCustom>
|
||||||
<IconView size={ICON_SIZE_BUTTON} color={MainColor.black} />
|
) : (
|
||||||
}
|
listData?.map((item: any, index: number) => (
|
||||||
onPress={() => {
|
<AdminTableValue
|
||||||
router.push(`/admin/forum/${index + 1}/list-report-comment`);
|
key={index}
|
||||||
}}
|
value1={
|
||||||
/>
|
<ActionIcon
|
||||||
}
|
icon={
|
||||||
value2={<TextCustom truncate={1}>Username username</TextCustom>}
|
<IconView
|
||||||
value3={
|
size={ICON_SIZE_BUTTON}
|
||||||
<TextCustom truncate={2} align="center">
|
color={MainColor.black}
|
||||||
SPAM
|
/>
|
||||||
</TextCustom>
|
}
|
||||||
}
|
onPress={() => {
|
||||||
/>
|
router.push(
|
||||||
))}
|
`/admin/forum/${item?.Forum_Komentar?.id}/list-report-comment`
|
||||||
</BaseBox>
|
);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
value2={
|
||||||
|
<TextCustom truncate={1}>
|
||||||
|
{item?.User?.username || "-"}
|
||||||
|
</TextCustom>
|
||||||
|
}
|
||||||
|
value3={
|
||||||
|
<TextCustom truncate={2} align="center">
|
||||||
|
{item?.ForumMaster_KategoriReport?.title || "-"}
|
||||||
|
</TextCustom>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
))
|
||||||
|
)}
|
||||||
|
</StackCustom>
|
||||||
</ViewWrapper>
|
</ViewWrapper>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-unused-vars */
|
/* eslint-disable react-hooks/exhaustive-deps */
|
||||||
import {
|
import {
|
||||||
ActionIcon,
|
ActionIcon,
|
||||||
BaseBox,
|
|
||||||
Divider,
|
Divider,
|
||||||
|
LoaderCustom,
|
||||||
SearchInput,
|
SearchInput,
|
||||||
Spacing,
|
StackCustom,
|
||||||
TextCustom,
|
TextCustom,
|
||||||
ViewWrapper,
|
ViewWrapper
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import { IconView } from "@/components/_Icon/IconComponent";
|
import { IconView } from "@/components/_Icon/IconComponent";
|
||||||
import AdminComp_BoxTitle from "@/components/_ShareComponent/Admin/BoxTitlePage";
|
import AdminComp_BoxTitle from "@/components/_ShareComponent/Admin/BoxTitlePage";
|
||||||
@@ -15,17 +15,47 @@ import AdminTableValue from "@/components/_ShareComponent/Admin/TableValue";
|
|||||||
import AdminTitlePage from "@/components/_ShareComponent/Admin/TitlePage";
|
import AdminTitlePage from "@/components/_ShareComponent/Admin/TitlePage";
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
import { ICON_SIZE_BUTTON } from "@/constants/constans-value";
|
import { ICON_SIZE_BUTTON } from "@/constants/constans-value";
|
||||||
import { router } from "expo-router";
|
import { apiAdminForum } from "@/service/api-admin/api-admin-forum";
|
||||||
import { useState } from "react";
|
import { router, useFocusEffect } from "expo-router";
|
||||||
|
import _ from "lodash";
|
||||||
|
import { useCallback, useState } from "react";
|
||||||
|
|
||||||
export default function AdminForumReportPosting() {
|
export default function AdminForumReportPosting() {
|
||||||
const [openDrawer, setOpenDrawer] = useState(false);
|
const [listData, setListData] = useState<any[] | null>(null);
|
||||||
const [id, setId] = useState<any>();
|
const [loadList, setLoadList] = useState<boolean>(false);
|
||||||
|
const [search, setSearch] = useState<string>("");
|
||||||
|
|
||||||
|
useFocusEffect(
|
||||||
|
useCallback(() => {
|
||||||
|
onLoadData();
|
||||||
|
}, [search])
|
||||||
|
);
|
||||||
|
|
||||||
|
const onLoadData = async () => {
|
||||||
|
try {
|
||||||
|
setLoadList(true);
|
||||||
|
|
||||||
|
const response = await apiAdminForum({
|
||||||
|
category: "report_posting",
|
||||||
|
search: search,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (response.success) {
|
||||||
|
setListData(response.data);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR]", error);
|
||||||
|
} finally {
|
||||||
|
setLoadList(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const rightComponent = (
|
const rightComponent = (
|
||||||
<SearchInput
|
<SearchInput
|
||||||
containerStyle={{ width: "100%", marginBottom: 0 }}
|
containerStyle={{ width: "100%", marginBottom: 0 }}
|
||||||
placeholder="Cari"
|
placeholder="Cari Postingan"
|
||||||
|
value={search}
|
||||||
|
onChangeText={setSearch}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -37,36 +67,49 @@ export default function AdminForumReportPosting() {
|
|||||||
rightComponent={rightComponent}
|
rightComponent={rightComponent}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<BaseBox>
|
<StackCustom gap={"sm"}>
|
||||||
<AdminTitleTable title1="Aksi" title2="Pelapor" title3="Postingan" />
|
<AdminTitleTable title1="Aksi" title2="Pelapor" title3="Postingan" />
|
||||||
<Spacing />
|
|
||||||
<Divider />
|
<Divider />
|
||||||
{Array.from({ length: 10 }).map((_, index) => (
|
{loadList ? (
|
||||||
<AdminTableValue
|
<LoaderCustom />
|
||||||
key={index}
|
) : _.isEmpty(listData) ? (
|
||||||
value1={
|
<TextCustom align="center" color="gray">
|
||||||
<ActionIcon
|
Belum ada data
|
||||||
icon={
|
</TextCustom>
|
||||||
<IconView size={ICON_SIZE_BUTTON} color={MainColor.black} />
|
) : (
|
||||||
}
|
listData?.map((item: any, index: number) => (
|
||||||
onPress={() => {
|
<AdminTableValue
|
||||||
router.push(`/admin/forum/${id}/list-report-posting`);
|
key={index}
|
||||||
}}
|
value1={
|
||||||
/>
|
<ActionIcon
|
||||||
}
|
icon={
|
||||||
value2={<TextCustom truncate={1}>Username username</TextCustom>}
|
<IconView
|
||||||
value3={
|
size={ICON_SIZE_BUTTON}
|
||||||
<TextCustom truncate={2} align="center">
|
color={MainColor.black}
|
||||||
Lorem, ipsum dolor sit amet consectetur adipisicing elit.
|
/>
|
||||||
Omnis laborum doloremque eius velit voluptate corrupti vel,
|
}
|
||||||
provident quaerat tempore animi sed accusamus amet.
|
onPress={() => {
|
||||||
Temporibus, praesentium? Rem voluptatum nesciunt voluptas
|
router.push(
|
||||||
repellat.
|
`/admin/forum/${item?.Forum_Posting?.id}/list-report-posting`
|
||||||
</TextCustom>
|
);
|
||||||
}
|
}}
|
||||||
/>
|
/>
|
||||||
))}
|
}
|
||||||
</BaseBox>
|
value2={
|
||||||
|
<TextCustom truncate={1}>
|
||||||
|
{item?.User?.username || "-"}
|
||||||
|
</TextCustom>
|
||||||
|
}
|
||||||
|
value3={
|
||||||
|
<TextCustom truncate={2} align="center">
|
||||||
|
{item?.Forum_Posting?.diskusi || "-"}
|
||||||
|
</TextCustom>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
))
|
||||||
|
)}
|
||||||
|
</StackCustom>
|
||||||
</ViewWrapper>
|
</ViewWrapper>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
/* eslint-disable react-hooks/exhaustive-deps */
|
||||||
import {
|
import {
|
||||||
AlertDefaultSystem,
|
AlertDefaultSystem,
|
||||||
BadgeCustom,
|
BadgeCustom,
|
||||||
@@ -7,17 +8,43 @@ import {
|
|||||||
Spacing,
|
Spacing,
|
||||||
StackCustom,
|
StackCustom,
|
||||||
TextCustom,
|
TextCustom,
|
||||||
ViewWrapper
|
ViewWrapper,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle";
|
import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle";
|
||||||
import AdminButtonReject from "@/components/_ShareComponent/Admin/ButtonReject";
|
import AdminButtonReject from "@/components/_ShareComponent/Admin/ButtonReject";
|
||||||
import AdminButtonReview from "@/components/_ShareComponent/Admin/ButtonReview";
|
import AdminButtonReview from "@/components/_ShareComponent/Admin/ButtonReview";
|
||||||
|
import ReportBox from "@/components/Box/ReportBox";
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
import { router, useLocalSearchParams } from "expo-router";
|
import funUpdateStatusJob from "@/screens/Admin/Job/funUpdateStatus";
|
||||||
|
import { apiAdminJobGetById } from "@/service/api-admin/api-admin-job";
|
||||||
|
import { router, useFocusEffect, useLocalSearchParams } from "expo-router";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
|
import { useCallback, useState } from "react";
|
||||||
|
import Toast from "react-native-toast-message";
|
||||||
|
|
||||||
export default function AdminJobDetailStatus() {
|
export default function AdminJobDetailStatus() {
|
||||||
const { id, status } = useLocalSearchParams();
|
const { id, status } = useLocalSearchParams();
|
||||||
|
const [data, setData] = useState<any | null>(null);
|
||||||
|
|
||||||
|
useFocusEffect(
|
||||||
|
useCallback(() => {
|
||||||
|
onLoadData();
|
||||||
|
}, [id])
|
||||||
|
);
|
||||||
|
|
||||||
|
const onLoadData = async () => {
|
||||||
|
try {
|
||||||
|
const response = await apiAdminJobGetById({
|
||||||
|
id: id as string,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (response.success) {
|
||||||
|
setData(response.data);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR]", error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const colorBadge = () => {
|
const colorBadge = () => {
|
||||||
if (status === "publish") {
|
if (status === "publish") {
|
||||||
@@ -32,11 +59,11 @@ export default function AdminJobDetailStatus() {
|
|||||||
const listData = [
|
const listData = [
|
||||||
{
|
{
|
||||||
label: "Username",
|
label: "Username",
|
||||||
value: "Bagas Banuna",
|
value: data?.Author?.username || "-",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Judul",
|
label: "Judul",
|
||||||
value: `Judul Proyek: ${id}Lorem ipsum dolor sit amet consectetur adipisicing elit.`,
|
value: data?.title || "-",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Status",
|
label: "Status",
|
||||||
@@ -48,24 +75,43 @@ export default function AdminJobDetailStatus() {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Konten",
|
label: "Konten",
|
||||||
value: "Lorem ipsum dolor sit amet consectetur adipisicing elit.",
|
value: data?.content || "-",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Deskripsi",
|
label: "Deskripsi",
|
||||||
value: "Lorem ipsum dolor sit amet consectetur adipisicing elit.",
|
value: data?.deskripsi || "-",
|
||||||
},
|
},
|
||||||
// {
|
|
||||||
// label: "Poster",
|
|
||||||
// value: (
|
|
||||||
// <ButtonCustom
|
|
||||||
// href={`/(application)/()/${id}`}
|
|
||||||
// >
|
|
||||||
// Lihat Poster
|
|
||||||
// </ButtonCustom>
|
|
||||||
// ),
|
|
||||||
// },
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
const handleUpdate = async ({
|
||||||
|
changeStatus,
|
||||||
|
}: {
|
||||||
|
changeStatus: "publish" | "review" | "reject";
|
||||||
|
}) => {
|
||||||
|
try {
|
||||||
|
const response = await funUpdateStatusJob({
|
||||||
|
id: id as string,
|
||||||
|
changeStatus,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!response.success) {
|
||||||
|
Toast.show({
|
||||||
|
type: "error",
|
||||||
|
text1: "Gagal mempublikasikan data",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Toast.show({
|
||||||
|
type: "success",
|
||||||
|
text1: "Berhasil mempublikasikan data",
|
||||||
|
});
|
||||||
|
|
||||||
|
router.back();
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR]", error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ViewWrapper
|
<ViewWrapper
|
||||||
@@ -73,8 +119,8 @@ export default function AdminJobDetailStatus() {
|
|||||||
>
|
>
|
||||||
<BaseBox>
|
<BaseBox>
|
||||||
<StackCustom>
|
<StackCustom>
|
||||||
{listData.map((item, i) => (
|
{listData?.map((item, index) => (
|
||||||
<Grid key={i}>
|
<Grid key={index}>
|
||||||
<Grid.Col
|
<Grid.Col
|
||||||
span={4}
|
span={4}
|
||||||
style={{ justifyContent: "center", paddingRight: 10 }}
|
style={{ justifyContent: "center", paddingRight: 10 }}
|
||||||
@@ -87,12 +133,19 @@ export default function AdminJobDetailStatus() {
|
|||||||
</Grid>
|
</Grid>
|
||||||
))}
|
))}
|
||||||
|
|
||||||
<TextCustom bold>Poster</TextCustom>
|
{data && data?.imageId && (
|
||||||
|
<StackCustom>
|
||||||
<DummyLandscapeImage />
|
<TextCustom bold>Poster</TextCustom>
|
||||||
|
<DummyLandscapeImage imageId={data?.imageId} />
|
||||||
|
</StackCustom>
|
||||||
|
)}
|
||||||
</StackCustom>
|
</StackCustom>
|
||||||
</BaseBox>
|
</BaseBox>
|
||||||
|
|
||||||
|
{data && data?.catatan && (status === "reject" || status === "review") && (
|
||||||
|
<ReportBox text={data?.catatan}/>
|
||||||
|
)}
|
||||||
|
|
||||||
{status === "review" && (
|
{status === "review" && (
|
||||||
<AdminButtonReview
|
<AdminButtonReview
|
||||||
onPublish={() => {
|
onPublish={() => {
|
||||||
@@ -101,24 +154,22 @@ export default function AdminJobDetailStatus() {
|
|||||||
message: "Apakah anda yakin ingin mempublikasikan data ini?",
|
message: "Apakah anda yakin ingin mempublikasikan data ini?",
|
||||||
textLeft: "Batal",
|
textLeft: "Batal",
|
||||||
textRight: "Ya",
|
textRight: "Ya",
|
||||||
onPressLeft: () => {
|
|
||||||
router.back();
|
|
||||||
},
|
|
||||||
onPressRight: () => {
|
onPressRight: () => {
|
||||||
router.back();
|
handleUpdate({ changeStatus: "publish" });
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
onReject={() => {
|
onReject={() => {
|
||||||
router.push(`/admin/job/${id}/reject-input`);
|
router.push(`/admin/job/${id}/${status}/reject-input`);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{status === "reject" && (
|
{status === "reject" && (
|
||||||
<AdminButtonReject
|
<AdminButtonReject
|
||||||
title="Tambah Catatan"
|
title="Tambah Catatan"
|
||||||
onReject={() => {
|
onReject={() => {
|
||||||
router.push(`/admin/job/${id}/reject-input`);
|
router.push(`/admin/job/${id}/${status}/reject-input`);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|||||||
115
app/(application)/admin/job/[id]/[status]/reject-input.tsx
Normal file
115
app/(application)/admin/job/[id]/[status]/reject-input.tsx
Normal file
@@ -0,0 +1,115 @@
|
|||||||
|
/* eslint-disable react-hooks/exhaustive-deps */
|
||||||
|
import {
|
||||||
|
AlertDefaultSystem,
|
||||||
|
BoxButtonOnFooter,
|
||||||
|
TextAreaCustom,
|
||||||
|
ViewWrapper,
|
||||||
|
} from "@/components";
|
||||||
|
import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle";
|
||||||
|
import AdminButtonReject from "@/components/_ShareComponent/Admin/ButtonReject";
|
||||||
|
import funUpdateStatusJob from "@/screens/Admin/Job/funUpdateStatus";
|
||||||
|
import { apiAdminJobGetById } from "@/service/api-admin/api-admin-job";
|
||||||
|
import { router, useFocusEffect, useLocalSearchParams } from "expo-router";
|
||||||
|
import { useCallback, useState } from "react";
|
||||||
|
import Toast from "react-native-toast-message";
|
||||||
|
|
||||||
|
export default function AdminJobRejectInput() {
|
||||||
|
const { id, status } = useLocalSearchParams();
|
||||||
|
const [data, setData] = useState<any | null>(null);
|
||||||
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
|
|
||||||
|
useFocusEffect(
|
||||||
|
useCallback(() => {
|
||||||
|
onLoadData();
|
||||||
|
}, [id])
|
||||||
|
);
|
||||||
|
|
||||||
|
const onLoadData = async () => {
|
||||||
|
try {
|
||||||
|
const response = await apiAdminJobGetById({
|
||||||
|
id: id as string,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (response.success) {
|
||||||
|
setData(response.data.catatan);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR]", error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleUpdate = async ({
|
||||||
|
changeStatus,
|
||||||
|
}: {
|
||||||
|
changeStatus: "publish" | "review" | "reject";
|
||||||
|
}) => {
|
||||||
|
try {
|
||||||
|
setIsLoading(true);
|
||||||
|
const response = await funUpdateStatusJob({
|
||||||
|
id: id as string,
|
||||||
|
changeStatus,
|
||||||
|
data: data,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!response.success) {
|
||||||
|
Toast.show({
|
||||||
|
type: "error",
|
||||||
|
text1: "Report gagal",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Toast.show({
|
||||||
|
type: "success",
|
||||||
|
text1: "Report berhasil",
|
||||||
|
});
|
||||||
|
|
||||||
|
if (status === "review") {
|
||||||
|
router.replace(`/admin/job/reject/status`);
|
||||||
|
} else if (status === "reject") {
|
||||||
|
router.back();
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR]", error);
|
||||||
|
} finally {
|
||||||
|
setIsLoading(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const buttonSubmit = (
|
||||||
|
<BoxButtonOnFooter>
|
||||||
|
<AdminButtonReject
|
||||||
|
isLoading={isLoading}
|
||||||
|
title="Report"
|
||||||
|
onReject={() =>
|
||||||
|
AlertDefaultSystem({
|
||||||
|
title: "Reject",
|
||||||
|
message: "Apakah anda yakin ingin menolak data ini?",
|
||||||
|
textLeft: "Batal",
|
||||||
|
textRight: "Ya",
|
||||||
|
onPressRight: () => {
|
||||||
|
handleUpdate({ changeStatus: "reject" });
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</BoxButtonOnFooter>
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<ViewWrapper
|
||||||
|
footerComponent={buttonSubmit}
|
||||||
|
headerComponent={<AdminBackButtonAntTitle title="Penolakan Job" />}
|
||||||
|
>
|
||||||
|
<TextAreaCustom
|
||||||
|
value={data}
|
||||||
|
onChangeText={setData}
|
||||||
|
placeholder="Masukan alasan"
|
||||||
|
required
|
||||||
|
showCount
|
||||||
|
maxLength={1000}
|
||||||
|
/>
|
||||||
|
</ViewWrapper>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,55 +0,0 @@
|
|||||||
import {
|
|
||||||
AlertDefaultSystem,
|
|
||||||
BoxButtonOnFooter,
|
|
||||||
TextAreaCustom,
|
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
|
||||||
import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle";
|
|
||||||
import AdminButtonReject from "@/components/_ShareComponent/Admin/ButtonReject";
|
|
||||||
import { router, useLocalSearchParams } from "expo-router";
|
|
||||||
import { useState } from "react";
|
|
||||||
|
|
||||||
export default function AdminJobRejectInput() {
|
|
||||||
const { id } = useLocalSearchParams();
|
|
||||||
const [value, setValue] = useState(id as string);
|
|
||||||
const buttonSubmit = (
|
|
||||||
<BoxButtonOnFooter>
|
|
||||||
<AdminButtonReject
|
|
||||||
title="Reject"
|
|
||||||
onReject={() =>
|
|
||||||
AlertDefaultSystem({
|
|
||||||
title: "Reject",
|
|
||||||
message: "Apakah anda yakin ingin menolak data ini?",
|
|
||||||
textLeft: "Batal",
|
|
||||||
textRight: "Ya",
|
|
||||||
onPressLeft: () => {
|
|
||||||
router.back();
|
|
||||||
},
|
|
||||||
onPressRight: () => {
|
|
||||||
console.log("value:", value);
|
|
||||||
router.replace(`/admin/job/reject/status`);
|
|
||||||
},
|
|
||||||
})
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</BoxButtonOnFooter>
|
|
||||||
);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ViewWrapper
|
|
||||||
footerComponent={buttonSubmit}
|
|
||||||
headerComponent={<AdminBackButtonAntTitle title="Penolakan Job" />}
|
|
||||||
>
|
|
||||||
<TextAreaCustom
|
|
||||||
value={value}
|
|
||||||
onChangeText={setValue}
|
|
||||||
placeholder="Masukan alasan"
|
|
||||||
required
|
|
||||||
showCount
|
|
||||||
maxLength={1000}
|
|
||||||
/>
|
|
||||||
</ViewWrapper>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -21,8 +21,6 @@ import { Divider } from "react-native-paper";
|
|||||||
|
|
||||||
export default function AdminJobStatus() {
|
export default function AdminJobStatus() {
|
||||||
const { status } = useLocalSearchParams();
|
const { status } = useLocalSearchParams();
|
||||||
console.log("[STATUS]", status);
|
|
||||||
|
|
||||||
const [list, setList] = useState<any | null>(null);
|
const [list, setList] = useState<any | null>(null);
|
||||||
const [loadList, setLoadList] = useState(false);
|
const [loadList, setLoadList] = useState(false);
|
||||||
const [search, setSearch] = useState("");
|
const [search, setSearch] = useState("");
|
||||||
@@ -41,8 +39,6 @@ export default function AdminJobStatus() {
|
|||||||
search,
|
search,
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log("[RESPONSE >>]", JSON.stringify(response, null, 2));
|
|
||||||
|
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
setList(response.data);
|
setList(response.data);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
/* eslint-disable react-hooks/exhaustive-deps */
|
||||||
import {
|
import {
|
||||||
AlertDefaultSystem,
|
AlertDefaultSystem,
|
||||||
BadgeCustom,
|
BadgeCustom,
|
||||||
@@ -13,90 +14,153 @@ import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButt
|
|||||||
import AdminButtonReject from "@/components/_ShareComponent/Admin/ButtonReject";
|
import AdminButtonReject from "@/components/_ShareComponent/Admin/ButtonReject";
|
||||||
import AdminButtonReview from "@/components/_ShareComponent/Admin/ButtonReview";
|
import AdminButtonReview from "@/components/_ShareComponent/Admin/ButtonReview";
|
||||||
import { GridDetail_4_8 } from "@/components/_ShareComponent/GridDetail_4_8";
|
import { GridDetail_4_8 } from "@/components/_ShareComponent/GridDetail_4_8";
|
||||||
|
import ReportBox from "@/components/Box/ReportBox";
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
|
import funUpdateStatusVoting from "@/screens/Admin/Voting/funUpdateStatus";
|
||||||
|
import { apiAdminVotingById } from "@/service/api-admin/api-admin-voting";
|
||||||
|
import { colorBadge } from "@/utils/colorBadge";
|
||||||
|
import { dateTimeView } from "@/utils/dateTimeView";
|
||||||
|
import { Entypo } from "@expo/vector-icons";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import { router, useLocalSearchParams } from "expo-router";
|
import { router, useFocusEffect, useLocalSearchParams } from "expo-router";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
|
import { useCallback, useState } from "react";
|
||||||
import { List } from "react-native-paper";
|
import { List } from "react-native-paper";
|
||||||
|
import Toast from "react-native-toast-message";
|
||||||
|
|
||||||
export default function AdminVotingDetail() {
|
export default function AdminVotingDetail() {
|
||||||
const { id, status } = useLocalSearchParams();
|
const { id, status } = useLocalSearchParams();
|
||||||
|
const [data, setData] = useState<any | null>(null);
|
||||||
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
|
|
||||||
const colorBadge = () => {
|
console.log("[status]", status);
|
||||||
if (status === "publish") {
|
|
||||||
return MainColor.green;
|
useFocusEffect(
|
||||||
} else if (status === "review") {
|
useCallback(() => {
|
||||||
return MainColor.orange;
|
onLoadData();
|
||||||
} else if (status === "reject") {
|
}, [id])
|
||||||
return MainColor.red;
|
);
|
||||||
} else {
|
|
||||||
return MainColor.placeholder;
|
const onLoadData = async () => {
|
||||||
|
try {
|
||||||
|
const response = await apiAdminVotingById({
|
||||||
|
id: id as string,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (response.success) {
|
||||||
|
setData(response.data);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR]", error);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const listData = [
|
const listData = [
|
||||||
{
|
{
|
||||||
label: "Username",
|
label: "Username",
|
||||||
value: "Bagas Banuna",
|
value: (data && data?.Author?.username) || "-",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Judul",
|
label: "Judul",
|
||||||
value: `Judul Proyek: ${id}Lorem ipsum dolor sit amet consectetur adipisicing elit.`,
|
value: (data && data?.title) || "-",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Status",
|
label: "Status",
|
||||||
value: (
|
value:
|
||||||
<BadgeCustom color={colorBadge()}>
|
data && data?.Voting_Status?.name ? (
|
||||||
{_.startCase(status as string)}
|
<BadgeCustom color={colorBadge({ status: status as string })}>
|
||||||
</BadgeCustom>
|
{status === "history" ? "Riwayat" : _.startCase(status as string)}
|
||||||
),
|
</BadgeCustom>
|
||||||
|
) : (
|
||||||
|
"-"
|
||||||
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Mulai Voting",
|
label: "Mulai Voting",
|
||||||
value: dayjs().format("DD/MM/YYYY"),
|
value:
|
||||||
|
(data && data?.awalVote && dateTimeView({ date: data?.awalVote })) ||
|
||||||
|
"-",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Voting Berakhir",
|
label: "Voting Berakhir",
|
||||||
value: dayjs().format("DD/MM/YYYY"),
|
value:
|
||||||
|
(data && data?.akhirVote && dateTimeView({ date: data?.akhirVote })) ||
|
||||||
|
"-",
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
label: "Deskripsi",
|
label: "Deskripsi",
|
||||||
value: "Lorem ipsum dolor sit amet consectetur adipisicing elit.",
|
value: (data && data?.deskripsi) || "-",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Daftar Pilhan",
|
label: "Daftar Pilihan",
|
||||||
value: (
|
value:
|
||||||
<>
|
data && data?.Voting_DaftarNamaVote
|
||||||
<List.Item
|
? data?.Voting_DaftarNamaVote?.map((item: any, i: number) => (
|
||||||
title={<TextCustom>Pilihan 1</TextCustom>}
|
<List.Item
|
||||||
left={(props) => (
|
key={i}
|
||||||
<List.Icon {...props} icon="circle" color={MainColor.yellow} />
|
title={<TextCustom>{item?.value}</TextCustom>}
|
||||||
)}
|
left={(props) => (
|
||||||
/>
|
<Entypo name="chevron-right" color={MainColor.yellow} />
|
||||||
<List.Item
|
)}
|
||||||
title={<TextCustom>Pilihan 2</TextCustom>}
|
/>
|
||||||
left={(props) => (
|
))
|
||||||
<List.Icon {...props} icon="circle" color={MainColor.yellow} />
|
: "-",
|
||||||
)}
|
|
||||||
/>
|
|
||||||
<List.Item
|
|
||||||
title={<TextCustom>Pilihan 3</TextCustom>}
|
|
||||||
left={(props) => (
|
|
||||||
<List.Icon {...props} icon="circle" color={MainColor.yellow} />
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
<List.Item
|
|
||||||
title={<TextCustom>Pilihan 4</TextCustom>}
|
|
||||||
left={(props) => (
|
|
||||||
<List.Icon {...props} icon="circle" color={MainColor.yellow} />
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
),
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
const handleUpdate = async ({
|
||||||
|
changeStatus,
|
||||||
|
}: {
|
||||||
|
changeStatus: "publish" | "review" | "reject";
|
||||||
|
}) => {
|
||||||
|
try {
|
||||||
|
const dateNow = new Date();
|
||||||
|
// const dateNowHour = dateNow.getHours();
|
||||||
|
// const awalVoteHour = dayjs(data?.awalVote).hour();
|
||||||
|
|
||||||
|
const isBefore = dayjs(dateNow).diff(dayjs(data?.awalVote), "hours") < 0;
|
||||||
|
console.log("[IS BEFORE]", isBefore);
|
||||||
|
|
||||||
|
if (!isBefore) {
|
||||||
|
Toast.show({
|
||||||
|
type: "error",
|
||||||
|
text1: "Tanggal & waktu telah lewat",
|
||||||
|
text2: "Silahkan report dan ubah tanggal & waktu voting",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Toast.show({
|
||||||
|
type: "success",
|
||||||
|
text1: "Berhasil mempublikasikan data",
|
||||||
|
});
|
||||||
|
|
||||||
|
setIsLoading(true);
|
||||||
|
const response = await funUpdateStatusVoting({
|
||||||
|
id: id as string,
|
||||||
|
changeStatus,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!response.success) {
|
||||||
|
Toast.show({
|
||||||
|
type: "error",
|
||||||
|
text1: "Gagal mempublikasikan data",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Toast.show({
|
||||||
|
type: "success",
|
||||||
|
text1: "Berhasil mempublikasikan data",
|
||||||
|
});
|
||||||
|
|
||||||
|
router.back();
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR]", error);
|
||||||
|
} finally {
|
||||||
|
setIsLoading(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ViewWrapper
|
<ViewWrapper
|
||||||
@@ -114,46 +178,59 @@ export default function AdminVotingDetail() {
|
|||||||
</StackCustom>
|
</StackCustom>
|
||||||
</BaseBox>
|
</BaseBox>
|
||||||
|
|
||||||
{status === "publish" && (
|
{status === "publish" ||
|
||||||
<BaseBox>
|
(status === "history" && (
|
||||||
<TextCustom bold align="center">
|
<BaseBox>
|
||||||
Hasil Voting
|
<TextCustom bold align="center">
|
||||||
</TextCustom>
|
Hasil Voting
|
||||||
<Spacing />
|
</TextCustom>
|
||||||
<Grid>
|
<Spacing />
|
||||||
|
<Grid>
|
||||||
{Array.from({length: 4}).map((_, index) => (
|
{data?.Voting_DaftarNamaVote?.map(
|
||||||
<Grid.Col key={index} span={3} style={{ paddingRight: 3, paddingLeft: 3 }}>
|
(item: any, index: number) => (
|
||||||
<StackCustom gap={"sm"}>
|
<Grid.Col
|
||||||
<CircleContainer value={index % 3 * 3} style={{ alignSelf: "center" }} />
|
key={index}
|
||||||
<TextCustom size="small" align="center">
|
span={12 / data?.Voting_DaftarNamaVote?.length}
|
||||||
Pilihan {index + 1}
|
style={{ paddingRight: 3, paddingLeft: 3 }}
|
||||||
</TextCustom>
|
>
|
||||||
</StackCustom>
|
<StackCustom gap={"sm"}>
|
||||||
</Grid.Col>
|
<CircleContainer
|
||||||
))}
|
value={item?.jumlah}
|
||||||
</Grid>
|
style={{ alignSelf: "center" }}
|
||||||
</BaseBox>
|
/>
|
||||||
)}
|
<TextCustom size="small" align="center">
|
||||||
|
{item?.value}
|
||||||
|
</TextCustom>
|
||||||
|
</StackCustom>
|
||||||
|
</Grid.Col>
|
||||||
|
)
|
||||||
|
)}
|
||||||
|
</Grid>
|
||||||
|
</BaseBox>
|
||||||
|
))}
|
||||||
|
|
||||||
|
{data &&
|
||||||
|
data?.catatan &&
|
||||||
|
(status === "review" || status === "reject") && (
|
||||||
|
<ReportBox text={data?.catatan} />
|
||||||
|
)}
|
||||||
|
|
||||||
{status === "review" && (
|
{status === "review" && (
|
||||||
<AdminButtonReview
|
<AdminButtonReview
|
||||||
|
isLoading={isLoading}
|
||||||
onPublish={() => {
|
onPublish={() => {
|
||||||
AlertDefaultSystem({
|
AlertDefaultSystem({
|
||||||
title: "Publish",
|
title: "Publish",
|
||||||
message: "Apakah anda yakin ingin mempublikasikan data ini?",
|
message: "Apakah anda yakin ingin mempublikasikan data ini?",
|
||||||
textLeft: "Cancel",
|
textLeft: "Cancel",
|
||||||
textRight: "Publish",
|
textRight: "Publish",
|
||||||
onPressLeft: () => {
|
|
||||||
router.back();
|
|
||||||
},
|
|
||||||
onPressRight: () => {
|
onPressRight: () => {
|
||||||
router.back();
|
handleUpdate({ changeStatus: "publish" });
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
onReject={() => {
|
onReject={() => {
|
||||||
router.push(`/admin/voting/${id}/reject-input`);
|
router.push(`/admin/voting/${id}/${status}/reject-input`);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
@@ -162,7 +239,7 @@ export default function AdminVotingDetail() {
|
|||||||
<AdminButtonReject
|
<AdminButtonReject
|
||||||
title="Tambah Catatan"
|
title="Tambah Catatan"
|
||||||
onReject={() => {
|
onReject={() => {
|
||||||
router.push(`/admin/voting/${id}/reject-input`);
|
router.push(`/admin/voting/${id}/${status}/reject-input`);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|||||||
113
app/(application)/admin/voting/[id]/[status]/reject-input.tsx
Normal file
113
app/(application)/admin/voting/[id]/[status]/reject-input.tsx
Normal file
@@ -0,0 +1,113 @@
|
|||||||
|
/* eslint-disable react-hooks/exhaustive-deps */
|
||||||
|
import {
|
||||||
|
AlertDefaultSystem,
|
||||||
|
BoxButtonOnFooter,
|
||||||
|
TextAreaCustom,
|
||||||
|
ViewWrapper,
|
||||||
|
} from "@/components";
|
||||||
|
import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle";
|
||||||
|
import AdminButtonReject from "@/components/_ShareComponent/Admin/ButtonReject";
|
||||||
|
import funUpdateStatusVoting from "@/screens/Admin/Voting/funUpdateStatus";
|
||||||
|
import { apiAdminVotingById } from "@/service/api-admin/api-admin-voting";
|
||||||
|
import { router, useFocusEffect, useLocalSearchParams } from "expo-router";
|
||||||
|
import { useCallback, useState } from "react";
|
||||||
|
import Toast from "react-native-toast-message";
|
||||||
|
|
||||||
|
export default function AdminVotingRejectInput() {
|
||||||
|
const { id, status } = useLocalSearchParams();
|
||||||
|
const [data, setData] = useState("");
|
||||||
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
|
|
||||||
|
useFocusEffect(
|
||||||
|
useCallback(() => {
|
||||||
|
onLoadData();
|
||||||
|
}, [id])
|
||||||
|
);
|
||||||
|
|
||||||
|
const onLoadData = async () => {
|
||||||
|
try {
|
||||||
|
const response = await apiAdminVotingById({
|
||||||
|
id: id as string,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (response.success) {
|
||||||
|
setData(response.data.catatan);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR]", error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleUpdate = async ({
|
||||||
|
changeStatus,
|
||||||
|
}: {
|
||||||
|
changeStatus: "publish" | "review" | "reject";
|
||||||
|
}) => {
|
||||||
|
try {
|
||||||
|
setIsLoading(true);
|
||||||
|
const response = await funUpdateStatusVoting({
|
||||||
|
id: id as string,
|
||||||
|
changeStatus,
|
||||||
|
data: data,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!response.success) {
|
||||||
|
Toast.show({
|
||||||
|
type: "error",
|
||||||
|
text1: "Report gagal",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Toast.show({
|
||||||
|
type: "success",
|
||||||
|
text1: "Report berhasil",
|
||||||
|
});
|
||||||
|
|
||||||
|
if (status === "review") {
|
||||||
|
router.replace(`/admin/voting/reject/status`);
|
||||||
|
} else if (status === "reject") {
|
||||||
|
router.back();
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR]", error);
|
||||||
|
} finally {
|
||||||
|
setIsLoading(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const buttonSubmit = (
|
||||||
|
<BoxButtonOnFooter>
|
||||||
|
<AdminButtonReject
|
||||||
|
title="Reject"
|
||||||
|
isLoading={isLoading}
|
||||||
|
onReject={() =>
|
||||||
|
AlertDefaultSystem({
|
||||||
|
title: "Reject",
|
||||||
|
message: "Apakah anda yakin ingin menolak data ini?",
|
||||||
|
textLeft: "Batal",
|
||||||
|
textRight: "Ya",
|
||||||
|
onPressRight: () => handleUpdate({ changeStatus: "reject" }),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</BoxButtonOnFooter>
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<ViewWrapper
|
||||||
|
footerComponent={buttonSubmit}
|
||||||
|
headerComponent={<AdminBackButtonAntTitle title="Penolakan Voting" />}
|
||||||
|
>
|
||||||
|
<TextAreaCustom
|
||||||
|
value={data}
|
||||||
|
onChangeText={setData}
|
||||||
|
placeholder="Masukan alasan"
|
||||||
|
required
|
||||||
|
showCount
|
||||||
|
maxLength={1000}
|
||||||
|
/>
|
||||||
|
</ViewWrapper>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,55 +0,0 @@
|
|||||||
import {
|
|
||||||
AlertDefaultSystem,
|
|
||||||
BoxButtonOnFooter,
|
|
||||||
TextAreaCustom,
|
|
||||||
ViewWrapper,
|
|
||||||
} from "@/components";
|
|
||||||
import AdminBackButtonAntTitle from "@/components/_ShareComponent/Admin/BackButtonAntTitle";
|
|
||||||
import AdminButtonReject from "@/components/_ShareComponent/Admin/ButtonReject";
|
|
||||||
import { router, useLocalSearchParams } from "expo-router";
|
|
||||||
import { useState } from "react";
|
|
||||||
|
|
||||||
export default function AdminVotingRejectInput() {
|
|
||||||
const { id } = useLocalSearchParams();
|
|
||||||
const [value, setValue] = useState(id as string);
|
|
||||||
const buttonSubmit = (
|
|
||||||
<BoxButtonOnFooter>
|
|
||||||
<AdminButtonReject
|
|
||||||
title="Reject"
|
|
||||||
onReject={() =>
|
|
||||||
AlertDefaultSystem({
|
|
||||||
title: "Reject",
|
|
||||||
message: "Apakah anda yakin ingin menolak data ini?",
|
|
||||||
textLeft: "Batal",
|
|
||||||
textRight: "Ya",
|
|
||||||
onPressLeft: () => {
|
|
||||||
router.back();
|
|
||||||
},
|
|
||||||
onPressRight: () => {
|
|
||||||
console.log("value:", value);
|
|
||||||
router.replace(`/admin/voting/reject/status`);
|
|
||||||
},
|
|
||||||
})
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
</BoxButtonOnFooter>
|
|
||||||
);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ViewWrapper
|
|
||||||
footerComponent={buttonSubmit}
|
|
||||||
headerComponent={<AdminBackButtonAntTitle title="Penolakan Voting" />}
|
|
||||||
>
|
|
||||||
<TextAreaCustom
|
|
||||||
value={value}
|
|
||||||
onChangeText={setValue}
|
|
||||||
placeholder="Masukan alasan"
|
|
||||||
required
|
|
||||||
showCount
|
|
||||||
maxLength={1000}
|
|
||||||
/>
|
|
||||||
</ViewWrapper>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,27 +1,60 @@
|
|||||||
|
/* eslint-disable react-hooks/exhaustive-deps */
|
||||||
import {
|
import {
|
||||||
ActionIcon,
|
ActionIcon,
|
||||||
BaseBox,
|
LoaderCustom,
|
||||||
SearchInput,
|
SearchInput,
|
||||||
Spacing,
|
StackCustom,
|
||||||
TextCustom,
|
TextCustom,
|
||||||
ViewWrapper,
|
ViewWrapper,
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import AdminComp_BoxTitle from "@/components/_ShareComponent/Admin/BoxTitlePage";
|
import AdminComp_BoxTitle from "@/components/_ShareComponent/Admin/BoxTitlePage";
|
||||||
import AdminTitleTable from "@/components/_ShareComponent/Admin/TableTitle";
|
import AdminTitleTable from "@/components/_ShareComponent/Admin/TableTitle";
|
||||||
import AdminTableValue from "@/components/_ShareComponent/Admin/TableValue";
|
import AdminTableValue from "@/components/_ShareComponent/Admin/TableValue";
|
||||||
import AdminTitlePage from "@/components/_ShareComponent/Admin/TitlePage";
|
import AdminTitlePage from "@/components/_ShareComponent/Admin/TitlePage";
|
||||||
import { ICON_SIZE_BUTTON } from "@/constants/constans-value";
|
import { ICON_SIZE_BUTTON } from "@/constants/constans-value";
|
||||||
|
import { apiAdminVoting } from "@/service/api-admin/api-admin-voting";
|
||||||
import { Octicons } from "@expo/vector-icons";
|
import { Octicons } from "@expo/vector-icons";
|
||||||
import { router, useLocalSearchParams } from "expo-router";
|
import { router, useFocusEffect, useLocalSearchParams } from "expo-router";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
|
import { useCallback, useState } from "react";
|
||||||
import { Divider } from "react-native-paper";
|
import { Divider } from "react-native-paper";
|
||||||
|
|
||||||
export default function AdminVotingStatus() {
|
export default function AdminVotingStatus() {
|
||||||
const { status } = useLocalSearchParams();
|
const { status } = useLocalSearchParams();
|
||||||
|
const [list, setList] = useState<any | null>(null);
|
||||||
|
const [loadList, setLoadList] = useState(false);
|
||||||
|
const [search, setSearch] = useState<string>("");
|
||||||
|
|
||||||
|
useFocusEffect(
|
||||||
|
useCallback(() => {
|
||||||
|
onLoadData();
|
||||||
|
}, [status, search])
|
||||||
|
);
|
||||||
|
|
||||||
|
const onLoadData = async () => {
|
||||||
|
try {
|
||||||
|
setLoadList(true);
|
||||||
|
const response = await apiAdminVoting({
|
||||||
|
category: status as "publish" | "review" | "reject" as any,
|
||||||
|
search,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (response.success) {
|
||||||
|
setList(response.data);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR]", error);
|
||||||
|
} finally {
|
||||||
|
setLoadList(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const rightComponent = (
|
const rightComponent = (
|
||||||
<SearchInput
|
<SearchInput
|
||||||
containerStyle={{ width: "100%", marginBottom: 0 }}
|
containerStyle={{ width: "100%", marginBottom: 0 }}
|
||||||
placeholder="Cari"
|
placeholder="Cari"
|
||||||
|
value={search}
|
||||||
|
onChangeText={setSearch}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
return (
|
return (
|
||||||
@@ -32,44 +65,52 @@ export default function AdminVotingStatus() {
|
|||||||
rightComponent={rightComponent}
|
rightComponent={rightComponent}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<BaseBox>
|
<StackCustom gap={"sm"}>
|
||||||
<AdminTitleTable
|
<AdminTitleTable
|
||||||
title1="Aksi"
|
title1="Aksi"
|
||||||
title2="Username"
|
title2="Username"
|
||||||
title3="Judul Voting"
|
title3="Judul Voting"
|
||||||
/>
|
/>
|
||||||
<Spacing />
|
|
||||||
<Divider />
|
<Divider />
|
||||||
|
|
||||||
{Array.from({ length: 10 }).map((_, index) => (
|
{loadList ? (
|
||||||
<AdminTableValue
|
<LoaderCustom />
|
||||||
key={index}
|
) : _.isEmpty(list) ? (
|
||||||
value1={
|
<TextCustom align="center" bold color="gray">
|
||||||
<ActionIcon
|
Belum ada data
|
||||||
icon={
|
</TextCustom>
|
||||||
<Octicons
|
) : (
|
||||||
name="eye"
|
list.map((item: any, i: number) => (
|
||||||
size={ICON_SIZE_BUTTON}
|
<AdminTableValue
|
||||||
color="black"
|
key={i}
|
||||||
/>
|
value1={
|
||||||
}
|
<ActionIcon
|
||||||
onPress={() => {
|
icon={
|
||||||
router.push(`/admin/voting/${index}/${status}`);
|
<Octicons
|
||||||
}}
|
name="eye"
|
||||||
/>
|
size={ICON_SIZE_BUTTON}
|
||||||
}
|
color="black"
|
||||||
value2={<TextCustom truncate={1}>Username username</TextCustom>}
|
/>
|
||||||
value3={
|
}
|
||||||
<TextCustom truncate={2}>
|
onPress={() => {
|
||||||
Lorem ipsum dolor sit amet consectetur adipisicing elit.
|
router.push(`/admin/voting/${item.id}/${status}`);
|
||||||
Blanditiis asperiores quidem deleniti architecto eaque et
|
}}
|
||||||
nostrum, ad consequuntur eveniet quisquam quae voluptatum
|
/>
|
||||||
ducimus! Dolorem nobis modi officia debitis, beatae mollitia.
|
}
|
||||||
</TextCustom>
|
value2={
|
||||||
}
|
<TextCustom truncate={1}>
|
||||||
/>
|
{item?.Author?.username || "-"}
|
||||||
))}
|
</TextCustom>
|
||||||
</BaseBox>
|
}
|
||||||
|
value3={
|
||||||
|
<TextCustom align="center" truncate={2}>
|
||||||
|
{item?.title || "-"}
|
||||||
|
</TextCustom>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
))
|
||||||
|
)}
|
||||||
|
</StackCustom>
|
||||||
</ViewWrapper>
|
</ViewWrapper>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
104
app/(application)/admin/voting/history.tsx
Normal file
104
app/(application)/admin/voting/history.tsx
Normal file
@@ -0,0 +1,104 @@
|
|||||||
|
/* eslint-disable react-hooks/exhaustive-deps */
|
||||||
|
import {
|
||||||
|
ActionIcon,
|
||||||
|
LoaderCustom,
|
||||||
|
SearchInput,
|
||||||
|
StackCustom,
|
||||||
|
TextCustom,
|
||||||
|
ViewWrapper
|
||||||
|
} from "@/components";
|
||||||
|
import AdminComp_BoxTitle from "@/components/_ShareComponent/Admin/BoxTitlePage";
|
||||||
|
import AdminTitleTable from "@/components/_ShareComponent/Admin/TableTitle";
|
||||||
|
import AdminTableValue from "@/components/_ShareComponent/Admin/TableValue";
|
||||||
|
import AdminTitlePage from "@/components/_ShareComponent/Admin/TitlePage";
|
||||||
|
import { ICON_SIZE_BUTTON } from "@/constants/constans-value";
|
||||||
|
import { apiAdminVoting } from "@/service/api-admin/api-admin-voting";
|
||||||
|
import { Octicons } from "@expo/vector-icons";
|
||||||
|
import { router, useFocusEffect } from "expo-router";
|
||||||
|
import _ from "lodash";
|
||||||
|
import { useCallback, useState } from "react";
|
||||||
|
import { Divider } from "react-native-paper";
|
||||||
|
|
||||||
|
export default function AdminVotingHistory() {
|
||||||
|
const [list, setList] = useState<any | null>(null);
|
||||||
|
const [loadList, setLoadList] = useState(false);
|
||||||
|
const [search, setSearch] = useState<string>("");
|
||||||
|
|
||||||
|
useFocusEffect(
|
||||||
|
useCallback(() => {
|
||||||
|
onLoadData();
|
||||||
|
}, [ search])
|
||||||
|
);
|
||||||
|
|
||||||
|
const onLoadData = async () => {
|
||||||
|
try {
|
||||||
|
setLoadList(true);
|
||||||
|
const response = await apiAdminVoting({
|
||||||
|
category: "history",
|
||||||
|
search,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (response.success) {
|
||||||
|
setList(response.data);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR]", error);
|
||||||
|
} finally {
|
||||||
|
setLoadList(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const rightComponent = (
|
||||||
|
<SearchInput
|
||||||
|
containerStyle={{ width: "100%", marginBottom: 0 }}
|
||||||
|
placeholder="Cari"
|
||||||
|
value={search}
|
||||||
|
onChangeText={setSearch}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<ViewWrapper headerComponent={<AdminTitlePage title="Voting" />}>
|
||||||
|
<AdminComp_BoxTitle
|
||||||
|
title="Riwayat"
|
||||||
|
rightComponent={rightComponent}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<StackCustom gap={"sm"}>
|
||||||
|
<AdminTitleTable
|
||||||
|
title1="Aksi"
|
||||||
|
title2="Username"
|
||||||
|
title3="Judul Voting"
|
||||||
|
/>
|
||||||
|
<Divider />
|
||||||
|
|
||||||
|
{loadList ? <LoaderCustom/> : _.isEmpty(list) ? <TextCustom align="center" bold color="gray">Belum ada data</TextCustom> : list.map((item: any, i: number) => (
|
||||||
|
<AdminTableValue
|
||||||
|
key={i}
|
||||||
|
value1={
|
||||||
|
<ActionIcon
|
||||||
|
icon={
|
||||||
|
<Octicons
|
||||||
|
name="eye"
|
||||||
|
size={ICON_SIZE_BUTTON}
|
||||||
|
color="black"
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
onPress={() => {
|
||||||
|
router.push(`/admin/voting/${item.id}/history`);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
value2={<TextCustom truncate={1}>{item?.Author?.username || "-"}</TextCustom>}
|
||||||
|
value3={
|
||||||
|
<TextCustom align="center" truncate={2}>
|
||||||
|
{item?.title || "-"}
|
||||||
|
</TextCustom>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</StackCustom>
|
||||||
|
</ViewWrapper>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -8,8 +8,56 @@ import {
|
|||||||
import AdminComp_BoxDashboard from "@/components/_ShareComponent/Admin/BoxDashboard";
|
import AdminComp_BoxDashboard from "@/components/_ShareComponent/Admin/BoxDashboard";
|
||||||
import AdminTitlePage from "@/components/_ShareComponent/Admin/TitlePage";
|
import AdminTitlePage from "@/components/_ShareComponent/Admin/TitlePage";
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
|
import { apiAdminVoting } from "@/service/api-admin/api-admin-voting";
|
||||||
|
import { useFocusEffect } from "expo-router";
|
||||||
|
import { useCallback, useState } from "react";
|
||||||
|
|
||||||
export default function AdminVoting() {
|
export default function AdminVoting() {
|
||||||
|
const [data, setData] = useState<any | null>(null);
|
||||||
|
|
||||||
|
useFocusEffect(
|
||||||
|
useCallback(() => {
|
||||||
|
onLoadData();
|
||||||
|
}, [])
|
||||||
|
);
|
||||||
|
|
||||||
|
const onLoadData = async () => {
|
||||||
|
try {
|
||||||
|
const response = await apiAdminVoting({
|
||||||
|
category: "dashboard",
|
||||||
|
});
|
||||||
|
|
||||||
|
if (response.success) {
|
||||||
|
setData(response.data);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR]", error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const listData = [
|
||||||
|
{
|
||||||
|
label: "Publish",
|
||||||
|
value: (data && data?.publish) || 0,
|
||||||
|
icon: <IconPublish size={25} color={MainColor.green} />,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Review",
|
||||||
|
value: (data && data?.review) || 0,
|
||||||
|
icon: <IconReview size={25} color={MainColor.orange} />,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Reject",
|
||||||
|
value: (data && data?.reject) || 0,
|
||||||
|
icon: <IconReject size={25} color={MainColor.red} />,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Riwayat",
|
||||||
|
value: (data && data?.history) || 0,
|
||||||
|
icon: <IconArchive size={25} color={MainColor.white_gray} />,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ViewWrapper>
|
<ViewWrapper>
|
||||||
@@ -24,26 +72,3 @@ export default function AdminVoting() {
|
|||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const listData = [
|
|
||||||
{
|
|
||||||
label: "Publish",
|
|
||||||
value: 4,
|
|
||||||
icon: <IconPublish size={25} color={MainColor.green} />,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "Review",
|
|
||||||
value: 7,
|
|
||||||
icon: <IconReview size={25} color={MainColor.orange} />,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "Reject",
|
|
||||||
value: 5,
|
|
||||||
icon: <IconReject size={25} color={MainColor.red} />,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "Riwayat",
|
|
||||||
value: 5,
|
|
||||||
icon: <IconArchive size={25} color={MainColor.white_gray} />,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|||||||
3
bun.lock
3
bun.lock
@@ -17,7 +17,6 @@
|
|||||||
"axios": "^1.11.0",
|
"axios": "^1.11.0",
|
||||||
"dayjs": "^1.11.13",
|
"dayjs": "^1.11.13",
|
||||||
"expo": "^54.0.0",
|
"expo": "^54.0.0",
|
||||||
"expo-blur": "~15.0.7",
|
|
||||||
"expo-camera": "~17.0.7",
|
"expo-camera": "~17.0.7",
|
||||||
"expo-clipboard": "~8.0.7",
|
"expo-clipboard": "~8.0.7",
|
||||||
"expo-constants": "~18.0.8",
|
"expo-constants": "~18.0.8",
|
||||||
@@ -1153,8 +1152,6 @@
|
|||||||
|
|
||||||
"expo-asset": ["expo-asset@12.0.8", "", { "dependencies": { "@expo/image-utils": "^0.8.7", "expo-constants": "~18.0.8" }, "peerDependencies": { "expo": "*", "react": "*", "react-native": "*" } }, "sha512-jj2U8zw9+7orST2rlQGULYiqPoECOuUyffs2NguGrq84bYbkM041T7TOMXH2raPVJnM9lEAP54ezI6XL+GVYqw=="],
|
"expo-asset": ["expo-asset@12.0.8", "", { "dependencies": { "@expo/image-utils": "^0.8.7", "expo-constants": "~18.0.8" }, "peerDependencies": { "expo": "*", "react": "*", "react-native": "*" } }, "sha512-jj2U8zw9+7orST2rlQGULYiqPoECOuUyffs2NguGrq84bYbkM041T7TOMXH2raPVJnM9lEAP54ezI6XL+GVYqw=="],
|
||||||
|
|
||||||
"expo-blur": ["expo-blur@15.0.7", "", { "peerDependencies": { "expo": "*", "react": "*", "react-native": "*" } }, "sha512-SugQQbQd+zRPy8z2G5qDD4NqhcD7srBF7fN7O7yq6q7ZFK59VWvpDxtMoUkmSfdxgqONsrBN/rLdk00USADrMg=="],
|
|
||||||
|
|
||||||
"expo-camera": ["expo-camera@17.0.7", "", { "dependencies": { "invariant": "^2.2.4" }, "peerDependencies": { "expo": "*", "react": "*", "react-native": "*", "react-native-web": "*" }, "optionalPeers": ["react-native-web"] }, "sha512-jdZfijfFjlVAuuIkDheA41YKpigPjqsN0juRvgyr7Lcyz+fvwZ3/RP50/n/hvuozH657wHxPfiyVVFa00z8TcQ=="],
|
"expo-camera": ["expo-camera@17.0.7", "", { "dependencies": { "invariant": "^2.2.4" }, "peerDependencies": { "expo": "*", "react": "*", "react-native": "*", "react-native-web": "*" }, "optionalPeers": ["react-native-web"] }, "sha512-jdZfijfFjlVAuuIkDheA41YKpigPjqsN0juRvgyr7Lcyz+fvwZ3/RP50/n/hvuozH657wHxPfiyVVFa00z8TcQ=="],
|
||||||
|
|
||||||
"expo-clipboard": ["expo-clipboard@8.0.7", "", { "peerDependencies": { "expo": "*", "react": "*", "react-native": "*" } }, "sha512-zvlfFV+wB2QQrQnHWlo0EKHAkdi2tycLtE+EXFUWTPZYkgu1XcH+aiKfd4ul7Z0SDF+1IuwoiW9AA9eO35aj3Q=="],
|
"expo-clipboard": ["expo-clipboard@8.0.7", "", { "peerDependencies": { "expo": "*", "react": "*", "react-native": "*" } }, "sha512-zvlfFV+wB2QQrQnHWlo0EKHAkdi2tycLtE+EXFUWTPZYkgu1XcH+aiKfd4ul7Z0SDF+1IuwoiW9AA9eO35aj3Q=="],
|
||||||
|
|||||||
16
components/Box/ReportBox.tsx
Normal file
16
components/Box/ReportBox.tsx
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
import StackCustom from "../Stack/StackCustom";
|
||||||
|
import TextCustom from "../Text/TextCustom";
|
||||||
|
import BaseBox from "./BaseBox";
|
||||||
|
|
||||||
|
export default function ReportBox({ text }: { text: string }) {
|
||||||
|
return (
|
||||||
|
<BaseBox>
|
||||||
|
<StackCustom gap={"sm"}>
|
||||||
|
<TextCustom bold>
|
||||||
|
Catatan penolakan
|
||||||
|
</TextCustom>
|
||||||
|
<TextCustom>{text}</TextCustom>
|
||||||
|
</StackCustom>
|
||||||
|
</BaseBox>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,27 +1,39 @@
|
|||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { StyleProp, StyleSheet, TextInput, View, ViewStyle } from "react-native";
|
import {
|
||||||
|
StyleProp,
|
||||||
|
StyleSheet,
|
||||||
|
View,
|
||||||
|
ViewStyle
|
||||||
|
} from "react-native";
|
||||||
|
import TextCustom from "../Text/TextCustom";
|
||||||
|
|
||||||
interface CircularInputProps {
|
interface CircularInputProps {
|
||||||
value?: string | number
|
value?: string | number;
|
||||||
onChange?: (value: string | number) => void;
|
onChange?: (value: string | number) => void;
|
||||||
icon?: React.ReactNode;
|
icon?: React.ReactNode;
|
||||||
style?: StyleProp<ViewStyle>
|
style?: StyleProp<ViewStyle>;
|
||||||
}
|
}
|
||||||
|
|
||||||
const CircularInput: React.FC<CircularInputProps> = ({ value, onChange, icon, style }) => {
|
const CircularInput: React.FC<CircularInputProps> = ({
|
||||||
|
value,
|
||||||
|
onChange,
|
||||||
|
icon,
|
||||||
|
style,
|
||||||
|
}) => {
|
||||||
return (
|
return (
|
||||||
<View style={[styles.circleContainer, style]}>
|
<View style={[styles.circleContainer, style]}>
|
||||||
{icon ? (
|
{icon ? (
|
||||||
icon
|
icon
|
||||||
) : (
|
) : (
|
||||||
<TextInput
|
<TextCustom
|
||||||
value={String(value)}
|
// text={String(value)}
|
||||||
onChangeText={onChange}
|
|
||||||
style={styles.input}
|
style={styles.input}
|
||||||
keyboardType="numeric"
|
// keyboardType="numeric"
|
||||||
maxLength={2} // Batasan maksimal karakter
|
// maxLength={2} // Batasan maksimal karakter
|
||||||
/>
|
>
|
||||||
|
{value}
|
||||||
|
</TextCustom>
|
||||||
)}
|
)}
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
@@ -39,7 +51,7 @@ const styles = StyleSheet.create({
|
|||||||
},
|
},
|
||||||
input: {
|
input: {
|
||||||
color: MainColor.yellow, // Warna kuning
|
color: MainColor.yellow, // Warna kuning
|
||||||
fontSize: 24,
|
fontSize: 18,
|
||||||
fontWeight: "bold",
|
fontWeight: "bold",
|
||||||
textAlign: "center",
|
textAlign: "center",
|
||||||
padding: 0,
|
padding: 0,
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ interface TextCustomProps {
|
|||||||
bold?: boolean;
|
bold?: boolean;
|
||||||
semiBold?: boolean;
|
semiBold?: boolean;
|
||||||
size?: "default" | "large" | "small" | "xlarge" | number
|
size?: "default" | "large" | "small" | "xlarge" | number
|
||||||
color?: "default" | "yellow" | "red" | "gray" | "green" | "black"
|
color?: "default" | "yellow" | "red" | "gray" | "green" | "black" | "orange"
|
||||||
align?: TextAlign; // Prop untuk alignment
|
align?: TextAlign; // Prop untuk alignment
|
||||||
truncate?: boolean | number;
|
truncate?: boolean | number;
|
||||||
onPress?: () => void;
|
onPress?: () => void;
|
||||||
@@ -62,6 +62,7 @@ const TextCustom: React.FC<TextCustomProps> = ({
|
|||||||
else if (color === "gray") selectedStyles.push(styles.gray);
|
else if (color === "gray") selectedStyles.push(styles.gray);
|
||||||
else if (color === "green") selectedStyles.push(styles.green);
|
else if (color === "green") selectedStyles.push(styles.green);
|
||||||
else if (color === "black") selectedStyles.push(styles.black);
|
else if (color === "black") selectedStyles.push(styles.black);
|
||||||
|
else if (color === "orange") selectedStyles.push(styles.orange);
|
||||||
|
|
||||||
// Alignment
|
// Alignment
|
||||||
if (align) {
|
if (align) {
|
||||||
@@ -140,4 +141,7 @@ export const styles = StyleSheet.create({
|
|||||||
black: {
|
black: {
|
||||||
color: MainColor.black,
|
color: MainColor.black,
|
||||||
},
|
},
|
||||||
|
orange: {
|
||||||
|
color: MainColor.orange,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
27
components/_Icon/IconOpenTo.tsx
Normal file
27
components/_Icon/IconOpenTo.tsx
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
import { MainColor } from "@/constants/color-palet";
|
||||||
|
import { ICON_SIZE_XLARGE } from "@/constants/constans-value";
|
||||||
|
import { Ionicons } from "@expo/vector-icons";
|
||||||
|
import React from "react";
|
||||||
|
|
||||||
|
export { IconOpenTo };
|
||||||
|
|
||||||
|
function IconOpenTo({
|
||||||
|
color,
|
||||||
|
size,
|
||||||
|
onPress,
|
||||||
|
}: {
|
||||||
|
color?: string;
|
||||||
|
size?: number;
|
||||||
|
onPress?: () => void;
|
||||||
|
}) {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Ionicons
|
||||||
|
onPress={onPress}
|
||||||
|
name="open"
|
||||||
|
size={size || ICON_SIZE_XLARGE}
|
||||||
|
color={color || MainColor.yellow}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -5,17 +5,20 @@ import { MainColor } from "@/constants/color-palet";
|
|||||||
export default function AdminButtonReject({
|
export default function AdminButtonReject({
|
||||||
title,
|
title,
|
||||||
onReject,
|
onReject,
|
||||||
|
isLoading,
|
||||||
}: {
|
}: {
|
||||||
title: string;
|
title: string;
|
||||||
onReject: () => void;
|
onReject: () => void;
|
||||||
|
isLoading?: boolean;
|
||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ButtonCustom
|
<ButtonCustom
|
||||||
iconLeft={<IconReject />}
|
iconLeft={<IconReject size={16} />}
|
||||||
backgroundColor={MainColor.red}
|
backgroundColor={MainColor.red}
|
||||||
textColor="white"
|
textColor="white"
|
||||||
onPress={onReject}
|
onPress={onReject}
|
||||||
|
isLoading={isLoading}
|
||||||
>
|
>
|
||||||
{title}
|
{title}
|
||||||
</ButtonCustom>
|
</ButtonCustom>
|
||||||
|
|||||||
@@ -4,9 +4,11 @@ import Grid from "@/components/Grid/GridCustom";
|
|||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
|
|
||||||
export default function AdminButtonReview({
|
export default function AdminButtonReview({
|
||||||
|
isLoading,
|
||||||
onPublish,
|
onPublish,
|
||||||
onReject,
|
onReject,
|
||||||
}: {
|
}: {
|
||||||
|
isLoading?: boolean;
|
||||||
onPublish: () => void;
|
onPublish: () => void;
|
||||||
onReject: () => void;
|
onReject: () => void;
|
||||||
}) {
|
}) {
|
||||||
@@ -15,6 +17,7 @@ export default function AdminButtonReview({
|
|||||||
<Grid>
|
<Grid>
|
||||||
<Grid.Col span={6} style={{ paddingRight: 10 }}>
|
<Grid.Col span={6} style={{ paddingRight: 10 }}>
|
||||||
<ButtonCustom
|
<ButtonCustom
|
||||||
|
isLoading={isLoading}
|
||||||
iconLeft={<IconPublish />}
|
iconLeft={<IconPublish />}
|
||||||
backgroundColor={MainColor.green}
|
backgroundColor={MainColor.green}
|
||||||
textColor="white"
|
textColor="white"
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import {
|
|||||||
StyleProp,
|
StyleProp,
|
||||||
ViewStyle,
|
ViewStyle,
|
||||||
} from "react-native";
|
} from "react-native";
|
||||||
import { SafeAreaView } from "react-native-safe-area-context";
|
import { NativeSafeAreaViewProps, SafeAreaView } from "react-native-safe-area-context";
|
||||||
|
|
||||||
interface ViewWrapperProps {
|
interface ViewWrapperProps {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
@@ -21,6 +21,7 @@ interface ViewWrapperProps {
|
|||||||
footerComponent?: React.ReactNode;
|
footerComponent?: React.ReactNode;
|
||||||
floatingButton?: React.ReactNode;
|
floatingButton?: React.ReactNode;
|
||||||
hideFooter?: boolean;
|
hideFooter?: boolean;
|
||||||
|
edgesFooter?: NativeSafeAreaViewProps["edges"];
|
||||||
style?: StyleProp<ViewStyle>;
|
style?: StyleProp<ViewStyle>;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -37,6 +38,7 @@ const ViewWrapper = ({
|
|||||||
footerComponent,
|
footerComponent,
|
||||||
floatingButton,
|
floatingButton,
|
||||||
hideFooter = false,
|
hideFooter = false,
|
||||||
|
edgesFooter =[],
|
||||||
style,
|
style,
|
||||||
}: ViewWrapperProps) => {
|
}: ViewWrapperProps) => {
|
||||||
const assetBackground = require("../../assets/images/main-background.png");
|
const assetBackground = require("../../assets/images/main-background.png");
|
||||||
@@ -77,7 +79,7 @@ const ViewWrapper = ({
|
|||||||
|
|
||||||
{footerComponent ? (
|
{footerComponent ? (
|
||||||
<SafeAreaView
|
<SafeAreaView
|
||||||
edges={["bottom"]}
|
edges={Platform.OS === "ios" ? edgesFooter : ["bottom"]}
|
||||||
style={{
|
style={{
|
||||||
backgroundColor: MainColor.darkblue,
|
backgroundColor: MainColor.darkblue,
|
||||||
height: OS_HEIGHT
|
height: OS_HEIGHT
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ export {
|
|||||||
|
|
||||||
// OS Height
|
// OS Height
|
||||||
const OS_ANDROID_HEIGHT = 115
|
const OS_ANDROID_HEIGHT = 115
|
||||||
const OS_IOS_HEIGHT = 65
|
const OS_IOS_HEIGHT = 70
|
||||||
const OS_HEIGHT = Platform.OS === "ios" ? OS_IOS_HEIGHT : OS_ANDROID_HEIGHT
|
const OS_HEIGHT = Platform.OS === "ios" ? OS_IOS_HEIGHT : OS_ANDROID_HEIGHT
|
||||||
|
|
||||||
// Text Size
|
// Text Size
|
||||||
|
|||||||
8
index.js
Normal file
8
index.js
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
import { registerRootComponent } from 'expo';
|
||||||
|
|
||||||
|
import App from './App';
|
||||||
|
|
||||||
|
// registerRootComponent calls AppRegistry.registerComponent('main', () => App);
|
||||||
|
// It also ensures that whether you load the app in Expo Go or in a native build,
|
||||||
|
// the environment is set up appropriately
|
||||||
|
registerRootComponent(App);
|
||||||
@@ -9,25 +9,17 @@
|
|||||||
/* Begin PBXBuildFile section */
|
/* Begin PBXBuildFile section */
|
||||||
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
|
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
|
||||||
3E461D99554A48A4959DE609 /* SplashScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AA286B85B6C04FC6940260E9 /* SplashScreen.storyboard */; };
|
3E461D99554A48A4959DE609 /* SplashScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AA286B85B6C04FC6940260E9 /* SplashScreen.storyboard */; };
|
||||||
3E483D87269347231471F774 /* libPods-HIPMIBADUNG.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 10F5AA024C601F56B4EEA12E /* libPods-HIPMIBADUNG.a */; };
|
|
||||||
3E9DE75169D0FBDB1B473165 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = F0C0055A487C52DF43B9AA8C /* PrivacyInfo.xcprivacy */; };
|
|
||||||
BB2F792D24A3F905000567C9 /* Expo.plist in Resources */ = {isa = PBXBuildFile; fileRef = BB2F792C24A3F905000567C9 /* Expo.plist */; };
|
BB2F792D24A3F905000567C9 /* Expo.plist in Resources */ = {isa = PBXBuildFile; fileRef = BB2F792C24A3F905000567C9 /* Expo.plist */; };
|
||||||
E3BE778B8B6E53CE5D518808 /* ExpoModulesProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = A445166333AB51CC299A7683 /* ExpoModulesProvider.swift */; };
|
|
||||||
F11748422D0307B40044C1D9 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F11748412D0307B40044C1D9 /* AppDelegate.swift */; };
|
F11748422D0307B40044C1D9 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F11748412D0307B40044C1D9 /* AppDelegate.swift */; };
|
||||||
/* End PBXBuildFile section */
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
/* Begin PBXFileReference section */
|
/* Begin PBXFileReference section */
|
||||||
10F5AA024C601F56B4EEA12E /* libPods-HIPMIBADUNG.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-HIPMIBADUNG.a"; sourceTree = BUILT_PRODUCTS_DIR; };
|
|
||||||
13B07F961A680F5B00A75B9A /* HIPMIBADUNG.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HIPMIBADUNG.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
13B07F961A680F5B00A75B9A /* HIPMIBADUNG.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HIPMIBADUNG.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = HIPMIBADUNG/Images.xcassets; sourceTree = "<group>"; };
|
13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = HIPMIBADUNG/Images.xcassets; sourceTree = "<group>"; };
|
||||||
13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = HIPMIBADUNG/Info.plist; sourceTree = "<group>"; };
|
13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = HIPMIBADUNG/Info.plist; sourceTree = "<group>"; };
|
||||||
43EA3CD4BD89A00F8AB4791D /* Pods-HIPMIBADUNG.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HIPMIBADUNG.release.xcconfig"; path = "Target Support Files/Pods-HIPMIBADUNG/Pods-HIPMIBADUNG.release.xcconfig"; sourceTree = "<group>"; };
|
|
||||||
7355472C9F7484C7F5780400 /* Pods-HIPMIBADUNG.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HIPMIBADUNG.debug.xcconfig"; path = "Target Support Files/Pods-HIPMIBADUNG/Pods-HIPMIBADUNG.debug.xcconfig"; sourceTree = "<group>"; };
|
|
||||||
A445166333AB51CC299A7683 /* ExpoModulesProvider.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ExpoModulesProvider.swift; path = "Pods/Target Support Files/Pods-HIPMIBADUNG/ExpoModulesProvider.swift"; sourceTree = "<group>"; };
|
|
||||||
AA286B85B6C04FC6940260E9 /* SplashScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = SplashScreen.storyboard; path = HIPMIBADUNG/SplashScreen.storyboard; sourceTree = "<group>"; };
|
AA286B85B6C04FC6940260E9 /* SplashScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = SplashScreen.storyboard; path = HIPMIBADUNG/SplashScreen.storyboard; sourceTree = "<group>"; };
|
||||||
BB2F792C24A3F905000567C9 /* Expo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Expo.plist; sourceTree = "<group>"; };
|
BB2F792C24A3F905000567C9 /* Expo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Expo.plist; sourceTree = "<group>"; };
|
||||||
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
|
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
|
||||||
F0C0055A487C52DF43B9AA8C /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xml; name = PrivacyInfo.xcprivacy; path = HIPMIBADUNG/PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
|
|
||||||
F11748412D0307B40044C1D9 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = HIPMIBADUNG/AppDelegate.swift; sourceTree = "<group>"; };
|
F11748412D0307B40044C1D9 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = AppDelegate.swift; path = HIPMIBADUNG/AppDelegate.swift; sourceTree = "<group>"; };
|
||||||
F11748442D0722820044C1D9 /* HIPMIBADUNG-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "HIPMIBADUNG-Bridging-Header.h"; path = "HIPMIBADUNG/HIPMIBADUNG-Bridging-Header.h"; sourceTree = "<group>"; };
|
F11748442D0722820044C1D9 /* HIPMIBADUNG-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "HIPMIBADUNG-Bridging-Header.h"; path = "HIPMIBADUNG/HIPMIBADUNG-Bridging-Header.h"; sourceTree = "<group>"; };
|
||||||
/* End PBXFileReference section */
|
/* End PBXFileReference section */
|
||||||
@@ -37,7 +29,6 @@
|
|||||||
isa = PBXFrameworksBuildPhase;
|
isa = PBXFrameworksBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
3E483D87269347231471F774 /* libPods-HIPMIBADUNG.a in Frameworks */,
|
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
@@ -53,7 +44,6 @@
|
|||||||
13B07FB51A68108700A75B9A /* Images.xcassets */,
|
13B07FB51A68108700A75B9A /* Images.xcassets */,
|
||||||
13B07FB61A68108700A75B9A /* Info.plist */,
|
13B07FB61A68108700A75B9A /* Info.plist */,
|
||||||
AA286B85B6C04FC6940260E9 /* SplashScreen.storyboard */,
|
AA286B85B6C04FC6940260E9 /* SplashScreen.storyboard */,
|
||||||
F0C0055A487C52DF43B9AA8C /* PrivacyInfo.xcprivacy */,
|
|
||||||
);
|
);
|
||||||
name = HIPMIBADUNG;
|
name = HIPMIBADUNG;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@@ -62,28 +52,10 @@
|
|||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
ED297162215061F000B7C4FE /* JavaScriptCore.framework */,
|
ED297162215061F000B7C4FE /* JavaScriptCore.framework */,
|
||||||
10F5AA024C601F56B4EEA12E /* libPods-HIPMIBADUNG.a */,
|
|
||||||
);
|
);
|
||||||
name = Frameworks;
|
name = Frameworks;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
523B30FE431343BE096F5C21 /* Pods */ = {
|
|
||||||
isa = PBXGroup;
|
|
||||||
children = (
|
|
||||||
7355472C9F7484C7F5780400 /* Pods-HIPMIBADUNG.debug.xcconfig */,
|
|
||||||
43EA3CD4BD89A00F8AB4791D /* Pods-HIPMIBADUNG.release.xcconfig */,
|
|
||||||
);
|
|
||||||
path = Pods;
|
|
||||||
sourceTree = "<group>";
|
|
||||||
};
|
|
||||||
7E80613205F5353A90501151 /* HIPMIBADUNG */ = {
|
|
||||||
isa = PBXGroup;
|
|
||||||
children = (
|
|
||||||
A445166333AB51CC299A7683 /* ExpoModulesProvider.swift */,
|
|
||||||
);
|
|
||||||
name = HIPMIBADUNG;
|
|
||||||
sourceTree = "<group>";
|
|
||||||
};
|
|
||||||
832341AE1AAA6A7D00B99B32 /* Libraries */ = {
|
832341AE1AAA6A7D00B99B32 /* Libraries */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
@@ -98,8 +70,6 @@
|
|||||||
832341AE1AAA6A7D00B99B32 /* Libraries */,
|
832341AE1AAA6A7D00B99B32 /* Libraries */,
|
||||||
83CBBA001A601CBA00E9B192 /* Products */,
|
83CBBA001A601CBA00E9B192 /* Products */,
|
||||||
2D16E6871FA4F8E400B85C8A /* Frameworks */,
|
2D16E6871FA4F8E400B85C8A /* Frameworks */,
|
||||||
523B30FE431343BE096F5C21 /* Pods */,
|
|
||||||
92643B17548A700FA33507C4 /* ExpoModulesProviders */,
|
|
||||||
);
|
);
|
||||||
indentWidth = 2;
|
indentWidth = 2;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@@ -114,14 +84,6 @@
|
|||||||
name = Products;
|
name = Products;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
92643B17548A700FA33507C4 /* ExpoModulesProviders */ = {
|
|
||||||
isa = PBXGroup;
|
|
||||||
children = (
|
|
||||||
7E80613205F5353A90501151 /* HIPMIBADUNG */,
|
|
||||||
);
|
|
||||||
name = ExpoModulesProviders;
|
|
||||||
sourceTree = "<group>";
|
|
||||||
};
|
|
||||||
BB2F792B24A3F905000567C9 /* Supporting */ = {
|
BB2F792B24A3F905000567C9 /* Supporting */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
@@ -139,13 +101,11 @@
|
|||||||
buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "HIPMIBADUNG" */;
|
buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "HIPMIBADUNG" */;
|
||||||
buildPhases = (
|
buildPhases = (
|
||||||
08A4A3CD28434E44B6B9DE2E /* [CP] Check Pods Manifest.lock */,
|
08A4A3CD28434E44B6B9DE2E /* [CP] Check Pods Manifest.lock */,
|
||||||
4DF2145C6600FA4F2932F421 /* [Expo] Configure project */,
|
|
||||||
13B07F871A680F5B00A75B9A /* Sources */,
|
13B07F871A680F5B00A75B9A /* Sources */,
|
||||||
13B07F8C1A680F5B00A75B9A /* Frameworks */,
|
13B07F8C1A680F5B00A75B9A /* Frameworks */,
|
||||||
13B07F8E1A680F5B00A75B9A /* Resources */,
|
13B07F8E1A680F5B00A75B9A /* Resources */,
|
||||||
00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
|
00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
|
||||||
800E24972A6A228C8D4807E9 /* [CP] Copy Pods Resources */,
|
800E24972A6A228C8D4807E9 /* [CP] Copy Pods Resources */,
|
||||||
4BE0A502450842B2C872639D /* [CP] Embed Pods Frameworks */,
|
|
||||||
);
|
);
|
||||||
buildRules = (
|
buildRules = (
|
||||||
);
|
);
|
||||||
@@ -195,7 +155,6 @@
|
|||||||
BB2F792D24A3F905000567C9 /* Expo.plist in Resources */,
|
BB2F792D24A3F905000567C9 /* Expo.plist in Resources */,
|
||||||
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
|
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
|
||||||
3E461D99554A48A4959DE609 /* SplashScreen.storyboard in Resources */,
|
3E461D99554A48A4959DE609 /* SplashScreen.storyboard in Resources */,
|
||||||
3E9DE75169D0FBDB1B473165 /* PrivacyInfo.xcprivacy in Resources */,
|
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
@@ -209,6 +168,8 @@
|
|||||||
files = (
|
files = (
|
||||||
);
|
);
|
||||||
inputPaths = (
|
inputPaths = (
|
||||||
|
"$(SRCROOT)/.xcode.env",
|
||||||
|
"$(SRCROOT)/.xcode.env.local",
|
||||||
);
|
);
|
||||||
name = "Bundle React Native code and images";
|
name = "Bundle React Native code and images";
|
||||||
outputPaths = (
|
outputPaths = (
|
||||||
@@ -239,43 +200,6 @@
|
|||||||
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
|
||||||
showEnvVarsInLog = 0;
|
showEnvVarsInLog = 0;
|
||||||
};
|
};
|
||||||
4BE0A502450842B2C872639D /* [CP] Embed Pods Frameworks */ = {
|
|
||||||
isa = PBXShellScriptBuildPhase;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
files = (
|
|
||||||
);
|
|
||||||
inputPaths = (
|
|
||||||
"${PODS_ROOT}/Target Support Files/Pods-HIPMIBADUNG/Pods-HIPMIBADUNG-frameworks.sh",
|
|
||||||
"${PODS_XCFRAMEWORKS_BUILD_DIR}/hermes-engine/Pre-built/hermes.framework/hermes",
|
|
||||||
);
|
|
||||||
name = "[CP] Embed Pods Frameworks";
|
|
||||||
outputPaths = (
|
|
||||||
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/hermes.framework",
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
shellPath = /bin/sh;
|
|
||||||
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-HIPMIBADUNG/Pods-HIPMIBADUNG-frameworks.sh\"\n";
|
|
||||||
showEnvVarsInLog = 0;
|
|
||||||
};
|
|
||||||
4DF2145C6600FA4F2932F421 /* [Expo] Configure project */ = {
|
|
||||||
isa = PBXShellScriptBuildPhase;
|
|
||||||
alwaysOutOfDate = 1;
|
|
||||||
buildActionMask = 2147483647;
|
|
||||||
files = (
|
|
||||||
);
|
|
||||||
inputFileListPaths = (
|
|
||||||
);
|
|
||||||
inputPaths = (
|
|
||||||
);
|
|
||||||
name = "[Expo] Configure project";
|
|
||||||
outputFileListPaths = (
|
|
||||||
);
|
|
||||||
outputPaths = (
|
|
||||||
);
|
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
|
||||||
shellPath = /bin/sh;
|
|
||||||
shellScript = "# This script configures Expo modules and generates the modules provider file.\nbash -l -c \"./Pods/Target\\ Support\\ Files/Pods-HIPMIBADUNG/expo-configure-project.sh\"\n";
|
|
||||||
};
|
|
||||||
800E24972A6A228C8D4807E9 /* [CP] Copy Pods Resources */ = {
|
800E24972A6A228C8D4807E9 /* [CP] Copy Pods Resources */ = {
|
||||||
isa = PBXShellScriptBuildPhase;
|
isa = PBXShellScriptBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
@@ -284,76 +208,14 @@
|
|||||||
inputPaths = (
|
inputPaths = (
|
||||||
"${PODS_ROOT}/Target Support Files/Pods-HIPMIBADUNG/Pods-HIPMIBADUNG-resources.sh",
|
"${PODS_ROOT}/Target Support Files/Pods-HIPMIBADUNG/Pods-HIPMIBADUNG-resources.sh",
|
||||||
"${PODS_CONFIGURATION_BUILD_DIR}/EXConstants/EXConstants.bundle",
|
"${PODS_CONFIGURATION_BUILD_DIR}/EXConstants/EXConstants.bundle",
|
||||||
"${PODS_CONFIGURATION_BUILD_DIR}/EXConstants/ExpoConstants_privacy.bundle",
|
"${PODS_CONFIGURATION_BUILD_DIR}/EXUpdates/EXUpdates.bundle",
|
||||||
"${PODS_CONFIGURATION_BUILD_DIR}/ExpoFileSystem/ExpoFileSystem_privacy.bundle",
|
"${PODS_CONFIGURATION_BUILD_DIR}/React-Core/RCTI18nStrings.bundle",
|
||||||
"${PODS_CONFIGURATION_BUILD_DIR}/ExpoSystemUI/ExpoSystemUI_privacy.bundle",
|
|
||||||
"${PODS_CONFIGURATION_BUILD_DIR}/RCT-Folly/RCT-Folly_privacy.bundle",
|
|
||||||
"${PODS_CONFIGURATION_BUILD_DIR}/RNCAsyncStorage/RNCAsyncStorage_resources.bundle",
|
|
||||||
"${PODS_CONFIGURATION_BUILD_DIR}/RNSVG/RNSVGFilters.bundle",
|
|
||||||
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/AntDesign.ttf",
|
|
||||||
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/Entypo.ttf",
|
|
||||||
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/EvilIcons.ttf",
|
|
||||||
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/Feather.ttf",
|
|
||||||
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/FontAwesome.ttf",
|
|
||||||
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/FontAwesome5_Brands.ttf",
|
|
||||||
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/FontAwesome5_Regular.ttf",
|
|
||||||
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/FontAwesome5_Solid.ttf",
|
|
||||||
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/FontAwesome6_Brands.ttf",
|
|
||||||
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/FontAwesome6_Regular.ttf",
|
|
||||||
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/FontAwesome6_Solid.ttf",
|
|
||||||
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/Fontisto.ttf",
|
|
||||||
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/Foundation.ttf",
|
|
||||||
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/Ionicons.ttf",
|
|
||||||
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/MaterialCommunityIcons.ttf",
|
|
||||||
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/MaterialIcons.ttf",
|
|
||||||
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/Octicons.ttf",
|
|
||||||
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/SimpleLineIcons.ttf",
|
|
||||||
"${PODS_ROOT}/../../node_modules/react-native-vector-icons/Fonts/Zocial.ttf",
|
|
||||||
"${PODS_CONFIGURATION_BUILD_DIR}/React-Core/React-Core_privacy.bundle",
|
|
||||||
"${PODS_CONFIGURATION_BUILD_DIR}/React-cxxreact/React-cxxreact_privacy.bundle",
|
|
||||||
"${PODS_CONFIGURATION_BUILD_DIR}/SDWebImage/SDWebImage.bundle",
|
|
||||||
"${PODS_CONFIGURATION_BUILD_DIR}/boost/boost_privacy.bundle",
|
|
||||||
"${PODS_CONFIGURATION_BUILD_DIR}/expo-dev-launcher/EXDevLauncher.bundle",
|
|
||||||
"${PODS_CONFIGURATION_BUILD_DIR}/expo-dev-menu/EXDevMenu.bundle",
|
|
||||||
"${PODS_CONFIGURATION_BUILD_DIR}/glog/glog_privacy.bundle",
|
|
||||||
"${PODS_CONFIGURATION_BUILD_DIR}/react-native-maps/ReactNativeMapsPrivacy.bundle",
|
|
||||||
);
|
);
|
||||||
name = "[CP] Copy Pods Resources";
|
name = "[CP] Copy Pods Resources";
|
||||||
outputPaths = (
|
outputPaths = (
|
||||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/EXConstants.bundle",
|
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/EXConstants.bundle",
|
||||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/ExpoConstants_privacy.bundle",
|
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/EXUpdates.bundle",
|
||||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/ExpoFileSystem_privacy.bundle",
|
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RCTI18nStrings.bundle",
|
||||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/ExpoSystemUI_privacy.bundle",
|
|
||||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RCT-Folly_privacy.bundle",
|
|
||||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RNCAsyncStorage_resources.bundle",
|
|
||||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RNSVGFilters.bundle",
|
|
||||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AntDesign.ttf",
|
|
||||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Entypo.ttf",
|
|
||||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/EvilIcons.ttf",
|
|
||||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Feather.ttf",
|
|
||||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FontAwesome.ttf",
|
|
||||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FontAwesome5_Brands.ttf",
|
|
||||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FontAwesome5_Regular.ttf",
|
|
||||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FontAwesome5_Solid.ttf",
|
|
||||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FontAwesome6_Brands.ttf",
|
|
||||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FontAwesome6_Regular.ttf",
|
|
||||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/FontAwesome6_Solid.ttf",
|
|
||||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Fontisto.ttf",
|
|
||||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Foundation.ttf",
|
|
||||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Ionicons.ttf",
|
|
||||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/MaterialCommunityIcons.ttf",
|
|
||||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/MaterialIcons.ttf",
|
|
||||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Octicons.ttf",
|
|
||||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/SimpleLineIcons.ttf",
|
|
||||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/Zocial.ttf",
|
|
||||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/React-Core_privacy.bundle",
|
|
||||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/React-cxxreact_privacy.bundle",
|
|
||||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/SDWebImage.bundle",
|
|
||||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/boost_privacy.bundle",
|
|
||||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/EXDevLauncher.bundle",
|
|
||||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/EXDevMenu.bundle",
|
|
||||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/glog_privacy.bundle",
|
|
||||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/ReactNativeMapsPrivacy.bundle",
|
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
shellPath = /bin/sh;
|
shellPath = /bin/sh;
|
||||||
@@ -368,7 +230,6 @@
|
|||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
F11748422D0307B40044C1D9 /* AppDelegate.swift in Sources */,
|
F11748422D0307B40044C1D9 /* AppDelegate.swift in Sources */,
|
||||||
E3BE778B8B6E53CE5D518808 /* ExpoModulesProvider.swift in Sources */,
|
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
@@ -377,13 +238,10 @@
|
|||||||
/* Begin XCBuildConfiguration section */
|
/* Begin XCBuildConfiguration section */
|
||||||
13B07F941A680F5B00A75B9A /* Debug */ = {
|
13B07F941A680F5B00A75B9A /* Debug */ = {
|
||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
baseConfigurationReference = 7355472C9F7484C7F5780400 /* Pods-HIPMIBADUNG.debug.xcconfig */;
|
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CODE_SIGN_ENTITLEMENTS = HIPMIBADUNG/HIPMIBADUNG.entitlements;
|
|
||||||
CURRENT_PROJECT_VERSION = 1;
|
CURRENT_PROJECT_VERSION = 1;
|
||||||
DEVELOPMENT_TEAM = A3FZDNQTUG;
|
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
@@ -401,26 +259,23 @@
|
|||||||
"-ObjC",
|
"-ObjC",
|
||||||
"-lc++",
|
"-lc++",
|
||||||
);
|
);
|
||||||
OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_DEBUG";
|
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = "com.anonymous.hipmi-mobile";
|
PRODUCT_BUNDLE_IDENTIFIER = "com.anonymous.hipmi-mobile";
|
||||||
PRODUCT_NAME = HIPMIBADUNG;
|
PRODUCT_NAME = "HIPMIBADUNG";
|
||||||
SWIFT_OBJC_BRIDGING_HEADER = "HIPMIBADUNG/HIPMIBADUNG-Bridging-Header.h";
|
SWIFT_OBJC_BRIDGING_HEADER = "HIPMIBADUNG/HIPMIBADUNG-Bridging-Header.h";
|
||||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||||
SWIFT_VERSION = 5.0;
|
SWIFT_VERSION = 5.0;
|
||||||
TARGETED_DEVICE_FAMILY = "1,2";
|
|
||||||
VERSIONING_SYSTEM = "apple-generic";
|
VERSIONING_SYSTEM = "apple-generic";
|
||||||
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
|
CODE_SIGN_ENTITLEMENTS = HIPMIBADUNG/HIPMIBADUNG.entitlements;
|
||||||
};
|
};
|
||||||
name = Debug;
|
name = Debug;
|
||||||
};
|
};
|
||||||
13B07F951A680F5B00A75B9A /* Release */ = {
|
13B07F951A680F5B00A75B9A /* Release */ = {
|
||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
baseConfigurationReference = 43EA3CD4BD89A00F8AB4791D /* Pods-HIPMIBADUNG.release.xcconfig */;
|
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CODE_SIGN_ENTITLEMENTS = HIPMIBADUNG/HIPMIBADUNG.entitlements;
|
|
||||||
CURRENT_PROJECT_VERSION = 1;
|
CURRENT_PROJECT_VERSION = 1;
|
||||||
DEVELOPMENT_TEAM = A3FZDNQTUG;
|
|
||||||
INFOPLIST_FILE = HIPMIBADUNG/Info.plist;
|
INFOPLIST_FILE = HIPMIBADUNG/Info.plist;
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
|
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
@@ -433,13 +288,13 @@
|
|||||||
"-ObjC",
|
"-ObjC",
|
||||||
"-lc++",
|
"-lc++",
|
||||||
);
|
);
|
||||||
OTHER_SWIFT_FLAGS = "$(inherited) -D EXPO_CONFIGURATION_RELEASE";
|
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = "com.anonymous.hipmi-mobile";
|
PRODUCT_BUNDLE_IDENTIFIER = "com.anonymous.hipmi-mobile";
|
||||||
PRODUCT_NAME = HIPMIBADUNG;
|
PRODUCT_NAME = "HIPMIBADUNG";
|
||||||
SWIFT_OBJC_BRIDGING_HEADER = "HIPMIBADUNG/HIPMIBADUNG-Bridging-Header.h";
|
SWIFT_OBJC_BRIDGING_HEADER = "HIPMIBADUNG/HIPMIBADUNG-Bridging-Header.h";
|
||||||
SWIFT_VERSION = 5.0;
|
SWIFT_VERSION = 5.0;
|
||||||
TARGETED_DEVICE_FAMILY = "1,2";
|
|
||||||
VERSIONING_SYSTEM = "apple-generic";
|
VERSIONING_SYSTEM = "apple-generic";
|
||||||
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
|
CODE_SIGN_ENTITLEMENTS = HIPMIBADUNG/HIPMIBADUNG.entitlements;
|
||||||
};
|
};
|
||||||
name = Release;
|
name = Release;
|
||||||
};
|
};
|
||||||
@@ -495,14 +350,10 @@
|
|||||||
/usr/lib/swift,
|
/usr/lib/swift,
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
);
|
);
|
||||||
LIBRARY_SEARCH_PATHS = "$(SDKROOT)/usr/lib/swift\"$(inherited)\"";
|
LIBRARY_SEARCH_PATHS = "\"$(inherited)\"";
|
||||||
MTL_ENABLE_DEBUG_INFO = YES;
|
MTL_ENABLE_DEBUG_INFO = YES;
|
||||||
ONLY_ACTIVE_ARCH = YES;
|
ONLY_ACTIVE_ARCH = YES;
|
||||||
OTHER_LDFLAGS = "$(inherited) ";
|
|
||||||
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
|
|
||||||
SDKROOT = iphoneos;
|
SDKROOT = iphoneos;
|
||||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG";
|
|
||||||
USE_HERMES = true;
|
|
||||||
};
|
};
|
||||||
name = Debug;
|
name = Debug;
|
||||||
};
|
};
|
||||||
@@ -551,12 +402,9 @@
|
|||||||
/usr/lib/swift,
|
/usr/lib/swift,
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
);
|
);
|
||||||
LIBRARY_SEARCH_PATHS = "$(SDKROOT)/usr/lib/swift\"$(inherited)\"";
|
LIBRARY_SEARCH_PATHS = "\"$(inherited)\"";
|
||||||
MTL_ENABLE_DEBUG_INFO = NO;
|
MTL_ENABLE_DEBUG_INFO = NO;
|
||||||
OTHER_LDFLAGS = "$(inherited) ";
|
|
||||||
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
|
|
||||||
SDKROOT = iphoneos;
|
SDKROOT = iphoneos;
|
||||||
USE_HERMES = true;
|
|
||||||
VALIDATE_PRODUCT = YES;
|
VALIDATE_PRODUCT = YES;
|
||||||
};
|
};
|
||||||
name = Release;
|
name = Release;
|
||||||
|
|||||||
10
ios/HIPMIBADUNG.xcworkspace/contents.xcworkspacedata
generated
10
ios/HIPMIBADUNG.xcworkspace/contents.xcworkspacedata
generated
@@ -1,10 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<Workspace
|
|
||||||
version = "1.0">
|
|
||||||
<FileRef
|
|
||||||
location = "group:HIPMIBADUNG.xcodeproj">
|
|
||||||
</FileRef>
|
|
||||||
<FileRef
|
|
||||||
location = "group:Pods/Pods.xcodeproj">
|
|
||||||
</FileRef>
|
|
||||||
</Workspace>
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
||||||
<plist version="1.0">
|
|
||||||
<dict>
|
|
||||||
<key>NSPrivacyAccessedAPITypes</key>
|
|
||||||
<array>
|
|
||||||
<dict>
|
|
||||||
<key>NSPrivacyAccessedAPIType</key>
|
|
||||||
<string>NSPrivacyAccessedAPICategoryUserDefaults</string>
|
|
||||||
<key>NSPrivacyAccessedAPITypeReasons</key>
|
|
||||||
<array>
|
|
||||||
<string>CA92.1</string>
|
|
||||||
</array>
|
|
||||||
</dict>
|
|
||||||
<dict>
|
|
||||||
<key>NSPrivacyAccessedAPIType</key>
|
|
||||||
<string>NSPrivacyAccessedAPICategoryFileTimestamp</string>
|
|
||||||
<key>NSPrivacyAccessedAPITypeReasons</key>
|
|
||||||
<array>
|
|
||||||
<string>0A2A.1</string>
|
|
||||||
<string>3B52.1</string>
|
|
||||||
<string>C617.1</string>
|
|
||||||
</array>
|
|
||||||
</dict>
|
|
||||||
<dict>
|
|
||||||
<key>NSPrivacyAccessedAPIType</key>
|
|
||||||
<string>NSPrivacyAccessedAPICategoryDiskSpace</string>
|
|
||||||
<key>NSPrivacyAccessedAPITypeReasons</key>
|
|
||||||
<array>
|
|
||||||
<string>E174.1</string>
|
|
||||||
<string>85F4.1</string>
|
|
||||||
</array>
|
|
||||||
</dict>
|
|
||||||
<dict>
|
|
||||||
<key>NSPrivacyAccessedAPIType</key>
|
|
||||||
<string>NSPrivacyAccessedAPICategorySystemBootTime</string>
|
|
||||||
<key>NSPrivacyAccessedAPITypeReasons</key>
|
|
||||||
<array>
|
|
||||||
<string>35F9.1</string>
|
|
||||||
</array>
|
|
||||||
</dict>
|
|
||||||
</array>
|
|
||||||
<key>NSPrivacyCollectedDataTypes</key>
|
|
||||||
<array/>
|
|
||||||
<key>NSPrivacyTracking</key>
|
|
||||||
<false/>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
||||||
@@ -1,11 +1,12 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="EXPO-VIEWCONTROLLER-1">
|
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="24093.7" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="EXPO-VIEWCONTROLLER-1">
|
||||||
<device id="retina6_12" orientation="portrait" appearance="light"/>
|
<device id="retina6_12" orientation="portrait" appearance="light"/>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<deployment identifier="iOS"/>
|
<deployment identifier="iOS"/>
|
||||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/>
|
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="24053.1"/>
|
||||||
<capability name="Named colors" minToolsVersion="9.0"/>
|
<capability name="Named colors" minToolsVersion="9.0"/>
|
||||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||||
|
<capability name="System colors in document resources" minToolsVersion="11.0"/>
|
||||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<scenes>
|
<scenes>
|
||||||
@@ -35,6 +36,9 @@
|
|||||||
</scenes>
|
</scenes>
|
||||||
<resources>
|
<resources>
|
||||||
<image name="SplashScreenLogo" width="200" height="200"/>
|
<image name="SplashScreenLogo" width="200" height="200"/>
|
||||||
|
<systemColor name="systemBackgroundColor">
|
||||||
|
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||||
|
</systemColor>
|
||||||
<namedColor name="SplashScreenBackground">
|
<namedColor name="SplashScreenBackground">
|
||||||
<color alpha="1.000" blue="1.00000000000000" green="1.00000000000000" red="1.00000000000000" customColorSpace="sRGB" colorSpace="custom"/>
|
<color alpha="1.000" blue="1.00000000000000" green="1.00000000000000" red="1.00000000000000" customColorSpace="sRGB" colorSpace="custom"/>
|
||||||
</namedColor>
|
</namedColor>
|
||||||
|
|||||||
20
ios/Podfile
20
ios/Podfile
@@ -4,12 +4,11 @@ require File.join(File.dirname(`node --print "require.resolve('react-native/pack
|
|||||||
require 'json'
|
require 'json'
|
||||||
podfile_properties = JSON.parse(File.read(File.join(__dir__, 'Podfile.properties.json'))) rescue {}
|
podfile_properties = JSON.parse(File.read(File.join(__dir__, 'Podfile.properties.json'))) rescue {}
|
||||||
|
|
||||||
ENV['RCT_NEW_ARCH_ENABLED'] = '0' if podfile_properties['newArchEnabled'] == 'false'
|
ENV['RCT_NEW_ARCH_ENABLED'] ||= '0' if podfile_properties['newArchEnabled'] == 'false'
|
||||||
ENV['EX_DEV_CLIENT_NETWORK_INSPECTOR'] = podfile_properties['EX_DEV_CLIENT_NETWORK_INSPECTOR']
|
ENV['EX_DEV_CLIENT_NETWORK_INSPECTOR'] ||= podfile_properties['EX_DEV_CLIENT_NETWORK_INSPECTOR']
|
||||||
|
ENV['RCT_USE_RN_DEP'] ||= '1' if podfile_properties['ios.buildReactNativeFromSource'] != 'true' && podfile_properties['newArchEnabled'] != 'false'
|
||||||
|
ENV['RCT_USE_PREBUILT_RNCORE'] ||= '1' if podfile_properties['ios.buildReactNativeFromSource'] != 'true' && podfile_properties['newArchEnabled'] != 'false'
|
||||||
platform :ios, podfile_properties['ios.deploymentTarget'] || '15.1'
|
platform :ios, podfile_properties['ios.deploymentTarget'] || '15.1'
|
||||||
install! 'cocoapods',
|
|
||||||
:deterministic_uuids => false
|
|
||||||
|
|
||||||
prepare_react_native_project!
|
prepare_react_native_project!
|
||||||
|
|
||||||
@@ -49,16 +48,5 @@ target 'HIPMIBADUNG' do
|
|||||||
:mac_catalyst_enabled => false,
|
:mac_catalyst_enabled => false,
|
||||||
:ccache_enabled => podfile_properties['apple.ccacheEnabled'] == 'true',
|
:ccache_enabled => podfile_properties['apple.ccacheEnabled'] == 'true',
|
||||||
)
|
)
|
||||||
|
|
||||||
# This is necessary for Xcode 14, because it signs resource bundles by default
|
|
||||||
# when building for devices.
|
|
||||||
installer.target_installation_results.pod_target_installation_results
|
|
||||||
.each do |pod_name, target_installation_result|
|
|
||||||
target_installation_result.resource_bundle_targets.each do |resource_bundle_target|
|
|
||||||
resource_bundle_target.build_configurations.each do |config|
|
|
||||||
config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
2944
ios/Podfile.lock
2944
ios/Podfile.lock
File diff suppressed because it is too large
Load Diff
7
metro.config.js
Normal file
7
metro.config.js
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
// Learn more https://docs.expo.io/guides/customizing-metro
|
||||||
|
const { getDefaultConfig } = require('expo/metro-config');
|
||||||
|
|
||||||
|
/** @type {import('expo/metro-config').MetroConfig} */
|
||||||
|
const config = getDefaultConfig(__dirname);
|
||||||
|
|
||||||
|
module.exports = config;
|
||||||
@@ -24,7 +24,6 @@
|
|||||||
"axios": "^1.11.0",
|
"axios": "^1.11.0",
|
||||||
"dayjs": "^1.11.13",
|
"dayjs": "^1.11.13",
|
||||||
"expo": "^54.0.0",
|
"expo": "^54.0.0",
|
||||||
"expo-blur": "~15.0.7",
|
|
||||||
"expo-camera": "~17.0.7",
|
"expo-camera": "~17.0.7",
|
||||||
"expo-clipboard": "~8.0.7",
|
"expo-clipboard": "~8.0.7",
|
||||||
"expo-constants": "~18.0.8",
|
"expo-constants": "~18.0.8",
|
||||||
|
|||||||
23
screens/Admin/Event/funUpdateStatus.ts
Normal file
23
screens/Admin/Event/funUpdateStatus.ts
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
import { apiAdminEventUpdateStatus } from "@/service/api-admin/api-admin-event";
|
||||||
|
|
||||||
|
export const funUpdateStatusEvent = async ({
|
||||||
|
id,
|
||||||
|
changeStatus,
|
||||||
|
data,
|
||||||
|
}: {
|
||||||
|
id: string;
|
||||||
|
changeStatus: "publish" | "review" | "reject";
|
||||||
|
data?: string;
|
||||||
|
}) => {
|
||||||
|
try {
|
||||||
|
const response = await apiAdminEventUpdateStatus({
|
||||||
|
id: id,
|
||||||
|
changeStatus: changeStatus as any,
|
||||||
|
data: data,
|
||||||
|
});
|
||||||
|
return response;
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR]", error);
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
};
|
||||||
26
screens/Admin/Job/funUpdateStatus.ts
Normal file
26
screens/Admin/Job/funUpdateStatus.ts
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
import { apiAdminJobUpdate } from "@/service/api-admin/api-admin-job";
|
||||||
|
|
||||||
|
const funUpdateStatusJob = async ({
|
||||||
|
id,
|
||||||
|
changeStatus,
|
||||||
|
data,
|
||||||
|
}: {
|
||||||
|
id: string;
|
||||||
|
changeStatus: "publish" | "review" | "reject";
|
||||||
|
data?: string;
|
||||||
|
}) => {
|
||||||
|
try {
|
||||||
|
const response = await apiAdminJobUpdate({
|
||||||
|
id: id,
|
||||||
|
status: changeStatus as any,
|
||||||
|
data: data,
|
||||||
|
});
|
||||||
|
|
||||||
|
return response;
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR]", error);
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export default funUpdateStatusJob;
|
||||||
26
screens/Admin/Voting/funUpdateStatus.ts
Normal file
26
screens/Admin/Voting/funUpdateStatus.ts
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
import { apiAdminVotingUpdateStatus } from "@/service/api-admin/api-admin-voting";
|
||||||
|
|
||||||
|
const funUpdateStatusVoting = async ({
|
||||||
|
id,
|
||||||
|
changeStatus,
|
||||||
|
data,
|
||||||
|
}: {
|
||||||
|
id: string;
|
||||||
|
changeStatus: "publish" | "review" | "reject";
|
||||||
|
data?: string;
|
||||||
|
}) => {
|
||||||
|
try {
|
||||||
|
const response = await apiAdminVotingUpdateStatus({
|
||||||
|
id: id,
|
||||||
|
status: changeStatus as any,
|
||||||
|
data: data,
|
||||||
|
});
|
||||||
|
|
||||||
|
return response;
|
||||||
|
} catch (error) {
|
||||||
|
console.log("[ERROR]", error);
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export default funUpdateStatusVoting;
|
||||||
@@ -38,7 +38,7 @@ const adminListMenu: NavbarItem[] = [
|
|||||||
{ label: "Review", link: "/admin/event/review/status" },
|
{ label: "Review", link: "/admin/event/review/status" },
|
||||||
{ label: "Reject", link: "/admin/event/reject/status" },
|
{ label: "Reject", link: "/admin/event/reject/status" },
|
||||||
{ label: "Tipe Acara", link: "/admin/event/type-of-event" },
|
{ label: "Tipe Acara", link: "/admin/event/type-of-event" },
|
||||||
{ label: "Riwayat", link: "/admin/event/riwayat/status" },
|
{ label: "Riwayat", link: "/admin/event/history/status" },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -49,7 +49,7 @@ const adminListMenu: NavbarItem[] = [
|
|||||||
{ label: "Publish", link: "/admin/voting/publish/status" },
|
{ label: "Publish", link: "/admin/voting/publish/status" },
|
||||||
{ label: "Review", link: "/admin/voting/review/status" },
|
{ label: "Review", link: "/admin/voting/review/status" },
|
||||||
{ label: "Reject", link: "/admin/voting/reject/status" },
|
{ label: "Reject", link: "/admin/voting/reject/status" },
|
||||||
{ label: "Riwayat", link: "/admin/voting/riwayat/status" },
|
{ label: "Riwayat", link: "/admin/voting/history" },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -69,7 +69,7 @@ const adminListMenu: NavbarItem[] = [
|
|||||||
{ label: "Dashboard", link: "/admin/forum" },
|
{ label: "Dashboard", link: "/admin/forum" },
|
||||||
{ label: "Posting", link: "/admin/forum/posting" },
|
{ label: "Posting", link: "/admin/forum/posting" },
|
||||||
{ label: "Report Posting", link: "/admin/forum/report-posting" },
|
{ label: "Report Posting", link: "/admin/forum/report-posting" },
|
||||||
{ label: "Report Comment", link: "/admin/forum/report-comment" },
|
{ label: "Report Komentar", link: "/admin/forum/report-comment" },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -131,7 +131,7 @@ const superAdminListMenu: NavbarItem[] = [
|
|||||||
{ label: "Review", link: "/admin/event/review/status" },
|
{ label: "Review", link: "/admin/event/review/status" },
|
||||||
{ label: "Reject", link: "/admin/event/reject/status" },
|
{ label: "Reject", link: "/admin/event/reject/status" },
|
||||||
{ label: "Tipe Acara", link: "/admin/event/type-of-event" },
|
{ label: "Tipe Acara", link: "/admin/event/type-of-event" },
|
||||||
{ label: "Riwayat", link: "/admin/event/riwayat/status" },
|
{ label: "Riwayat", link: "/admin/event/history/status" },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -142,7 +142,7 @@ const superAdminListMenu: NavbarItem[] = [
|
|||||||
{ label: "Publish", link: "/admin/voting/publish/status" },
|
{ label: "Publish", link: "/admin/voting/publish/status" },
|
||||||
{ label: "Review", link: "/admin/voting/review/status" },
|
{ label: "Review", link: "/admin/voting/review/status" },
|
||||||
{ label: "Reject", link: "/admin/voting/reject/status" },
|
{ label: "Reject", link: "/admin/voting/reject/status" },
|
||||||
{ label: "Riwayat", link: "/admin/voting/riwayat/status" },
|
{ label: "Riwayat", link: "/admin/voting/history" },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -162,7 +162,7 @@ const superAdminListMenu: NavbarItem[] = [
|
|||||||
{ label: "Dashboard", link: "/admin/forum" },
|
{ label: "Dashboard", link: "/admin/forum" },
|
||||||
{ label: "Posting", link: "/admin/forum/posting" },
|
{ label: "Posting", link: "/admin/forum/posting" },
|
||||||
{ label: "Report Posting", link: "/admin/forum/report-posting" },
|
{ label: "Report Posting", link: "/admin/forum/report-posting" },
|
||||||
{ label: "Report Comment", link: "/admin/forum/report-comment" },
|
{ label: "Report Komentar", link: "/admin/forum/report-comment" },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
50
service/api-admin/api-admin-event.ts
Normal file
50
service/api-admin/api-admin-event.ts
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
import { apiConfig } from "../api-config";
|
||||||
|
|
||||||
|
export async function apiAdminEvent({
|
||||||
|
category,
|
||||||
|
search,
|
||||||
|
}: {
|
||||||
|
category: "dashboard" | "history" | "publish" | "review" | "type-of-event";
|
||||||
|
search?: string;
|
||||||
|
}) {
|
||||||
|
try {
|
||||||
|
const response = await apiConfig.get(
|
||||||
|
`/mobile/admin/event?category=${category}&search=${search}`
|
||||||
|
);
|
||||||
|
return response.data;
|
||||||
|
} catch (error) {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function apiAdminEventById({ id }: { id: string }) {
|
||||||
|
try {
|
||||||
|
const response = await apiConfig.get(`/mobile/admin/event/${id}`);
|
||||||
|
return response.data;
|
||||||
|
} catch (error) {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function apiAdminEventUpdateStatus({
|
||||||
|
id,
|
||||||
|
changeStatus,
|
||||||
|
data,
|
||||||
|
}: {
|
||||||
|
id: string;
|
||||||
|
changeStatus: "publish" | "review" | "reject";
|
||||||
|
data?: string;
|
||||||
|
}) {
|
||||||
|
try {
|
||||||
|
const response = await apiConfig.put(
|
||||||
|
`/mobile/admin/event/${id}?status=${changeStatus}`,
|
||||||
|
{
|
||||||
|
data: data,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
return response.data;
|
||||||
|
} catch (error) {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
91
service/api-admin/api-admin-forum.ts
Normal file
91
service/api-admin/api-admin-forum.ts
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
import { apiConfig } from "../api-config";
|
||||||
|
|
||||||
|
export async function apiAdminForum({
|
||||||
|
category,
|
||||||
|
search,
|
||||||
|
}: {
|
||||||
|
category: "dashboard" | "posting" | "report_posting" | "report_comment";
|
||||||
|
search?: string;
|
||||||
|
}) {
|
||||||
|
try {
|
||||||
|
const response = await apiConfig.get(
|
||||||
|
`/mobile/admin/forum?category=${category}&search=${search}`
|
||||||
|
);
|
||||||
|
return response.data;
|
||||||
|
} catch (error) {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function apiAdminForumPostingById({ id }: { id: string }) {
|
||||||
|
try {
|
||||||
|
const response = await apiConfig.get(`/mobile/admin/forum/${id}`);
|
||||||
|
return response.data;
|
||||||
|
} catch (error) {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
export async function apiAdminForumCommentById({
|
||||||
|
id,
|
||||||
|
category,
|
||||||
|
}: {
|
||||||
|
id: string;
|
||||||
|
category: "get-all" | "get-one";
|
||||||
|
}) {
|
||||||
|
try {
|
||||||
|
const response = await apiConfig.get(
|
||||||
|
`/mobile/admin/forum/${id}/comment?category=${category}`
|
||||||
|
);
|
||||||
|
return response.data;
|
||||||
|
} catch (error) {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function apiAdminForumListReportCommentById({
|
||||||
|
id,
|
||||||
|
}: {
|
||||||
|
id: string;
|
||||||
|
}) {
|
||||||
|
try {
|
||||||
|
const response = await apiConfig.get(
|
||||||
|
`/mobile/admin/forum/${id}/report-comment`
|
||||||
|
);
|
||||||
|
return response.data;
|
||||||
|
} catch (error) {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function apiAdminForumDeactivateComment({ id }: { id: string }) {
|
||||||
|
try {
|
||||||
|
const response = await apiConfig.put(`/mobile/admin/forum/${id}/comment`);
|
||||||
|
return response.data;
|
||||||
|
} catch (error) {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function apiAdminForumListReportPostingById({
|
||||||
|
id,
|
||||||
|
}: {
|
||||||
|
id: string;
|
||||||
|
}) {
|
||||||
|
try {
|
||||||
|
const response = await apiConfig.get(
|
||||||
|
`/mobile/admin/forum/${id}/report-posting`
|
||||||
|
);
|
||||||
|
return response.data;
|
||||||
|
} catch (error) {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function apiAdminForumDeactivatePosting({ id }: { id: string }) {
|
||||||
|
try {
|
||||||
|
const response = await apiConfig.put(`/mobile/admin/forum/${id}`);
|
||||||
|
return response.data;
|
||||||
|
} catch (error) {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -16,3 +16,34 @@ export async function apiAdminJob({
|
|||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function apiAdminJobGetById({ id }: { id: string }) {
|
||||||
|
try {
|
||||||
|
const response = await apiConfig.get(`/mobile/admin/job/${id}`);
|
||||||
|
return response.data;
|
||||||
|
} catch (error) {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function apiAdminJobUpdate({
|
||||||
|
id,
|
||||||
|
status,
|
||||||
|
data,
|
||||||
|
}: {
|
||||||
|
id: string;
|
||||||
|
status: "publish" | "review" | "reject";
|
||||||
|
data?: string;
|
||||||
|
}) {
|
||||||
|
try {
|
||||||
|
const response = await apiConfig.put(
|
||||||
|
`/mobile/admin/job/${id}?status=${status}`,
|
||||||
|
{
|
||||||
|
data: data,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
return response.data;
|
||||||
|
} catch (error) {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
49
service/api-admin/api-admin-voting.ts
Normal file
49
service/api-admin/api-admin-voting.ts
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
import { apiConfig } from "../api-config";
|
||||||
|
|
||||||
|
export async function apiAdminVoting({
|
||||||
|
category,
|
||||||
|
search,
|
||||||
|
}: {
|
||||||
|
category: "dashboard" | "history" | "publish" | "review" | "report";
|
||||||
|
search?: string;
|
||||||
|
}) {
|
||||||
|
try {
|
||||||
|
const response = await apiConfig.get(
|
||||||
|
`/mobile/admin/voting?category=${category}&search=${search}`
|
||||||
|
);
|
||||||
|
return response.data;
|
||||||
|
} catch (error) {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function apiAdminVotingById({ id }: { id: string }) {
|
||||||
|
try {
|
||||||
|
const response = await apiConfig.get(`/mobile/admin/voting/${id}`);
|
||||||
|
return response.data;
|
||||||
|
} catch (error) {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function apiAdminVotingUpdateStatus({
|
||||||
|
id,
|
||||||
|
data,
|
||||||
|
status,
|
||||||
|
}: {
|
||||||
|
id: string;
|
||||||
|
data?: string;
|
||||||
|
status: "publish" | "review" | "reject";
|
||||||
|
}) {
|
||||||
|
try {
|
||||||
|
const response = await apiConfig.put(
|
||||||
|
`/mobile/admin/voting/${id}?status=${status}`,
|
||||||
|
{
|
||||||
|
data: data,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
return response.data;
|
||||||
|
} catch (error) {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -138,3 +138,42 @@ export async function apiEventCheckParticipants({
|
|||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function apiEventGetConfirmation({
|
||||||
|
id,
|
||||||
|
userId,
|
||||||
|
}: {
|
||||||
|
id: string;
|
||||||
|
userId?: string;
|
||||||
|
}) {
|
||||||
|
try {
|
||||||
|
const response = await apiConfig.get(`/mobile/event/${id}/confirmation?userId=${userId}`);
|
||||||
|
return response.data;
|
||||||
|
} catch (error) {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function apiEventConfirmationAction({
|
||||||
|
id,
|
||||||
|
userId,
|
||||||
|
category,
|
||||||
|
}: {
|
||||||
|
id: string;
|
||||||
|
userId?: string;
|
||||||
|
category?: "join_and_confirm" | "confirmation";
|
||||||
|
}) {
|
||||||
|
try {
|
||||||
|
const response = await apiConfig.post(
|
||||||
|
`/mobile/event/${id}/confirmation?category=${category}`,
|
||||||
|
{
|
||||||
|
data: {
|
||||||
|
userId: userId,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
);
|
||||||
|
return response.data;
|
||||||
|
} catch (error) {
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import axios, { AxiosInstance } from "axios";
|
|||||||
import Constants from "expo-constants";
|
import Constants from "expo-constants";
|
||||||
export const BASE_URL = Constants.expoConfig?.extra?.BASE_URL;
|
export const BASE_URL = Constants.expoConfig?.extra?.BASE_URL;
|
||||||
export const API_BASE_URL = Constants.expoConfig?.extra?.API_BASE_URL;
|
export const API_BASE_URL = Constants.expoConfig?.extra?.API_BASE_URL;
|
||||||
|
export const DEEP_LINK_URL = Constants.expoConfig?.extra?.DEEP_LINK_URL;
|
||||||
|
|
||||||
export const apiConfig: AxiosInstance = axios.create({
|
export const apiConfig: AxiosInstance = axios.create({
|
||||||
baseURL: API_BASE_URL,
|
baseURL: API_BASE_URL,
|
||||||
|
|||||||
@@ -195,7 +195,14 @@ export const GStyles = StyleSheet.create({
|
|||||||
bottomBar: {
|
bottomBar: {
|
||||||
backgroundColor: MainColor.darkblue,
|
backgroundColor: MainColor.darkblue,
|
||||||
borderTopColor: AccentColor.blue,
|
borderTopColor: AccentColor.blue,
|
||||||
borderTopWidth: 1,
|
// borderTopWidth: 0.5,
|
||||||
|
height: "100%",
|
||||||
|
justifyContent: "center",
|
||||||
|
shadowColor: AccentColor.blue,
|
||||||
|
shadowOffset: { width: 0, height: -5},
|
||||||
|
shadowOpacity: 0.4,
|
||||||
|
shadowRadius: 40,
|
||||||
|
elevation: 8, // untuk Android
|
||||||
},
|
},
|
||||||
bottomBarContainer: {
|
bottomBarContainer: {
|
||||||
paddingHorizontal: 15,
|
paddingHorizontal: 15,
|
||||||
|
|||||||
14
utils/colorBadge.ts
Normal file
14
utils/colorBadge.ts
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
import { MainColor } from "@/constants/color-palet";
|
||||||
|
|
||||||
|
export const colorBadge = ({ status }: { status: string }) => {
|
||||||
|
const statusLowerCase = status.toLowerCase();
|
||||||
|
if (statusLowerCase === "publish") {
|
||||||
|
return MainColor.green;
|
||||||
|
} else if (statusLowerCase === "review") {
|
||||||
|
return MainColor.orange;
|
||||||
|
} else if (statusLowerCase === "reject") {
|
||||||
|
return MainColor.red;
|
||||||
|
} else {
|
||||||
|
return MainColor.placeholder;
|
||||||
|
}
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user