File tree Expand file tree Collapse file tree 8 files changed +36
-12
lines changed
Expand file tree Collapse file tree 8 files changed +36
-12
lines changed Original file line number Diff line number Diff line change 1+ import ShufflePage from "@/src/components/pages/shufflePage/shufflePage" ;
12import { CollectionsApi } from "@/src/utils/apiClients/apiClients" ;
23import { Metadata } from "next" ;
34import { headers } from "next/headers" ;
@@ -13,5 +14,5 @@ export default async function Shuffle() {
1314 await headers ( ) ;
1415
1516 const url : string = await CollectionsApi . getRandomCollectionOrItem ( ) ;
16- return redirect ( url ) ;
17+ return < ShufflePage redirectPath = { url } /> ;
1718}
Original file line number Diff line number Diff line change @@ -288,7 +288,8 @@ const UniversalViewer: React.FC<UniversalViewerProps> = React.memo(
288288 />
289289 </ >
290290 ) ;
291- }
291+ } ,
292+ ( prevProps , nextProps ) => prevProps . manifestId === nextProps . manifestId
292293) ;
293294
294295UniversalViewer . displayName = "UniversalViewer" ;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 22
33import { ItemModel } from "../../../models/item" ;
44import React from "react" ;
5- import { UniversalViewer } from "../uv/universalViewerLazy " ;
5+ import UniversalViewer from "../uv/universalViewer " ;
66import "universalviewer/dist/esm/index.css" ;
77import { PlyrPlayer } from "../plyr/dynamic" ;
88
Original file line number Diff line number Diff line change 1+ "use client" ;
2+ import { useEffect } from "react" ;
3+ import { useRouter } from "next/navigation" ;
4+ import { trackCTA } from "@/src/utils/ga4Utils" ;
5+
6+ interface ShufflePageProps {
7+ redirectPath : string ;
8+ }
9+
10+ export default function ShufflePage ( { redirectPath } : ShufflePageProps ) {
11+ const router = useRouter ( ) ;
12+ useEffect ( ( ) => {
13+ trackCTA ( "Shuffle" , redirectPath , "Digital Collections Shuffle" ) ;
14+ router . push ( redirectPath ) ;
15+ } ) ;
16+ return null ;
17+ }
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ const lanesData = {
99 uuid : "90d41660-53a5-0130-2430-58d385a7b928" ,
1010 title : "Opportunity: journal of Negro life" ,
1111 url : "https://digitalcollections.nypl.org/collections/opportunity#/?tab=navigation" ,
12- imageID : "58864967 " ,
12+ imageID : "58886276 " ,
1313 } ,
1414 {
1515 uuid : "66d899e0-b7b9-013c-626c-0242ac110002" ,
@@ -25,7 +25,7 @@ const lanesData = {
2525 } ,
2626 {
2727 uuid : "924921a0-3cd0-0136-c557-0af54bc5b55e" ,
28- title : "Reform Advocate" ,
28+ title : "The Reform Advocate" ,
2929 url : "https://digitalcollections.nypl.org/collections/the-reform-advocate#/?tab=navigation" ,
3030 imageID : "57880025" ,
3131 } ,
Original file line number Diff line number Diff line change @@ -58,6 +58,16 @@ export const trackAVProgress = (
5858 } ) ;
5959} ;
6060
61+ export const trackCTA = ( text : string , url : string , type : string ) => {
62+ const dataLayer = window [ "dataLayer" ] || [ ] ;
63+ dataLayer . push ( {
64+ event : "cta_click" ,
65+ click_text : text ,
66+ click_url : url ,
67+ click_type : type ,
68+ } ) ;
69+ } ;
70+
6171export const trackSearchResults = (
6272 searchResultsLayout : "grid" | "list" ,
6373 filterNames : string [ ] ,
Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ export class DCHomepage {
8686
8787 //collections
8888 this . recentlyDigitizedCollection = this . page . getByRole ( "link" , {
89- name : "Reform Advocate" ,
89+ name : "The Reform Advocate" ,
9090 exact : true ,
9191 } ) ;
9292 this . farmSecurityAdministrationPhotographsCollection = this . page . locator (
@@ -96,7 +96,7 @@ export class DCHomepage {
9696 //collections' items total count
9797 //these locators are used to verify that the collections have items
9898 this . recentlyDigitizedCollectionItems = this . page . locator (
99- "#item-count-reform-advocate-3"
99+ "#item-count-the- reform-advocate-3"
100100 ) ;
101101 this . farmSecurityAdministrationPhotographsCollectionItems =
102102 this . page . locator (
You can’t perform that action at this time.
0 commit comments