| @@ -1,10 +1,18 @@ | ||
| 1 | +import { handleDesign } from '@auto-launch/fetchers/get-design'; | |
| 2 | +import { applyDesign, chooseLogo } from '@auto-launch/functions/design'; | |
| 1 | 3 | import { LaunchPage } from '@auto-launch/LaunchPage'; |
| 4 | +import { chooseTemplates } from '@auto-launch/templates'; | |
| 2 | 5 | import { createRoot } from '@wordpress/element'; |
| 3 | 6 | import '@auto-launch/auto-launch.css'; |
| 4 | 7 | |
| 5 | -requestAnimationFrame(() => { | |
| 8 | +requestAnimationFrame(async () => { | |
| 6 | 9 | const launch = document.getElementById('extendify-auto-launch-page'); |
| 7 | 10 | if (!launch) return; |
| 11 | + // Before the first paint, or the partner's own colours show and then swap. | |
| 12 | + const design = await handleDesign(); | |
| 13 | + chooseTemplates(design.templates); | |
| 14 | + chooseLogo(design.logo); | |
| 15 | + applyDesign(launch, design); | |
| 8 | 16 | const root = createRoot(launch); |
| 9 | 17 | root.render(<LaunchPage />); |
| 10 | 18 | }); |