From 89bebfa8793899ac4703a918c9556b8c5d97369b Mon Sep 17 00:00:00 2001 From: Ole Date: Mon, 29 Apr 2024 13:40:27 +0200 Subject: [PATCH 1/2] feat: Reorganize sell screen --- .../SellWithArtsy/Components/Footer.tsx | 39 +--------- .../SellWithArtsy/Components/Header.tsx | 64 +--------------- .../SellWithArtsy/Components/HowItWorks.tsx | 27 +------ .../Components/SellWithArtsyRecentlySold.tsx | 2 +- .../Components/StickySWAHeader.tsx | 76 +++++++++++++++++++ .../SellWithArtsy/SellWithArtsyHome.tsx | 39 ++++++++-- 6 files changed, 118 insertions(+), 129 deletions(-) create mode 100644 src/app/Scenes/SellWithArtsy/Components/StickySWAHeader.tsx diff --git a/src/app/Scenes/SellWithArtsy/Components/Footer.tsx b/src/app/Scenes/SellWithArtsy/Components/Footer.tsx index 2cb5a97b063..8e73db9a327 100644 --- a/src/app/Scenes/SellWithArtsy/Components/Footer.tsx +++ b/src/app/Scenes/SellWithArtsy/Components/Footer.tsx @@ -1,34 +1,10 @@ -import { ContextModule, OwnerType, TappedConsignArgs } from "@artsy/cohesion" -import { Flex, Spacer, Text, Separator, Button } from "@artsy/palette-mobile" +import { Flex, Text, Separator } from "@artsy/palette-mobile" import { navigate } from "app/system/navigation/navigate" import { isTablet } from "react-native-device-info" -export const Footer: React.FC<{ - onConsignPress: (tappedConsignArgs: TappedConsignArgs) => void -}> = ({ onConsignPress }) => { - const buttonText = "Start Selling" - +export const Footer: React.FC = () => { return ( - - Meet your new art advisor.{"\n"}It’s Artsy. - - - - - - - - @@ -41,20 +17,13 @@ export const Footer: React.FC<{ onPress={() => navigate("https://partners.artsy.net/")} style={{ textDecorationLine: "underline" }} > - {" "} Become a partner {" "} to access the world’s largest online art marketplace. + + ) } - -const tracks = { - consignArgs: (subject: string): TappedConsignArgs => ({ - contextModule: ContextModule.sellFooter, - contextScreenOwnerType: OwnerType.sell, - subject, - }), -} diff --git a/src/app/Scenes/SellWithArtsy/Components/Header.tsx b/src/app/Scenes/SellWithArtsy/Components/Header.tsx index caacd512b6e..e58c0002157 100644 --- a/src/app/Scenes/SellWithArtsy/Components/Header.tsx +++ b/src/app/Scenes/SellWithArtsy/Components/Header.tsx @@ -1,32 +1,11 @@ -import { - ActionType, - ContextModule, - OwnerType, - TappedConsignArgs, - TappedConsignmentInquiry, -} from "@artsy/cohesion" -import { Flex, Text, Button } from "@artsy/palette-mobile" +import { Flex, Text } from "@artsy/palette-mobile" import { useScreenDimensions } from "app/utils/hooks" import { Image } from "react-native" import { isTablet } from "react-native-device-info" -interface HeaderProps { - onConsignPress: (tappedConsignArgs: TappedConsignArgs) => void - onInquiryPress: (inquiryTrackingArgs?: TappedConsignmentInquiry) => void -} - -export const Header: React.FC = ({ onConsignPress, onInquiryPress }) => { - const buttonText = "Start Selling" +export const Header: React.FC = () => { const { width } = useScreenDimensions() - const handleSubmitPress = (subject: string) => { - onConsignPress(tracks.consignArgs(subject)) - } - - const handleInquiryPress = () => { - onInquiryPress(tracks.consignmentInquiryTapped()) - } - return ( = ({ onConsignPress, onInquiryPress } Sell art from your collection - + With our global reach and art market expertise, our specialists will find the best sales option for your work. - - - - ) } - -const tracks = { - consignArgs: (subject: string): TappedConsignArgs => ({ - contextModule: ContextModule.sellHeader, - contextScreenOwnerType: OwnerType.sell, - subject, - }), - consignmentInquiryTapped: (): TappedConsignmentInquiry => ({ - action: ActionType.tappedConsignmentInquiry, - context_module: ContextModule.sellHeader, - context_screen: OwnerType.sell, - context_screen_owner_type: OwnerType.sell, - subject: "Get in Touch", - }), -} diff --git a/src/app/Scenes/SellWithArtsy/Components/HowItWorks.tsx b/src/app/Scenes/SellWithArtsy/Components/HowItWorks.tsx index cbe399a89ce..84167fe1a70 100644 --- a/src/app/Scenes/SellWithArtsy/Components/HowItWorks.tsx +++ b/src/app/Scenes/SellWithArtsy/Components/HowItWorks.tsx @@ -1,5 +1,4 @@ -import { ContextModule, OwnerType, TappedConsignArgs } from "@artsy/cohesion" -import { Spacer, Flex, Text, Join, Button } from "@artsy/palette-mobile" +import { Spacer, Flex, Text, Join } from "@artsy/palette-mobile" const STEPS = [ { @@ -20,11 +19,7 @@ const STEPS = [ }, ] -export const HowItWorks: React.FC<{ - onConsignPress: (tappedConsignArgs: TappedConsignArgs) => void -}> = ({ onConsignPress }) => { - const buttonText = "Start Selling" - +export const HowItWorks: React.FC = () => { return ( How it works @@ -38,25 +33,7 @@ export const HowItWorks: React.FC<{ {step.text} ))} - - ) } - -const tracks = { - consignArgs: (subject: string): TappedConsignArgs => ({ - contextModule: ContextModule.sellHowItWorks, - contextScreenOwnerType: OwnerType.sell, - subject, - }), -} diff --git a/src/app/Scenes/SellWithArtsy/Components/SellWithArtsyRecentlySold.tsx b/src/app/Scenes/SellWithArtsy/Components/SellWithArtsyRecentlySold.tsx index 7f44618c95e..0839c5e19ce 100644 --- a/src/app/Scenes/SellWithArtsy/Components/SellWithArtsyRecentlySold.tsx +++ b/src/app/Scenes/SellWithArtsy/Components/SellWithArtsyRecentlySold.tsx @@ -32,7 +32,7 @@ export const SellWithArtsyRecentlySold: React.FC return ( - Sold Recently on Artsy + Previously sold on Artsy diff --git a/src/app/Scenes/SellWithArtsy/Components/StickySWAHeader.tsx b/src/app/Scenes/SellWithArtsy/Components/StickySWAHeader.tsx new file mode 100644 index 00000000000..c1fe380a4a0 --- /dev/null +++ b/src/app/Scenes/SellWithArtsy/Components/StickySWAHeader.tsx @@ -0,0 +1,76 @@ +import { + ActionType, + ContextModule, + OwnerType, + TappedConsignArgs, + TappedConsignmentInquiry, +} from "@artsy/cohesion" +import { Flex, Text, Button, Spacer, LinkText, useScreenDimensions } from "@artsy/palette-mobile" +import { Platform } from "react-native" + +interface StickySWAHeaderProps { + onConsignPress: (tappedConsignArgs: TappedConsignArgs) => void + onInquiryPress: (inquiryTrackingArgs?: TappedConsignmentInquiry) => void +} + +export const StickySWAHeader: React.FC = ({ + onConsignPress, + onInquiryPress, +}) => { + const { bottom } = useScreenDimensions().safeAreaInsets + + const handleSubmitPress = (subject: string) => { + onConsignPress(tracks.consignArgs(subject)) + } + + const handleInquiryPress = () => { + onInquiryPress(tracks.consignmentInquiryTapped()) + } + + return ( + <> + + + + + + + Not sure what you’re looking for?{" "} + + Speak to an advisor + + + + + ) +} + +const tracks = { + consignArgs: (subject: string): TappedConsignArgs => ({ + contextModule: ContextModule.sellHeader, + contextScreenOwnerType: OwnerType.sell, + subject, + }), + consignmentInquiryTapped: (): TappedConsignmentInquiry => ({ + action: ActionType.tappedConsignmentInquiry, + context_module: ContextModule.sellHeader, + context_screen: OwnerType.sell, + context_screen_owner_type: OwnerType.sell, + subject: "Get in Touch", + }), +} diff --git a/src/app/Scenes/SellWithArtsy/SellWithArtsyHome.tsx b/src/app/Scenes/SellWithArtsy/SellWithArtsyHome.tsx index d56414e263e..a4a89f01f4b 100644 --- a/src/app/Scenes/SellWithArtsy/SellWithArtsyHome.tsx +++ b/src/app/Scenes/SellWithArtsy/SellWithArtsyHome.tsx @@ -1,4 +1,11 @@ -import { tappedConsign, TappedConsignArgs, TappedConsignmentInquiry } from "@artsy/cohesion" +import { + ActionType, + ContextModule, + OwnerType, + tappedConsign, + TappedConsignArgs, + TappedConsignmentInquiry, +} from "@artsy/cohesion" import { Flex, Join, LegacyScreen, Spacer } from "@artsy/palette-mobile" import { SellWithArtsyHomeQuery } from "__generated__/SellWithArtsyHomeQuery.graphql" import { SellWithArtsyHome_me$data } from "__generated__/SellWithArtsyHome_me.graphql" @@ -25,6 +32,7 @@ import { Footer } from "./Components/Footer" import { Header } from "./Components/Header" import { HowItWorks } from "./Components/HowItWorks" import { SellWithArtsyRecentlySold } from "./Components/SellWithArtsyRecentlySold" +import { StickySWAHeader } from "app/Scenes/SellWithArtsy/Components/StickySWAHeader" interface SellWithArtsyHomeProps { recentlySoldArtworks?: SellWithArtsyHome_recentlySoldArtworksTypeConnection$data @@ -97,15 +105,15 @@ export const SellWithArtsyHome: React.FC = ({ > }> -
+
- + - + @@ -117,13 +125,15 @@ export const SellWithArtsyHome: React.FC = ({ - + -