@@ -4,6 +4,8 @@ import { registerSnapHandler } from "@farcaster/snap-hono";
44import type { SnapElementInput , SnapHandlerResult } from "@farcaster/snap" ;
55
66const app = new Hono ( ) ;
7+ const SNAP_IMAGE_URL =
8+ "https://boey4mnqvpqdktto.public.blob.vercel-storage.com/chain/9d1648dc4d5a42fe.png" ;
79
810registerSnapHandler ( app , async ( ctx ) : Promise < SnapHandlerResult > => {
911 const base = snapBaseUrlFromRequest ( ctx . request ) ;
@@ -19,7 +21,7 @@ export default app;
1921
2022function componentImprovementsPage (
2123 base : string ,
22- submitted : boolean ,
24+ submitted : boolean
2325) : SnapHandlerResult {
2426 return {
2527 version : "2.0" ,
@@ -30,14 +32,20 @@ function componentImprovementsPage(
3032 elements : {
3133 page : {
3234 type : "stack" ,
33- children : [ "banner" , "showcase-controls" , "pager" , "actions" , "status" ] ,
35+ children : [
36+ "banner" ,
37+ "showcase-controls" ,
38+ "pager" ,
39+ "actions" ,
40+ "status" ,
41+ ] ,
3442 } ,
3543 banner : {
3644 type : "image" ,
3745 props : {
38- url : "https://placehold.co/1200x300/0f766e/ffffff.png?text=NEYN-11381" ,
46+ url : SNAP_IMAGE_URL ,
3947 aspect : "4:1" ,
40- alt : "Compact teal NEYN-11381 banner" ,
48+ alt : "Compact chain banner" ,
4149 title : "NEYN-11381 showcase" ,
4250 subtitle : "Paginator, image overlays, compact copy, dense grids" ,
4351 } ,
@@ -91,28 +99,32 @@ function componentImprovementsPage(
9199 "jump-medium-grid" : paginatorButton ( "Medium grid" , "paginator_go_to" , {
92100 page : 4 ,
93101 } ) ,
94- overview : pageStack ( "overview-title" , "overview-copy" , "overview-short" ) ,
102+ overview : pageStack (
103+ "overview-title" ,
104+ "overview-copy" ,
105+ "overview-short"
106+ ) ,
95107 "overview-title" : heading ( "Visible paginator" ) ,
96108 "overview-copy" : caption (
97109 "This example keeps the built-in controls and indicators visible while also using custom local actions outside the paginator." ,
98- 2 ,
110+ 2
99111 ) ,
100112 "overview-short" : caption (
101- "Text now wraps by default; add maxLines only when a section needs a bounded height." ,
113+ "Text now wraps by default; add maxLines only when a section needs a bounded height."
102114 ) ,
103115 copy : pageStack ( "copy-title" , "copy-one-line" , "copy-two-lines" ) ,
104116 "copy-title" : heading ( "Optional text clamping" ) ,
105117 "copy-one-line" : caption (
106- "No maxLines prop here: this long piece of supporting copy can wrap naturally instead of being clamped by default." ,
118+ "No maxLines prop here: this long piece of supporting copy can wrap naturally instead of being clamped by default."
107119 ) ,
108120 "copy-two-lines" : caption (
109121 "This text opts into maxLines: 2, giving longer explanatory copy a little more room without letting the snap become tall." ,
110- 2 ,
122+ 2
111123 ) ,
112124 grid : pageStack ( "grid-title" , "grid-copy" , "dense-grid" , "grid-next" ) ,
113125 "grid-title" : heading ( "Dense 1:1 grid" ) ,
114126 "grid-copy" : caption (
115- "Square cells keep board-like layouts compact and predictable." ,
127+ "Square cells keep board-like layouts compact and predictable."
116128 ) ,
117129 "dense-grid" : {
118130 type : "cell_grid" ,
@@ -128,12 +140,12 @@ function componentImprovementsPage(
128140 "small-grid" : pageStack (
129141 "small-grid-title" ,
130142 "small-grid-copy" ,
131- "small-square-grid" ,
143+ "small-square-grid"
132144 ) ,
133145 "small-grid-title" : heading ( "Small centered grid" ) ,
134146 "small-grid-copy" : caption (
135147 "maxWidth: sm caps this board, centers it, and keeps every cell square." ,
136- 2 ,
148+ 2
137149 ) ,
138150 "small-square-grid" : {
139151 type : "cell_grid" ,
@@ -149,12 +161,12 @@ function componentImprovementsPage(
149161 "medium-grid" : pageStack (
150162 "medium-grid-title" ,
151163 "medium-grid-copy" ,
152- "medium-square-grid" ,
164+ "medium-square-grid"
153165 ) ,
154166 "medium-grid-title" : heading ( "Medium centered grid" ) ,
155167 "medium-grid-copy" : caption (
156168 "maxWidth: md is wider than sm but still centers itself; lg/default remains full-width." ,
157- 2 ,
169+ 2
158170 ) ,
159171 "medium-square-grid" : {
160172 type : "cell_grid" ,
@@ -170,12 +182,12 @@ function componentImprovementsPage(
170182 "custom-nav" : pageStack (
171183 "custom-nav-title" ,
172184 "custom-nav-copy" ,
173- "custom-nav-row" ,
185+ "custom-nav-row"
174186 ) ,
175187 "custom-nav-title" : heading ( "Custom local controls" ) ,
176188 "custom-nav-copy" : caption (
177189 "Buttons can move the snap's one paginator locally without POSTing." ,
178- 2 ,
190+ 2
179191 ) ,
180192 "custom-nav-row" : {
181193 type : "stack" ,
@@ -189,7 +201,7 @@ function componentImprovementsPage(
189201 "image-card-image" : {
190202 type : "image" ,
191203 props : {
192- url : "https://placehold.co/1200x300/115e59/ffffff.png?text=4%3A1+Overlay" ,
204+ url : SNAP_IMAGE_URL ,
193205 aspect : "4:1" ,
194206 alt : "4:1 card with overlay text" ,
195207 title : "Image props, not hero" ,
@@ -200,13 +212,13 @@ function componentImprovementsPage(
200212 "many-pages-title" : heading ( "More than six pages" ) ,
201213 "many-pages-copy" : caption (
202214 "Paginator pages can exceed the normal per-container child count while the global element cap still applies." ,
203- 2 ,
215+ 2
204216 ) ,
205217 limits : pageStack ( "limits-title" , "limits-copy" , "limits-back" ) ,
206218 "limits-title" : heading ( "Validation stays strict" ) ,
207219 "limits-copy" : caption (
208220 "The local page index never becomes a POST input, and snap-level limits still protect the whole tree." ,
209- 2 ,
221+ 2
210222 ) ,
211223 "limits-back" : paginatorButton ( "Go to first" , "paginator_go_to" , {
212224 page : 0 ,
@@ -215,7 +227,7 @@ function componentImprovementsPage(
215227 "finish-title" : heading ( "Compact actions" ) ,
216228 "finish-copy" : caption (
217229 "The shorter button height and restored gaps should feel compact without crowding the layout." ,
218- 2 ,
230+ 2
219231 ) ,
220232 actions : {
221233 type : "stack" ,
@@ -286,7 +298,7 @@ function caption(content: string, maxLines?: number): SnapElementInput {
286298function paginatorButton (
287299 label : string ,
288300 action : "paginator_next" | "paginator_prev" | "paginator_go_to" ,
289- params : Record < string , unknown > = { } ,
301+ params : Record < string , unknown > = { }
290302) : SnapElementInput {
291303 return {
292304 type : "button" ,
0 commit comments