From 752d33d5b3b801f7818ebbb50eb380126340ac2a Mon Sep 17 00:00:00 2001 From: xmflsct Date: Sun, 29 Jan 2023 17:28:49 +0100 Subject: [PATCH] Dimming images for dark mode --- src/components/Account.tsx | 1 + src/components/GracefullyImage.tsx | 14 ++++++++++++-- src/components/Timeline/Conversation.tsx | 1 + .../Timeline/Shared/Attachment/Audio.tsx | 6 ++---- .../Timeline/Shared/Attachment/Image.tsx | 1 + src/components/Timeline/Shared/Avatar.tsx | 4 ++-- src/components/Timeline/Shared/Card.tsx | 1 + src/screens/Tabs/Shared/Account/Attachments.tsx | 1 + src/screens/Tabs/Shared/Account/Header.tsx | 1 + .../Tabs/Shared/Account/Information/Avatar.tsx | 1 + src/screens/Tabs/index.tsx | 5 ----- 11 files changed, 23 insertions(+), 13 deletions(-) diff --git a/src/components/Account.tsx b/src/components/Account.tsx index a59b51f1..da062c03 100644 --- a/src/components/Account.tsx +++ b/src/components/Account.tsx @@ -45,6 +45,7 @@ const ComponentAccount: React.FC = ({ account, props, borderRadius: 8, marginRight: StyleConstants.Spacing.S }} + dim /> diff --git a/src/components/GracefullyImage.tsx b/src/components/GracefullyImage.tsx index 9a708980..30aec804 100644 --- a/src/components/GracefullyImage.tsx +++ b/src/components/GracefullyImage.tsx @@ -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(uri.original || uri.remote) @@ -111,6 +113,14 @@ const GracefullyImage = ({ }} /> {blurhashView()} + {dim && theme !== 'light' ? ( + + ) : null} ) } diff --git a/src/components/Timeline/Conversation.tsx b/src/components/Timeline/Conversation.tsx index 3f492e49..182fde47 100644 --- a/src/components/Timeline/Conversation.tsx +++ b/src/components/Timeline/Conversation.tsx @@ -88,6 +88,7 @@ const TimelineConversation: React.FC = ({ conversation, queryKey, highlig : StyleConstants.Avatar.M }} style={{ flex: 1, flexBasis: '50%' }} + dim /> ))} diff --git a/src/components/Timeline/Shared/Attachment/Audio.tsx b/src/components/Timeline/Shared/Attachment/Audio.tsx index 3c3cd5ee..94cbdde0 100644 --- a/src/components/Timeline/Shared/Attachment/Audio.tsx +++ b/src/components/Timeline/Shared/Attachment/Audio.tsx @@ -83,11 +83,9 @@ const AttachmentAudio: React.FC = ({ total, index, sensitiveShown, audio <> {audio.preview_url ? ( ) : null}