File tree Expand file tree Collapse file tree 3 files changed +7
-4
lines changed
pages/details/common/get-this-title-files Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,9 @@ function logoutLink() {
5050 return loginOrOutLink ( 'logout' ) ;
5151}
5252
53- function setUtmCampaign ( url : string , campaign : string ) {
53+ export type UtmCampaign = 'book-details' | 'subjects-dropdown' ;
54+
55+ function setUtmCampaign ( url : string , campaign : UtmCampaign ) {
5456 try {
5557 const parsed = new URL ( url ) ;
5658
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import {faCloudDownloadAlt} from '@fortawesome/free-solid-svg-icons/faCloudDownl
99import { faVolumeUp } from '@fortawesome/free-solid-svg-icons/faVolumeUp' ;
1010import { faAmazon } from '@fortawesome/free-brands-svg-icons/faAmazon' ;
1111import $ from '~/helpers/$' ;
12+ import { type UtmCampaign } from '~/helpers/link' ;
1213import { treatSpaceOrEnterAsClick } from '~/helpers/events' ;
1314import { useIntl , FormattedMessage } from 'react-intl' ;
1415import OrderPrintCopy from './order-print-copy/order-print-copy' ;
@@ -197,7 +198,7 @@ export function PdfOption({model}: {model: Model}) {
197198 ) : null ;
198199}
199200
200- export function usePrintCopyDialog ( campaign : string ) {
201+ export function usePrintCopyDialog ( campaign : UtmCampaign ) {
201202 const [ Dialog , open ] = useDialog ( ) ;
202203 const PCDialog = React . useCallback (
203204 ( { text, slug} : { text : string ; slug : string } ) => (
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import {faUsers} from '@fortawesome/free-solid-svg-icons/faUsers';
55import { useIntl } from 'react-intl' ;
66import './order-print-copy.scss' ;
77import cmsFetch from '~/helpers/cms-fetch' ;
8- import linkHelper from '~/helpers/link' ;
8+ import linkHelper , { type UtmCampaign } from '~/helpers/link' ;
99
1010type Content = {
1111 headerText : string ;
@@ -94,7 +94,7 @@ function useBookstoreContentLink(slug: string) {
9494 return url ;
9595}
9696
97- export default function OrderPrintCopy ( { slug, campaign} : { slug : string ; campaign : string } ) {
97+ export default function OrderPrintCopy ( { slug, campaign} : { slug : string ; campaign : UtmCampaign } ) {
9898 const { formatMessage} = useIntl ( ) ;
9999 const bookstoreLink = useBookstoreContentLink ( slug ) ;
100100 const contentArray = React . useMemo ( ( ) => {
You can’t perform that action at this time.
0 commit comments