mirror of
https://github.com/tooot-app/app
synced 2025-03-12 09:30:11 +01:00
Dimming images for dark mode
This commit is contained in:
parent
e447a91cfb
commit
752d33d5b3
@ -45,6 +45,7 @@ const ComponentAccount: React.FC<PropsWithChildren & Props> = ({ account, props,
|
||||
borderRadius: 8,
|
||||
marginRight: StyleConstants.Spacing.S
|
||||
}}
|
||||
dim
|
||||
/>
|
||||
<View style={{ flex: 1 }}>
|
||||
<CustomText numberOfLines={1}>
|
||||
|
@ -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>
|
||||
)
|
||||
}
|
||||
|
@ -88,6 +88,7 @@ const TimelineConversation: React.FC<Props> = ({ conversation, queryKey, highlig
|
||||
: StyleConstants.Avatar.M
|
||||
}}
|
||||
style={{ flex: 1, flexBasis: '50%' }}
|
||||
dim
|
||||
/>
|
||||
))}
|
||||
</View>
|
||||
|
@ -83,11 +83,9 @@ const AttachmentAudio: React.FC<Props> = ({ total, index, sensitiveShown, audio
|
||||
<>
|
||||
{audio.preview_url ? (
|
||||
<GracefullyImage
|
||||
uri={{
|
||||
original: audio.preview_url,
|
||||
remote: audio.preview_remote_url
|
||||
}}
|
||||
uri={{ original: audio.preview_url, remote: audio.preview_remote_url }}
|
||||
style={styles.background}
|
||||
dim
|
||||
/>
|
||||
) : null}
|
||||
<Button
|
||||
|
@ -39,6 +39,7 @@ const AttachmentImage = ({
|
||||
blurhash={image.blurhash}
|
||||
onPress={() => navigateToImagesViewer(image.id)}
|
||||
style={{ aspectRatio: aspectRatio({ total, index, ...image.meta?.original }) }}
|
||||
dim
|
||||
/>
|
||||
</View>
|
||||
<AttachmentAltText sensitiveShown={sensitiveShown} text={image.description} />
|
||||
|
@ -31,8 +31,7 @@ const TimelineAvatar: React.FC<Props> = ({ account }) => {
|
||||
})
|
||||
})}
|
||||
onPress={() =>
|
||||
!disableOnPress &&
|
||||
navigation.push('Tab-Shared-Account', { account: actualAccount })
|
||||
!disableOnPress && navigation.push('Tab-Shared-Account', { account: actualAccount })
|
||||
}
|
||||
uri={{ original: actualAccount.avatar, static: actualAccount.avatar_static }}
|
||||
dimension={
|
||||
@ -51,6 +50,7 @@ const TimelineAvatar: React.FC<Props> = ({ account }) => {
|
||||
overflow: 'hidden',
|
||||
marginRight: StyleConstants.Spacing.S
|
||||
}}
|
||||
dim
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
@ -86,6 +86,7 @@ const TimelineCard: React.FC = () => {
|
||||
blurhash={status.card.blurhash}
|
||||
style={{ flexBasis: StyleConstants.Font.LineHeight.M * 5 }}
|
||||
imageStyle={{ borderTopLeftRadius: 6, borderBottomLeftRadius: 6 }}
|
||||
dim
|
||||
/>
|
||||
) : null}
|
||||
<View style={{ flex: 1, padding: StyleConstants.Spacing.S }}>
|
||||
|
@ -93,6 +93,7 @@ const AccountAttachments: React.FC = () => {
|
||||
dimension={{ width: width, height: width }}
|
||||
style={{ marginLeft: StyleConstants.Spacing.Global.PagePadding }}
|
||||
onPress={() => navigation.push('Tab-Shared-Toot', { toot: item })}
|
||||
dim
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
@ -28,6 +28,7 @@ const AccountHeader: React.FC = () => {
|
||||
)
|
||||
}
|
||||
}}
|
||||
dim
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
@ -42,6 +42,7 @@ const AccountInformationAvatar: React.FC = () => {
|
||||
}
|
||||
}
|
||||
}}
|
||||
dim
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
@ -89,11 +89,6 @@ const ScreenTabs = () => {
|
||||
name='Tab-Me'
|
||||
component={TabMe}
|
||||
listeners={({ navigation }) => ({
|
||||
tabPress: () => {
|
||||
if (navigation.isFocused()) {
|
||||
navigation.navigate('Tab-Me', { screen: 'Tab-Me-Switch' })
|
||||
}
|
||||
},
|
||||
tabLongPress: () => {
|
||||
haptics('Light')
|
||||
navigation.navigate('Tab-Me', { screen: 'Tab-Me-Root' })
|
||||
|
Loading…
x
Reference in New Issue
Block a user