gonna switch to preact jsx

This commit is contained in:
mehbark 2023-07-12 12:55:08 -04:00
parent 41b3127e17
commit 2bb8e71a46
2 changed files with 14 additions and 5 deletions

View file

@ -1,3 +1,4 @@
import { Html } from "./html.ts";
import { Component } from "./jsx/jsx-runtime.ts"; import { Component } from "./jsx/jsx-runtime.ts";
export const Main: Component = (attributes, children) => ( export const Main: Component = (attributes, children) => (
@ -20,3 +21,15 @@ export const styles = (s: Record<string, string | number>): string =>
Object.entries(s) Object.entries(s)
.map(([rule, val]) => `${rule}: ${val};`) .map(([rule, val]) => `${rule}: ${val};`)
.join(""); .join("");
export const eggbug_emotions: Record<string, Html> = {
smiling: (
<img
class="eggbug"
src="https://staging.cohostcdn.org/attachment/f33b4285-0455-4128-96b8-117054af40c3/eggbugSquare.png"
alt="eggbug, smiling"
/>
),
};
export const EggbugImg: Component = ({ type }) => eggbug_emotions[type];

View file

@ -4,11 +4,7 @@ import { Component } from "./jsx/jsx-runtime.ts";
const Eggbug: Component = () => ( const Eggbug: Component = () => (
<HCenter> <HCenter>
<img <Eggbug type="smiling" />
class="eggbug"
src="https://staging.cohostcdn.org/attachment/f33b4285-0455-4128-96b8-117054af40c3/eggbugSquare.png"
alt="eggbug, smiling"
/>
</HCenter> </HCenter>
); );