refactor(progress_bar): should be a component

This commit is contained in:
Paul Chavard 2023-02-21 09:35:55 +01:00 committed by Paul Chavard
parent af31e097fb
commit 47a8d33d85
5 changed files with 10 additions and 2 deletions

View file

@ -0,0 +1,2 @@
class Attachment::ProgressBarComponent < ApplicationComponent
end

View file

@ -0,0 +1,3 @@
---
en:
loading: Loading

View file

@ -0,0 +1,3 @@
---
fr:
loading: Chargement de fichier

View file

@ -1,5 +1,5 @@
%template#progress-bar-template
.direct-upload
.direct-upload__progress{ role: "progressbar", 'aria-label': "Chargement de fichier", tabindex: "0", 'aria-valuemin': "0", 'aria-valuemax': "100", max: "100", style: "width: 0%" }
.direct-upload__progress{ role: "progressbar", 'aria-label': t(".loading"), tabindex: "0", 'aria-valuemin': "0", 'aria-valuemax': "100", max: "100", style: "width: 0%" }
%span.direct-upload__filename
%slot{ name: "filename" }

View file

@ -59,4 +59,4 @@
- if Rails.env.development?
= vite_typescript_tag 'axe-core'
= yield :charts_js
= render partial: "layouts/progress_bar"
= render Attachment::ProgressBarComponent.new