mirror of
https://github.com/penpot/penpot.git
synced 2025-03-14 08:41:48 -05:00
💄 Add cosmetic improvements on project_menu component.
This commit is contained in:
parent
1d174a4379
commit
56dfdaecb7
2 changed files with 17 additions and 5 deletions
|
@ -6,6 +6,7 @@
|
||||||
|
|
||||||
(ns app.main.ui.dashboard.project-menu
|
(ns app.main.ui.dashboard.project-menu
|
||||||
(:require
|
(:require
|
||||||
|
[app.common.spec :as us]
|
||||||
[app.main.data.dashboard :as dd]
|
[app.main.data.dashboard :as dd]
|
||||||
[app.main.data.messages :as dm]
|
[app.main.data.messages :as dm]
|
||||||
[app.main.data.modal :as modal]
|
[app.main.data.modal :as modal]
|
||||||
|
@ -17,14 +18,24 @@
|
||||||
[app.util.dom :as dom]
|
[app.util.dom :as dom]
|
||||||
[app.util.i18n :as i18n :refer [tr]]
|
[app.util.i18n :as i18n :refer [tr]]
|
||||||
[app.util.router :as rt]
|
[app.util.router :as rt]
|
||||||
|
[cljs.spec.alpha :as s]
|
||||||
[rumext.alpha :as mf]))
|
[rumext.alpha :as mf]))
|
||||||
|
|
||||||
|
(s/def ::project some?)
|
||||||
|
(s/def ::show? boolean?)
|
||||||
|
(s/def ::on-edit fn?)
|
||||||
|
(s/def ::on-menu-close fn?)
|
||||||
|
(s/def ::top (s/nilable ::us/number))
|
||||||
|
(s/def ::left (s/nilable ::us/number))
|
||||||
|
(s/def ::on-import fn?)
|
||||||
|
|
||||||
|
(s/def ::project-menu
|
||||||
|
(s/keys :req-un [::project ::show? ::on-edit ::on-menu-close]
|
||||||
|
:opt-un [::top ::left ::on-import]))
|
||||||
|
|
||||||
(mf/defc project-menu
|
(mf/defc project-menu
|
||||||
[{:keys [project show? on-edit on-menu-close top left on-import] :as props}]
|
[{:keys [project show? on-edit on-menu-close top left on-import] :as props}]
|
||||||
(assert (some? project) "missing `project` prop")
|
(us/verify ::project-menu props)
|
||||||
(assert (boolean? show?) "missing `show?` prop")
|
|
||||||
(assert (fn? on-edit) "missing `on-edit` prop")
|
|
||||||
(assert (fn? on-menu-close) "missing `on-menu-close` prop")
|
|
||||||
(let [top (or top 0)
|
(let [top (or top 0)
|
||||||
left (or left 0)
|
left (or left 0)
|
||||||
|
|
||||||
|
@ -83,7 +94,7 @@
|
||||||
on-finish-import
|
on-finish-import
|
||||||
(mf/use-callback
|
(mf/use-callback
|
||||||
(fn []
|
(fn []
|
||||||
(when (some? on-import) (on-import))))]
|
(when (fn? on-import) (on-import))))]
|
||||||
|
|
||||||
[:*
|
[:*
|
||||||
[:& udi/import-form {:ref file-input
|
[:& udi/import-form {:ref file-input
|
||||||
|
|
|
@ -179,6 +179,7 @@
|
||||||
:viewport-ref viewport-ref}])
|
:viewport-ref viewport-ref}])
|
||||||
|
|
||||||
[:& widgets/viewport-actions]]
|
[:& widgets/viewport-actions]]
|
||||||
|
|
||||||
[:svg.render-shapes
|
[:svg.render-shapes
|
||||||
{:id "render"
|
{:id "render"
|
||||||
:xmlns "http://www.w3.org/2000/svg"
|
:xmlns "http://www.w3.org/2000/svg"
|
||||||
|
|
Loading…
Add table
Reference in a new issue