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

Configure Feed

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

๐Ÿ’„ use primary color for the sidebar

+29 -8
+2 -1
src/client.css
··· 5 5 --foreground: #09090b; 6 6 --card: #fff; 7 7 --card-foreground: #09090b; 8 - --primary: #574747; 8 + /* color-slate-800 */ 9 + --primary: oklch(20.8% 0.042 265.755); 9 10 --primary-foreground: #fafafa; 10 11 --secondary: #f4f4f5; 11 12 --secondary-foreground: #574747;
+19 -2
src/client.gleam
··· 227 227 msg: login.Msg, 228 228 ) -> #(Model, Effect(Msg)) { 229 229 case login.update(page, msg) { 230 + // Clear any remaining error message and continue execution as normal. 230 231 login.Continue(page, effect) -> #( 231 232 Model(..model, page: page.Login(page)), 232 233 effect.map(effect, LoginMsg), 233 234 ) 234 235 236 + // ๏‹ƒ Server successfully authenticated the Client, we can now store 237 + // the returned Session token in our application Model and access 238 + // protected routes. 235 239 login.ServerAuthenticatedUser(session) -> #( 236 240 Model(..model, session:), 237 241 route.Dashboard ··· 239 243 |> modem.push(option.None, option.None), 240 244 ) 241 245 246 + // ๏‘ฎ Server failed to authenticate the Client, display a error message 247 + // on the Login page and continue execution. 242 248 login.ServerFailedToAuthenticate(reason) -> { 243 249 let message = case reason { 244 250 rsvp.HttpError(resp) -> resp.body 245 - rsvp.NetworkError -> "Connection unnavailable" 251 + 252 + rsvp.NetworkError -> 253 + case model.lang { 254 + language.BrazillianPortuguese | language.PortugalPortuguese -> 255 + "Conexรฃo nรฃo disponรญvel" 256 + _ -> "Connection not available" 257 + } 246 258 247 - _ -> "" 259 + _ -> 260 + case model.lang { 261 + language.BrazillianPortuguese | language.PortugalPortuguese -> 262 + "Ocorreu um erro ao enviar credenciais" 263 + _ -> "An error occurred when sending credentials" 264 + } 248 265 } 249 266 250 267 let page = login.Model(..page, loading: False, message:)
+3 -3
src/client/page/login.gleam
··· 50 50 case msg { 51 51 // FIELDS ------------------------------------------------------------------ 52 52 UserTypedEmail(email:) -> { 53 - let model = Model(..model, email:) 53 + let model = Model(..model, email:, message: "") 54 54 Continue(model, effect.none()) 55 55 } 56 56 57 57 UserTypedPassword(password:) -> { 58 - let model = Model(..model, password:) 58 + let model = Model(..model, password:, message: "") 59 59 Continue(model, effect.none()) 60 60 } 61 61 ··· 71 71 |> rsvp.expect_json(session.decoder(), _) 72 72 |> rsvp.post("/api/login", body, _) 73 73 74 - let model = Model(..model, loading: True) 74 + let model = Model(..model, loading: True, message: "") 75 75 Continue(model, effect) 76 76 } 77 77
+1 -1
src/client/page/navbar.gleam
··· 34 34 ]), 35 35 36 36 // Logo with Title 37 - html.div([class("hidden gap-2 items-center md:flex")], [ 37 + html.div([class("hidden gap-2 items-center md:flex hover:cursor-default")], [ 38 38 brand.logo([class("size-10 drop-shadow-md")]), 39 39 brand.title([class("text-xl")]), 40 40 ]),
+4 -1
src/client/page/sidebar.gleam
··· 6 6 pub type Msg 7 7 8 8 pub fn view(_session: session.Session) -> element.Element(Msg) { 9 - html.aside([attr.data("sidebar", ""), class("p-4")], [ 9 + let data_sidebar = attr.data("sidebar", "") 10 + 11 + html.aside([data_sidebar, class("p-4 bg-primary text-primary-foreground")], [ 10 12 html.p([], [html.text("sidebar")]), 13 + html.hr([class("my-2")]), 11 14 ]) 12 15 }