From d82f0c5b202bc3eb093f047b96187601ac74325f Mon Sep 17 00:00:00 2001 From: amaliadwiy Date: Thu, 7 May 2026 16:45:52 +0800 Subject: [PATCH] feat: redesign halaman detail user dan profile dengan tampilan modern - Pindahkan badge APPROVER & AKTIF ke dalam header gradient - Ganti card berlatar menjadi list dengan border bottom saja - Gunakan icon colors.icon agar terlihat pada tema gelap - Tambahkan class baru di Styles.ts: memberAvatarRing, memberBadgeRow, memberBadgeApprover, memberBadgePill, memberInfoRow, memberInfoIcon, memberInfoContent, cWhiteDimmed, pv14, mb08 - Terapkan design yang sama pada halaman profile --- app/(application)/member/[id].tsx | 115 ++++++++++++++++-------------- app/(application)/profile.tsx | 75 ++++++++++++------- constants/Styles.ts | 45 ++++++++++++ 3 files changed, 156 insertions(+), 79 deletions(-) diff --git a/app/(application)/member/[id].tsx b/app/(application)/member/[id].tsx index 4b5cbab..201d351 100644 --- a/app/(application)/member/[id].tsx +++ b/app/(application)/member/[id].tsx @@ -1,6 +1,5 @@ import AppHeader from "@/components/AppHeader"; import ImageUser from "@/components/imageNew"; -import ItemDetailMember from "@/components/itemDetailMember"; import LabelStatus from "@/components/labelStatus"; import HeaderRightMemberDetail from "@/components/member/headerMemberDetail"; import Skeleton from "@/components/skeleton"; @@ -11,6 +10,7 @@ import { valueRoleUser } from "@/constants/RoleUser"; import Styles from "@/constants/Styles"; import { apiGetProfile } from "@/lib/api"; import { useTheme } from "@/providers/ThemeProvider"; +import { AntDesign, MaterialCommunityIcons, MaterialIcons } from "@expo/vector-icons"; import { LinearGradient } from "expo-linear-gradient"; import { router, Stack, useLocalSearchParams } from "expo-router"; import React, { useEffect, useState } from "react"; @@ -110,60 +110,71 @@ export default function MemberDetail() { colors={[colors.header, colors.homeGradient]} style={[Styles.wrapHeadViewMember]} > - { - loading ? - <> - - - - - : - <> - setPreview(true)}> + {loading ? ( + <> + + + + + ) : ( + <> + setPreview(true)}> + - - {data?.name} - {data?.role} - - - } + + + {data?.name} + {data?.role} + + {data?.isApprover && ( + + APPROVER + + )} + + {data?.isActive ? 'AKTIF' : 'TIDAK AKTIF'} + + + + )} - - - Informasi - - {data?.isApprover && ( - - )} - - - - { - loading ? - arrSkeleton.map((item, index) => { - return ( - - ) - }) - : - <> - - - - - - - - } + + Informasi + + {loading ? ( + arrSkeleton.map((_, index) => ( + + + + + + + )) + ) : ( + [ + { icon: , label: 'NIK', value: data?.nik }, + { icon: , label: 'Lembaga Desa', value: data?.group }, + { icon: , label: 'Jabatan', value: data?.position }, + { icon: , label: 'No Telepon', value: `+62${data?.phone}` }, + { icon: , label: 'Email', value: data?.email }, + { icon: , label: 'Jenis Kelamin', value: data?.gender == "F" ? "Perempuan" : "Laki-Laki" }, + ].map((item, index, arr) => ( + + + {item.icon} + + + {item.label} + {item.value ?? '-'} + + + )) + )} + diff --git a/app/(application)/profile.tsx b/app/(application)/profile.tsx index e9c90af..52c2f72 100644 --- a/app/(application)/profile.tsx +++ b/app/(application)/profile.tsx @@ -1,6 +1,5 @@ import AppHeader from "@/components/AppHeader"; import { ButtonHeader } from "@/components/buttonHeader"; -import ItemDetailMember from "@/components/itemDetailMember"; import Text from "@/components/Text"; import { assetUserImage } from "@/constants/AssetsError"; import { ConstEnv } from "@/constants/ConstEnv"; @@ -9,7 +8,7 @@ import { apiGetProfile } from "@/lib/api"; import { setEntities } from "@/lib/entitiesSlice"; import { useAuthSession } from "@/providers/AuthProvider"; import { useTheme } from "@/providers/ThemeProvider"; -import { Feather } from "@expo/vector-icons"; +import { Feather, MaterialCommunityIcons, MaterialIcons } from "@expo/vector-icons"; import { LinearGradient } from "expo-linear-gradient"; import { router, Stack } from "expo-router"; import { useState } from "react"; @@ -42,6 +41,15 @@ export default function Profile() { setRefreshing(false) }; + const infoRows = [ + { icon: , label: 'NIK', value: entities.nik }, + { icon: , label: 'Lembaga Desa', value: entities.group }, + { icon: , label: 'Jabatan', value: entities.position }, + { icon: , label: 'No Telepon', value: `0${entities.phone}` }, + { icon: , label: 'Email', value: entities.email }, + { icon: , label: 'Jenis Kelamin', value: entities.gender == "F" ? 'Perempuan' : 'Laki-laki' }, + ] + return ( } - onPress={() => { - router.push('/setting') - }} + onPress={() => router.push('/setting')} /> } /> @@ -75,32 +81,47 @@ export default function Profile() { } style={[Styles.h100, { backgroundColor: colors.background }]} > - - - setPreview(true)}> + + setPreview(true)}> + { setError(true) }} + onError={() => setError(true)} style={[Styles.userProfileBig]} /> - - {entities.name} - {entities.role} - - - - Informasi - {/* Note: ItemDetailMember might need updates to support dynamic colors if it uses default text colors */} - - - - - - + + {entities.name} + {entities.role} + {entities.isApprover && ( + + + APPROVER + + + )} + + + + Informasi + + {infoRows.map((item, index, arr) => ( + + + {item.icon} + + + {item.label} + {item.value ?? '-'} + + + ))} @@ -114,4 +135,4 @@ export default function Profile() { /> ) -} \ No newline at end of file +} diff --git a/constants/Styles.ts b/constants/Styles.ts index 976a1aa..b9fab98 100644 --- a/constants/Styles.ts +++ b/constants/Styles.ts @@ -1068,6 +1068,51 @@ const Styles = StyleSheet.create({ color: 'white', fontWeight: '500', }, + pv14: { + paddingVertical: 14, + }, + mb08: { + marginBottom: 8, + }, + cWhiteDimmed: { + color: 'rgba(255,255,255,0.7)', + }, + memberAvatarRing: { + borderWidth: 3, + borderColor: 'rgba(255,255,255,0.4)', + borderRadius: 100, + }, + memberBadgeRow: { + flexDirection: 'row', + gap: 8, + marginTop: 12, + }, + memberBadgeApprover: { + paddingHorizontal: 10, + paddingVertical: 4, + borderRadius: 20, + borderWidth: 1, + borderColor: 'rgba(255,255,255,0.6)', + backgroundColor: 'rgba(255,255,255,0.15)', + }, + memberBadgePill: { + paddingHorizontal: 10, + paddingVertical: 4, + borderRadius: 20, + }, + memberInfoRow: { + flexDirection: 'row', + alignItems: 'center', + paddingVertical: 14, + }, + memberInfoIcon: { + width: 36, + alignItems: 'center', + }, + memberInfoContent: { + flex: 1, + marginLeft: 10, + }, }) export default Styles; \ No newline at end of file