1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00

Dimming images for dark mode

This commit is contained in:
xmflsct
2023-01-29 17:28:49 +01:00
parent e447a91cfb
commit 752d33d5b3
11 changed files with 23 additions and 13 deletions

View File

@ -38,6 +38,7 @@ export interface Props {
height: number
}>
>
dim?: boolean
}
const GracefullyImage = ({
@ -50,10 +51,11 @@ const GracefullyImage = ({
onPress,
style,
imageStyle,
setImageDimensions
setImageDimensions,
dim
}: Props) => {
const { reduceMotionEnabled } = useAccessibility()
const { colors } = useTheme()
const { colors, theme } = useTheme()
const [imageLoaded, setImageLoaded] = useState(false)
const [currentUri, setCurrentUri] = useState<string | undefined>(uri.original || uri.remote)
@ -111,6 +113,14 @@ const GracefullyImage = ({
}}
/>
{blurhashView()}
{dim && theme !== 'light' ? (
<View
style={[
styles.placeholder,
{ backgroundColor: 'black', opacity: theme === 'dark_lighter' ? 0.18 : 0.36 }
]}
/>
) : null}
</Pressable>
)
}