0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-15 17:21:17 -05:00

Change copy texts and style of library dialogs

This commit is contained in:
Andrés Moya 2020-10-14 08:59:44 +02:00 committed by Andrey Antukh
parent 3e14393c97
commit 3064000a2c
5 changed files with 48 additions and 32 deletions

View file

@ -1155,12 +1155,6 @@
"es" : "Añadir “%s” como Biblioteca Compartida"
}
},
"modals.add-shared-confirm.title" : {
"used-in" : [ "src/app/main/ui/workspace/header.cljs:111", "src/app/main/ui/dashboard/grid.cljs:113" ],
"translations" : {
"en" : "Adding shared library"
}
},
"modals.change-email.confirm-email" : {
"used-in" : [ "src/app/main/ui/settings/change_email.cljs:103" ],
"translations" : {
@ -1413,12 +1407,6 @@
"es" : "Añadir “%s” como Biblioteca Compartida"
}
},
"modals.remove-shared-confirm.title" : {
"used-in" : [ "src/app/main/ui/workspace/header.cljs:121", "src/app/main/ui/dashboard/grid.cljs:126" ],
"translations" : {
"en" : "Unshare file"
}
},
"notifications.profile-deletion-not-allowed" : {
"used-in" : [ "src/app/main/ui/settings/delete_account.cljs:28" ],
"translations" : {

View file

@ -177,16 +177,26 @@
}
.accept-button {
border: 1px solid $color-danger;
border-radius: 3px;
background: $color-danger;
color: $color-white;
cursor: pointer;
padding: 0.5rem 1rem;
&:hover {
background: $color-danger-dark;
&.danger {
background: $color-danger;
border: 1px solid $color-danger;
color: $color-white;
&:hover {
background: $color-danger-dark;
}
}
&.primary {
background: $color-primary;
border: 1px solid $color-primary;
color: $color-black;
&:hover {
background: $color-primary-dark;
}
}
}

View file

@ -14,12 +14,20 @@
[app.main.ui.icons :as i]
[app.util.dom :as dom]
[app.util.i18n :as i18n :refer [tr t]]
[app.util.data :refer [classnames]]
[rumext.alpha :as mf]))
(mf/defc confirm-dialog
{::mf/register modal/components
::mf/register-as :confirm}
[{:keys [message title on-accept on-cancel hint cancel-label accept-label] :as props}]
[{:keys [message
title
on-accept
on-cancel
hint
cancel-label
accept-label
accept-style] :as props}]
(let [locale (mf/deref i18n/locale)
on-accept (or on-accept identity)
@ -27,6 +35,7 @@
message (or message (t locale "ds.confirm-title"))
cancel-label (or cancel-label (tr "ds.confirm-cancel"))
accept-label (or accept-label (tr "ds.confirm-ok"))
accept-style (or accept-style :danger)
title (or title (t locale "ds.confirm-title"))
accept-fn
@ -58,13 +67,16 @@
[:div.modal-footer
[:div.action-buttons
[:input.cancel-button
{:type "button"
:value cancel-label
:on-click cancel-fn}]
(when-not (empty? cancel-label)
[:input.cancel-button
{:type "button"
:value cancel-label
:on-click cancel-fn}])
[:input.accept-button
{:type "button"
{:class (classnames :danger (= accept-style :danger)
:primary (= accept-style :primary))
:type "button"
:value accept-label
:on-click accept-fn}]]]]]))

View file

@ -109,10 +109,12 @@
(dom/stop-propagation event)
(st/emit! (modal/show
{:type :confirm
:message (t locale "modals.add-shared-confirm.message" (:name file))
:title (t locale "modals.add-shared-confirm.title")
:message ""
:title (t locale "modals.add-shared-confirm.message" (:name file))
:hint (t locale "modals.add-shared-confirm.hint")
:cancel-label ""
:accept-label (t locale "modals.add-shared-confirm.accept")
:accept-style :primary
:on-accept add-shared}))))
on-del-shared
@ -123,9 +125,10 @@
(dom/stop-propagation event)
(st/emit! (modal/show
{:type :confirm
:title (t locale "modals.remove-shared-confirm.title")
:message (t locale "modals.remove-shared-confirm.message" (:name file))
:message ""
:title (t locale "modals.remove-shared-confirm.message" (:name file))
:hint (t locale "modals.remove-shared-confirm.hint")
:cancel-label ""
:accept-label (t locale "modals.remove-shared-confirm.accept")
:on-accept del-shared}))))

View file

@ -107,10 +107,12 @@
(mf/deps file)
(st/emitf (modal/show
{:type :confirm
:message (t locale "modals.add-shared-confirm.message" (:name file))
:title (t locale "modals.add-shared-confirm.title")
:message ""
:title (t locale "modals.add-shared-confirm.message" (:name file))
:hint (t locale "modals.add-shared-confirm.hint")
:cancel-label ""
:accept-label (t locale "modals.add-shared-confirm.accept")
:accept-style :primary
:on-accept add-shared-fn})))
on-remove-shared
@ -118,9 +120,10 @@
(mf/deps file)
(st/emitf (modal/show
{:type :confirm
:title (t locale "modals.remove-shared-confirm.title")
:message (t locale "modals.remove-shared-confirm.message" (:name file))
:message ""
:title (t locale "modals.remove-shared-confirm.message" (:name file))
:hint (t locale "modals.remove-shared-confirm.hint")
:cancel-label ""
:accept-label (t locale "modals.remove-shared-confirm.accept")
:on-accept del-shared-fn})))