From 852b8ae27167eab812010a4960b7e362972aea35 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Sat, 2 Nov 2024 12:48:39 +0000 Subject: [PATCH] Rename shapes to semantic meanings It looks like after all I do want to fork based on those. --- src/screens/Profile/Header/Shell.tsx | 2 +- src/view/com/lightbox/ImageViewing/@types/index.ts | 2 +- .../ImageViewing/components/ImageItem/ImageItem.android.tsx | 4 ++-- .../ImageViewing/components/ImageItem/ImageItem.ios.tsx | 4 ++-- src/view/com/profile/ProfileSubpageHeader.tsx | 2 +- src/view/com/util/post-embeds/index.tsx | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/screens/Profile/Header/Shell.tsx b/src/screens/Profile/Header/Shell.tsx index f0d33466fc..b6eb6bb8b0 100644 --- a/src/screens/Profile/Header/Shell.tsx +++ b/src/screens/Profile/Header/Shell.tsx @@ -72,7 +72,7 @@ let ProfileHeaderShell = ({ height: 1000, width: 1000, }, - shape: 'circle', + type: 'circle-avi', }, ], index: 0, diff --git a/src/view/com/lightbox/ImageViewing/@types/index.ts b/src/view/com/lightbox/ImageViewing/@types/index.ts index 008cba8733..9b1cc785fb 100644 --- a/src/view/com/lightbox/ImageViewing/@types/index.ts +++ b/src/view/com/lightbox/ImageViewing/@types/index.ts @@ -24,5 +24,5 @@ export type ImageSource = { thumbRect: MeasuredDimensions | null alt?: string dimensions: Dimensions | null - shape: 'circle' | 'rect' | 'rounded-rect' + type: 'image' | 'circle-avi' | 'rect-avi' } diff --git a/src/view/com/lightbox/ImageViewing/components/ImageItem/ImageItem.android.tsx b/src/view/com/lightbox/ImageViewing/components/ImageItem/ImageItem.android.tsx index 807b064566..9d0ea67007 100644 --- a/src/view/com/lightbox/ImageViewing/components/ImageItem/ImageItem.android.tsx +++ b/src/view/com/lightbox/ImageViewing/components/ImageItem/ImageItem.android.tsx @@ -309,9 +309,9 @@ const ImageItem = ({ width: SCREEN.width, height: imageAspect ? SCREEN.width / imageAspect : undefined, borderRadius: - imageSrc.shape === 'circle' + imageSrc.type === 'circle-avi' ? SCREEN.width / 2 - : imageSrc.shape === 'rounded-rect' + : imageSrc.type === 'rect-avi' ? 20 : 0, }} diff --git a/src/view/com/lightbox/ImageViewing/components/ImageItem/ImageItem.ios.tsx b/src/view/com/lightbox/ImageViewing/components/ImageItem/ImageItem.ios.tsx index 5435589358..daad19bef3 100644 --- a/src/view/com/lightbox/ImageViewing/components/ImageItem/ImageItem.ios.tsx +++ b/src/view/com/lightbox/ImageViewing/components/ImageItem/ImageItem.ios.tsx @@ -138,9 +138,9 @@ const ImageItem = ({ width: SCREEN.width, height: imageAspect ? SCREEN.width / imageAspect : undefined, borderRadius: - imageSrc.shape === 'circle' + imageSrc.type === 'circle-avi' ? SCREEN.width / 2 - : imageSrc.shape === 'rounded-rect' + : imageSrc.type === 'rect-avi' ? 20 : 0, }} diff --git a/src/view/com/profile/ProfileSubpageHeader.tsx b/src/view/com/profile/ProfileSubpageHeader.tsx index daa1f01185..4462af325e 100644 --- a/src/view/com/profile/ProfileSubpageHeader.tsx +++ b/src/view/com/profile/ProfileSubpageHeader.tsx @@ -87,7 +87,7 @@ export function ProfileSubpageHeader({ height: 1000, width: 1000, }, - shape: 'rounded-rect', + type: 'rect-avi', }, ], index: 0, diff --git a/src/view/com/util/post-embeds/index.tsx b/src/view/com/util/post-embeds/index.tsx index 67ab1f5e60..9ec04298f0 100644 --- a/src/view/com/util/post-embeds/index.tsx +++ b/src/view/com/util/post-embeds/index.tsx @@ -155,7 +155,7 @@ export function PostEmbeds({ images: items.map((item, i) => ({ ...item, thumbRect: thumbRects[i] ?? null, - shape: 'rect', + type: 'image', })), index, })