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
@@ -19,6 +22,21 @@ function reactNativeWebPlugin() {
1922 } ;
2023}
2124
25+ const firstBannerZone = TOP_BAR_BANNER . zones [ 0 ] ;
26+ const bannerReservationHeadTags = firstBannerZone
27+ ? [
28+ {
29+ tagName : 'script' ,
30+ attributes : { type : 'text/javascript' } ,
31+ innerHTML : topbarBannerReservationScript (
32+ firstBannerZone . zoneId ,
33+ firstBannerZone . contentId ,
34+ TOP_BAR_BANNER . hiddenPaths ,
35+ ) ,
36+ } ,
37+ ]
38+ : [ ] ;
39+
2240/** @type {import('@docusaurus/types').Config } */
2341const config = {
2442 title : 'React Native Enriched HTML' ,
@@ -79,6 +97,10 @@ const config = {
7997 require . resolve ( '@swmansion/t-rex-ui/preset' ) ,
8098 ] ,
8199
100+ headTags : bannerReservationHeadTags ,
101+
102+ clientModules : [ require . resolve ( './src/clientModules/topbarBannerRefresh.ts' ) ] ,
103+
82104 plugins : [
83105 reactNativeWebPlugin ,
84106 function transpileTRexUiTheme ( ) {
@@ -100,13 +122,12 @@ const config = {
100122 } ,
101123 } ;
102124 } ,
103- // TODO: enable Google Tag Manager with a container id for this site.
104- // process.env.NODE_ENV === 'production' && [
105- // '@docusaurus/plugin-google-tag-manager',
106- // {
107- // containerId: 'GTM-XXXXXXX',
108- // },
109- // ],
125+ process . env . NODE_ENV === 'production' && [
126+ '@docusaurus/plugin-google-tag-manager' ,
127+ {
128+ containerId : 'GTM-N5QK8TMT' ,
129+ } ,
130+ ] ,
110131 ] . filter ( Boolean ) ,
111132
112133 themeConfig :
0 commit comments