mirror of
https://github.com/penpot/penpot.git
synced 2025-08-07 14:38:33 +02:00
commit
4a349ec050
4 changed files with 50 additions and 26 deletions
|
@ -148,6 +148,7 @@
|
||||||
(let [{:keys [data params]} route
|
(let [{:keys [data params]} route
|
||||||
props (get profile :props)
|
props (get profile :props)
|
||||||
section (get data :name)
|
section (get data :name)
|
||||||
|
team (mf/deref refs/team)
|
||||||
|
|
||||||
|
|
||||||
show-question-modal?
|
show-question-modal?
|
||||||
|
@ -165,7 +166,8 @@
|
||||||
(and (contains? cf/flags :onboarding)
|
(and (contains? cf/flags :onboarding)
|
||||||
(not (:onboarding-viewed props))
|
(not (:onboarding-viewed props))
|
||||||
(not (contains? props :onboarding-team-id))
|
(not (contains? props :onboarding-team-id))
|
||||||
(contains? props :newsletter-updates))
|
(contains? props :newsletter-updates)
|
||||||
|
(:is-default team))
|
||||||
|
|
||||||
show-release-modal?
|
show-release-modal?
|
||||||
(and (contains? cf/flags :onboarding)
|
(and (contains? cf/flags :onboarding)
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
[app.common.media :as cm]
|
[app.common.media :as cm]
|
||||||
[app.main.data.fonts :as df]
|
[app.main.data.fonts :as df]
|
||||||
[app.main.data.modal :as modal]
|
[app.main.data.modal :as modal]
|
||||||
|
[app.main.data.notifications :as ntf]
|
||||||
[app.main.repo :as rp]
|
[app.main.repo :as rp]
|
||||||
[app.main.store :as st]
|
[app.main.store :as st]
|
||||||
[app.main.ui.components.context-menu-a11y :refer [context-menu*]]
|
[app.main.ui.components.context-menu-a11y :refer [context-menu*]]
|
||||||
|
@ -109,6 +110,8 @@
|
||||||
(swap! uploading* disj id)
|
(swap! uploading* disj id)
|
||||||
(st/emit! (df/add-font font)))
|
(st/emit! (df/add-font font)))
|
||||||
(fn [error]
|
(fn [error]
|
||||||
|
(st/emit! (ntf/error (tr "errors.bad-font" (first (:names item)))))
|
||||||
|
(swap! fonts* dissoc id)
|
||||||
(js/console.log "error" error))))))
|
(js/console.log "error" error))))))
|
||||||
|
|
||||||
on-upload
|
on-upload
|
||||||
|
|
|
@ -331,6 +331,15 @@
|
||||||
client-position)]
|
client-position)]
|
||||||
(st/emit! (dd/show-file-menu-with-position file-id position)))))
|
(st/emit! (dd/show-file-menu-with-position file-id position)))))
|
||||||
|
|
||||||
|
on-context-menu
|
||||||
|
(mf/use-fn
|
||||||
|
(mf/deps is-library-view)
|
||||||
|
(fn [event]
|
||||||
|
(dom/stop-propagation event)
|
||||||
|
(dom/prevent-default event)
|
||||||
|
(when-not is-library-view
|
||||||
|
(on-menu-click event))))
|
||||||
|
|
||||||
edit
|
edit
|
||||||
(mf/use-fn
|
(mf/use-fn
|
||||||
(mf/deps file)
|
(mf/deps file)
|
||||||
|
@ -373,7 +382,7 @@
|
||||||
:on-key-down handle-key-down
|
:on-key-down handle-key-down
|
||||||
:on-double-click on-navigate
|
:on-double-click on-navigate
|
||||||
:on-drag-start on-drag-start
|
:on-drag-start on-drag-start
|
||||||
:on-context-menu on-menu-click}
|
:on-context-menu on-context-menu}
|
||||||
|
|
||||||
[:div {:class (stl/css :overlay)}]
|
[:div {:class (stl/css :overlay)}]
|
||||||
|
|
||||||
|
@ -392,6 +401,7 @@
|
||||||
[:h3 (:name file)])
|
[:h3 (:name file)])
|
||||||
[:& grid-item-metadata {:modified-at (:modified-at file)}]]
|
[:& grid-item-metadata {:modified-at (:modified-at file)}]]
|
||||||
|
|
||||||
|
(when-not is-library-view
|
||||||
[:div {:class (stl/css-case :project-th-actions true :force-display (:menu-open dashboard-local))}
|
[:div {:class (stl/css-case :project-th-actions true :force-display (:menu-open dashboard-local))}
|
||||||
[:div
|
[:div
|
||||||
{:class (stl/css :project-th-icon :menu)
|
{:class (stl/css :project-th-icon :menu)
|
||||||
|
@ -416,7 +426,7 @@
|
||||||
:on-edit on-edit
|
:on-edit on-edit
|
||||||
:on-menu-close on-menu-close
|
:on-menu-close on-menu-close
|
||||||
:origin origin
|
:origin origin
|
||||||
:parent-id (dm/str file-id "-action-menu")}]])]]]]]))
|
:parent-id (dm/str file-id "-action-menu")}]])]])]]]))
|
||||||
|
|
||||||
(mf/defc grid
|
(mf/defc grid
|
||||||
{::mf/props :obj}
|
{::mf/props :obj}
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
[app.main.refs :as refs]
|
[app.main.refs :as refs]
|
||||||
[app.main.store :as st]
|
[app.main.store :as st]
|
||||||
[app.main.ui.context :as muc]
|
[app.main.ui.context :as muc]
|
||||||
|
[app.main.ui.ds.buttons.icon-button :refer [icon-button*]]
|
||||||
[app.main.ui.ds.foundations.assets.icon :refer [icon*]]
|
[app.main.ui.ds.foundations.assets.icon :refer [icon*]]
|
||||||
[app.main.ui.ds.layout.tab-switcher :refer [tab-switcher*]]
|
[app.main.ui.ds.layout.tab-switcher :refer [tab-switcher*]]
|
||||||
[app.main.ui.hooks.resize :refer [use-resize-hook]]
|
[app.main.ui.hooks.resize :refer [use-resize-hook]]
|
||||||
|
@ -205,6 +206,9 @@
|
||||||
(fn [section]
|
(fn [section]
|
||||||
(reset! current-section* section)))
|
(reset! current-section* section)))
|
||||||
|
|
||||||
|
on-close-history
|
||||||
|
(mf/use-fn #(st/emit! (dw/remove-layout-flag :document-history)))
|
||||||
|
|
||||||
handle-expand
|
handle-expand
|
||||||
(mf/use-callback
|
(mf/use-callback
|
||||||
(mf/deps size)
|
(mf/deps size)
|
||||||
|
@ -255,7 +259,12 @@
|
||||||
{:tabs #js [#js {:label (tr "workspace.versions.tab.history") :id "history" :content versions-tab}
|
{:tabs #js [#js {:label (tr "workspace.versions.tab.history") :id "history" :content versions-tab}
|
||||||
#js {:label (tr "workspace.versions.tab.actions") :id "actions" :content history-tab}]
|
#js {:label (tr "workspace.versions.tab.actions") :id "actions" :content history-tab}]
|
||||||
:default-selected "history"
|
:default-selected "history"
|
||||||
:class (stl/css :left-sidebar-tabs)}]
|
:class (stl/css :left-sidebar-tabs)
|
||||||
|
:action-button-position "end"
|
||||||
|
:action-button (mf/html [:> icon-button* {:variant "ghost"
|
||||||
|
:aria-label (tr "labels.close")
|
||||||
|
:on-click on-close-history
|
||||||
|
:icon "close"}])}]
|
||||||
|
|
||||||
:else
|
:else
|
||||||
[:> options-toolbox props])]]]))
|
[:> options-toolbox props])]]]))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue