this repo has no description
lustre frontent oat-ui gleam
0
fork

Configure Feed

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

:bug: remove cors issue caused by `youid` package

+20 -26
+1 -1
gleam.toml
··· 10 10 lustre = ">= 5.6.0 and < 6.0.0" 11 11 modem = ">= 2.1.2 and < 3.0.0" 12 12 rsvp = ">= 1.2.0 and < 2.0.0" 13 - youid = ">= 1.6.0 and < 2.0.0" 14 13 15 14 [dev_dependencies] 16 15 gleeunit = ">= 1.0.0 and < 2.0.0" 17 16 lustre_dev_tools = ">= 2.3.6 and < 3.0.0" 18 17 19 18 [tools.lustre.html] 19 + title = "BFD" 20 20 stylesheets = [{ href = "https://unpkg.com/@knadh/oat/oat.min.css" }] 21 21 scripts = [{ src = "https://unpkg.com/@knadh/oat/oat.min.js" }] 22 22
-2
manifest.toml
··· 42 42 { name = "snag", version = "1.2.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "snag", source = "hex", outer_checksum = "274F41D6C3ECF99F7686FDCE54183333E41D2C1CA5A3A673F9A8B2C7A4401077" }, 43 43 { name = "tom", version = "2.0.2", build_tools = ["gleam"], requirements = ["gleam_stdlib", "gleam_time"], otp_app = "tom", source = "hex", outer_checksum = "234A842F3D087D35737483F5DFB6DE9839E3366EF0CAF8726D2D094210227670" }, 44 44 { name = "wisp", version = "2.2.2", build_tools = ["gleam"], requirements = ["directories", "exception", "filepath", "gleam_crypto", "gleam_erlang", "gleam_http", "gleam_json", "gleam_stdlib", "houdini", "logging", "marceau", "mist", "simplifile"], otp_app = "wisp", source = "hex", outer_checksum = "5FF5F1E288C3437252ABB93D8F9CF42FF652CE7AD54480CFE736038DC09C4F22" }, 45 - { name = "youid", version = "1.6.0", build_tools = ["gleam"], requirements = ["gleam_crypto", "gleam_stdlib", "gleam_time"], otp_app = "youid", source = "hex", outer_checksum = "7A3ABA44B1B38BC2BDCB5474C5317AA372BE58DFBC649815EE08B03526DDA18D" }, 46 45 ] 47 46 48 47 [requirements] ··· 55 54 lustre_dev_tools = { version = ">= 2.3.6 and < 3.0.0" } 56 55 modem = { version = ">= 2.1.2 and < 3.0.0" } 57 56 rsvp = { version = ">= 1.2.0 and < 2.0.0" } 58 - youid = { version = ">= 1.6.0 and < 2.0.0" }
+4 -2
src/client.gleam
··· 10 10 import gleam/http/response 11 11 import gleam/option 12 12 import lustre 13 + import lustre/attribute as attr 13 14 import lustre/effect.{type Effect} 14 15 import lustre/element 16 + import lustre/element/html 15 17 import modem 16 18 import rsvp 17 19 ··· 110 112 element_view: element.Element(a), 111 113 f: fn(a) -> Msg, 112 114 ) -> element.Element(Msg) { 113 - element.fragment([ 115 + html.section([attr.data("sidebar-layout", "")], [ 114 116 navbar.view(model.session) |> element.map(NavbarMsg), 115 117 sidebar.view(model.session) |> element.map(SidebarMsg), 116 - element_view |> element.map(f), 118 + html.main([attr.class("p-4")], [element_view |> element.map(f)]), 117 119 ]) 118 120 } 119 121
+2 -2
src/client/page/login.gleam
··· 1 + import client/session 1 2 import gleam/json 2 3 import lustre/effect 3 4 import lustre/element 4 5 import lustre/element/html 5 6 import rsvp 6 - import client/session 7 7 8 8 pub type Model { 9 9 Model( ··· 78 78 } 79 79 80 80 pub fn view(_session: session.Session, _model: Model) -> element.Element(Msg) { 81 - html.main([], [element.none()]) 81 + html.p([], [html.text("login")]) 82 82 }
+5 -3
src/client/page/navbar.gleam
··· 1 - import lustre/attribute 1 + import client/session 2 + import lustre/attribute.{class} as attr 2 3 import lustre/element 3 4 import lustre/element/html 4 - import client/session 5 5 6 6 pub type Msg 7 7 8 8 pub fn view(_session: session.Session) -> element.Element(Msg) { 9 - html.aside([attribute.data("topnav", "")], []) 9 + html.nav([attr.data("topnav", ""), class("p-4 border border-gray-500")], [ 10 + html.p([], [html.text("navbar")]), 11 + ]) 10 12 }
+5 -3
src/client/page/sidebar.gleam
··· 1 - import lustre/attribute 1 + import client/session 2 + import lustre/attribute.{class} as attr 2 3 import lustre/element 3 4 import lustre/element/html 4 - import client/session 5 5 6 6 pub type Msg 7 7 8 8 pub fn view(_session: session.Session) -> element.Element(Msg) { 9 - html.aside([attribute.data("sidebar", "")], []) 9 + html.aside([attr.data("sidebar", ""), class("p-4")], [ 10 + html.p([], [html.text("sidebar")]), 11 + ]) 10 12 }
+2 -11
src/client/user.gleam
··· 1 1 import gleam/dynamic/decode 2 - import youid/uuid 3 2 4 3 pub type User { 5 - User(id: uuid.Uuid, full_name: String, email: String) 4 + User(id: String, full_name: String, email: String) 6 5 } 7 6 8 7 pub fn decoder() -> decode.Decoder(User) { 9 - use id <- decode.field("id", uuid_decoder()) 8 + use id <- decode.field("id", decode.string) 10 9 use full_name <- decode.field("full_name", decode.string) 11 10 use email <- decode.field("email", decode.string) 12 11 13 12 decode.success(User(id:, full_name:, email:)) 14 13 } 15 - 16 - fn uuid_decoder() -> decode.Decoder(uuid.Uuid) { 17 - use str <- decode.then(decode.string) 18 - case uuid.from_string(str) { 19 - Ok(value) -> decode.success(value) 20 - Error(_) -> decode.failure(uuid.v7(), "Uuid") 21 - } 22 - }
+1 -2
test/dummy.gleam
··· 1 1 import client/user.{type User, User} 2 - import youid/uuid 3 2 4 3 pub fn user() -> User { 5 - User(id: uuid.v7(), full_name: "Dummy", email: "dummy@lustre.dev") 4 + User(id: "", full_name: "Dummy", email: "dummy@lustre.dev") 6 5 }