upd : scroll view

Deskripsi:
- horizontal view hide
- vertical view hide
- scroll view height

No Issues
This commit is contained in:
2025-09-09 12:30:40 +08:00
parent 1509d1b702
commit 83291676d3
25 changed files with 124 additions and 67 deletions

View File

@@ -8,7 +8,7 @@ import { useAuthSession } from "@/providers/AuthProvider";
import { Entypo, MaterialIcons } from "@expo/vector-icons";
import { router, Stack, useLocalSearchParams } from "expo-router";
import React, { useEffect, useState } from "react";
import { Dimensions, SafeAreaView, ScrollView, View } from "react-native";
import { Dimensions, RefreshControl, SafeAreaView, ScrollView, View } from "react-native";
import RenderHTML from 'react-native-render-html';
import { useSelector } from "react-redux";
@@ -28,6 +28,7 @@ export default function DetailAnnouncement() {
const contentWidth = Dimensions.get('window').width
const [loading, setLoading] = useState(true)
const arrSkeleton = Array.from({ length: 2 }, (_, index) => index)
const [refreshing, setRefreshing] = useState(false)
async function handleLoad(loading: boolean) {
try {
@@ -56,6 +57,13 @@ export default function DetailAnnouncement() {
return htmlRegex.test(text);
};
const handleRefresh = async () => {
setRefreshing(true)
handleLoad(false)
await new Promise(resolve => setTimeout(resolve, 2000));
setRefreshing(false)
};
return (
<SafeAreaView>
<Stack.Screen
@@ -66,7 +74,16 @@ export default function DetailAnnouncement() {
headerRight: () => entityUser.role != 'user' && entityUser.role != 'coadmin' ? <HeaderRightAnnouncementDetail id={id} /> : <></>,
}}
/>
<ScrollView>
<ScrollView
showsVerticalScrollIndicator={false}
style={[Styles.h100]}
refreshControl={
<RefreshControl
refreshing={refreshing}
onRefresh={() => handleRefresh()}
/>
}
>
<View style={[Styles.p15]}>
<View style={[Styles.wrapPaper]}>
{

View File

@@ -110,8 +110,11 @@ export default function CreateAnnouncement() {
),
}}
/>
<ScrollView>
<View style={[Styles.p15, Styles.mb100]}>
<ScrollView
showsVerticalScrollIndicator={false}
style={[Styles.h100]}
>
<View style={[Styles.p15]}>
<InputForm
label="Judul"
type="default"

View File

@@ -153,8 +153,11 @@ export default function EditAnnouncement() {
),
}}
/>
<ScrollView>
<View style={[Styles.p15, Styles.mb100]}>
<ScrollView
showsVerticalScrollIndicator={false}
style={[Styles.h100]}
>
<View style={[Styles.p15]}>
<InputForm
label="Judul"
type="default"

View File

