Skip to content

Commit ec372ed

Browse files
committed
Add auto-reload component
1 parent 9b28913 commit ec372ed

File tree

5 files changed

+204
-186
lines changed

5 files changed

+204
-186
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package app.cash.backfila.ui.components
2+
3+
import kotlinx.html.TagConsumer
4+
import kotlinx.html.div
5+
6+
// TODO
7+
// Currently this reloads the whole page every 10s
8+
// We want to ideally only update within a turbo frame so the rest of the UI is stable
9+
// (ie. update form for backfill show page)
10+
fun TagConsumer<*>.AutoReload(block: TagConsumer<*>.() -> Unit) {
11+
div {
12+
attributes["data-controller"] = "auto-reload"
13+
attributes["data-auto-reload-target"] = "frame"
14+
15+
block()
16+
}
17+
}

service/src/main/kotlin/app/cash/backfila/ui/components/DashboardPageLayout.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ class DashboardPageLayout @Inject constructor(
107107
) {
108108
div("py-10") {
109109
main {
110+
// TODO maybe make max-w wider
110111
div("mx-auto max-w-7xl sm:px-6 lg:px-8") {
111112
// TODO remove when new UI is stable and preferred
112113
UseOldUIAlert()

0 commit comments

Comments
 (0)