From 073eb20a300b8b718fbfdb9fe0b23e5c839f8ad3 Mon Sep 17 00:00:00 2001 From: Mounir Dhahri Date: Fri, 10 Jan 2025 12:28:40 +0100 Subject: [PATCH 1/2] fix: double header on some webview screens Co-authored-by: dariakoko --- src/app/Navigation/routes.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/app/Navigation/routes.tsx b/src/app/Navigation/routes.tsx index b94e7ef5910..916faaa0476 100644 --- a/src/app/Navigation/routes.tsx +++ b/src/app/Navigation/routes.tsx @@ -1503,8 +1503,18 @@ export const artsyDotNetRoutes = defineRoutes([ path: "/:slug", name: "VanityURLEntity", Component: VanityURLEntityRenderer, + options: { + screenOptions: { + headerShown: false, + }, + }, }, - webViewRoute({ path: "/*" }), + webViewRoute({ + path: "/*", + screenOptions: { + headerShown: false, + }, + }), ]) export const liveDotArtsyRoutes = defineRoutes([ From 7da132d6fc011db7843302c4809232e1ecfe1323 Mon Sep 17 00:00:00 2001 From: Mounir Dhahri Date: Fri, 10 Jan 2025 12:30:59 +0100 Subject: [PATCH 2/2] feat: add quick links section Co-authored-by: Daria Kozlova --- .../HomeViewSectionQuickLinks.tests.tsx | 26 ++++++++++ .../Sections/HomeViewSectionQuickLinks.tsx | 49 +++++++++++++++++++ src/app/store/config/features.ts | 5 ++ 3 files changed, 80 insertions(+) create mode 100644 src/app/Scenes/HomeView/Sections/HomeViewSectionQuickLinks.tests.tsx create mode 100644 src/app/Scenes/HomeView/Sections/HomeViewSectionQuickLinks.tsx diff --git a/src/app/Scenes/HomeView/Sections/HomeViewSectionQuickLinks.tests.tsx b/src/app/Scenes/HomeView/Sections/HomeViewSectionQuickLinks.tests.tsx new file mode 100644 index 00000000000..9b12f5f1067 --- /dev/null +++ b/src/app/Scenes/HomeView/Sections/HomeViewSectionQuickLinks.tests.tsx @@ -0,0 +1,26 @@ +import { fireEvent, screen } from "@testing-library/react-native" +import { + HomeViewSectionQuickLinks, + Pills, +} from "app/Scenes/HomeView/Sections/HomeViewSectionQuickLinks" +import { navigate } from "app/system/navigation/navigate" +import { renderWithWrappers } from "app/utils/tests/renderWithWrappers" + +describe("HomeViewSectionQuickLinks", () => { + it("renders a list of pills", () => { + renderWithWrappers() + + Pills.forEach((pill) => { + expect(screen.getByText(pill.title)).toBeTruthy() + }) + }) + + it("navigates to the pill href", () => { + renderWithWrappers() + + Pills.forEach((pill) => { + fireEvent.press(screen.getByText(pill.title)) + expect(navigate).toHaveBeenCalledWith(pill.href) + }) + }) +}) diff --git a/src/app/Scenes/HomeView/Sections/HomeViewSectionQuickLinks.tsx b/src/app/Scenes/HomeView/Sections/HomeViewSectionQuickLinks.tsx new file mode 100644 index 00000000000..baf2befd02d --- /dev/null +++ b/src/app/Scenes/HomeView/Sections/HomeViewSectionQuickLinks.tsx @@ -0,0 +1,49 @@ +import { Pill, Spacer, Text, useSpace } from "@artsy/palette-mobile" +import { navigate } from "app/system/navigation/navigate" +import { FlatList } from "react-native-gesture-handler" + +export const HomeViewSectionQuickLinks: React.FC<{}> = () => { + const space = useSpace() + + return ( + } + renderItem={({ item: pill }) => ( + { + navigate(pill.href) + }} + > + + {pill.title} + + + )} + /> + ) +} + +type QuickLinkPill = { + title: string + href: string +} + +export const Pills: Array = [ + { title: "Follows", href: "/favorites" }, + { title: "Auctions", href: "/auctions" }, + { title: "Saves", href: "/favorites/saves" }, + { title: "Art under $1000", href: "/collect?price_range=%2A-1000" }, + { title: "Price Database", href: "/price-database" }, + { title: "Editorial", href: "/news" }, +] diff --git a/src/app/store/config/features.ts b/src/app/store/config/features.ts index 1763c16623d..93d61a3db0e 100644 --- a/src/app/store/config/features.ts +++ b/src/app/store/config/features.ts @@ -258,6 +258,11 @@ export const features = { showInDevMenu: true, echoFlagKey: "AREnableViewPortPrefetching", }, + AREnableHomeViewQuickLinks: { + description: "Enable Home View Quick Links", + readyForRelease: false, + showInDevMenu: true, + }, } satisfies { [key: string]: FeatureDescriptor } export interface DevToggleDescriptor {