Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: cleanup images, officially retire OpaqueImageView #11264

Merged
merged 30 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
f6699b1
remove stable palette image flag
brainbicycle Dec 9, 2024
01da57f
delete OpaqueImageView2 component, default to OpaqueImageView
brainbicycle Dec 9, 2024
44312e5
remove usage in ArticleCard
brainbicycle Dec 9, 2024
d9e53d4
remove usage in ArtistShow
brainbicycle Dec 9, 2024
060201b
remove usage in ArtistAutosuggestRow
brainbicycle Dec 9, 2024
4568539
remove usage in ArtworkListImage
brainbicycle Dec 9, 2024
0875b98
remove usage in SavedItemRow
brainbicycle Dec 9, 2024
62c2a54
remove usage in ShowItemRow
brainbicycle Dec 9, 2024
0e3aec8
remove usage in SaleArtworkTileRailCard
brainbicycle Dec 9, 2024
bbde155
remove usage in Toast
brainbicycle Dec 9, 2024
57cbe29
remove usage in ArtistSeriesHeader
brainbicycle Dec 9, 2024
3e3dba8
remove usage in ArtistSeriesListItem
brainbicycle Dec 9, 2024
6f35deb
remove usage in TabFairItemRow
brainbicycle Dec 9, 2024
57247af
remove comment in DeepZoomTile
brainbicycle Dec 9, 2024
49e0246
remove all simple usages
brainbicycle Dec 9, 2024
72c1aad
remove more simple usages
brainbicycle Dec 9, 2024
2c2734f
remove my collection usage
brainbicycle Dec 10, 2024
478878a
use util from palette
brainbicycle Dec 10, 2024
c3daf30
replace usage in ShowContextCard
brainbicycle Dec 10, 2024
a92b4ac
replace usage in ImageZoomView
brainbicycle Dec 10, 2024
9b8da61
delete OpaqueImageView code
brainbicycle Dec 10, 2024
c4497ff
fix artist list item test
brainbicycle Dec 10, 2024
1a05ede
fix collection header test
brainbicycle Dec 10, 2024
c2a2a87
fix collectionArtistSeriesRail test
brainbicycle Dec 10, 2024
d327ba4
fix showContextCard test
brainbicycle Dec 10, 2024
a618a74
fix saleArtworkTileRailCard tests
brainbicycle Dec 10, 2024
7858ffd
fix broken FairEventSectionCard
brainbicycle Dec 10, 2024
73d23d0
fix broken ActiveBid
brainbicycle Dec 10, 2024
1f10d64
fix broken ImagePreview
brainbicycle Dec 10, 2024
1f04457
fix broken conversation components
brainbicycle Dec 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 16 additions & 11 deletions src/app/Components/ArticleCard.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
import { Spacer, Flex, useTheme, Text, Touchable, SkeletonBox, SkeletonText } from "@artsy/palette-mobile"
import {
Spacer,
Flex,
useTheme,
Text,
Touchable,
SkeletonBox,
SkeletonText,
Image,
} from "@artsy/palette-mobile"
import { ArticleCard_article$data } from "__generated__/ArticleCard_article.graphql"
import { OpaqueImageView } from "app/Components/OpaqueImageView2"
import { navigate } from "app/system/navigation/navigate"
import { compact } from "lodash"
import { DateTime } from "luxon"
Expand Down Expand Up @@ -42,8 +50,8 @@ export const ArticleCard: React.FC<ArticleCardProps> = ({ article, onPress, isFl
(isFluid ? (
<>
<View style={{ width }}>
<OpaqueImageView
imageURL={imageURL}
<Image
src={imageURL}
// aspect ratio is fixed to 1.33 to match the old image aspect ratio
aspectRatio={1.33}
// 40 here comes from the mx={2} from the parent component
Expand All @@ -52,8 +60,8 @@ export const ArticleCard: React.FC<ArticleCardProps> = ({ article, onPress, isFl
</View>
</>
) : (
<OpaqueImageView
imageURL={imageURL}
<Image
src={imageURL}
width={ARTICLE_CARD_IMAGE_WIDTH}
height={ARTICLE_CARD_IMAGE_HEIGHT}
/>
Expand Down Expand Up @@ -97,10 +105,7 @@ export const ArticleCardContainer = createFragmentContainer(ArticleCard, {

export const SkeletonArticleCard: React.FC = () => (
<Flex maxWidth={ARTICLE_CARD_IMAGE_WIDTH}>
<SkeletonBox
height={ARTICLE_CARD_IMAGE_HEIGHT}
width={ARTICLE_CARD_IMAGE_WIDTH}
/>
<SkeletonBox height={ARTICLE_CARD_IMAGE_HEIGHT} width={ARTICLE_CARD_IMAGE_WIDTH} />
<Spacer y={1} />
<SkeletonText variant="lg-display" mb={0.5}>
10 Shows we suggest you don't miss during Berlin Art Week
Expand All @@ -113,4 +118,4 @@ export const SkeletonArticleCard: React.FC = () => (
Art • Sep 10, 2024
</SkeletonText>
</Flex>
)
)
19 changes: 10 additions & 9 deletions src/app/Components/Artist/ArtistShows/ArtistShow.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { ActionType, ContextModule, OwnerType, TappedShowGroup } from "@artsy/cohesion"
import { Touchable } from "@artsy/palette-mobile"
import { Image, Touchable } from "@artsy/palette-mobile"
import { ArtistShow_show$data, ArtistShow_show$key } from "__generated__/ArtistShow_show.graphql"
import OpaqueImageView from "app/Components/OpaqueImageView/OpaqueImageView"
import { navigate } from "app/system/navigation/navigate"
import { useFeatureFlag } from "app/utils/hooks/useFeatureFlag"
import { hrefForPartialShow } from "app/utils/router"
Expand Down Expand Up @@ -42,13 +41,15 @@ export const ArtistShow: React.FC<Props> = ({ styles, show, index, imageDimensio
<Touchable onPress={handleTap} haptic>
<View style={[styles?.container]}>
<View style={[styles?.imageMargin]}>
<OpaqueImageView
imageURL={imageURL}
width={imageDimensions.width}
height={imageDimensions.height}
blurhash={showBlurhash ? image?.blurhash : undefined}
style={[{ overflow: "hidden", borderRadius: 2, flex: 0 }]}
/>
{!!imageURL && (
<Image
src={imageURL}
width={imageDimensions.width}
height={imageDimensions.height}
blurhash={showBlurhash ? image?.blurhash : undefined}
style={[{ overflow: "hidden", borderRadius: 2, flex: 0 }]}
/>
)}
</View>
{/* this wrapper required to make numberOfLines work when parent is a row */}
<View style={{ flex: 1 }}>
Expand Down
21 changes: 11 additions & 10 deletions src/app/Components/ArtistAutosuggest/ArtistAutosuggestRow.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Spacer, Flex } from "@artsy/palette-mobile"
import { Spacer, Flex, Image } from "@artsy/palette-mobile"
import { AutosuggestResult } from "app/Components/AutosuggestResults/AutosuggestResults"
import OpaqueImageView from "app/Components/OpaqueImageView/OpaqueImageView"
import { ResultWithHighlight } from "app/Scenes/Search/components/ResultWithHighlight"
import { TouchableWithoutFeedback } from "react-native"

Expand All @@ -19,14 +18,16 @@ export const ArtistAutosuggestRow: React.FC<Props> = ({ result, highlight, onRes
testID={`artist-suggestion-${result.internalID}`}
>
<Flex height={IMAGE_SIZE} flexDirection="row" alignItems="center">
<OpaqueImageView
imageURL={result.imageUrl}
width={IMAGE_SIZE}
height={IMAGE_SIZE}
style={{
overflow: "hidden",
}}
/>
{!!result.imageUrl && (
<Image
src={result.imageUrl}
width={IMAGE_SIZE}
height={IMAGE_SIZE}
style={{
overflow: "hidden",
}}
/>
)}
<Spacer x={1} />
<Flex flex={1}>
{!!result.displayLabel && (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Flex, FlexProps } from "@artsy/palette-mobile"
import { Flex, FlexProps, Image } from "@artsy/palette-mobile"
import { ArtworkListNoImage } from "app/Components/ArtworkLists/components/ArtworkListNoImage"
import { OpaqueImageView } from "app/Components/OpaqueImageView2"
import { FC } from "react"

export interface ArtworkListImageProps extends FlexProps {
Expand All @@ -18,7 +17,7 @@ export const ArtworkListImage: FC<ArtworkListImageProps> = ({
return (
<Flex bg="black5" {...rest}>
{imageURL ? (
<OpaqueImageView imageURL={imageURL} width={size} height={size} useRawURL={true} />
<Image src={imageURL} width={size} height={size} performResize={false} />
) : (
<ArtworkListNoImage
width={size}
Expand Down
9 changes: 2 additions & 7 deletions src/app/Components/Cards/MediumCard.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Spacer, Flex, Box, BoxProps, useTheme, Text } from "@artsy/palette-mobile"
import { OpaqueImageView as NewOpaqueImageView } from "app/Components/OpaqueImageView2"
import { Spacer, Flex, Box, BoxProps, useTheme, Text, Image } from "@artsy/palette-mobile"
import LinearGradient from "react-native-linear-gradient"
import { CardTag, CardTagProps } from "./CardTag"

Expand Down Expand Up @@ -30,11 +29,7 @@ export const MediumCard: React.FC<MediumCardProps> = ({ image, title, subtitle,
{...rest}
>
<Flex flex={2} backgroundColor="black10">
<NewOpaqueImageView
imageURL={image}
height={MEDIUM_CARD_HEIGHT}
width={MEDIUM_CARD_WIDTH}
/>
<Image src={image} height={MEDIUM_CARD_HEIGHT} width={MEDIUM_CARD_WIDTH} />
</Flex>
<LinearGradient
colors={["rgba(0, 0, 0, 0)", "rgba(0, 0, 0, 1)"]}
Expand Down
5 changes: 2 additions & 3 deletions src/app/Components/Lists/SavedItemRow.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Spacer, Flex, useColor, Text, Touchable } from "@artsy/palette-mobile"
import OpaqueImageView from "app/Components/OpaqueImageView/OpaqueImageView"
import { Spacer, Flex, useColor, Text, Touchable, Image } from "@artsy/palette-mobile"
import { navigate } from "app/system/navigation/navigate"

interface SavedItemRowProps {
Expand Down Expand Up @@ -37,7 +36,7 @@ export const SavedItemRow: React.FC<SavedItemRowProps> = ({
borderRadius={square_image ? 2 : size / 2}
overflow="hidden"
>
<OpaqueImageView imageURL={imageURL} width={size} height={size} />
{!!imageURL && <Image src={imageURL} width={size} height={size} />}
</Flex>
<Spacer x={2} />
<Text variant="sm" weight="medium">
Expand Down
5 changes: 2 additions & 3 deletions src/app/Components/Lists/ShowItemRow.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { Flex, Box, ClassTheme, Text, Button, Touchable } from "@artsy/palette-mobile"
import { Flex, Box, ClassTheme, Text, Button, Touchable, Image } from "@artsy/palette-mobile"
import { themeGet } from "@styled-system/theme-get"
import { ShowItemRowMutation } from "__generated__/ShowItemRowMutation.graphql"
import { ShowItemRow_show$data } from "__generated__/ShowItemRow_show.graphql"
import { Pin } from "app/Components/Icons/Pin"
import OpaqueImageView from "app/Components/OpaqueImageView/OpaqueImageView"
import { exhibitionDates } from "app/Scenes/Map/exhibitionPeriodParser"
import { navigate } from "app/system/navigation/navigate"
import { hrefForPartialShow } from "app/utils/router"
Expand Down Expand Up @@ -131,7 +130,7 @@ export class ShowItemRow extends React.Component<Props, State> {
</DefaultImageContainer>
) : (
<DefaultImageContainer>
<OpaqueImageView width={62} height={62} imageURL={imageURL} />
<Image width={62} height={62} src={imageURL} />
</DefaultImageContainer>
)}
<Flex flexDirection="column" flexGrow={1} width={165} mr={1}>
Expand Down
3 changes: 0 additions & 3 deletions src/app/Components/OpaqueImageView/OpaqueImageView.tsx

This file was deleted.

37 changes: 0 additions & 37 deletions src/app/Components/OpaqueImageView/createGeminiUrl.tsx

This file was deleted.

Loading
Loading