From ac0496c97c4ce6f9f0320d9ef54e204db48f8109 Mon Sep 17 00:00:00 2001 From: Tom Meagher Date: Fri, 9 Feb 2024 18:58:31 -0500 Subject: [PATCH] chore: update styles --- example/src/index.tsx | 8 ++- src/dev/components.tsx | 142 ++++++++++++++++++++++++----------------- 2 files changed, 88 insertions(+), 62 deletions(-) diff --git a/example/src/index.tsx b/example/src/index.tsx index 92c6c8c2..65931445 100644 --- a/example/src/index.tsx +++ b/example/src/index.tsx @@ -64,7 +64,8 @@ app.frame('/action', ({ buttonValue, inputText }) => { image: (
{ image: (
{ app.frame('/no-intents', () => { return { image: ( -
+
foo
), diff --git a/src/dev/components.tsx b/src/dev/components.tsx index 33af319a..36bb93c6 100644 --- a/src/dev/components.tsx +++ b/src/dev/components.tsx @@ -68,14 +68,15 @@ function Frame(props: FrameProps) { postUrl, title, } = props + const hasIntents = Boolean(input || buttons?.length) return (
- + - {Boolean(input || buttons?.length) && ( + {hasIntents && (
{input && } @@ -98,18 +99,26 @@ function Frame(props: FrameProps) { } type ImgProps = { + hasIntents?: boolean | undefined imageAspectRatio: string imageUrl: string title?: string | undefined } function Img(props: ImgProps) { - const { imageAspectRatio, imageUrl, title = 'Farcaster frame' } = props + const { + hasIntents, + imageAspectRatio, + imageUrl, + title = 'Farcaster frame', + } = props return ( {title} -
-
-
Current Context
-
-
-
-
Previous Context
-
-
+
+
+ +
-
-
-
-
-
Frame
-
-
- - {debug && ( -
-
Debug
-
-
- )} -
+
+ + +
- {htmlTags && ( -
-
Meta Tags
-
-
- )} + {htmlTags && ( +
+
-
+ )} +
+ ) +} + +type PanelProps = { + content: string + title: string +} + +function Panel(props: PanelProps) { + const { content: __html, title } = props + return ( +
+
{title}
+
) } @@ -370,9 +386,9 @@ function Footer() { export function DevStyles() { const styles = ` :root { - --bg: #181818; + --bg: #1A1A19; --bn: #262626; - --br: #404040; + --br: #282C2E; --fg: rgba(255, 255, 255, 0.87); --fg2: rgba(255, 255, 255, 0.7); } @@ -534,9 +550,16 @@ export function DevStyles() { /** Utilities **/ .border { border-width: 1px; } - .border-l { border-left-width: 1px; } .border-t-0 { border-top-width: 0; } .cursor-pointer { cursor: pointer; } + .divide-x > * + * { + border-right-width: 0; + border-left-width: 1px; + } + .divide-y > * + * { + border-top-width: 1px; + border-bottom-width: 0px; + } .font-bold { font-weight: 700; } .font-mono { font-family: monospace; } .flex { display: flex; } @@ -550,6 +573,7 @@ export function DevStyles() { .grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } + .h-full { height: 100%; } .h-10 { height: 2.5rem; } .items-center { align-items: center; } .justify-center { justify-content: center; } @@ -587,5 +611,5 @@ export function DevStyles() { scrollbar-width: thin; } ` - return + return