]> Untitled Git - lemmy-ui.git/commitdiff
Adding a warning for deselecting the undetermined language. (#945)
authorDessalines <dessalines@users.noreply.github.com>
Tue, 21 Feb 2023 20:53:35 +0000 (15:53 -0500)
committerGitHub <noreply@github.com>
Tue, 21 Feb 2023 20:53:35 +0000 (15:53 -0500)
- Fixes #930

lemmy-translations
src/shared/components/common/language-select.tsx

index 819531ae64c6cba12cb406eb98333fd52988bf3e..7379716231b9f7e67f710751c839398b7ab5d65e 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 819531ae64c6cba12cb406eb98333fd52988bf3e
+Subproject commit 7379716231b9f7e67f710751c839398b7ab5d65e
index 1182531a03b0944a4d484a08654432bd2e488db6..d98be2e295dd446f28fb0468cea6b122df2c9d35 100644 (file)
@@ -47,33 +47,38 @@ export class LanguageSelect extends Component<LanguageSelectProps, any> {
     return this.props.iconVersion ? (
       this.selectBtn
     ) : (
-      <div className="form-group row">
-        <label
-          className={classNames("col-form-label", {
-            "col-sm-3": this.props.multiple,
-            "col-sm-2": !this.props.multiple,
-          })}
-          htmlFor={this.id}
-        >
-          {i18n.t(this.props.multiple ? "language_plural" : "language")}
-        </label>
-        <div
-          className={classNames("input-group", {
-            "col-sm-9": this.props.multiple,
-            "col-sm-10": !this.props.multiple,
-          })}
-        >
-          {this.selectBtn}
-          {this.props.multiple && (
-            <div className="input-group-append">
-              <button
-                className="input-group-text"
-                onClick={linkEvent(this, this.handleDeselectAll)}
-              >
-                <Icon icon="x" />
-              </button>
-            </div>
-          )}
+      <div>
+        <div className="alert alert-warning" role="alert">
+          {i18n.t("undetermined_language_warning")}
+        </div>
+        <div className="form-group row">
+          <label
+            className={classNames("col-form-label", {
+              "col-sm-3": this.props.multiple,
+              "col-sm-2": !this.props.multiple,
+            })}
+            htmlFor={this.id}
+          >
+            {i18n.t(this.props.multiple ? "language_plural" : "language")}
+          </label>
+          <div
+            className={classNames("input-group", {
+              "col-sm-9": this.props.multiple,
+              "col-sm-10": !this.props.multiple,
+            })}
+          >
+            {this.selectBtn}
+            {this.props.multiple && (
+              <div className="input-group-append">
+                <button
+                  className="input-group-text"
+                  onClick={linkEvent(this, this.handleDeselectAll)}
+                >
+                  <Icon icon="x" />
+                </button>
+              </div>
+            )}
+          </div>
         </div>
       </div>
     );