From 5fe6bf8778c5e5e7995ac2372772fdca600edac8 Mon Sep 17 00:00:00 2001 From: Daniel Adams Date: Fri, 19 Apr 2024 18:28:42 +0200 Subject: [PATCH] Add tracking header (#726) * Fix initial CI issue * Linting * Fix naming error * Add tracking snippets * Fix issues badly, need to work out why theme is empty * Fix components used on contributing page * Roll back styled-components to v5 * Add option to track * Prettier --------- Co-authored-by: Owen Niblock Co-authored-by: Owen Niblock --- theme/src/components/head.js | 6 ++++++ theme/src/components/live-code.js | 10 +++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/theme/src/components/head.js b/theme/src/components/head.js index d57e6eac..e8dacbf2 100644 --- a/theme/src/components/head.js +++ b/theme/src/components/head.js @@ -15,6 +15,12 @@ function Head(props) { + {siteMetadata.primerTracking ? ( + <> + + + + ) : null} ) } diff --git a/theme/src/components/live-code.js b/theme/src/components/live-code.js index a93d13f6..8062033d 100644 --- a/theme/src/components/live-code.js +++ b/theme/src/components/live-code.js @@ -106,15 +106,15 @@ function LiveCode({code, language, highlight, noinline, metastring}) { onChange={handleChange} theme={githubTheme} ignoreTabKey={true} - padding={theme.space[3]} + padding={theme?.space[3]} style={{ - fontFamily: theme.fonts.mono, + fontFamily: theme?.fonts.mono, fontSize: '85%', - borderBottomLeftRadius: theme.radii[2], - borderBottomRightRadius: theme.radii[2], + borderBottomLeftRadius: theme?.radii[2], + borderBottomRightRadius: theme?.radii[2], border: '1px solid', borderTop: 0, - borderColor: theme.colors.border.default, + borderColor: theme?.colors.border.default, }} />