0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-04-09 21:41:23 -05:00

♻️ Switch contextual notification component (#5874)

This commit is contained in:
Xaviju 2025-02-17 16:03:13 +01:00 committed by GitHub
parent c41f86f0a4
commit 91fa39705d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 11 additions and 12 deletions

View file

@ -18,6 +18,7 @@
[app.main.ui.components.button-link :as bl]
[app.main.ui.components.forms :as fm]
[app.main.ui.components.link :as lk]
[app.main.ui.ds.notifications.context-notification :refer [context-notification*]]
[app.main.ui.icons :as i]
[app.main.ui.notifications.context-notification :refer [context-notification]]
[app.util.dom :as dom]
@ -158,10 +159,8 @@
[:*
(when-let [message @error]
[:& context-notification
{:level :error
:content message
:role "alert"}])
[:> context-notification*
{:level :error} message])
[:& fm/form {:on-submit on-submit
:class (stl/css :login-form)

View file

@ -14,7 +14,7 @@
--notification-bg-color: var(--color-background-primary);
--notification-fg-color: var(--color-foreground-primary);
--notification-border-color: var(--color-background-quaternary);
--notification-padding: var(--sp-l);
--notification-padding: var(--sp-m);
--notification-icon-color: var(--color-foreground-secondary);
--notification-icon-margin: var(--sp-xxs);

View file

@ -21,8 +21,8 @@
[]
(let [notification (mf/deref ref:notification)
on-close (mf/use-fn #(st/emit! (ntf/hide)))
context? (and (nil? (:timeout notification))
(nil? (:actions notification)))
actionable? (and (nil? (:timeout notification))
(nil? (:actions notification)))
inline? (or (= :inline (:type notification))
(= :floating (:position notification)))
toast? (or (= :toast (:type notification))
@ -44,7 +44,8 @@
:links (:links notification)
:content (:content notification)}]
context?
;; This should be substited with the actionable-notification* component
actionable?
[:& context-notification
{:level (or (:level notification) :info)
:links (:links notification)

View file

@ -19,7 +19,7 @@
[app.main.ui.ds.foundations.assets.icon :as i]
[app.main.ui.ds.foundations.typography.heading :refer [heading*]]
[app.main.ui.ds.foundations.typography.text :refer [text*]]
[app.main.ui.notifications.context-notification :refer [context-notification]]
[app.main.ui.ds.notifications.context-notification :refer [context-notification*]]
[app.main.ui.workspace.colorpicker :as colorpicker]
[app.main.ui.workspace.colorpicker.ramp :refer [ramp-selector*]]
[app.main.ui.workspace.tokens.changes :as wtch]
@ -498,9 +498,8 @@
(when (and warning-name-change? (= action "edit"))
[:div {:class (stl/css :warning-name-change-notification-wrapper)}
[:> context-notification
{:level :warning
:content (tr "workspace.token.warning-name-change")}]])]
[:> context-notification*
{:level :warning :appearance :ghost} (tr "workspace.token.warning-name-change")]])]
[:div {:class (stl/css :input-row)}
[:> input-tokens*