Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enhance: bottom bar to show undo mode
- Loading branch information
1 parent
e04ec1d
commit 6f1237a
Showing
6 changed files
with
52 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
(ns frontend.components.bottom-bar | ||
"Bottom bar for editor's status, the general rule is to avoid using this | ||
to present user a simple and clean UI." | ||
(:require [frontend.ui :as ui] | ||
[frontend.state :as state] | ||
[rum.core :as rum] | ||
[frontend.db :as db] | ||
[frontend.modules.editor.undo-redo :as undo-redo])) | ||
|
||
(rum/defc bar < rum/reactive | ||
[] | ||
(let [page-only-mode? (state/sub :history/page-only-mode?) | ||
undo-page-id (state/sub :history/page)] | ||
(prn "render bar " {:page-only-mode? page-only-mode? | ||
:undo-page-id undo-page-id}) | ||
(when (or (and page-only-mode? undo-page-id) | ||
;; others | ||
) | ||
[:div#ls-bottom-bar | ||
[:div.items | ||
(when undo-page-id | ||
[:div.item.flex.items-center | ||
(str "Undo: " (:block/original-name (db/entity undo-page-id))) | ||
[:a.inline-flex.ml-1 {:on-click undo-redo/toggle-undo-redo-mode!} | ||
(ui/icon "x")]])]]))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#ls-bottom-bar { | ||
@apply shadow-lg text-sm p-1 fixed bottom-0 rounded-md; | ||
|
||
.items { | ||
@apply flex flex-row flex-1; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters