mirror of
https://github.com/penpot/penpot.git
synced 2025-06-06 09:41:43 +02:00
Merge remote-tracking branch 'origin/staging' into develop
This commit is contained in:
commit
8f786407af
32 changed files with 131 additions and 168 deletions
|
@ -93,6 +93,10 @@
|
|||
(= :wrong-credentials (:code cause)))
|
||||
(reset! error (tr "errors.wrong-credentials"))
|
||||
|
||||
(and (= :validation (:type cause))
|
||||
(= :account-without-password (:code cause)))
|
||||
(reset! error (tr "errors.wrong-credentials"))
|
||||
|
||||
:else
|
||||
(reset! error (tr "errors.generic"))))
|
||||
|
||||
|
|
|
@ -29,10 +29,7 @@
|
|||
|
||||
width (mf/use-state nil)
|
||||
rowref (mf/use-ref)
|
||||
itemsize (if (>= @width 1030)
|
||||
280
|
||||
230)
|
||||
|
||||
itemsize 330
|
||||
ratio (if (some? @width) (/ @width itemsize) 0)
|
||||
nitems (mth/floor ratio)
|
||||
limit (min 10 nitems)
|
||||
|
@ -50,27 +47,26 @@
|
|||
#(st/emit! (dd/fetch-shared-files)
|
||||
(dd/clear-selected-files)))
|
||||
|
||||
(mf/use-effect
|
||||
(fn []
|
||||
(let [node (mf/ref-val rowref)
|
||||
mnt? (volatile! true)
|
||||
sub (->> (wapi/observe-resize node)
|
||||
(rx/observe-on :af)
|
||||
(rx/subs (fn [entries]
|
||||
(let [row (first entries)
|
||||
row-rect (.-contentRect ^js row)
|
||||
row-width (.-width ^js row-rect)]
|
||||
(when @mnt?
|
||||
(reset! width row-width))))))]
|
||||
(fn []
|
||||
(vreset! mnt? false)
|
||||
(rx/dispose! sub)))))
|
||||
(mf/with-effect
|
||||
(let [node (mf/ref-val rowref)
|
||||
mnt? (volatile! true)
|
||||
sub (->> (wapi/observe-resize node)
|
||||
(rx/observe-on :af)
|
||||
(rx/subs (fn [entries]
|
||||
(let [row (first entries)
|
||||
row-rect (.-contentRect ^js row)
|
||||
row-width (.-width ^js row-rect)]
|
||||
(when @mnt?
|
||||
(reset! width row-width))))))]
|
||||
(fn []
|
||||
(vreset! mnt? false)
|
||||
(rx/dispose! sub))))
|
||||
|
||||
[:*
|
||||
[:header.dashboard-header
|
||||
[:header.dashboard-header {:ref rowref}
|
||||
[:div.dashboard-title
|
||||
[:h1 (tr "dashboard.libraries-title")]]]
|
||||
[:section.dashboard-container.no-bg {:ref rowref}
|
||||
[:section.dashboard-container.no-bg.dashboard-shared
|
||||
[:& grid {:files files
|
||||
:project default-project
|
||||
:origin :libraries
|
||||
|
|
|
@ -204,7 +204,7 @@
|
|||
i/search])]))
|
||||
|
||||
(mf/defc teams-selector-dropdown
|
||||
[{:keys [profile] :as props}]
|
||||
[{:keys [team profile] :as props}]
|
||||
(let [teams (mf/deref refs/teams)
|
||||
|
||||
on-create-clicked
|
||||
|
@ -217,23 +217,25 @@
|
|||
(st/emit! (dd/go-to-projects team-id))))]
|
||||
|
||||
[:ul.dropdown.teams-dropdown
|
||||
[:li.title (tr "dashboard.switch-team")]
|
||||
[:hr]
|
||||
[:li.team-name {:on-click (partial team-selected (:default-team-id profile))}
|
||||
[:span.team-icon i/logo-icon]
|
||||
[:span.team-text (tr "dashboard.your-penpot")]]
|
||||
[:span.team-text (tr "dashboard.your-penpot")]
|
||||
(when (= (:default-team-id profile) (:id team))
|
||||
[:span.icon i/tick])]
|
||||
|
||||
(for [team (remove :is-default (vals teams))]
|
||||
[:li.team-name {:on-click (partial team-selected (:id team))
|
||||
:key (dm/str (:id team))}
|
||||
(for [team-item (remove :is-default (vals teams))]
|
||||
[:li.team-name {:on-click (partial team-selected (:id team-item))
|
||||
:key (dm/str (:id team-item))}
|
||||
[:span.team-icon
|
||||
[:img {:src (cf/resolve-team-photo-url team)
|
||||
:alt (:name team)}]]
|
||||
[:span.team-text {:title (:name team)} (:name team)]])
|
||||
|
||||
[:img {:src (cf/resolve-team-photo-url team-item)
|
||||
:alt (:name team-item)}]]
|
||||
[:span.team-text {:title (:name team-item)} (:name team-item)]
|
||||
(when (= (:id team-item) (:id team))
|
||||
[:span.icon i/tick])])
|
||||
[:hr]
|
||||
[:li.action {:on-click on-create-clicked :data-test "create-new-team"}
|
||||
(tr "dashboard.create-new-team")]]))
|
||||
[:li.team-name.action {:on-click on-create-clicked :data-test "create-new-team"}
|
||||
[:span.team-icon.new-team i/close]
|
||||
[:span.team-text (tr "dashboard.create-new-team")]]]))
|
||||
|
||||
(s/def ::member-id ::us/uuid)
|
||||
(s/def ::leave-modal-form
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue