From a78fe5ffe8d2f27a2e4a0b8a9ea20d870831f2b2 Mon Sep 17 00:00:00 2001 From: xmflsct Date: Sun, 12 Feb 2023 23:08:15 +0100 Subject: [PATCH 1/2] Added attachment border radius --- ios/Podfile.lock | 4 +- package.json | 4 +- src/components/GracefullyImage.tsx | 14 +---- .../Timeline/Shared/Attachment/Audio.tsx | 4 +- .../Timeline/Shared/Attachment/Image.tsx | 12 ++++- .../Shared/Attachment/Unsupported.tsx | 4 +- .../Timeline/Shared/Attachment/Video.tsx | 4 +- .../Timeline/Shared/Attachment/index.tsx | 52 +++++++++---------- src/screens/Compose/EditAttachment.tsx | 2 +- .../Compose/Root/Footer/Attachments.tsx | 2 +- yarn.lock | 30 +++++------ 11 files changed, 68 insertions(+), 64 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 19c7394b..e70d7255 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -352,7 +352,7 @@ PODS: - React - react-native-menu (0.7.3): - React - - react-native-mmkv (2.6.1): + - react-native-mmkv (2.7.0): - MMKV (>= 1.2.13) - React-Core - react-native-netinfo (9.3.7): @@ -825,7 +825,7 @@ SPEC CHECKSUMS: react-native-ios-context-menu: e529171ba760a1af7f2ef0729f5a7f4d226171c5 react-native-language-detection: f414937fa715108ab50a6269a3de0bcb95e4ceb0 react-native-menu: 9d7d6f819cc7fa14a15cf86888c53f3240d86f1b - react-native-mmkv: 28af0c2a3dc9495c2cea80f9d41444e096c2a1ef + react-native-mmkv: a2a40a0458bdbc9d43c4e7752ecfc5e3a87b66dd react-native-netinfo: 2517ad504b3d303e90d7a431b0fcaef76d207983 react-native-pager-view: 54bed894cecebe28cede54c01038d9d1e122de43 react-native-paste-input: fb7156dc75960c9895ddd9b9d68eeb874c9f323a diff --git a/package.json b/package.json index 96cfbca4..55f9d52f 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "@react-navigation/stack": "^6.3.12", "@sentry/react-native": "4.14.0", "@sharcoux/slider": "^6.1.1", - "@tanstack/react-query": "^4.24.4", + "@tanstack/react-query": "^4.24.6", "axios": "^1.3.2", "diff": "^5.1.0", "expo": "^48.0.0-beta", @@ -76,7 +76,7 @@ "react-native-image-picker": "^5.0.1", "react-native-ios-context-menu": "^1.15.3", "react-native-language-detection": "^0.2.2", - "react-native-mmkv": "~2.6.1", + "react-native-mmkv": "~2.7.0", "react-native-pager-view": "^6.1.2", "react-native-quick-base64": "^2.0.5", "react-native-reanimated": "^2.14.4", diff --git a/src/components/GracefullyImage.tsx b/src/components/GracefullyImage.tsx index 23ce899f..fb95f5b0 100644 --- a/src/components/GracefullyImage.tsx +++ b/src/components/GracefullyImage.tsx @@ -21,13 +21,7 @@ export interface Props { onPress?: () => void style?: StyleProp imageStyle?: ImageStyle - // For image viewer when there is no image size available - setImageDimensions?: React.Dispatch< - React.SetStateAction<{ - width: number - height: number - }> - > + dim?: boolean enableLiveTextInteraction?: boolean } @@ -41,7 +35,6 @@ const GracefullyImage = ({ onPress, style, imageStyle, - setImageDimensions, dim, enableLiveTextInteraction = false }: Props) => { @@ -68,11 +61,6 @@ const GracefullyImage = ({ source={hidden ? undefined : connectMedia(source)} transition={{ duration: 80 }} style={{ flex: 1, ...imageStyle }} - onLoad={event => { - if (setImageDimensions && event.source) { - setImageDimensions(event.source) - } - }} onError={() => { if ( sources.default?.uri && diff --git a/src/components/Timeline/Shared/Attachment/Audio.tsx b/src/components/Timeline/Shared/Attachment/Audio.tsx index 65ae47ec..4e176df8 100644 --- a/src/components/Timeline/Shared/Attachment/Audio.tsx +++ b/src/components/Timeline/Shared/Attachment/Audio.tsx @@ -64,7 +64,9 @@ const AttachmentAudio: React.FC = ({ total, index, sensitiveShown, audio flex: 1, flexDirection: 'row', backgroundColor: colors.shimmerDefault, - aspectRatio: aspectRatio({ total, index, ...audio.meta?.original }) + aspectRatio: aspectRatio({ total, index, ...audio.meta?.original }), + borderRadius: StyleConstants.BorderRadius / 2, + overflow: 'hidden' }} > +