From ea8407436461d16a687b95c8e51450297692bb7a Mon Sep 17 00:00:00 2001 From: Tom Meagher Date: Fri, 9 Feb 2024 13:26:14 -0500 Subject: [PATCH] refactor: remove dev inline styles --- src/dev/components.tsx | 268 ++++++++++++++++------------------------- src/farc.tsx | 1 + 2 files changed, 105 insertions(+), 164 deletions(-) diff --git a/src/dev/components.tsx b/src/dev/components.tsx index 8ea422fb..fb42ef85 100644 --- a/src/dev/components.tsx +++ b/src/dev/components.tsx @@ -17,14 +17,7 @@ export type AppProps = { export function App(props: AppProps) { const { baseUrl, frame, state } = props return ( -
+
@@ -46,11 +39,7 @@ export function Preview(props: PreviewProps) { hx-post="/dev" hx-swap="innerHTML" hx-target={`#${hxTarget}`} - style={{ - display: 'flex', - flexDirection: 'column', - gap: '0.5rem', - }} + class="flex flex-col gap-2" > @@ -73,46 +62,18 @@ function Frame(props: FrameProps) { title, } = props return ( -
-
- +
+
+ {Boolean(input || buttons?.length) && ( -
+
{input && } {buttons && ( -
+
{buttons.map((button) => (
-
- {new URL(baseUrl).host} +
) @@ -145,21 +99,15 @@ type ImgProps = { function Img(props: ImgProps) { const { imageAspectRatio, imageUrl, title = 'Farcaster frame' } = props return ( -
- {title} -
+ {title} ) } @@ -170,19 +118,9 @@ function Input(props: InputProps) { return ( ) } @@ -195,22 +133,7 @@ function Button(props: ButtonProps) {