Skip to content

Commit d5138b9

Browse files
authored
Merge pull request #12805 from mfo/US/improve-ui-upload-spacers
amelioration: ETQ usager, j'aimerais un composant d'upload plus raccord ac l'UX de DS
2 parents d814518 + e64689d commit d5138b9

3 files changed

Lines changed: 28 additions & 5 deletions

File tree

app/assets/stylesheets/attachment.scss

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,14 @@
7575
.fr-download {
7676
margin-bottom: 0.5rem;
7777
}
78+
79+
li + li {
80+
margin-top: 0.5rem;
81+
}
82+
}
83+
84+
.attachment-row:last-child {
85+
margin-bottom: 0 !important;
7886
}
7987

8088
// Legacy support
@@ -95,6 +103,13 @@ ul[data-file-input-reset-target='fileList'] {
95103
border-color 0.2s,
96104
border-style 0.2s,
97105
background-color 0.2s;
106+
107+
@media (max-width: 48em) {
108+
border: none;
109+
background-color: transparent;
110+
text-align: left;
111+
padding: 0 !important;
112+
}
98113
}
99114
.fr-hr-or {
100115
max-width: 90px;

app/components/attachment/attachment_row_component/attachment_row_component.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div
2-
class="fr-mt-3w"
2+
class="fr-mt-0 fr-mb-3w attachment-row"
33
id="<%= dom_id(attachment, :persisted_row) %>"
44
data-attachment-row="true"
55
>

app/components/attachment/file_field_component/file_field_component.html.erb

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,24 @@
1717
class="<%= drop_zone_decorator.css_class %>"
1818
>
1919
<div
20-
class="attachment-drop-area fr-p-3w"
20+
class="attachment-drop-area fr-p-2w"
2121
role="button"
2222
tabindex="0"
2323
aria-label="<%= t('.drop_zone_aria_label') %>"
2424
data-action="click->drop-target#openFilePicker keydown.enter->drop-target#openFilePicker keydown.space->drop-target#openFilePicker"
2525
>
26-
<span class="fr-icon-upload-line" aria-hidden="true"></span>
26+
<span
27+
class="fr-icon-upload-line fr-hidden fr-unhidden-md"
28+
aria-hidden="true"
29+
></span>
2730

28-
<p><%= t('.drop_zone_label', count: @max) %></p>
29-
<p class="fr-hr-or"><%= t('.or') %></p>
31+
<p class="fr-mb-1v fr-hidden fr-unhidden-md">
32+
<%= t('.drop_zone_label', count: @max) %>
33+
</p>
34+
35+
<p class="fr-hr-or fr-mb-2v fr-hidden fr-unhidden-md">
36+
<%= t('.or') %>
37+
</p>
3038

3139
<button
3240
class="fr-btn fr-btn--secondary fr-btn--sm"

0 commit comments

Comments
 (0)