|
1 | | -import { useRef, useState } from "react"; |
| 1 | +import { useMemo, useRef, useState } from "react"; |
2 | 2 | import { DxcContainer, DxcFlex, DxcWizard } from "@dxc-technology/halstack-react"; |
3 | 3 | import StepHeading from "./components/StepHeading"; |
4 | 4 | import BottomButtons from "./components/BottomButtons"; |
@@ -57,6 +57,19 @@ const ThemeGeneratorConfigPage = () => { |
57 | 57 | const [tokens, setTokens] = useState<Record<string, string>>({}); |
58 | 58 | const lastGeneratedColorsRef = useRef<string>(""); |
59 | 59 |
|
| 60 | + const themeJson = useMemo(() => { |
| 61 | + const themeObject = { |
| 62 | + tokens: tokens, |
| 63 | + logos: { |
| 64 | + mainLogo: "", |
| 65 | + footerLogo: "", |
| 66 | + footerReducedLogo: "", |
| 67 | + favicon: "", |
| 68 | + }, |
| 69 | + }; |
| 70 | + return JSON.stringify(themeObject, null, 2); |
| 71 | + }, [tokens]); |
| 72 | + |
60 | 73 | const generateTokensFromColors = () => { |
61 | 74 | try { |
62 | 75 | const mappedColors = { |
@@ -93,7 +106,7 @@ const ThemeGeneratorConfigPage = () => { |
93 | 106 | case 1: |
94 | 107 | return <ThemeGeneratorPreviewPage tokens={tokens} logos={logos} />; |
95 | 108 | case 2: |
96 | | - return <ReviewDetails generatedTokens={tokens} logos={logos} />; |
| 109 | + return <ReviewDetails tokens={tokens} logos={logos} themeJson={themeJson} />; |
97 | 110 | } |
98 | 111 | }; |
99 | 112 |
|
@@ -131,7 +144,7 @@ const ThemeGeneratorConfigPage = () => { |
131 | 144 | <BottomButtons |
132 | 145 | currentStep={currentStep} |
133 | 146 | onChangeStep={handleChangeStep} |
134 | | - onExport={() => handleExport(tokens)} |
| 147 | + onExport={() => handleExport(themeJson)} |
135 | 148 | /> |
136 | 149 | </DxcFlex> |
137 | 150 | </DxcContainer> |
|
0 commit comments