Skip to content

Commit

Permalink
refactor: Better Library layout
Browse files Browse the repository at this point in the history
  • Loading branch information
motform committed Oct 6, 2024
1 parent 465f097 commit 530adab
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions src/org/motform/multiverse/components/library.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,19 @@

(defn LibraryToggles []
[:section.h-stack.spaced.centered
[:p>a.source-code {:href "https://github.com/motform/multiverse" :target "_bank"}
"Source code avalible on GitHub"]
[:section.h-stack.gap-half
[:button.shadow-medium.button-secondary.rounded
{:on-pointer-down #(when (.confirm js/window "Do you really want to empty the library? This deletes all stories and can not be undone!")
(rf/dispatch [:library/clear]))}
"empty library"]
[:button.button-secondary.rounded.shadow-medium
{:on-pointer-down #(export-markdown)}
"export library"]]])
"export as Markdown"]

[:button.button-secondary.rounded.shadow-medium
{:on-pointer-down #(export-markdown)}
"export as CSV"]]

[:button.shadow-medium.button-secondary.rounded
{:on-pointer-down #(when (.confirm js/window "Do you really want to empty the library? This deletes all stories and can not be undone!")
(rf/dispatch [:library/clear]))}
"Delete all stories"]])

(defn Empty []
[:section>p "The Library is empty, go" [:br]
Expand All @@ -66,7 +69,7 @@
(defn Library []
[:main.library.v-stack.gap-double.pad-half
(if @(rf/subscribe [:db/stories])
[:<>
[LibraryItems]
[LibraryToggles]]
[:section.v-stack.gap-half
[LibraryToggles]
[LibraryItems]]
[Empty])])

0 comments on commit 530adab

Please sign in to comment.