Skip to content

Commit

Permalink
[BootstrapAdminUi] Close button to flash messages (#155)
Browse files Browse the repository at this point in the history
Fixes #108
  • Loading branch information
loic425 authored Dec 10, 2024
2 parents 2422a60 + ce0434f commit 5261f08
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 15 deletions.
14 changes: 14 additions & 0 deletions src/BootstrapAdminUi/assets/styles/_flashes.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*!
* This file is part of the Sylius package.
*
* (c) Sylius Sp. z o.o.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

.alert {
.close {
cursor: pointer;
}
}
1 change: 1 addition & 0 deletions src/BootstrapAdminUi/assets/styles/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

@import "alert";
@import "datatable";
@import "flashes";
@import "form";
@import "navbar";
@import "icons";
Expand Down
7 changes: 7 additions & 0 deletions src/BootstrapAdminUi/public/app.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions src/BootstrapAdminUi/public/app.rtl.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,28 @@
{{ sylius_test_html_attribute('sylius-flash-message') }}
{{ sylius_test_html_attribute('sylius-flash-message-type', type) }}
>
<div class="d-flex">
<div>
{{ ux_icon(icons[type]) }}
</div>
<div class="mx-2">
<h4 class="alert-title">
{% set header = 'sylius.ui.' ~ type %}
{{ header|trans }}
</h4>
<div class="text-secondary">
{% if flash is iterable %}
{{ flash.message|trans(flash.parameters, 'flashes') }}
{% else %}
{{ flash|trans({}, 'flashes') }}
{% endif %}
<div class="d-flex justify-content-between">
<div class="d-flex">
<div>
{{ ux_icon(icons[type]) }}
</div>
<div class="mx-2">
<h4 class="alert-title">
{% set header = 'sylius.ui.' ~ type %}
{{ header|trans }}
</h4>
<div class="text-secondary">
{% if flash is iterable %}
{{ flash.message|trans(flash.parameters, 'flashes') }}
{% else %}
{{ flash|trans({}, 'flashes') }}
{% endif %}
</div>
</div>
</div>
<span class="justify-self-end close" data-bs-dismiss="alert" aria-label="Close">
{{ ux_icon('tabler:x') }}
</span>
</div>
</div>
{% endfor %}
Expand Down

0 comments on commit 5261f08

Please sign in to comment.