diff --git a/client/src/components/HeroElement.jsx b/client/src/components/HeroElement.jsx index 7d12d8d..fd3efb0 100644 --- a/client/src/components/HeroElement.jsx +++ b/client/src/components/HeroElement.jsx @@ -107,12 +107,15 @@ function content(element) { case 'buttons': return case 'moon': { - const size = element.props?.size || 96 - const glow = element.props?.glow ?? 0.45 + const props = element.props || {} + const size = props.size || 96 + const glow = props.glow ?? 0.45 + // Image source is configurable; old layouts with no src fall back to the + // default hero moon so they render exactly as before. Size/glow unchanged. return ( 1024 * 1024 && !confirm('This image is over 1 MB and may slow the page. Upload anyway?')) return + setUp(true) + try { + const { url } = await api.admin.upload(f) + onProps({ src: url }) + } catch { + /* ignore */ + } finally { + setUp(false) + } + } return (
-

Uses the moon from the hero artwork.

+
+ Moon image + {p.src ? ( + + ) : ( +

Using the default moon from the hero artwork.

+ )} + + {p.src && ( + onProps({ src: '' })}>Use default + )} +
+