diff --git a/Gemfile.lock b/Gemfile.lock index aa8ac0a0af0..20f3bc13bca 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -18,16 +18,16 @@ GEM artifactory (3.0.17) atomos (0.1.3) aws-eventstream (1.3.0) - aws-partitions (1.1006.0) - aws-sdk-core (3.212.0) + aws-partitions (1.1025.0) + aws-sdk-core (3.214.0) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.992.0) aws-sigv4 (~> 1.9) jmespath (~> 1, >= 1.6.1) - aws-sdk-kms (1.95.0) + aws-sdk-kms (1.96.0) aws-sdk-core (~> 3, >= 3.210.0) aws-sigv4 (~> 1.5) - aws-sdk-s3 (1.170.1) + aws-sdk-s3 (1.176.1) aws-sdk-core (~> 3, >= 3.210.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.5) @@ -119,8 +119,8 @@ GEM faraday-em_synchrony (1.0.0) faraday-excon (1.1.0) faraday-httpclient (1.0.1) - faraday-multipart (1.0.4) - multipart-post (~> 2) + faraday-multipart (1.1.0) + multipart-post (~> 2.0) faraday-net_http (1.0.2) faraday-net_http_persistent (1.2.0) faraday-patron (1.0.0) @@ -129,7 +129,7 @@ GEM faraday_middleware (1.2.1) faraday (~> 1.0) fastimage (2.3.1) - fastlane (2.225.0) + fastlane (2.226.0) CFPropertyList (>= 2.3, < 4.0.0) addressable (>= 2.8, < 3.0.0) artifactory (~> 3.0) @@ -169,7 +169,7 @@ GEM tty-spinner (>= 0.8.0, < 1.0.0) word_wrap (~> 1.0.0) xcodeproj (>= 1.13.0, < 2.0.0) - xcpretty (~> 0.3.0) + xcpretty (~> 0.4.0) xcpretty-travis-formatter (>= 0.0.3, < 2.0.0) fastlane-plugin-appcenter (2.1.2) fastlane-plugin-bundletool (1.0.12) @@ -226,13 +226,13 @@ GEM signet (>= 0.16, < 2.a) highline (2.0.3) http-2 (0.11.0) - http-cookie (1.0.7) + http-cookie (1.0.8) domain_name (~> 0.5) httpclient (2.8.3) i18n (1.14.1) concurrent-ruby (~> 1.0) jmespath (1.6.2) - json (2.8.2) + json (2.9.1) jwt (2.9.3) base64 lowdown (1.0.0) @@ -260,8 +260,8 @@ GEM trailblazer-option (>= 0.1.1, < 0.2.0) uber (< 0.2.0) retriable (3.1.2) - rexml (3.3.9) - rouge (2.0.7) + rexml (3.4.0) + rouge (3.28.0) ruby-macho (2.5.1) ruby2_keywords (0.0.5) rubyzip (2.3.2) @@ -301,8 +301,8 @@ GEM colored2 (~> 3.1) nanaimo (~> 0.4.0) rexml (>= 3.3.6, < 4.0) - xcpretty (0.3.0) - rouge (~> 2.0.7) + xcpretty (0.4.0) + rouge (~> 3.28.0) xcpretty-travis-formatter (1.0.1) xcpretty (~> 0.2, >= 0.0.7) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 392d904da74..dde544f0c29 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -2703,7 +2703,7 @@ SPEC CHECKSUMS: GTMAppAuth: 99fb010047ba3973b7026e45393f51f27ab965ae GTMSessionFetcher: 0e876eea9782ec6462e91ab872711c357322c94f hermes-engine: ea92f60f37dba025e293cbe4b4a548fd26b610a0 - Interstellar: ab67502af03105f92100a043e178d188a1a437c9 + Interstellar: cd0c3290e249b5f156113a4c6c9c09dd0f418aaa INTUAnimationEngine: 3a7d63738cd51af573d16848a771feedea7cc9f2 iOSSnapshotTestCase: a670511f9ee3829c2b9c23e6e68f315fd7b6790f ISO8601DateFormatter: 8311a2d4e265b269b2fed7ab4db685dcb0a7ccb2 @@ -2729,7 +2729,7 @@ SPEC CHECKSUMS: PromisesObjC: f5707f49cb48b9636751c5b2e7d227e43fba9f47 Pulley: edc993fb57f7eb20541c8453d0fce10559f21dac Quick: ce1276c7c27ba2da3cb2fd0cde053c3648b3b22d - RCT-Folly: 4464f4d875961fce86008d45f4ecf6cef6de0740 + RCT-Folly: 34124ae2e667a0e5f0ea378db071d27548124321 RCTDeprecation: 726d24248aeab6d7180dac71a936bbca6a994ed1 RCTRequired: a94e7febda6db0345d207e854323c37e3a31d93b RCTTypeSafety: 28e24a6e44f5cbf912c66dde6ab7e07d1059a205 diff --git a/src/app/Components/Artist/ArtistShows/ArtistShow.tsx b/src/app/Components/Artist/ArtistShows/ArtistShow.tsx index 3a5661ddb95..e95c85f1430 100644 --- a/src/app/Components/Artist/ArtistShows/ArtistShow.tsx +++ b/src/app/Components/Artist/ArtistShows/ArtistShow.tsx @@ -1,6 +1,7 @@ import { ActionType, ContextModule, OwnerType, TappedShowGroup } from "@artsy/cohesion" -import { Image, Touchable } from "@artsy/palette-mobile" +import { Touchable } from "@artsy/palette-mobile" import { ArtistShow_show$data, ArtistShow_show$key } from "__generated__/ArtistShow_show.graphql" +import { ImageWithFallback } from "app/Components/ImageWithFallback/ImageWithFallback" import { navigate } from "app/system/navigation/navigate" import { useFeatureFlag } from "app/utils/hooks/useFeatureFlag" import { hrefForPartialShow } from "app/utils/router" @@ -41,15 +42,13 @@ export const ArtistShow: React.FC = ({ styles, show, index, imageDimensio - {!!imageURL && ( - - )} + {/* this wrapper required to make numberOfLines work when parent is a row */} diff --git a/src/app/Components/ArtsyWebView.tsx b/src/app/Components/ArtsyWebView.tsx index face69b1111..207c86f9f22 100644 --- a/src/app/Components/ArtsyWebView.tsx +++ b/src/app/Components/ArtsyWebView.tsx @@ -215,7 +215,9 @@ export const ArtsyWebView = forwardRef< // to a different vanityURL that we can handle inapp, such as Fair & Partner. if ( result.type === "match" && - ["ReactWebView", "ModalWebView", "VanityURLEntity"].includes(result.module) + ["ReactWebView", "ModalWebView", "VanityURLEntity", "LiveAuctionWebView"].includes( + result.module + ) ) { if (innerRef.current) { innerRef.current.shareTitleUrl = targetURL diff --git a/src/app/Components/Bidding/Screens/CreditCardForm.tests.tsx b/src/app/Components/Bidding/Screens/CreditCardForm.tests.tsx index fdb22d153c5..607008268e3 100644 --- a/src/app/Components/Bidding/Screens/CreditCardForm.tests.tsx +++ b/src/app/Components/Bidding/Screens/CreditCardForm.tests.tsx @@ -160,7 +160,7 @@ describe("CreditCardForm", () => { await waitFor(() => expect(addButton.props.accessibilityState.disabled).toEqual(true)) }) - it("is enabled while the form is valid", () => { + it("is enabled while the form is valid", async () => { const onSubmitMock = jest.fn() ;(createToken as jest.Mock).mockReturnValueOnce(stripeToken) @@ -187,7 +187,33 @@ describe("CreditCardForm", () => { const addButton = screen.getByTestId("credit-card-form-button") - expect(addButton.props.accessibilityState.disabled).toEqual(false) + await waitFor(() => expect(addButton.props.accessibilityState.disabled).toEqual(false)) + }) + + it("is disabled when the form is invalid", async () => { + renderWithWrappers( + null } as any} + billingAddress={{ + fullName: "mockName", + addressLine1: "mockAddress1", + addressLine2: "mockAddress2", + city: "mockCity", + state: "mockState", + postalCode: "mockPostalCode", + phoneNumber: "mockPhone", + country: { shortName: "US", longName: "United States" }, + }} + /> + ) + + const creditCardField = screen.getByTestId("credit-card-field") + fireEvent.changeText(creditCardField, "4242") // incomplete number + + const addButton = screen.getByTestId("credit-card-form-button") + + await waitFor(() => expect(addButton.props.accessibilityState.disabled).toEqual(true)) }) it("shows an error when stripe's API returns an error", async () => { diff --git a/src/app/Components/Bidding/Validators/creditCardFormFieldsValidationSchema.ts b/src/app/Components/Bidding/Validators/creditCardFormFieldsValidationSchema.ts index 7358751777f..05448d63d5e 100644 --- a/src/app/Components/Bidding/Validators/creditCardFormFieldsValidationSchema.ts +++ b/src/app/Components/Bidding/Validators/creditCardFormFieldsValidationSchema.ts @@ -2,7 +2,9 @@ import * as Yup from "yup" export const creditCardFormValidationSchema = Yup.object().shape({ creditCard: Yup.object().shape({ - valid: Yup.boolean().required("Credit card is required"), + valid: Yup.boolean() + .oneOf([true], "Credit card is required") + .required("Credit card is required"), }), fullName: Yup.string().required("Name is required"), addressLine1: Yup.string().required("Address is required"), diff --git a/src/app/Components/ImageWithFallback/ImageWithFallback.tests.tsx b/src/app/Components/ImageWithFallback/ImageWithFallback.tests.tsx new file mode 100644 index 00000000000..f4e3381871f --- /dev/null +++ b/src/app/Components/ImageWithFallback/ImageWithFallback.tests.tsx @@ -0,0 +1,23 @@ +import { ImageWithFallback } from "app/Components/ImageWithFallback/ImageWithFallback" +import { renderWithWrappers } from "app/utils/tests/renderWithWrappers" + +describe("ImageWithFallback", () => { + it("renders without error", () => { + renderWithWrappers() + }) + + it("renders the image when a url is passed", async () => { + const view = renderWithWrappers( + + ) + const image = await view.findByTestId("image") + expect(image).toBeTruthy() + }) + + it("renders the fallback when a url is not passed", async () => { + const view = renderWithWrappers() + + const fallbackImage = await view.findByTestId("fallback-image") + expect(fallbackImage).toBeTruthy() + }) +}) diff --git a/src/app/Components/ImageWithFallback/ImageWithFallback.tsx b/src/app/Components/ImageWithFallback/ImageWithFallback.tsx new file mode 100644 index 00000000000..4000343e052 --- /dev/null +++ b/src/app/Components/ImageWithFallback/ImageWithFallback.tsx @@ -0,0 +1,29 @@ +import { Box, Image, ImageProps } from "@artsy/palette-mobile" + +// Extend ImageProps but make `src` optional, require height and width +type ImageWithFallbackProps = Omit & { + src?: string | null + height: number + width: number +} + +export const ImageWithFallback: React.FC = ({ + src, + width, + height, + ...props +}) => { + if (!src) { + return ( + + ) + } + + return +} diff --git a/src/app/Components/Lists/SavedItemRow.tsx b/src/app/Components/Lists/SavedItemRow.tsx index a9960062f37..232af286a9a 100644 --- a/src/app/Components/Lists/SavedItemRow.tsx +++ b/src/app/Components/Lists/SavedItemRow.tsx @@ -1,4 +1,5 @@ -import { Spacer, Flex, useColor, Text, Touchable, Image } from "@artsy/palette-mobile" +import { Spacer, Flex, useColor, Text, Touchable } from "@artsy/palette-mobile" +import { ImageWithFallback } from "app/Components/ImageWithFallback/ImageWithFallback" import { navigate } from "app/system/navigation/navigate" interface SavedItemRowProps { @@ -36,7 +37,7 @@ export const SavedItemRow: React.FC = ({ borderRadius={square_image ? 2 : size / 2} overflow="hidden" > - {!!imageURL && } + diff --git a/src/app/Components/ShowCard.tsx b/src/app/Components/ShowCard.tsx index 6c4246763fb..dd29eeb4f95 100644 --- a/src/app/Components/ShowCard.tsx +++ b/src/app/Components/ShowCard.tsx @@ -1,14 +1,7 @@ -import { - Spacer, - Flex, - Text, - Touchable, - SkeletonBox, - SkeletonText, - Image, -} from "@artsy/palette-mobile" +import { Spacer, Flex, Text, Touchable, SkeletonBox, SkeletonText } from "@artsy/palette-mobile" import { toTitleCase } from "@artsy/to-title-case" import { ShowCard_show$data } from "__generated__/ShowCard_show.graphql" +import { ImageWithFallback } from "app/Components/ImageWithFallback/ImageWithFallback" import { navigate } from "app/system/navigation/navigate" import { compact } from "lodash" import { GestureResponderEvent, ViewProps } from "react-native" @@ -47,7 +40,7 @@ export const ShowCard: React.FC = ({ show, onPress }) => { - {!!imageURL && } + {show.name} diff --git a/src/app/Components/ThreeUpImageLayout.tsx b/src/app/Components/ThreeUpImageLayout.tsx index a4adafb05f7..17c1913bbae 100644 --- a/src/app/Components/ThreeUpImageLayout.tsx +++ b/src/app/Components/ThreeUpImageLayout.tsx @@ -1,4 +1,5 @@ -import { Box, Image } from "@artsy/palette-mobile" +import { Box } from "@artsy/palette-mobile" +import { ImageWithFallback } from "app/Components/ImageWithFallback/ImageWithFallback" import styled from "styled-components/native" interface ThreeUpImageLayoutProps { @@ -16,7 +17,7 @@ export const ThreeUpImageLayout: React.FC = ({ imageURL return ( - = ({ imageURL /> - - { ) } + if (currentRoute && Platform.OS === "ios") { + LegacyNativeModules.ARTDeeplinkTimeoutModule.invalidateDeeplinkTimeout() + } + addBreadcrumb({ message: `navigated to ${currentRoute?.name}`, category: "navigation", diff --git a/src/app/Scenes/ArtQuiz/ArtQuizResults/ArtQuizResultsTabs/ArtQuizResultsEmptyTabs.tsx b/src/app/Scenes/ArtQuiz/ArtQuizResults/ArtQuizResultsTabs/ArtQuizResultsEmptyTabs.tsx index b13240122e8..70c49202de5 100644 --- a/src/app/Scenes/ArtQuiz/ArtQuizResults/ArtQuizResultsTabs/ArtQuizResultsEmptyTabs.tsx +++ b/src/app/Scenes/ArtQuiz/ArtQuizResults/ArtQuizResultsTabs/ArtQuizResultsEmptyTabs.tsx @@ -4,7 +4,7 @@ import { ArtQuizResultsEmptyTabsQuery } from "__generated__/ArtQuizResultsEmptyT import { ArtQuizResultsTabsHeader } from "app/Scenes/ArtQuiz/ArtQuizResults/ArtQuizResultsTabs/ArtQuizResultsTabsHeader" import { ArtQuizTrendingArtists } from "app/Scenes/ArtQuiz/ArtQuizResults/ArtQuizResultsTabs/ArtQuizTrendingArtists" import { ArtQuizTrendingCollections } from "app/Scenes/ArtQuiz/ArtQuizResults/ArtQuizResultsTabs/ArtQuizTrendingCollections" -import { navigate } from "app/system/navigation/navigate" +import { popToRoot } from "app/system/navigation/navigate" import { graphql, useLazyLoadQuery } from "react-relay" @@ -19,7 +19,7 @@ export const ArtQuizResultsEmptyTabs = () => { title="Explore Your Quiz Results" lazy headerProps={{ - onBack: () => navigate("/"), + onBack: () => popToRoot(), }} BelowTitleHeaderComponent={() => ( diff --git a/src/app/Scenes/ArtQuiz/ArtQuizResults/ArtQuizResultsTabs/ArtQuizResultsTabs.tsx b/src/app/Scenes/ArtQuiz/ArtQuizResults/ArtQuizResultsTabs/ArtQuizResultsTabs.tsx index 0e81cbcbf15..d913c60f49b 100644 --- a/src/app/Scenes/ArtQuiz/ArtQuizResults/ArtQuizResultsTabs/ArtQuizResultsTabs.tsx +++ b/src/app/Scenes/ArtQuiz/ArtQuizResults/ArtQuizResultsTabs/ArtQuizResultsTabs.tsx @@ -5,7 +5,7 @@ import { ArtQuizExploreArtists } from "app/Scenes/ArtQuiz/ArtQuizResults/ArtQuiz import { ArtQuizExploreArtworks } from "app/Scenes/ArtQuiz/ArtQuizResults/ArtQuizResultsTabs/ArtQuizExploreArtworks" import { ArtQuizLikedArtworks } from "app/Scenes/ArtQuiz/ArtQuizResults/ArtQuizResultsTabs/ArtQuizLikedArtworks" import { ArtQuizResultsTabsHeader } from "app/Scenes/ArtQuiz/ArtQuizResults/ArtQuizResultsTabs/ArtQuizResultsTabsHeader" -import { navigate } from "app/system/navigation/navigate" +import { popToRoot } from "app/system/navigation/navigate" import React, { useState } from "react" import { graphql, useFragment } from "react-relay" @@ -26,7 +26,7 @@ export const ArtQuizResultsTabs = ({ me }: { me: ArtQuizResultsQuery$data["me"] title={title} lazy headerProps={{ - onBack: () => navigate("/"), + onBack: () => popToRoot(), }} onTabChange={({ tabName }) => { setActiveTab(tabName as TabName) diff --git a/src/app/Scenes/City/Components/FairEventSection/Components/FairEventSectionCard.tsx b/src/app/Scenes/City/Components/FairEventSection/Components/FairEventSectionCard.tsx index 112122ef621..57c8562e22e 100644 --- a/src/app/Scenes/City/Components/FairEventSection/Components/FairEventSectionCard.tsx +++ b/src/app/Scenes/City/Components/FairEventSection/Components/FairEventSectionCard.tsx @@ -21,15 +21,21 @@ export class FairEventSectionCard extends Component { fair: { image, name, profile, exhibition_period }, } = this.props + const width = Dimensions.get("window").width / 2 + 50 + return ( - {!!image?.url && } - - - {profile?.icon?.url ? : null} + {!!image?.url && ( + + )} + + + {!!profile?.icon?.url ? ( + + ) : null} - + {name} @@ -49,9 +55,6 @@ export class FairEventSectionCard extends Component { const BackgroundImage = styled(Image)` background: ${themeGet("colors.black60")}; - position: absolute; - height: 100%; - width: 100%; ` const Container = styled(Box)` @@ -71,9 +74,8 @@ const Overlay = styled.View` ` const Logo = styled(Image)` - width: 100px; - height: 100px; background-color: transparent; margin-bottom: ${themeGet("space.1")}; + position: absolute; tint-color: white; ` diff --git a/src/app/Scenes/City/Components/TabFairItemRow/index.tsx b/src/app/Scenes/City/Components/TabFairItemRow/index.tsx index 0c936cb3922..ea3e7f30361 100644 --- a/src/app/Scenes/City/Components/TabFairItemRow/index.tsx +++ b/src/app/Scenes/City/Components/TabFairItemRow/index.tsx @@ -1,4 +1,5 @@ -import { Flex, Box, ClassTheme, Text, Image } from "@artsy/palette-mobile" +import { Flex, Box, ClassTheme, Text } from "@artsy/palette-mobile" +import { ImageWithFallback } from "app/Components/ImageWithFallback/ImageWithFallback" import { Fair } from "app/Scenes/Map/types" import { navigate } from "app/system/navigation/navigate" import React from "react" @@ -25,7 +26,7 @@ export class TabFairItemRow extends React.Component { this.handleTap(item)}> - {!!fairImage && } + {!!item.name && ( diff --git a/src/app/Scenes/Feature/components/FeatureFeaturedLink.tsx b/src/app/Scenes/Feature/components/FeatureFeaturedLink.tsx index 2d675ee6b8d..704e2463a1f 100644 --- a/src/app/Scenes/Feature/components/FeatureFeaturedLink.tsx +++ b/src/app/Scenes/Feature/components/FeatureFeaturedLink.tsx @@ -1,5 +1,6 @@ -import { Flex, Image, Text } from "@artsy/palette-mobile" +import { Flex, Text } from "@artsy/palette-mobile" import { FeatureFeaturedLink_featuredLink$data } from "__generated__/FeatureFeaturedLink_featuredLink.graphql" +import { ImageWithFallback } from "app/Components/ImageWithFallback/ImageWithFallback" import { navigate } from "app/system/navigation/navigate" import { TouchableOpacity } from "react-native" import LinearGradient from "react-native-linear-gradient" @@ -22,9 +23,7 @@ const FeatureFeaturedLink: React.FC = ({ featuredLink, } }} > - {!!featuredLink.image?.url && ( - - )} + = ({ - {!!imageUrl && } + {!!showInitials && ( { - + {this.statusLabel} {headline} diff --git a/src/app/Scenes/Inbox/Components/Conversations/ConversationSnippet.tsx b/src/app/Scenes/Inbox/Components/Conversations/ConversationSnippet.tsx index 98bbbeac123..b362613f2a2 100644 --- a/src/app/Scenes/Inbox/Components/Conversations/ConversationSnippet.tsx +++ b/src/app/Scenes/Inbox/Components/Conversations/ConversationSnippet.tsx @@ -1,6 +1,7 @@ -import { Flex, ClassTheme, Text, Touchable, Image } from "@artsy/palette-mobile" +import { Flex, ClassTheme, Text, Touchable } from "@artsy/palette-mobile" import { themeGet } from "@styled-system/theme-get" import { ConversationSnippet_conversation$data } from "__generated__/ConversationSnippet_conversation.graphql" +import { ImageWithFallback } from "app/Components/ImageWithFallback/ImageWithFallback" import { Schema, Track, track as _track } from "app/utils/track" import moment from "moment" import React from "react" @@ -28,9 +29,7 @@ const Indicator = styled.View` background-color: ${themeGet("colors.blue100")}; ` -const ImageView = styled(Image)` - width: 80px; - height: 80px; +const ImageView = styled(ImageWithFallback)` border-radius: 2px; ` @@ -97,7 +96,7 @@ export class ConversationSnippet extends React.Component { )} - {!!imageURL && } + diff --git a/src/app/Scenes/Inbox/Components/Conversations/ItemShow.tsx b/src/app/Scenes/Inbox/Components/Conversations/ItemShow.tsx index 7227d967c2b..12ae031e76d 100644 --- a/src/app/Scenes/Inbox/Components/Conversations/ItemShow.tsx +++ b/src/app/Scenes/Inbox/Components/Conversations/ItemShow.tsx @@ -1,5 +1,6 @@ -import { Flex, Box, Text, Separator, Touchable, Image } from "@artsy/palette-mobile" +import { Flex, Box, Text, Separator, Touchable } from "@artsy/palette-mobile" import { ItemShow_show$data } from "__generated__/ItemShow_show.graphql" +import { ImageWithFallback } from "app/Components/ImageWithFallback/ImageWithFallback" import { navigate } from "app/system/navigation/navigate" import { createFragmentContainer, graphql } from "react-relay" @@ -18,9 +19,12 @@ export const ItemShow: React.FC = ({ show }) => { show.href && navigate(show.href)}> - {!!show.image?.thumbnailUrl && ( - - )} + diff --git a/src/app/Scenes/Inbox/Components/Conversations/Preview/Attachment/AttachmentPreview.tsx b/src/app/Scenes/Inbox/Components/Conversations/Preview/Attachment/AttachmentPreview.tsx index b1ff06c9ac2..7deb981c7d1 100644 --- a/src/app/Scenes/Inbox/Components/Conversations/Preview/Attachment/AttachmentPreview.tsx +++ b/src/app/Scenes/Inbox/Components/Conversations/Preview/Attachment/AttachmentPreview.tsx @@ -1,6 +1,5 @@ -import { ClassTheme } from "@artsy/palette-mobile" +import { ClassTheme, Touchable } from "@artsy/palette-mobile" import { AttachmentPreview_attachment$data } from "__generated__/AttachmentPreview_attachment.graphql" -import { Touchable } from "@artsy/palette-mobile" import React from "react" import { findNodeHandle } from "react-native" import { createFragmentContainer, graphql } from "react-relay" diff --git a/src/app/Scenes/Inbox/Components/Conversations/Preview/Attachment/ImagePreview.tsx b/src/app/Scenes/Inbox/Components/Conversations/Preview/Attachment/ImagePreview.tsx index 15bf4f9161d..31e37c4f7df 100644 --- a/src/app/Scenes/Inbox/Components/Conversations/Preview/Attachment/ImagePreview.tsx +++ b/src/app/Scenes/Inbox/Components/Conversations/Preview/Attachment/ImagePreview.tsx @@ -1,29 +1,33 @@ import { Image } from "@artsy/palette-mobile" import { ImagePreview_attachment$data } from "__generated__/ImagePreview_attachment.graphql" import { createFragmentContainer, graphql } from "react-relay" -import styled from "styled-components/native" import AttachmentPreview, { AttachmentProps } from "./AttachmentPreview" -const ImageView = styled(Image)` - height: 250px; - flex: 1; -` - interface Props extends AttachmentProps { attachment: ImagePreview_attachment$data } -export const ImagePreview: React.FC = ({ attachment, onSelected }) => ( - - - -) +const IMAGE_SIZE = 235 + +export const ImagePreview: React.FC = ({ attachment, onSelected }) => { + return ( + + + + ) +} export default createFragmentContainer(ImagePreview, { attachment: graphql` fragment ImagePreview_attachment on Attachment { downloadURL + ...AttachmentPreview_attachment } `, diff --git a/src/app/Scenes/MyAccount/MyAccountDeleteAccount.tsx b/src/app/Scenes/MyAccount/MyAccountDeleteAccount.tsx index 37f823d2e42..5f5228fca52 100644 --- a/src/app/Scenes/MyAccount/MyAccountDeleteAccount.tsx +++ b/src/app/Scenes/MyAccount/MyAccountDeleteAccount.tsx @@ -76,6 +76,7 @@ const MyAccountDeleteAccount: React.FC = ({ me: { h multiline placeholder="Please share with us why you are leaving" onChangeText={setExplanation} + defaultValue={explanation} error={!hasPassword ? error : undefined} /> @@ -90,6 +91,7 @@ const MyAccountDeleteAccount: React.FC = ({ me: { h secureTextEntry placeholder="Enter your password to continue" onChangeText={setPassword} + defaultValue={password} error={error} /> diff --git a/src/app/Scenes/MyBids/Components/Lot.tsx b/src/app/Scenes/MyBids/Components/Lot.tsx index 8ed93fa1c4c..b6fc4a03354 100644 --- a/src/app/Scenes/MyBids/Components/Lot.tsx +++ b/src/app/Scenes/MyBids/Components/Lot.tsx @@ -1,5 +1,6 @@ -import { Flex, Box, Text, Image } from "@artsy/palette-mobile" +import { Flex, Box, Text } from "@artsy/palette-mobile" import { Lot_saleArtwork$data } from "__generated__/Lot_saleArtwork.graphql" +import { ImageWithFallback } from "app/Components/ImageWithFallback/ImageWithFallback" import React from "react" import { createFragmentContainer, graphql } from "react-relay" @@ -20,9 +21,7 @@ class Lot extends React.Component { - {!!saleArtwork?.artwork?.image?.url && ( - - )} + {!!ArtworkBadge && ( diff --git a/src/app/Scenes/MyCollection/Screens/Artist/AddMyCollectionArtist.tsx b/src/app/Scenes/MyCollection/Screens/Artist/AddMyCollectionArtist.tsx index 58c17f57246..86f05a33745 100644 --- a/src/app/Scenes/MyCollection/Screens/Artist/AddMyCollectionArtist.tsx +++ b/src/app/Scenes/MyCollection/Screens/Artist/AddMyCollectionArtist.tsx @@ -5,6 +5,7 @@ import { Input, InputRef, Join, + Screen, Spacer, } from "@artsy/palette-mobile" import { RouteProp, useIsFocused, useNavigation, useRoute } from "@react-navigation/native" @@ -92,7 +93,7 @@ export const AddMyCollectionArtist: React.FC = () => { } return ( - <> + Add New Artist @@ -113,7 +114,7 @@ export const AddMyCollectionArtist: React.FC = () => { keyboardShouldPersistTaps="handled" ref={scrollViewRef} > - + }> { - + ) } diff --git a/src/app/Scenes/MyCollection/Screens/MyCollectionAddCollectedArtists/MyCollectionAddCollectedArtists.tsx b/src/app/Scenes/MyCollection/Screens/MyCollectionAddCollectedArtists/MyCollectionAddCollectedArtists.tsx index c0cceb473b1..177d394a8fd 100644 --- a/src/app/Scenes/MyCollection/Screens/MyCollectionAddCollectedArtists/MyCollectionAddCollectedArtists.tsx +++ b/src/app/Scenes/MyCollection/Screens/MyCollectionAddCollectedArtists/MyCollectionAddCollectedArtists.tsx @@ -32,9 +32,9 @@ export const MyCollectionAddCollectedArtists: React.FC<{}> = () => { } return ( - + - + null}> diff --git a/src/app/Scenes/MyProfile/MyProfileEditModal.tsx b/src/app/Scenes/MyProfile/MyProfileEditModal.tsx index a8f415e5478..fe451440984 100644 --- a/src/app/Scenes/MyProfile/MyProfileEditModal.tsx +++ b/src/app/Scenes/MyProfile/MyProfileEditModal.tsx @@ -109,15 +109,7 @@ export const MyProfileEditModal: React.FC = ({ } return ( - + {message} diff --git a/src/app/Scenes/MyProfile/MyProfilePaymentNewCreditCard.tsx b/src/app/Scenes/MyProfile/MyProfilePaymentNewCreditCard.tsx index 0c053228d45..c5a1ccae35a 100644 --- a/src/app/Scenes/MyProfile/MyProfilePaymentNewCreditCard.tsx +++ b/src/app/Scenes/MyProfile/MyProfilePaymentNewCreditCard.tsx @@ -188,6 +188,7 @@ export const MyProfilePaymentNewCreditCard: React.FC<{}> = ({}) => { title="Name on card" placeholder="Full name" onChangeText={actions.fields.fullName.setValue} + defaultValue={state.fields.fullName.value ?? ""} returnKeyType="next" onSubmitEditing={() => addressLine1Ref.current?.focus()} /> @@ -196,6 +197,7 @@ export const MyProfilePaymentNewCreditCard: React.FC<{}> = ({}) => { title="Address line 1" placeholder="Add street address" onChangeText={actions.fields.addressLine1.setValue} + defaultValue={state.fields.addressLine1.value ?? ""} returnKeyType="next" onSubmitEditing={() => addressLine2Ref.current?.focus()} /> @@ -209,6 +211,7 @@ export const MyProfilePaymentNewCreditCard: React.FC<{}> = ({}) => { "Add your apt, etc.", ]} onChangeText={actions.fields.addressLine2.setValue} + defaultValue={state.fields.addressLine2.value ?? ""} returnKeyType="next" onSubmitEditing={() => cityRef.current?.focus()} /> @@ -216,6 +219,7 @@ export const MyProfilePaymentNewCreditCard: React.FC<{}> = ({}) => { ref={cityRef} title="City" onChangeText={actions.fields.city.setValue} + defaultValue={state.fields.city.value ?? ""} returnKeyType="next" onSubmitEditing={() => postalCodeRef.current?.focus()} /> @@ -223,6 +227,7 @@ export const MyProfilePaymentNewCreditCard: React.FC<{}> = ({}) => { ref={postalCodeRef} title="Postal Code" onChangeText={actions.fields.postalCode.setValue} + defaultValue={state.fields.postalCode.value ?? ""} returnKeyType="next" onSubmitEditing={() => stateRef.current?.focus()} /> @@ -231,6 +236,7 @@ export const MyProfilePaymentNewCreditCard: React.FC<{}> = ({}) => { ref={stateRef} title="State, province, or region" onChangeText={actions.fields.state.setValue} + defaultValue={state.fields.state.value ?? ""} onSubmitEditing={() => { stateRef.current?.blur() scrollViewRef.current?.scrollToEnd() diff --git a/src/app/Scenes/Onboarding/Auth2/AuthContext.tsx b/src/app/Scenes/Onboarding/Auth2/AuthContext.tsx index 54918575ad5..fc89e680a75 100644 --- a/src/app/Scenes/Onboarding/Auth2/AuthContext.tsx +++ b/src/app/Scenes/Onboarding/Auth2/AuthContext.tsx @@ -38,7 +38,9 @@ export const defaultState: AuthContextModel = { // actions goBack: action((state) => { - state.currentScreen = state.previousScreens.pop() + if (state.previousScreens.length !== 0) { + state.currentScreen = state.previousScreens.pop() + } }), setCurrentScreen: action((state, currentScreen) => { state.previousScreens.push(state.currentScreen) diff --git a/src/app/Scenes/Onboarding/Auth2/__tests__/AuthContext.tests.tsx b/src/app/Scenes/Onboarding/Auth2/__tests__/AuthContext.tests.tsx index 3783e735a20..765cfc44705 100644 --- a/src/app/Scenes/Onboarding/Auth2/__tests__/AuthContext.tests.tsx +++ b/src/app/Scenes/Onboarding/Auth2/__tests__/AuthContext.tests.tsx @@ -57,6 +57,17 @@ describe("AuthContext", () => { expect(getState().currentScreen).toEqual({ name: "SignUpPasswordStep" }) }) + it("doesn't goBack when there are no previous screens", () => { + const { getState, actions } = setup({ + currentScreen: { name: "LoginWelcomeStep" }, + previousScreens: [], + }) + + act(() => actions.goBack()) + + expect(getState().currentScreen).toEqual({ name: "LoginWelcomeStep" }) + }) + it("setCurrentScreen", () => { const { getState, actions } = setup({ currentScreen: { name: "LoginWelcomeStep" } }) diff --git a/src/app/Scenes/Onboarding/Onboarding.tsx b/src/app/Scenes/Onboarding/Onboarding.tsx index 6849bd524e8..269245ca70b 100644 --- a/src/app/Scenes/Onboarding/Onboarding.tsx +++ b/src/app/Scenes/Onboarding/Onboarding.tsx @@ -88,6 +88,12 @@ export const OnboardingWelcomeScreens = () => { + {/** + * There are two "Forgot Password?" forms in this flow: + * 1. The ForgotPasswordStep step in the OnboardingHome screen + * 2. The ForgotPassword screen linked-to in the OnboardingSocialLink screen + */} + ) : ( diff --git a/src/app/Scenes/Partner/Components/PartnerShowRailItem.tsx b/src/app/Scenes/Partner/Components/PartnerShowRailItem.tsx index dca85d2c204..9fc8f8e6025 100644 --- a/src/app/Scenes/Partner/Components/PartnerShowRailItem.tsx +++ b/src/app/Scenes/Partner/Components/PartnerShowRailItem.tsx @@ -1,5 +1,6 @@ -import { Flex, Image, Spacer, Text, Touchable, useScreenDimensions } from "@artsy/palette-mobile" +import { Flex, Spacer, Text, Touchable, useScreenDimensions } from "@artsy/palette-mobile" import { PartnerShowRailItem_show$data } from "__generated__/PartnerShowRailItem_show.graphql" +import { ImageWithFallback } from "app/Components/ImageWithFallback/ImageWithFallback" import { exhibitionDates } from "app/Scenes/Map/exhibitionPeriodParser" import { navigate } from "app/system/navigation/navigate" import { Schema } from "app/utils/track" @@ -30,9 +31,12 @@ export const PartnerShowRailItem: React.FC = (props) => { return ( - {!!imageURL && ( - - )} + {name} diff --git a/src/app/Scenes/SavedSearchAlertsList/Components/EmptyMessage.tsx b/src/app/Scenes/SavedSearchAlertsList/Components/EmptyMessage.tsx index 9d5c74f4e8c..bfe2b6e6bb8 100644 --- a/src/app/Scenes/SavedSearchAlertsList/Components/EmptyMessage.tsx +++ b/src/app/Scenes/SavedSearchAlertsList/Components/EmptyMessage.tsx @@ -1,16 +1,17 @@ import { - Spacer, - Flex, + ArtworkIcon, + BellIcon, Box, - Text, Button, - Join, FilterIcon, - BellIcon, - ArtworkIcon, + Flex, + Join, + Spacer, + Text, } from "@artsy/palette-mobile" import SearchIcon from "app/Components/Icons/SearchIcon" -import { navigate } from "app/system/navigation/navigate" +import { GlobalStore } from "app/store/GlobalStore" +import { navigate, popToRoot } from "app/system/navigation/navigate" import { ScrollView } from "react-native" interface InfoSectionProps { @@ -64,6 +65,8 @@ const t = { } export const EmptyMessage: React.FC = () => { + const selectedTab = GlobalStore.useAppState((state) => state.bottomTabs.sessionState.selectedTab) + return ( @@ -77,7 +80,17 @@ export const EmptyMessage: React.FC = () => { } /> - diff --git a/src/app/Scenes/Search/components/SearchResultImage.tsx b/src/app/Scenes/Search/components/SearchResultImage.tsx index b4a15b6f052..1437086650f 100644 --- a/src/app/Scenes/Search/components/SearchResultImage.tsx +++ b/src/app/Scenes/Search/components/SearchResultImage.tsx @@ -1,4 +1,5 @@ -import { Avatar, Flex, Image } from "@artsy/palette-mobile" +import { Avatar, Flex } from "@artsy/palette-mobile" +import { ImageWithFallback } from "app/Components/ImageWithFallback/ImageWithFallback" export const IMAGE_SIZE = 40 @@ -21,15 +22,13 @@ export const SearchResultImage: React.FC<{ borderRadius={round ? IMAGE_SIZE / 2 : 0} overflow="hidden" > - {!!imageURL && ( - - )} + ) } diff --git a/src/app/Scenes/Search/components/TrendingArtistCard.tsx b/src/app/Scenes/Search/components/TrendingArtistCard.tsx index 91d531be986..0b80159a2c2 100644 --- a/src/app/Scenes/Search/components/TrendingArtistCard.tsx +++ b/src/app/Scenes/Search/components/TrendingArtistCard.tsx @@ -1,5 +1,6 @@ -import { Flex, Image, Text } from "@artsy/palette-mobile" +import { Flex, Text } from "@artsy/palette-mobile" import { TrendingArtistCard_artist$key } from "__generated__/TrendingArtistCard_artist.graphql" +import { ImageWithFallback } from "app/Components/ImageWithFallback/ImageWithFallback" import { TouchableHighlight } from "react-native" import { useFragment, graphql } from "react-relay" @@ -21,9 +22,11 @@ export const TrendingArtistCard: React.FC = ({ artist, onPress={onPress} > - {!!data.coverArtwork?.image?.url && ( - - )} + diff --git a/src/app/Scenes/SellWithArtsy/ArtworkForm/Components/SubmitArtworkFromMyCollectionArtworks.tsx b/src/app/Scenes/SellWithArtsy/ArtworkForm/Components/SubmitArtworkFromMyCollectionArtworks.tsx index e849bc83a87..b64ef3f6c80 100644 --- a/src/app/Scenes/SellWithArtsy/ArtworkForm/Components/SubmitArtworkFromMyCollectionArtworks.tsx +++ b/src/app/Scenes/SellWithArtsy/ArtworkForm/Components/SubmitArtworkFromMyCollectionArtworks.tsx @@ -72,8 +72,8 @@ export const SubmitArtworkFromMyCollectionArtworks: React.FC<{}> = () => { setIsLoading(false) - navigation.navigate("AddTitle") - setCurrentStep("AddTitle") + navigation.navigate("SelectArtist") + setCurrentStep("SelectArtist") } } catch (error) { console.error( @@ -105,7 +105,7 @@ export const SubmitArtworkFromMyCollectionArtworks: React.FC<{}> = () => { }} > My Collection.{"\n"} - {" "} + @@ -114,8 +114,8 @@ export const SubmitArtworkFromMyCollectionArtworks: React.FC<{}> = () => {