From 2bb8e71a4632087964766d19b57204d0115e5e8c Mon Sep 17 00:00:00 2001 From: mehbark Date: Wed, 12 Jul 2023 12:55:08 -0400 Subject: [PATCH] gonna switch to preact jsx --- html/common.tsx | 13 +++++++++++++ html/eggbug-spamclick-battle.tsx | 6 +----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/html/common.tsx b/html/common.tsx index 52abd38..9a1d269 100644 --- a/html/common.tsx +++ b/html/common.tsx @@ -1,3 +1,4 @@ +import { Html } from "./html.ts"; import { Component } from "./jsx/jsx-runtime.ts"; export const Main: Component = (attributes, children) => ( @@ -20,3 +21,15 @@ export const styles = (s: Record): string => Object.entries(s) .map(([rule, val]) => `${rule}: ${val};`) .join(""); + +export const eggbug_emotions: Record = { + smiling: ( + eggbug, smiling + ), +}; + +export const EggbugImg: Component = ({ type }) => eggbug_emotions[type]; diff --git a/html/eggbug-spamclick-battle.tsx b/html/eggbug-spamclick-battle.tsx index 98c4551..aa122a9 100644 --- a/html/eggbug-spamclick-battle.tsx +++ b/html/eggbug-spamclick-battle.tsx @@ -4,11 +4,7 @@ import { Component } from "./jsx/jsx-runtime.ts"; const Eggbug: Component = () => ( - eggbug, smiling + );