11// @ts -check
22// Note: type annotations allow type checking and IDEs autocompletion
33
4+ import { topbarBannerReservationScript } from '@swmansion/t-rex-ui/topbar-banner' ;
5+ import { TOP_BAR_BANNER } from './src/components/topbarBanner.config.ts' ;
6+
47const lightCodeTheme = require ( './src/theme/CodeBlock/highlighting-light.js' ) ;
58const darkCodeTheme = require ( './src/theme/CodeBlock/highlighting-dark.js' ) ;
69
10+
11+ const firstBannerZone = TOP_BAR_BANNER . zones [ 0 ] ;
12+ const bannerReservationHeadTags = firstBannerZone
13+ ? [
14+ {
15+ tagName : 'script' ,
16+ attributes : { type : 'text/javascript' } ,
17+ innerHTML : topbarBannerReservationScript (
18+ firstBannerZone . zoneId ,
19+ firstBannerZone . contentId ,
20+ TOP_BAR_BANNER . hiddenPaths ,
21+ ) ,
22+ } ,
23+ ]
24+ : [ ] ;
25+
726/** @type {import('@docusaurus/types').Config } */
827const config = {
928 title : 'React Native Enriched HTML' ,
@@ -64,6 +83,10 @@ const config = {
6483 require . resolve ( '@swmansion/t-rex-ui/preset' ) ,
6584 ] ,
6685
86+ headTags : bannerReservationHeadTags ,
87+
88+ clientModules : [ require . resolve ( './src/clientModules/topbarBannerRefresh.ts' ) ] ,
89+
6790 plugins : [
6891 function transpileTRexUiTheme ( ) {
6992 return {
@@ -84,13 +107,12 @@ const config = {
84107 } ,
85108 } ;
86109 } ,
87- // TODO: enable Google Tag Manager with a container id for this site.
88- // process.env.NODE_ENV === 'production' && [
89- // '@docusaurus/plugin-google-tag-manager',
90- // {
91- // containerId: 'GTM-XXXXXXX',
92- // },
93- // ],
110+ process . env . NODE_ENV === 'production' && [
111+ '@docusaurus/plugin-google-tag-manager' ,
112+ {
113+ containerId : 'GTM-N5QK8TMT' ,
114+ } ,
115+ ] ,
94116 ] . filter ( Boolean ) ,
95117
96118 themeConfig :
0 commit comments