this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add pop_up field to HomeTimeline page model

+19 -13
+3 -3
client/src/lumina_client.gleam
··· 400 400 let assert model_type.WsConnectionConnected(socket) = model.ws 401 401 as "Socket not connected" 402 402 let model = case model.page { 403 - HomeTimeline(..) -> { 404 - model_type.Model(..model, page: HomeTimeline(Some(tid))) 403 + HomeTimeline(timeline_id: _, pop_up:) -> { 404 + model_type.Model(..model, page: HomeTimeline(Some(tid), pop_up:)) 405 405 } 406 406 _ -> model 407 407 } ··· 462 462 Model( 463 463 ..model, 464 464 // Global is default until user information says otherwise, however, we can't set it here, for that'd make it impossible to know if it's set by user or by default. 465 - page: HomeTimeline(None), 465 + page: HomeTimeline(None, None), 466 466 token: Some(token), 467 467 ), 468 468 effect.batch([
+12 -3
client/src/lumina_client/model_type.gleam
··· 115 115 Landing 116 116 Register(fields: RegisterPageFields, ready: Option(Result(Nil, String))) 117 117 Login(fields: LoginFields, success: Option(Bool)) 118 - HomeTimeline(timeline_id: Option(String)) 118 + HomeTimeline(timeline_id: Option(String), pop_up: Option(String)) 119 119 } 120 120 121 121 fn encode_page(page: Page) -> json.Json { ··· 154 154 ]) 155 155 }), 156 156 ]) 157 - HomeTimeline(timeline_id:) -> 157 + HomeTimeline(timeline_id:, pop_up:) -> 158 158 json.object( 159 159 [#("type", json.string("home_timeline"))] 160 160 |> list.append(case timeline_id { 161 161 None -> [] 162 162 Some(i) -> [#("timeline_id", json.string(i))] 163 + }) 164 + |> list.append(case pop_up { 165 + None -> [] 166 + Some(i) -> [#("pop_up", json.string(i))] 163 167 }), 164 168 ) 165 169 } ··· 202 206 None, 203 207 decode.optional(decode.string), 204 208 ) 205 - decode.success(HomeTimeline(timeline_id:)) 209 + use pop_up <- decode.optional_field( 210 + "pop_up", 211 + None, 212 + decode.optional(decode.string), 213 + ) 214 + decode.success(HomeTimeline(timeline_id:, pop_up:)) 206 215 } 207 216 _ -> decode.failure(Landing, "Page") 208 217 }
+4 -7
client/src/lumina_client/view.gleam
··· 16 16 import lumina_client/model_type.{ 17 17 type Model, HomeTimeline, Landing, Login, Register, 18 18 } 19 + import lumina_client/view/homepage 19 20 import lustre/attribute.{attribute} 20 21 import lustre/element.{type Element} 21 22 import lustre/element/html ··· 466 467 fn view_homepage(model: model_type.Model) { 467 468 // Dissect the model 468 469 let assert model_type.Model( 469 - page: model_type.HomeTimeline(timeline_id:), 470 + page: model_type.HomeTimeline(timeline_id:, pop_up:), 470 471 user:, 471 472 ws: _, 472 473 token:, ··· 487 488 html.div( 488 489 [ 489 490 attribute.class( 490 - "drawer-content flex flex-col items-center bg-neutral text-neutral-content h-screen max-h-[calc(100vh-4rem)]", 491 + "drawer-content items-center flex flex-col bg-neutral text-neutral-content h-screen max-h-[calc(100vh-4rem)]", 491 492 ), 492 493 ], 493 - [ 494 - html.div([attribute.class("justify-center p-4")], [ 495 - element.text("Still, I've to put something on here innit?"), 496 - ]), 497 - ], 494 + [homepage.timeline(model)], 498 495 ), 499 496 html.div([attribute.class("drawer-side")], [ 500 497 html.label(