@@ -130,7 +130,7 @@ export default function EditBanner() {
category="update" />,
}}
/>
<ScrollView>
<ScrollView showsVerticalScrollIndicator={false} style={[Styles.h100]}>
<View style={[Styles.p15, Styles.mb100]}>
<View style={[Styles.mb15]}>
{selectedImage != undefined ? (

View File

@@ -117,8 +117,8 @@ export default function CreateBanner() {
),
}}
/>
<ScrollView>
<View style={[Styles.p15, Styles.mb100]}>
<ScrollView showsVerticalScrollIndicator={false} style={[Styles.h100]}>
<View style={[Styles.p15]}>
<View style={[Styles.mb15]}>
{selectedImage != undefined ? (
<Pressable onPress={pickImageAsync}>

View File

@@ -139,7 +139,7 @@ export default function DetailDiscussionGeneral() {
}}
/>
<View style={{ flex: 1 }}>
<ScrollView>
<ScrollView showsVerticalScrollIndicator={false}>
<View style={[Styles.p15, Styles.mb100]}>
{
loading ?

View File

@@ -116,7 +116,7 @@ export default function AddMemberDiscussionDetail() {
selectMember.length > 0
?
<View>
<ScrollView horizontal style={[Styles.mb10, Styles.pv10]}>
<ScrollView horizontal style={[Styles.mb10, Styles.pv10]} showsHorizontalScrollIndicator={false}>
{
selectMember.map((item: any, index: any) => (
<ImageWithLabel
@@ -133,7 +133,9 @@ export default function AddMemberDiscussionDetail() {
:
<Text style={[Styles.textDefault, Styles.cGray, Styles.pv05, { textAlign: 'center' }]}>Tidak ada member yang dipilih</Text>
}
<ScrollView>
<ScrollView
showsVerticalScrollIndicator={false}
>
{
data.length > 0 ?

View File

@@ -142,7 +142,7 @@ export default function CreateDiscussionGeneral() {
),
}}
/>
<ScrollView>
<ScrollView showsVerticalScrollIndicator={false} style={[Styles.h100]}>
<View style={[Styles.p15, Styles.mb100]}>
{
(entityUser.role == "supadmin" ||

View File

@@ -119,7 +119,7 @@ export default function EditDiscussionGeneral() {
),
}}
/>
<ScrollView>
<ScrollView showsVerticalScrollIndicator={false} style={[Styles.h100]}>
<View style={[Styles.p15]}>
<InputForm
label="Judul"

View File

@@ -123,7 +123,7 @@ export default function AddMemberCalendarEvent() {
selectMember.length > 0
?
<View>
<ScrollView horizontal style={[Styles.mb10, Styles.pv10]}>
<ScrollView horizontal style={[Styles.mb10, Styles.pv10]} showsHorizontalScrollIndicator={false}>
{
selectMember.map((item: any, index: any) => (
<ImageWithLabel
@@ -140,7 +140,9 @@ export default function AddMemberCalendarEvent() {
:
<Text style={[Styles.textDefault, Styles.cGray, Styles.pv05, { textAlign: 'center' }]}>Tidak ada member yang dipilih</Text>
}
<ScrollView>
<ScrollView
showsVerticalScrollIndicator={false}
>
{
data.length > 0 ?
data.map((item: any, index: any) => {

View File

@@ -112,7 +112,7 @@ export default function CreateCalendarAddMember() {
selectMember.length > 0
?
<View>
<ScrollView horizontal style={[Styles.mb10, Styles.pv10]}>
<ScrollView horizontal style={[Styles.mb10, Styles.pv10]} showsHorizontalScrollIndicator={false}>
{
selectMember.map((item: any, index: any) => (
<ImageWithLabel
@@ -129,7 +129,9 @@ export default function CreateCalendarAddMember() {
:
<Text style={[Styles.textDefault, Styles.cGray, Styles.pv05, { textAlign: 'center' }]}>Tidak ada member yang dipilih</Text>
}
<ScrollView>
<ScrollView
showsVerticalScrollIndicator={false}
>
{
data.length > 0 ?

View File

@@ -118,7 +118,7 @@ export default function AddMemberTask() {
selectMember.length > 0
?
<View>
<ScrollView horizontal style={[Styles.mb10, Styles.pv10]}>
<ScrollView horizontal style={[Styles.mb10, Styles.pv10]} showsHorizontalScrollIndicator={false}>
{
selectMember.map((item: any, index: any) => (
<ImageWithLabel
@@ -135,7 +135,9 @@ export default function AddMemberTask() {
:
<Text style={[Styles.textDefault, Styles.cGray, Styles.pv05, { textAlign: 'center' }]}>Tidak ada member yang dipilih</Text>
}
<ScrollView>
<ScrollView
showsVerticalScrollIndicator={false}
>
{
data.length > 0 ?

View File

@@ -88,7 +88,7 @@ export default function AddMemberCreateTask() {
selectMember.length > 0
?
<View>
<ScrollView horizontal style={[Styles.mb10, Styles.pv10]}>
<ScrollView horizontal style={[Styles.mb10, Styles.pv10]} showsHorizontalScrollIndicator={false}>
{
selectMember.map((item: any, index: any) => (
<ImageWithLabel
@@ -105,7 +105,9 @@ export default function AddMemberCreateTask() {
:
<Text style={[Styles.textDefault, Styles.cGray, Styles.pv05, { textAlign: 'center' }]}>Tidak ada member yang dipilih</Text>
}
<ScrollView>
<ScrollView
showsVerticalScrollIndicator={false}
>
{
data.length > 0 ?

View File

@@ -106,7 +106,7 @@ export default function ListTask() {
return (
<View style={[Styles.p15, { flex: 1 }]}>
<View>
<ScrollView horizontal style={[Styles.mb10]}>
<ScrollView horizontal style={[Styles.mb10]} showsHorizontalScrollIndicator={false}>
<ButtonTab
active={statusFix}
value="0"

View File

@@ -119,7 +119,7 @@ export default function AddMemberDivision() {
selectMember.length > 0
?
<View>
<ScrollView horizontal style={[Styles.mb10, Styles.pv10]}>
<ScrollView horizontal style={[Styles.mb10, Styles.pv10]} showsHorizontalScrollIndicator={false}>
{
selectMember.map((item: any, index: any) => (
<ImageWithLabel
@@ -136,7 +136,9 @@ export default function AddMemberDivision() {
:
<Text style={[Styles.textDefault, Styles.cGray, Styles.pv05, { textAlign: 'center' }]}>Tidak ada member yang dipilih</Text>
}
<ScrollView>
<ScrollView
showsVerticalScrollIndicator={false}
>
{
data.length > 0 ?

View File

@@ -81,7 +81,7 @@ export default function CreateDivisionAddMember() {
selectMember.length > 0
?
<View>
<ScrollView horizontal style={[Styles.mb10, Styles.pv10]}>
<ScrollView horizontal style={[Styles.mb10, Styles.pv10]} showsHorizontalScrollIndicator={false}>
{
selectMember.map((item: any, index: any) => (
<ImageWithLabel
@@ -98,7 +98,9 @@ export default function CreateDivisionAddMember() {
:
<Text style={[Styles.textDefault, Styles.cGray, Styles.pv05, { textAlign: 'center' }]}>Tidak ada member yang dipilih</Text>
}
<ScrollView>
<ScrollView
showsVerticalScrollIndicator={false}
>
{
data.length > 0 ?

View File

@@ -231,7 +231,7 @@ export default function CreateMember() {
behavior={Platform.OS === 'ios' ? 'padding' : undefined}
keyboardVerticalOffset={headerHeight}
>
<ScrollView>
<ScrollView showsVerticalScrollIndicator={false}>
<View style={[Styles.p15]}>
<View style={{ justifyContent: "center", alignItems: "center" }}>
{selectedImage != undefined ? (

View File

@@ -264,8 +264,8 @@ export default function EditMember() {
behavior={Platform.OS === 'ios' ? 'padding' : undefined}
keyboardVerticalOffset={headerHeight}
>
<ScrollView>
<View style={[Styles.p15, Styles.mb100]}>
<ScrollView showsVerticalScrollIndicator={false} style={[Styles.h100]}>
<View style={[Styles.p15]}>
<View style={{ justifyContent: "center", alignItems: "center" }}>
{
errorImg ?

View File

@@ -117,7 +117,7 @@ export default function AddMemberProject() {
selectMember.length > 0
?
<View>
<ScrollView horizontal style={[Styles.mb10, Styles.pv10]}>
<ScrollView horizontal style={[Styles.mb10, Styles.pv10]} showsHorizontalScrollIndicator={false}>
{
selectMember.map((item: any, index: any) => (
<ImageWithLabel
@@ -134,35 +134,43 @@ export default function AddMemberProject() {
:
<Text style={[Styles.textDefault, Styles.cGray, Styles.pv05, { textAlign: 'center' }]}>Tidak ada member yang dipilih</Text>
}
<ScrollView>
<ScrollView
showsVerticalScrollIndicator={false}
style={[Styles.h100]}
>
{
data.length > 0 ?
data.map((item: any, index: any) => {
const found = dataOld.some((i: any) => i.idUser == item.id)
return (
<Pressable
key={index}
style={[Styles.itemSelectModal]}
onPress={() => {
!found && onChoose(item.id, item.name, item.img)
}}
>
<View style={[Styles.rowItemsCenter, Styles.w80]}>
<ImageUser src={`${ConstEnv.url_storage}/files/${item.img}`} border />
<View style={[Styles.ml10]}>
<Text style={[Styles.textDefault]} numberOfLines={1}>{item.name}</Text>
<View style={[Styles.mb100]}>
{
data.map((item: any, index: any) => {
const found = dataOld.some((i: any) => i.idUser == item.id)
return (
<Pressable
key={index}
style={[Styles.itemSelectModal]}
onPress={() => {
!found && onChoose(item.id, item.name, item.img)
}}
>
<View style={[Styles.rowItemsCenter, Styles.w80]}>
<ImageUser src={`${ConstEnv.url_storage}/files/${item.img}`} border />
<View style={[Styles.ml10]}>
<Text style={[Styles.textDefault]} numberOfLines={1}>{item.name}</Text>
{
found && <Text style={[Styles.textInformation, Styles.cGray]}>sudah menjadi anggota</Text>
}
</View>
</View>
{
found && <Text style={[Styles.textInformation, Styles.cGray]}>sudah menjadi anggota</Text>
selectMember.some((i: any) => i.idUser == item.id) && <AntDesign name="check" size={20} color={'black'} />
}
</View>
</View>
{
selectMember.some((i: any) => i.idUser == item.id) && <AntDesign name="check" size={20} color={'black'} />
}
</Pressable>
)
}
)
</Pressable>
)
}
)
}
</View>
:
<Text style={[Styles.textDefault, { textAlign: 'center' }]}>Tidak ada data</Text>
}

View File

@@ -88,8 +88,11 @@ export default function ProjectCancel() {
),
}}
/>
<ScrollView>
<View style={[Styles.p15, Styles.mb100]}>
<ScrollView
showsVerticalScrollIndicator={false}
style={[Styles.h100]}
>
<View style={[Styles.p15]}>
<InputForm
label="Alasan Pembatalan"
type="default"
@@ -99,6 +102,7 @@ export default function ProjectCancel() {
error={error}
errorText="Alasan pembatalan harus diisi"
onChange={(val) => onValidation(val)}
multiline
/>
</View>
</ScrollView>

View File

@@ -107,8 +107,11 @@ export default function ReportProject() {
),
}}
/>
<ScrollView>
<View style={[Styles.p15, Styles.mb100]}>
<ScrollView
showsVerticalScrollIndicator={false}
style={[Styles.h100]}
>
<View style={[Styles.p15]}>
<InputForm
label="Laporan Kegiatan"
type="default"

View File

@@ -205,8 +205,11 @@ export default function CreateProject() {
),
}}
/>
<ScrollView>
<View style={[Styles.p15, Styles.mb100]}>
<ScrollView
showsVerticalScrollIndicator={false}
style={[Styles.h100]}
>
<View style={[Styles.p15]}>
{
(entityUser.role == "supadmin" || entityUser.role == "developer")
&&

View File

@@ -95,7 +95,7 @@ export default function AddMemberCreateProject() {
selectMember.length > 0
?
<View>
<ScrollView horizontal style={[Styles.mb10, Styles.pv10]}>
<ScrollView horizontal style={[Styles.mb10, Styles.pv10]} showsHorizontalScrollIndicator={false}>
{
selectMember.map((item: any, index: any) => (
<ImageWithLabel
@@ -112,7 +112,9 @@ export default function AddMemberCreateProject() {
:
<Text style={[Styles.textDefault, Styles.cGray, Styles.pv05, { textAlign: 'center' }]}>Tidak ada member yang dipilih</Text>
}
<ScrollView>
<ScrollView
showsVerticalScrollIndicator={false}
>
{
data.length > 0 ?

View File

@@ -120,7 +120,7 @@ export default function ListProject() {
return (
<View style={[Styles.p15, { flex: 1 }]}>
<View>
<ScrollView horizontal style={[Styles.mb10]}>
<ScrollView horizontal style={[Styles.mb10]} showsHorizontalScrollIndicator={false}>
<ButtonTab
active={statusFix}
value="0"