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

[DO NOT MERGE] - 8.63 release candidate #11495

Closed
wants to merge 9 commits into from
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2012-2022 Art.sy, Inc.
Copyright (c) 2012-2025 Art.sy, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "eigen",
"version": "1.21.52",
"native-code-version": 44,
"license": "MIT",
"description": "Artsy mobile app.",
"engines": {
"node": "20.x",
Expand Down Expand Up @@ -92,7 +92,6 @@
"react-native"
],
"contributors": "See docs/thanks.md",
"license": "MIT",
"bugs": {
"url": "https://github.com/artsy/eigen/issues"
},
Expand Down
28 changes: 27 additions & 1 deletion src/app/Components/ArtsyWebView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ import { addBreadcrumb } from "@sentry/react-native"
import { NavigationHeader } from "app/Components/NavigationHeader"
import { BottomTabRoutes } from "app/Scenes/BottomTabs/bottomTabsConfig"
import { GlobalStore, getCurrentEmissionState } from "app/store/GlobalStore"
import { GoBackProps, dismissModal, goBack, navigate } from "app/system/navigation/navigate"
import {
GoBackProps,
dismissModal,
goBack,
navigate,
navigationEvents,
} from "app/system/navigation/navigate"
import { matchRoute } from "app/system/navigation/utils/matchRoute"
import { useBackHandler } from "app/utils/hooks/useBackHandler"
import { useDevToggle } from "app/utils/hooks/useDevToggle"
Expand Down Expand Up @@ -90,6 +96,18 @@ export const ArtsyWebViewPage = ({
}
}

const handleModalDismiss = () => {
dismissModal()
}

useEffect(() => {
const emitter = navigationEvents.addListener("requestModalDismiss", handleModalDismiss)

return () => {
emitter.removeListener("requestModalDismiss", handleModalDismiss)
}
}, [])

