upd: refresh control

deskripsi:
- warna refresh control pada semua fitur
- warna bottom pada modal select

No Issues
This commit is contained in:
2026-02-18 16:35:04 +08:00
parent 64aaafa2be
commit 31b7cf6a30
28 changed files with 124 additions and 26 deletions

View File

@@ -5,20 +5,42 @@ import Text from "@/components/Text";
import { assetUserImage } from "@/constants/AssetsError";
import { ConstEnv } from "@/constants/ConstEnv";
import Styles from "@/constants/Styles";
import { apiGetProfile } from "@/lib/api";
import { setEntities } from "@/lib/entitiesSlice";
import { useAuthSession } from "@/providers/AuthProvider";
import { useTheme } from "@/providers/ThemeProvider";
import { Feather, Ionicons } from "@expo/vector-icons";
import { Feather } from "@expo/vector-icons";
import { LinearGradient } from "expo-linear-gradient";
import { router, Stack } from "expo-router";
import { useState } from "react";
import { Image, Modal, Pressable, SafeAreaView, ScrollView, TouchableOpacity, View } from "react-native";
import { Image, Pressable, RefreshControl, SafeAreaView, ScrollView, View } from "react-native";
import ImageViewing from 'react-native-image-viewing';
import { useSelector } from 'react-redux';
import { useDispatch, useSelector } from 'react-redux';
export default function Profile() {
const { colors } = useTheme();
const entities = useSelector((state: any) => state.entities)
const [error, setError] = useState(false)
const [preview, setPreview] = useState(false)
const [refreshing, setRefreshing] = useState(false)
const dispatch = useDispatch()
const { token, decryptToken } = useAuthSession()
async function handleUserLogin() {
const hasil = await decryptToken(String(token?.current))
apiGetProfile({ id: hasil })
.then((data) => dispatch(setEntities(data.data)))
.catch((error) => {
console.error(error)
});
}
const handleRefresh = async () => {
setRefreshing(true)
handleUserLogin()
await new Promise(resolve => setTimeout(resolve, 2000));
setRefreshing(false)
};
return (
<SafeAreaView style={{ flex: 1, backgroundColor: colors.background }}>
@@ -43,7 +65,16 @@ export default function Profile() {
)
}}
/>
<ScrollView style={[Styles.h100, { backgroundColor: colors.background }]}>
<ScrollView
refreshControl={
<RefreshControl
refreshing={refreshing}
onRefresh={handleRefresh}
tintColor={colors.icon}
/>
}
style={[Styles.h100, { backgroundColor: colors.background }]}
>
<View style={{ flexDirection: 'column' }}>
<LinearGradient
colors={[colors.header, colors.homeGradient]}