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.

🚧 add dashboard and not_found pages

+34 -5
+9 -1
src/client.gleam
··· 1 1 import client/language 2 2 import client/page 3 + import client/page/dashboard 3 4 import client/page/home 4 5 import client/page/login 5 6 import client/page/navbar ··· 57 58 // PAGES --- 58 59 LoginMsg(msg: login.Msg) 59 60 HomeMsg(msg: home.Msg) 61 + DashboardMsg(msg: dashboard.Msg) 60 62 63 + // UI Elements 61 64 SidebarMsg(msg: sidebar.Msg) 62 65 NavbarMsg(msg: navbar.Msg) 66 + NotFoundMsg(not_found.Msg) 63 67 } 64 68 65 69 // INIT ------------------------------------------------------------------------ ··· 133 137 Model(session:, route: route.Login, page: page.Login(page), ..) -> 134 138 layout(model, login.view(session, page), LoginMsg) 135 139 136 - _ -> not_found.view() 140 + // DASHBOARD PAGE ---------------------------------------------------------- 141 + Model(session:, route: route.Dashboard, page: page.Dashboard(page), ..) -> 142 + layout(model, dashboard.view(session, page), DashboardMsg) 143 + 144 + _ -> layout(model, not_found.view(), NotFoundMsg) 137 145 } 138 146 } 139 147
+3 -2
src/client/page.gleam
··· 1 + import client/page/dashboard 1 2 import client/page/login 2 3 import client/route 3 4 4 5 pub type Page { 5 6 Home 6 7 Login(page_model: login.Model) 7 - Dashboard 8 + Dashboard(page_model: dashboard.Model) 8 9 9 10 NotFound 10 11 } ··· 14 15 case route { 15 16 route.Home -> Home 16 17 route.Login -> Login(login.empty) 18 + route.Dashboard -> Dashboard(dashboard.empty) 17 19 route.NotFound -> NotFound 18 - route.Dashboard -> Dashboard 19 20 } 20 21 }
+20
src/client/page/dashboard.gleam
··· 1 + import client/session 2 + import lustre/effect 3 + import lustre/element 4 + import lustre/element/html 5 + 6 + pub type Model { 7 + Model 8 + } 9 + 10 + pub type Msg 11 + 12 + pub const empty: Model = Model 13 + 14 + pub fn update(model: Model, _msg: Msg) -> #(Model, effect.Effect(Msg)) { 15 + #(model, effect.none()) 16 + } 17 + 18 + pub fn view(_session: session.Session, _model: Model) -> element.Element(Msg) { 19 + html.p([], [html.text("Dashboard")]) 20 + }
+2 -2
src/client/page/not_found.gleam
··· 1 1 import lustre/effect 2 - import lustre/element 2 + import lustre/element/html 3 3 4 4 pub type Model { 5 5 Model ··· 14 14 } 15 15 16 16 pub fn view() { 17 - element.none() 17 + html.p([], [html.text("Not found")]) 18 18 }