~sjm/redwood

52d9aa37b362c81605b3352feb4efbbe4f11aa4b — Sam Marshall 3 years ago de4c8b3 master
chore: add button to top-bar
2 files changed, 23 insertions(+), 4 deletions(-)

M src/redwood/components/top_bar.cljs
M src/redwood/components/top_bar/set_date.cljs
M src/redwood/components/top_bar.cljs => src/redwood/components/top_bar.cljs +21 -3
@@ 7,15 7,33 @@
(defn settings-button
  []
  [:button {:style {:border "1px solid black"
                    :grid-column 2
                    :background "white"
                    :float "right"}
                    :height 24}
            :on-click #(rf/dispatch [::e/ui-toggle-top-bar])}
   "?"])

(defn top-bar-options
  []
  [:div {:style {:display "grid"
                 :grid-template-columns "20% 5% 75%"}}
   [:button {:style {:background "white"
                     :border "1px solid black"}}
    "export journal as text"]
   [:div]
   [:div
    [:p {:style {:margin 0
                 :padding-bottom 4}}
     "set campaign time"]
    [set-date]]])

(defn top-bar
  []
  (let [top-bar-open @(rf/subscribe [::q/top-bar-open])]
    [:div
     (when top-bar-open [set-date])
    [:div {:style {:display "grid"
                   :padding-bottom 8
                   :border-bottom "1px solid black"
                   :grid-template-columns "1fr 24px"}}
     (when top-bar-open [top-bar-options])
     [settings-button]]))


M src/redwood/components/top_bar/set_date.cljs => src/redwood/components/top_bar/set_date.cljs +2 -1
@@ 17,7 17,8 @@
  [lbl inp]
  [:div {:style {:display "flex"
                 :flex-direction "column"
                 :width 80}}
                 :width 80
                 :margin-right 8}}
   lbl
   inp])