From dc43c51b0df43294e017f17be71649314ed0d349 Mon Sep 17 00:00:00 2001 From: Jay Sitter Date: Sun, 25 Jun 2023 02:27:07 -0400 Subject: [PATCH] fix(a11y): Change the look and behavior of some file upload fields --- src/assets/css/main.css | 9 ++ .../components/common/image-upload-form.tsx | 50 +++---- src/shared/components/home/emojis-form.tsx | 51 +++---- src/shared/components/home/site-form.tsx | 38 ++--- src/shared/components/post/post-form.tsx | 135 +++++++++--------- 5 files changed, 146 insertions(+), 137 deletions(-) diff --git a/src/assets/css/main.css b/src/assets/css/main.css index cb4a8b81..dde2a503 100644 --- a/src/assets/css/main.css +++ b/src/assets/css/main.css @@ -88,6 +88,15 @@ color: var(--bs-gray) !important; } +input[type="file"]::file-selector-button { + font: inherit; + border: 0; + padding: 0.375em 0.75em; + border-radius: var(--bs-border-radius); + background-color: var(--bs-secondary); + color: var(--bs-white); +} + .icon { display: inline-grid; display: inline-flex; diff --git a/src/shared/components/common/image-upload-form.tsx b/src/shared/components/common/image-upload-form.tsx index e8005ccc..107949f6 100644 --- a/src/shared/components/common/image-upload-form.tsx +++ b/src/shared/components/common/image-upload-form.tsx @@ -33,38 +33,34 @@ export class ImageUploadForm extends Component< render() { return (
- + {this.props.imageSrc && ( + + {/* TODO: Create "Current Iamge" translation for alt text */} + + + + )} diff --git a/src/shared/components/home/emojis-form.tsx b/src/shared/components/home/emojis-form.tsx index caf8221c..930bd55c 100644 --- a/src/shared/components/home/emojis-form.tsx +++ b/src/shared/components/home/emojis-form.tsx @@ -87,7 +87,10 @@ export class EmojiForm extends Component { )}
- +
@@ -129,30 +132,30 @@ export class EmojiForm extends Component { /> )} {cv.image_url.length === 0 && ( - - - + /> + )}
{I18NextService.i18n.t("column_emoji")} diff --git a/src/shared/components/home/site-form.tsx b/src/shared/components/home/site-form.tsx index 382f5650..e30d13bf 100644 --- a/src/shared/components/home/site-form.tsx +++ b/src/shared/components/home/site-form.tsx @@ -155,28 +155,32 @@ export class SiteForm extends Component { /> -
-