🐛 Fix modal hint as context notification (#6276)

This commit is contained in:
Eva Marco 2025-04-11 11:27:30 +02:00 committed by GitHub
parent 686ab14b43
commit 870fec6bbd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 17 additions and 28 deletions

View file

@ -10,6 +10,7 @@
[app.main.data.modal :as modal] [app.main.data.modal :as modal]
[app.main.store :as st] [app.main.store :as st]
[app.main.ui.components.link :as lk] [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.icons :as i]
[app.util.dom :as dom] [app.util.dom :as dom]
[app.util.i18n :as i18n :refer [tr]] [app.util.i18n :as i18n :refer [tr]]
@ -72,7 +73,9 @@
[:h3 {:class (stl/css :modal-scd-msg)} scd-message]) [:h3 {:class (stl/css :modal-scd-msg)} scd-message])
(when (string? hint) (when (string? hint)
[:p {:class (stl/css :modal-hint)} hint])] [:> context-notification* {:level :info
:appearance :ghost}
hint])]
[:div {:class (stl/css :modal-footer)} [:div {:class (stl/css :modal-footer)}
[:div {:class (stl/css :action-buttons)} [:div {:class (stl/css :action-buttons)}

View file

@ -36,10 +36,6 @@
margin-bottom: $s-24; margin-bottom: $s-24;
} }
.modal-hint {
@include bodyLargeTypography;
}
.action-buttons { .action-buttons {
@extend .modal-action-btns; @extend .modal-action-btns;
} }

View file

@ -9,6 +9,7 @@
(:require (:require
[app.main.data.modal :as modal] [app.main.data.modal :as modal]
[app.main.store :as st] [app.main.store :as st]
[app.main.ui.ds.notifications.context-notification :refer [context-notification*]]
[app.main.ui.icons :as i] [app.main.ui.icons :as i]
[app.util.dom :as dom] [app.util.dom :as dom]
[app.util.i18n :as i18n :refer [tr]] [app.util.i18n :as i18n :refer [tr]]
@ -76,7 +77,9 @@
(when (and (string? scd-message) (not= scd-message "")) (when (and (string? scd-message) (not= scd-message ""))
[:h3 {:class (stl/css :modal-scd-msg)} scd-message]) [:h3 {:class (stl/css :modal-scd-msg)} scd-message])
(when (string? hint) (when (string? hint)
[:p {:class (stl/css :modal-hint)} hint]) [:> context-notification* {:level :info
:appearance :ghost}
hint])
(when (> (count items) 0) (when (> (count items) 0)
[:* [:*
[:p {:class (stl/css :modal-subtitle)} [:p {:class (stl/css :modal-subtitle)}

View file

@ -52,10 +52,6 @@
@include bodyLargeTypography; @include bodyLargeTypography;
} }
.modal-hint {
@extend .modal-hint-base;
}
.action-buttons { .action-buttons {
@extend .modal-action-btns; @extend .modal-action-btns;
} }

View file

@ -881,9 +881,10 @@
[:div {:class (stl/css :modal-container)} [:div {:class (stl/css :modal-container)}
[:& fm/form {:form form :on-submit on-submit} [:& fm/form {:form form :on-submit on-submit}
[:div {:class (stl/css :modal-header)} [:div {:class (stl/css :modal-header)}
(if webhook [:h2 {:class (stl/css :modal-title)}
[:h2 {:class (stl/css :modal-title)} (tr "modals.edit-webhook.title")] (if webhook
[:h2 {:class (stl/css :modal-title)} (tr "modals.create-webhook.title")]) (tr "modals.edit-webhook.title")
(tr "modals.create-webhook.title"))]
[:button {:class (stl/css :modal-close-btn) [:button {:class (stl/css :modal-close-btn)
:on-click on-modal-close} i/close]] :on-click on-modal-close} i/close]]

View file

@ -11,6 +11,7 @@
[app.main.data.modal :as modal] [app.main.data.modal :as modal]
[app.main.repo :as rp] [app.main.repo :as rp]
[app.main.store :as st] [app.main.store :as st]
[app.main.ui.ds.notifications.context-notification :refer [context-notification*]]
[app.main.ui.icons :as i] [app.main.ui.icons :as i]
[app.util.dom :as dom] [app.util.dom :as dom]
[app.util.i18n :as i18n :refer [tr]] [app.util.i18n :as i18n :refer [tr]]
@ -114,7 +115,9 @@
:key (dm/str file-id)} :key (dm/str file-id)}
[:span "- " file-name]])]] [:span "- " file-name]])]]
(when (and (string? hint) (not= hint "")) (when (and (string? hint) (not= hint ""))
[:h3 {:class (stl/css :modal-hint)} hint])] [:> context-notification* {:level :info
:appearance :ghost}
hint])]
[:* [:*
[:h3 {:class (stl/css :modal-msg)} no-files-msg]]))] [:h3 {:class (stl/css :modal-msg)} no-files-msg]]))]

View file

@ -35,10 +35,6 @@
margin-bottom: $s-24; margin-bottom: $s-24;
} }
.modal-hint {
@extend .modal-hint-base;
}
.element-list { .element-list {
@include bodyLargeTypography; @include bodyLargeTypography;
color: var(--modal-text-foreground-color); color: var(--modal-text-foreground-color);

View file

@ -130,10 +130,6 @@
.no-selection { .no-selection {
@include bodySmallTypography; @include bodySmallTypography;
margin-bottom: $s-24; margin-bottom: $s-24;
.modal-hint {
@include bodySmallTypography;
color: var(--modal-text-foreground-color);
}
.modal-link { .modal-link {
@include bodyLargeTypography; @include bodyLargeTypography;
text-decoration: none; text-decoration: none;

View file

@ -32,14 +32,9 @@
@extend .modal-close-btn-base; @extend .modal-close-btn-base;
} }
.modal-content, .modal-content {
.no-selection {
@include bodySmallTypography; @include bodySmallTypography;
margin-bottom: $s-24; margin-bottom: $s-24;
.modal-hint {
@include bodySmallTypography;
color: var(--modal-text-foreground-color);
}
.modal-link { .modal-link {
@include bodyLargeTypography; @include bodyLargeTypography;
text-decoration: none; text-decoration: none;