From 14d67142096cf4c97fdb675d1a8b4dd387b3b054 Mon Sep 17 00:00:00 2001 From: ammarahm-ed Date: Mon, 11 Sep 2023 12:51:01 +0500 Subject: [PATCH] theme: confirm before downloading code-block css --- .../src/components/theme-builder/index.tsx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/apps/theme-builder/src/components/theme-builder/index.tsx b/apps/theme-builder/src/components/theme-builder/index.tsx index 3f22a9f27..4b4df59e4 100644 --- a/apps/theme-builder/src/components/theme-builder/index.tsx +++ b/apps/theme-builder/src/components/theme-builder/index.tsx @@ -643,13 +643,25 @@ function exportTheme(theme: ThemeDefinition) { }), `${theme.id}.json` ); + const confirmed = window.confirm( + "Do you also want to download code-block.css for this theme?" + ); + if (confirmed) { + FileSaver.saveAs( + new Blob([theme.codeBlockCSS], { + type: "text/plain" + }), + `code-block.css` + ); + } } function themeToJSON(theme: ThemeDefinition) { return JSON.stringify( { $schema: JSON_SCHEMA_URL, - ...theme + ...theme, + codeBlockCSS: undefined }, undefined, 2