mirror of
https://github.com/penpot/penpot.git
synced 2026-09-10 14:09:17 +00:00
🐛 Show check icon after copying team invitation link (#8996)
Co-authored-by: Andrey Antukh <niwi@niwi.nz>
This commit is contained in:
parent
e1d3106f61
commit
bb91c06390
@ -38,6 +38,7 @@
|
|||||||
[app.util.dom :as dom]
|
[app.util.dom :as dom]
|
||||||
[app.util.forms :as uforms]
|
[app.util.forms :as uforms]
|
||||||
[app.util.i18n :as i18n :refer [tr]]
|
[app.util.i18n :as i18n :refer [tr]]
|
||||||
|
[app.util.timers :as tm]
|
||||||
[beicon.v2.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[cuerdas.core :as str]
|
[cuerdas.core :as str]
|
||||||
[rumext.v2 :as mf]))
|
[rumext.v2 :as mf]))
|
||||||
@ -613,7 +614,10 @@
|
|||||||
{::mf/props :obj
|
{::mf/props :obj
|
||||||
::mf/private true}
|
::mf/private true}
|
||||||
[{:keys [invitation team-id]}]
|
[{:keys [invitation team-id]}]
|
||||||
(let [email (:email invitation)
|
(let [email (:email invitation)
|
||||||
|
copied* (mf/use-state false)
|
||||||
|
copied? (deref copied*)
|
||||||
|
|
||||||
on-error
|
on-error
|
||||||
(mf/use-fn
|
(mf/use-fn
|
||||||
(mf/deps email)
|
(mf/deps email)
|
||||||
@ -639,6 +643,8 @@
|
|||||||
on-copy-success
|
on-copy-success
|
||||||
(mf/use-fn
|
(mf/use-fn
|
||||||
(fn []
|
(fn []
|
||||||
|
(reset! copied* true)
|
||||||
|
(tm/schedule 1000 #(reset! copied* false))
|
||||||
(st/emit! (ntf/success (tr "notifications.invitation-link-copied"))
|
(st/emit! (ntf/success (tr "notifications.invitation-link-copied"))
|
||||||
(modal/hide))))
|
(modal/hide))))
|
||||||
|
|
||||||
@ -656,7 +662,7 @@
|
|||||||
[:> icon-button* {:variant "ghost"
|
[:> icon-button* {:variant "ghost"
|
||||||
:aria-label (tr "labels.copy-invitation-link")
|
:aria-label (tr "labels.copy-invitation-link")
|
||||||
:on-click on-copy
|
:on-click on-copy
|
||||||
:icon "clipboard"}]))
|
:icon (if copied? "tick" "clipboard")}]))
|
||||||
|
|
||||||
(mf/defc invitation-row*
|
(mf/defc invitation-row*
|
||||||
{::mf/wrap [mf/memo]
|
{::mf/wrap [mf/memo]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user