From 6c92a4dbf3243f8ae16ceec238fa4f817376bc41 Mon Sep 17 00:00:00 2001 From: Kyrylo Shmidt Date: Tue, 20 Jun 2023 18:02:50 +0200 Subject: [PATCH 1/2] Fix initial font values --- src/components/common/App/index.tsx | 7 +++++-- src/components/common/App/styles.ts | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/components/common/App/index.tsx b/src/components/common/App/index.tsx index c381430fb..cf6e5d32e 100644 --- a/src/components/common/App/index.tsx +++ b/src/components/common/App/index.tsx @@ -36,10 +36,13 @@ export const actions = addPrefix(ACTION_PREFIX, { SET_IS_JAEGER_ENABLED: "SET_IS_JAEGER_ENABLED" }); +const defaultMainFont = isString(window.mainFont) ? window.mainFont : ""; +const defaultCodeFont = isString(window.codeFont) ? window.codeFont : ""; + export const App = (props: AppProps) => { const [mode, setMode] = useState(getMode()); - const [mainFont, setMainFont] = useState(""); - const [codeFont, setCodeFont] = useState(""); + const [mainFont, setMainFont] = useState(defaultMainFont); + const [codeFont, setCodeFont] = useState(defaultCodeFont); useEffect(() => { if (!props.theme) { diff --git a/src/components/common/App/styles.ts b/src/components/common/App/styles.ts index 9e4d0d333..04ac42dfe 100644 --- a/src/components/common/App/styles.ts +++ b/src/components/common/App/styles.ts @@ -31,7 +31,7 @@ export const getMainFont = (customFont: string): FlattenSimpleInterpolation => { return css` /* stylelint-disable-next-line font-family-no-missing-generic-family-keyword */ - font-family: ${[customFont, osFont, "sans-serif"] + font-family: ${[`"${customFont}"`, osFont, "sans-serif"] .filter(Boolean) .join(", ")}; `; From ecf005206dc8f5a8de3249a5b43fa2bc1ef6bed7 Mon Sep 17 00:00:00 2001 From: Kyrylo Shmidt Date: Tue, 20 Jun 2023 18:13:19 +0200 Subject: [PATCH 2/2] Fix code font value --- src/components/common/App/styles.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/common/App/styles.ts b/src/components/common/App/styles.ts index 04ac42dfe..85ca81b30 100644 --- a/src/components/common/App/styles.ts +++ b/src/components/common/App/styles.ts @@ -64,7 +64,7 @@ export const getCodeFont = (customFont: string): FlattenSimpleInterpolation => { return css` /* stylelint-disable-next-line font-family-no-missing-generic-family-keyword */ - font-family: ${[customFont, osFont, "monospace"] + font-family: ${[`"${customFont}"`, osFont, "monospace"] .filter(Boolean) .join(", ")}; `;