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 path = require ( 'path' ) ;
58
69const lightCodeTheme = require ( './src/theme/CodeBlock/highlighting-light.js' ) ;
@@ -53,6 +56,21 @@ function enrichedHtmlLocalSourcePlugin() {
5356 } ;
5457}
5558
59+ const firstBannerZone = TOP_BAR_BANNER . zones [ 0 ] ;
60+ const bannerReservationHeadTags = firstBannerZone
61+ ? [
62+ {
63+ tagName : 'script' ,
64+ attributes : { type : 'text/javascript' } ,
65+ innerHTML : topbarBannerReservationScript (
66+ firstBannerZone . zoneId ,
67+ firstBannerZone . contentId ,
68+ TOP_BAR_BANNER . hiddenPaths ,
69+ ) ,
70+ } ,
71+ ]
72+ : [ ] ;
73+
5674/** @type {import('@docusaurus/types').Config } */
5775const config = {
5876 title : 'React Native Enriched HTML' ,
@@ -113,6 +131,10 @@ const config = {
113131 require . resolve ( '@swmansion/t-rex-ui/preset' ) ,
114132 ] ,
115133
134+ headTags : bannerReservationHeadTags ,
135+
136+ clientModules : [ require . resolve ( './src/clientModules/topbarBannerRefresh.ts' ) ] ,
137+
116138 plugins : [
117139 reactNativeWebPlugin ,
118140 enrichedHtmlLocalSourcePlugin ,
@@ -135,13 +157,12 @@ const config = {
135157 } ,
136158 } ;
137159 } ,
138- // TODO: enable Google Tag Manager with a container id for this site.
139- // process.env.NODE_ENV === 'production' && [
140- // '@docusaurus/plugin-google-tag-manager',
141- // {
142- // containerId: 'GTM-XXXXXXX',
143- // },
144- // ],
160+ process . env . NODE_ENV === 'production' && [
161+ '@docusaurus/plugin-google-tag-manager' ,
162+ {
163+ containerId : 'GTM-N5QK8TMT' ,
164+ } ,
165+ ] ,
145166 ] . filter ( Boolean ) ,
146167
147168 themeConfig :
0 commit comments