Skip to content

Commit 7bc5017

Browse files
authored
fix(examples/kitchen-sink): swap broken React.createElement logo for data URI (#121)
The previous `logo: () => React.createElement(CiderpressLogo)` form failed to load because `react` is not a direct dependency of the example workspace, so the config loader's Node-side resolution threw "Cannot find module 'react'" and the dev server refused to start. Switching to the LogoImage object form (`{ src, alt }`) keeps the function-form `logo` demo intact (proves the NavLogo portal pipeline, re-runs on theme change, reads `theme.colors.brand`) without requiring a React import — the config loader runs in Node, no JSX needed. Renders an inline data URI "ACME" wordmark in the active theme's brand color so the kitchen-sink example visibly differs from the auto-generated `/logo.svg` shown by examples/simple.
1 parent f71d7f4 commit 7bc5017

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

examples/kitchen-sink/ciderpress.config.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
1-
import React from 'react'
2-
import { CiderpressLogo, defineConfig } from 'ciderpress'
1+
import { defineConfig } from 'ciderpress'
2+
3+
const acmeLogoSvg = (color: string): string =>
4+
`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 40"><text x="0" y="30" font-family="monospace" font-size="32" font-weight="700" fill="${color}">ACME</text></svg>`
35

46
export default defineConfig({
57
title: 'Acme Platform',
68
description: 'The Acme Monorepo Documentation',
79
tagline: 'Everything you need to build, ship, and scale.',
810
theme: { name: 'arcade' },
9-
logo: () => React.createElement(CiderpressLogo),
11+
logo: ({ theme }) => ({
12+
src: `data:image/svg+xml;utf8,${encodeURIComponent(acmeLogoSvg(theme.colors.brand))}`,
13+
alt: 'Acme Platform',
14+
}),
1015
home: {
1116
features: { truncate: { description: 2 } },
1217
workspaces: { columns: 2, truncate: { title: 1, description: 2 } },

0 commit comments

Comments
 (0)