fix: sesuaikan warna border dengan tema pada halaman pilih anggota dan admin divisi
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import Styles from "@/constants/Styles";
|
||||
import { useTheme } from "@/providers/ThemeProvider";
|
||||
import { useState } from "react";
|
||||
import { Image } from "react-native";
|
||||
|
||||
@@ -9,12 +10,16 @@ type Props = {
|
||||
onError?: (val:boolean) => void
|
||||
}
|
||||
|
||||
export default function ImageUser({ src, size, onError }: Props) {
|
||||
export default function ImageUser({ src, size, border, onError }: Props) {
|
||||
const [error, setError] = useState(false)
|
||||
const { colors } = useTheme()
|
||||
return (
|
||||
<Image
|
||||
source={error ? require('../assets/images/user.jpg') : { uri: src }}
|
||||
style={[size == 'xs' ? Styles.userProfileExtraSmall : size == 'lg' ? Styles.userProfileBig : Styles.userProfileSmall, Styles.borderAll]}
|
||||
style={[
|
||||
size == 'xs' ? Styles.userProfileExtraSmall : size == 'lg' ? Styles.userProfileBig : Styles.userProfileSmall,
|
||||
border && { borderWidth: 1, borderColor: colors.icon + '40', borderRadius: 100 }
|
||||
]}
|
||||
onError={() => {
|
||||
setError(true)
|
||||
onError?.(true)
|
||||
|
||||
Reference in New Issue
Block a user