Merge pull request 'amalia/09-okt-25' (#49) from amalia/09-okt-25 into join

Reviewed-on: bip/mobile-darmasaba#49
This commit is contained in:
2025-10-09 17:55:18 +08:00
4 changed files with 37 additions and 8 deletions

View File

@@ -4,7 +4,7 @@ export default {
expo: { expo: {
name: "Desa+", name: "Desa+",
slug: "mobile-darmasaba", slug: "mobile-darmasaba",
version: "2.0.1", // Versi aplikasi (App Store) version: "2.0.2", // Versi aplikasi (App Store)
jsEngine: "jsc", jsEngine: "jsc",
orientation: "portrait", orientation: "portrait",
icon: "./assets/images/logo-icon-small.png", icon: "./assets/images/logo-icon-small.png",
@@ -14,7 +14,7 @@ export default {
ios: { ios: {
supportsTablet: true, supportsTablet: true,
bundleIdentifier: "mobiledarmasaba.app", bundleIdentifier: "mobiledarmasaba.app",
buildNumber: "3", buildNumber: "4",
infoPlist: { infoPlist: {
ITSAppUsesNonExemptEncryption: false, ITSAppUsesNonExemptEncryption: false,
CFBundleDisplayName: "Desa+" CFBundleDisplayName: "Desa+"
@@ -23,7 +23,7 @@ export default {
}, },
android: { android: {
package: "mobiledarmasaba.app", package: "mobiledarmasaba.app",
versionCode: 10, versionCode: 11,
adaptiveIcon: { adaptiveIcon: {
foregroundImage: "./assets/images/logo-icon-small.png", foregroundImage: "./assets/images/logo-icon-small.png",
backgroundColor: "#ffffff" backgroundColor: "#ffffff"

View File

@@ -20,6 +20,7 @@ import { useHeaderHeight } from '@react-navigation/elements';
import { router, Stack, useLocalSearchParams } from "expo-router"; import { router, Stack, useLocalSearchParams } from "expo-router";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { KeyboardAvoidingView, Platform, Pressable, ScrollView, View } from "react-native"; import { KeyboardAvoidingView, Platform, Pressable, ScrollView, View } from "react-native";
import Toast from "react-native-toast-message";
import { useSelector } from "react-redux"; import { useSelector } from "react-redux";
type Props = { type Props = {
@@ -54,6 +55,9 @@ export default function DetailDiscussionGeneral() {
const arrSkeleton = Array.from({ length: 3 }, (_, index) => index) const arrSkeleton = Array.from({ length: 3 }, (_, index) => index)
const reference = ref(getDB(), `/discussion-general/${id}`); const reference = ref(getDB(), `/discussion-general/${id}`);
const headerHeight = useHeaderHeight(); const headerHeight = useHeaderHeight();
const [detailMore, setDetailMore] = useState<any>([])
const [loadingSendKomentar, setLoadingSendKomentar] = useState(false)
useEffect(() => { useEffect(() => {
const onValueChange = reference.on('value', snapshot => { const onValueChange = reference.on('value', snapshot => {
@@ -116,16 +120,21 @@ export default function DetailDiscussionGeneral() {
async function handleKomentar() { async function handleKomentar() {
try { try {
setLoadingSendKomentar(true)
if (komentar != '') { if (komentar != '') {
const hasil = await decryptToken(String(token?.current)) const hasil = await decryptToken(String(token?.current))
const response = await apiSendDiscussionGeneralCommentar({ id: id, data: { desc: komentar, user: hasil } }) const response = await apiSendDiscussionGeneralCommentar({ id: id, data: { desc: komentar, user: hasil } })
if (response.success) { if (response.success) {
setKomentar('') setKomentar('')
updateTrigger() updateTrigger()
} else {
Toast.show({ type: 'small', text1: 'Gagal menambahkan komentar' })
} }
} }
} catch (error) { } catch (error) {
console.error(error) console.error(error)
} finally {
setLoadingSendKomentar(false)
} }
} }
@@ -195,6 +204,16 @@ export default function DetailDiscussionGeneral() {
title={item.username} title={item.username}
rightTopInfo={item.createdAt} rightTopInfo={item.createdAt}
desc={item.comment} desc={item.comment}
descEllipsize={detailMore.includes(item.id) ? false : true}
onPress={() => {
setDetailMore((prev: any) => {
if (prev.includes(item.id)) {
return prev.filter((id: string) => id !== item.id)
} else {
return [...prev, item.id]
}
})
}}
/> />
) )
}) })
@@ -225,14 +244,14 @@ export default function DetailDiscussionGeneral() {
multiline multiline
itemRight={ itemRight={
<Pressable onPress={() => { <Pressable onPress={() => {
(komentar != '' && !regexOnlySpacesOrEnter.test(komentar) && data?.status === 1 && data?.isActive && (memberDiscussion || (entityUser.role != "user" && entityUser.role != "coadmin"))) (!loadingSendKomentar && komentar != '' && !regexOnlySpacesOrEnter.test(komentar) && data?.status === 1 && data?.isActive && (memberDiscussion || (entityUser.role != "user" && entityUser.role != "coadmin")))
&& handleKomentar() && handleKomentar()
}} }}
style={[ style={[
Platform.OS == 'android' && Styles.mb12, Platform.OS == 'android' && Styles.mb12,
]} ]}
> >
<MaterialIcons name="send" size={25} style={(komentar == '' || regexOnlySpacesOrEnter.test(komentar) || data?.status === 2 || !data?.isActive || (!memberDiscussion && (entityUser.role == "user" || entityUser.role == "coadmin"))) ? Styles.cGray : Styles.cDefault} /> <MaterialIcons name="send" size={25} style={(loadingSendKomentar || komentar == '' || regexOnlySpacesOrEnter.test(komentar) || data?.status === 2 || !data?.isActive || (!memberDiscussion && (entityUser.role == "user" || entityUser.role == "coadmin"))) ? Styles.cGray : Styles.cDefault} />
</Pressable> </Pressable>
} }
/> />

View File

@@ -64,6 +64,7 @@ export default function DiscussionDetail() {
const reference = ref(getDB(), `/discussion-division/${detail}`); const reference = ref(getDB(), `/discussion-division/${detail}`);
const [refreshing, setRefreshing] = useState(false) const [refreshing, setRefreshing] = useState(false)
const headerHeight = useHeaderHeight(); const headerHeight = useHeaderHeight();
const [detailMore, setDetailMore] = useState<any>([])
useEffect(() => { useEffect(() => {
@@ -276,7 +277,16 @@ export default function DiscussionDetail() {
title={item.username} title={item.username}
rightTopInfo={item.createdAt} rightTopInfo={item.createdAt}
desc={item.comment} desc={item.comment}
descEllipsize={false} descEllipsize={detailMore.includes(item.id) ? false : true}
onPress={() => {
setDetailMore((prev: any) => {
if (prev.includes(item.id)) {
return prev.filter((id: string) => id !== item.id)
} else {
return [...prev, item.id]
}
})
}}
/> />
)) ))
} }

View File

@@ -19,7 +19,7 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string> <string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>2.0.1</string> <string>2.0.2</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleURLTypes</key> <key>CFBundleURLTypes</key>
@@ -39,7 +39,7 @@
</dict> </dict>
</array> </array>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>3</string> <string>4</string>
<key>ITSAppUsesNonExemptEncryption</key> <key>ITSAppUsesNonExemptEncryption</key>
<false/> <false/>
<key>LSMinimumSystemVersion</key> <key>LSMinimumSystemVersion</key>