fix : tampilan

deskripsi:
- detail divisi > on klik pda file
- update project dan tugas divisi tidak perlu loading judul project
- tampilan notifikasi top right info

No Issues
This commit is contained in:
2025-07-22 15:27:13 +08:00
parent 88dd6165f2
commit b4eab22731
6 changed files with 84 additions and 29 deletions

View File

@@ -104,7 +104,7 @@ export default function AddMemberTask() {
)
}}
/>
<View style={[Styles.p15]}>
<View style={[Styles.p15, Styles.mb100]}>
<InputSearch onChange={(val) => setSearch(val)} value={search} />
{
@@ -142,10 +142,10 @@ export default function AddMemberTask() {
!found && onChoose(item.idUser, item.name, item.img)
}}
>
<View style={[Styles.rowItemsCenter]}>
<View style={[Styles.rowItemsCenter, Styles.w80]}>
<ImageUser src={`https://wibu-storage.wibudev.com/api/files/${item.img}`} border />
<View style={[Styles.ml10]}>
<Text style={[Styles.textDefault]}>{item.name}</Text>
<Text style={[Styles.textDefault]} numberOfLines={1}>{item.name}</Text>
{
found && <Text style={[Styles.textInformation, Styles.cGray]}>sudah menjadi anggota</Text>
}

View File

@@ -31,14 +31,16 @@ export default function DetailTaskDivision() {
const update = useSelector((state: any) => state.taskUpdate)
async function handleLoad() {
async function handleLoad(cat: 'data' | 'progress') {
try {
setLoading(true)
if (cat == 'data') setLoading(true)
const hasil = await decryptToken(String(token?.current))
const response = await apiGetTaskOne({ id: detail, user: hasil, cat: 'data' })
setData(response.data)
const responseProgress = await apiGetTaskOne({ id: detail, user: hasil, cat: 'progress' })
setProgress(responseProgress.data.progress)
const response = await apiGetTaskOne({ id: detail, user: hasil, cat: cat })
if (cat == 'data') {
setData(response.data)
} else {
setProgress(response.data.progress)
}
} catch (error) {
console.error(error)
} finally {
@@ -47,8 +49,12 @@ export default function DetailTaskDivision() {
}
useEffect(() => {
handleLoad()
}, [update.progress, update.data])
handleLoad('data')
}, [update.data])
useEffect(() => {
handleLoad('progress')
}, [update.progress])
return (
<SafeAreaView>
@@ -57,7 +63,7 @@ export default function DetailTaskDivision() {
headerLeft: () => <ButtonBackHeader onPress={() => { router.back() }} />,
headerTitle: loading ? 'Loading... ' : data?.title,
headerTitleAlign: 'center',
headerRight: () => <HeaderRightTaskDetail id={detail} division={id} status={data?.status}/>,
headerRight: () => <HeaderRightTaskDetail id={detail} division={id} status={data?.status} />,
}}
/>
<ScrollView>

View File

@@ -135,6 +135,7 @@ export default function Notification() {
return (
<BorderBottomItem
borderType="bottom"
width={55}
icon={
<View style={[Styles.iconContent, item.isRead ? ColorsStatus.secondary : ColorsStatus.primary]}>
<Feather name="bell" size={25} color="white" />

View File

@@ -102,9 +102,8 @@ export default function AddMemberProject() {
)
}}
/>
<View style={[Styles.p15]}>
<View style={[Styles.p15, Styles.mb100]}>
<InputSearch onChange={(val) => handleSearch(val)} value={search} />
{
selectMember.length > 0
?
@@ -115,7 +114,7 @@ export default function AddMemberProject() {
<ImageWithLabel
key={index}
label={item.name}
src={item.img}
src={`https://wibu-storage.wibudev.com/api/files/${item.img}`}
onClick={() => onChoose(item.idUser, item.name, item.img)}
/>
))
@@ -127,7 +126,6 @@ export default function AddMemberProject() {
<Text style={[Styles.textDefault, Styles.cGray, Styles.pv05, { textAlign: 'center' }]}>Tidak ada member yang dipilih</Text>
}
<ScrollView>
{
data.length > 0 ?
data.map((item: any, index: any) => {
@@ -140,10 +138,10 @@ export default function AddMemberProject() {
!found && onChoose(item.id, item.name, item.img)
}}
>
<View style={[Styles.rowItemsCenter]}>
<View style={[Styles.rowItemsCenter, Styles.w80]}>
<ImageUser src={`https://wibu-storage.wibudev.com/api/files/${item.img}`} border />
<View style={[Styles.ml10]}>
<Text style={[Styles.textDefault]}>{item.name}</Text>
<Text style={[Styles.textDefault]} numberOfLines={1}>{item.name}</Text>
{
found && <Text style={[Styles.textInformation, Styles.cGray]}>sudah menjadi anggota</Text>
}

View File

@@ -38,14 +38,16 @@ export default function DetailProject() {
const [isMember, setIsMember] = useState(false)
const entityUser = useSelector((state: any) => state.user)
async function handleLoad() {
async function handleLoad(cat: 'data' | 'progress') {
try {
setLoading(true)
if (cat == 'data') setLoading(true)
const hasil = await decryptToken(String(token?.current))
const response = await apiGetProjectOne({ user: hasil, cat: 'data', id: id })
setData(response.data)
const responseProgress = await apiGetProjectOne({ user: hasil, cat: 'progress', id: id })
setProgress(responseProgress.data.progress)
const response = await apiGetProjectOne({ user: hasil, cat: cat, id: id })
if (cat == 'data') {
setData(response.data)
} else {
setProgress(response.data.progress)
}
} catch (error) {
console.error(error)
} finally {
@@ -65,8 +67,12 @@ export default function DetailProject() {
}
useEffect(() => {
handleLoad()
}, [update.data, update.progress])
handleLoad('data')
}, [update.data])
useEffect(() => {
handleLoad('progress')
}, [update.progress])
useEffect(() => {
checkMember()