const handleGoBack = () => {
if (backAction) {
backAction()
Expand Down Expand Up @@ -208,6 +226,14 @@ export const ArtsyWebView = forwardRef<
return
}

// TODO: For not we are not redirecting to home from webviews because of artsy logo
// in purchase flow breaking things. We should instead hide the artsy logo or not redirect to home
// when in eigen purchase flow.
if (result.type === "match" && result.module === "Home") {
stopLoading(true)
return
}

// if it's a route that we know we don't have a native view for, keep it in the webview
// only vanityURLs which do not have a native screen ends up in the webview. So also keep in webview for VanityUrls
// TODO:- Handle cases where a vanityURl lands in a webview and then webview url navigation state changes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const AutomountedBottomSheetModal: FC<AutomountedBottomSheetModalProps> =

// dismiss modal on back button press on Android
useBackHandler(() => {
if (ref.current && modalIsPresented) {
if (ref.current && modalIsPresented && visible) {
ref.current.dismiss()
return true
} else {
Expand Down
10 changes: 5 additions & 5 deletions src/app/Components/ContextMenu/ContextMenuArtwork.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,6 @@ export const ContextMenuArtwork: React.FC<ContextMenuArtworkProps> = ({

const [androidVisible, setAndroidVisible] = useState(false)

const handleAndroidLongPress = () => {
setAndroidVisible(true)
}

if (isIOS && enableContextMenuIOS) {
return (
<ContextMenu
Expand All @@ -220,6 +216,10 @@ export const ContextMenuArtwork: React.FC<ContextMenuArtworkProps> = ({
)
}

const handleAndroidLongPress = () => {
setAndroidVisible(true)
}

// Fall back to a bottom sheet on Android
if (!isIOS && enableContextMenuAndroid) {
return (
Expand All @@ -228,7 +228,7 @@ export const ContextMenuArtwork: React.FC<ContextMenuArtworkProps> = ({
underlayColor={color("white100")}
activeOpacity={0.8}
onLongPress={handleAndroidLongPress}
onPress={undefined}
delayLongPress={1200}
>
{children}
</TouchableHighlight>
Expand Down
8 changes: 7 additions & 1 deletion src/app/Components/Select/Components/SelectModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,13 @@ export const SelectModal: React.FC<{
}, [searchTerm, visible])

return (
<Modal visible={visible} onDismiss={onDismiss} statusBarTranslucent testID={testID}>
<Modal
visible={visible}
onDismiss={onDismiss}
onRequestClose={onDismiss}
statusBarTranslucent
testID={testID}
>
<Screen>
<Flex p={2} pb="15px" flexDirection="row" alignItems="center" flexGrow={0}>
<Flex flex={1} />
Expand Down
2 changes: 1 addition & 1 deletion src/app/Components/Select/SelectV2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ const SelectModal: React.FC<{
}, [searchTerm, props.visible])

return (
<Modal visible={props.visible} onDismiss={props.onDismiss}>
<Modal visible={props.visible} onDismiss={props.onDismiss} onRequestClose={props.onDismiss}>
<Flex p={2} pb="15px" flexDirection="row" alignItems="center" flexGrow={0}>
<Flex flex={1} />
<Flex flex={2} alignItems="center">
Expand Down
4 changes: 3 additions & 1 deletion src/app/Scenes/ArtQuiz/ArtQuizArtworks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,10 @@ const ArtQuizArtworkCard: React.FC<ArtQuizArtworkCardProps> = ({ artwork }) => {
const { width } = useScreenDimensions()
const space = useSpace()

const CARD_HEIGHT = 500

return (
<Flex width={width - space(4)} height={500} backgroundColor="white">
<Flex width={width - space(4)} height={CARD_HEIGHT} backgroundColor="white">
<Image
source={{ uri: artwork?.image?.resized?.src }}
style={{ flex: 1 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ describe(FooterButtons, () => {
expect(mockDismissModal).toHaveBeenCalled()
await flushPromiseQueue()

expect(navigate).toHaveBeenCalledWith("my-collection/artists/new", {
expect(navigate).toHaveBeenCalledWith("my-collection/collected-artists/new", {
passProps: {
source: Tab.collection,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ export const FooterButtons = ({
switchTab("profile")
dismissModal()
requestAnimationFrame(() => {
navigate("my-collection/artists/new", {
navigate("my-collection/collected-artists/new", {
passProps: {
source: Tab.collection,
},
Expand Down
14 changes: 12 additions & 2 deletions src/app/Scenes/Inbox/Components/Conversations/Composer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ import { themeGet } from "@styled-system/theme-get"
import { Composer_conversation$data } from "__generated__/Composer_conversation.graphql"
import { Schema, Track, track as _track } from "app/utils/track"
import React from "react"
import { Keyboard, KeyboardAvoidingView, TextInput, TouchableWithoutFeedback } from "react-native"
import {
Keyboard,
KeyboardAvoidingView,
Platform,
TextInput,
TouchableWithoutFeedback,
} from "react-native"
import { createFragmentContainer, graphql } from "react-relay"
import styled from "styled-components/native"
import { ConversationCTAFragmentContainer } from "./ConversationCTA"
Expand Down Expand Up @@ -90,7 +96,11 @@ export default class Composer extends React.Component<Props, State> {
fontFamily: "Unica77LL-Regular",
}
return (
<KeyboardAvoidingView style={{ flex: 1 }}>
<KeyboardAvoidingView
behavior="padding"
keyboardVerticalOffset={Platform.OS === "ios" ? 120 : 80}
style={{ flex: 1, justifyContent: "space-between" }}
>
{this.props.children}
<Flex flexDirection="column">
<ConversationCTAFragmentContainer
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import {
Button,
EntityHeader,
Flex,
HeartFillIcon,
HeartIcon,
Expand All @@ -9,9 +7,9 @@ import {
Text,
Touchable,
useScreenDimensions,
useTheme,
} from "@artsy/palette-mobile"
import { InfiniteDiscoveryArtworkCard_artwork$key } from "__generated__/InfiniteDiscoveryArtworkCard_artwork.graphql"
import { ArtistListItemContainer } from "app/Components/ArtistListItem"
import { HEART_ICON_SIZE } from "app/Components/constants"
import { useSaveArtwork } from "app/utils/mutations/useSaveArtwork"
import { sizeToFit } from "app/utils/useSizeToFit"
Expand All @@ -24,7 +22,6 @@ interface InfiniteDiscoveryArtworkCardProps {
export const InfiniteDiscoveryArtworkCard: React.FC<InfiniteDiscoveryArtworkCardProps> = ({
artwork: artworkProp,
}) => {
const { color } = useTheme()
const { width: screenWidth } = useScreenDimensions()

const artwork = useFragment<InfiniteDiscoveryArtworkCard_artwork$key>(
Expand All @@ -45,29 +42,24 @@ export const InfiniteDiscoveryArtworkCard: React.FC<InfiniteDiscoveryArtworkCard
return null
}

const MAX_ARTWORK_HEIGHT = 500
const CARD_HEIGHT = 800

const src = artwork.images?.[0]?.url
const width = artwork.images?.[0]?.width ?? 0
const height = artwork.images?.[0]?.height ?? 0

const size = sizeToFit({ width: width, height: height }, { width: screenWidth, height: 500 })
const size = sizeToFit(
{ width: width, height: height },
{ width: screenWidth, height: MAX_ARTWORK_HEIGHT }
)

return (
<Flex backgroundColor={color("white100")} width="100%" height={800}>
<EntityHeader
name={artwork.artistNames ?? ""}
meta={artwork.artists?.[0]?.formattedNationalityAndBirthday ?? undefined}
imageUrl={artwork.artists?.[0]?.coverArtwork?.images?.[0]?.url ?? undefined}
initials={artwork.artists?.[0]?.initials ?? undefined}
RightButton={
<Button variant="outlineGray" size="small">
Follow
</Button>
}
p={1}
/>
<Flex backgroundColor="white100" width="100%" height={CARD_HEIGHT}>
<ArtistListItemContainer artist={artwork.artists?.[0]} />
<Spacer y={2} />

<Flex alignItems="center" backgroundColor={color("purple60")}>
<Flex alignItems="center" backgroundColor="purple60">
{!!src && <Image src={src} height={size.height} width={size.width} />}
</Flex>
<Flex flexDirection="row" justifyContent="space-between" p={1}>
Expand All @@ -77,15 +69,15 @@ export const InfiniteDiscoveryArtworkCard: React.FC<InfiniteDiscoveryArtworkCard
{/* prevent long artwork titles from pushing the save button off of the card, */}
{/* it doesn't work as expected on Android. */}
<Text
color={color("black60")}
color="black60"
italic
variant="sm-display"
ellipsizeMode="tail"
numberOfLines={1}
>
{artwork.title}
</Text>
<Text color={color("black60")} variant="sm-display">
<Text color="black60" variant="sm-display">
, {artwork.date}
</Text>
</Flex>
Expand Down Expand Up @@ -129,6 +121,7 @@ const infiniteDiscoveryArtworkCardFragment = graphql`
}
formattedNationalityAndBirthday
initials
...ArtistListItem_artist
}
date
id
Expand Down
10 changes: 7 additions & 3 deletions src/app/Scenes/MyProfile/MyProfilePaymentNewCreditCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { goBack } from "app/system/navigation/navigate"
import { getRelayEnvironment } from "app/system/relay/defaultEnvironment"
import { Action, Computed, action, computed, useLocalStore } from "easy-peasy"
import React, { useEffect, useRef } from "react"
import { Alert, ScrollView } from "react-native"
import { Alert, KeyboardAvoidingView, Platform, ScrollView } from "react-native"
import { commitMutation, graphql } from "react-relay"
import { __triggerRefresh } from "./MyProfilePayment"

Expand Down Expand Up @@ -165,7 +165,11 @@ export const MyProfilePaymentNewCreditCard: React.FC<{}> = ({}) => {
}

return (
<>
<KeyboardAvoidingView
style={{ flex: 1 }}
behavior={Platform.OS === "ios" ? "padding" : "height"}
keyboardVerticalOffset={Platform.OS === "ios" ? 64 : 0}
>
<ScrollView ref={scrollViewRef}>
<Flex p={2}>
<Stack spacing={2}>
Expand Down Expand Up @@ -257,7 +261,7 @@ export const MyProfilePaymentNewCreditCard: React.FC<{}> = ({}) => {
</Stack>
</Flex>
</ScrollView>
</>
</KeyboardAvoidingView>
)
}

Expand Down
2 changes: 1 addition & 1 deletion src/app/Scenes/SavedSearchAlert/EditSavedSearchAlert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export const EditSavedSearchAlert: React.FC<EditSavedSearchAlertProps> = (props)
)

const { settings, ...attributes } = me?.alert ?? {}
const isCustomAlertsNotificationsEnabled = viewer.notificationPreferences.some((preference) => {
const isCustomAlertsNotificationsEnabled = viewer?.notificationPreferences?.some((preference) => {
return (
preference.channel === "email" &&
preference.name === "custom_alerts" &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const CreateSavedSearchAlertContent: React.FC<CreateSavedSearchAlertContentProps
const isPreviouslyFocused = useRef(false)
const [refetching, setRefetching] = useState(false)
const [enablePushNotifications, setEnablePushNotifications] = useState(true)
const isCustomAlertsNotificationsEnabled = viewer?.notificationPreferences.some((preference) => {
const isCustomAlertsNotificationsEnabled = viewer?.notificationPreferences?.some((preference) => {
return (
preference.channel === "email" &&
preference.name === "custom_alerts" &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,11 @@ const SubmitArtworkFormContent: React.FC<SubmitArtworkProps> = ({

return (
<FormikProvider value={formik}>
<KeyboardAvoidingView style={{ flex: 1 }}>
<KeyboardAvoidingView
style={{ flex: 1 }}
behavior={Platform.OS === "ios" ? "padding" : "height"}
keyboardVerticalOffset={Platform.OS === "ios" ? 65 : 0}
>
<NavigationContainer
independent
ref={__unsafe__SubmissionArtworkFormNavigationRef}
Expand Down
1 change: 1 addition & 0 deletions src/app/store/NativeModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ listenToNativeEvents((event: NativeEvent) => {
return
case "REQUEST_NAVIGATION": {
const { route, props } = event.payload
navigationEvents.emit("requestModalDismiss")
navigate(route, { passProps: props })
return
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/store/config/features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ export const features = {
},
AREnableArtworkCardContextMenuAndroid: {
description: "Enable long press menu on artwork cards for Android",
readyForRelease: false,
readyForRelease: true,
showInDevMenu: true,
echoFlagKey: "AREnableArtworkCardContextMenuAndroid",
},
Expand Down
3 changes: 2 additions & 1 deletion src/app/utils/PushNotification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
unsafe_getUserAccessToken,
} from "app/store/GlobalStore"
import { PendingPushNotification } from "app/store/PendingPushNotificationModel"
import { navigate } from "app/system/navigation/navigate"
import { navigate, navigationEvents } from "app/system/navigation/navigate"
import { Platform } from "react-native"
import DeviceInfo from "react-native-device-info"
import PushNotification, { ReceivedNotification } from "react-native-push-notification"
Expand Down Expand Up @@ -208,6 +208,7 @@ export const handleReceivedNotification = (
}
const hasUrl = !!notification.data.url
if (isLoggedIn && hasUrl) {
navigationEvents.emit("requestModalDismiss")
navigate(notification.data.url as string, {
passProps: notification.data,
ignoreDebounce: true,
Expand Down