Skip to content

Commit

Permalink
Merge pull request #11332 from wellcomecollection/guidestop-slicesimu…
Browse files Browse the repository at this point in the history
…lator

Change GuideStop rendering based on if inside slice simulator or not
  • Loading branch information
rcantin-w authored Oct 29, 2024
2 parents 8239706 + dbfeacc commit aa0b92d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions common/services/prismic/link-resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ type DataProps = {
};

function linkResolver(doc: Props | DataProps): string {
// this is mostly useful for scenarios like rendering in Page Builder
if (!doc) return '/';

const { uid, type } = doc;

if (!uid) return '/';
Expand Down
1 change: 1 addition & 0 deletions common/views/slices/GuideStop/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const GuideStopSlice: FunctionComponent<GuideStopProps> = ({
type: 'bsl' | 'audio-without-descriptions';
exhibitionGuide: ExhibitionHighlightTour;
};

const link = number
? `${linkResolver(exhibitionGuide)}/${type}/${number}`
: undefined;
Expand Down

0 comments on commit aa0b92d

Please sign in to comment.