From c902219997a6cf62d4215b46654b1a59ba0d9879 Mon Sep 17 00:00:00 2001
From: RiedleroD <github@riedler.wien>
Date: Wed, 26 Jun 2024 17:20:50 +0200
Subject: [PATCH] added setting to switch between center and left-aligned user
 bio

---
 src/components/settings_modal/tabs/general_tab.vue | 5 +++++
 src/components/user_card/user_card.scss            | 1 -
 src/components/user_card/user_card.vue             | 1 +
 src/i18n/de.json                                   | 1 +
 src/i18n/en.json                                   | 1 +
 src/modules/config.js                              | 1 +
 6 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/components/settings_modal/tabs/general_tab.vue b/src/components/settings_modal/tabs/general_tab.vue
index 4f314ca0..70fcaef8 100644
--- a/src/components/settings_modal/tabs/general_tab.vue
+++ b/src/components/settings_modal/tabs/general_tab.vue
@@ -159,6 +159,11 @@
             {{ $t('settings.show_page_backgrounds') }}
           </BooleanSetting>
         </li>
+        <li>
+          <BooleanSetting path="centerAlignBio">
+            {{ $t('settings.center_align_bio') }}
+          </BooleanSetting>
+        </li>
         <li>
           <BooleanSetting path="stopGifs">
             {{ $t('settings.stop_gifs') }}
diff --git a/src/components/user_card/user_card.scss b/src/components/user_card/user_card.scss
index 92b27037..854c4117 100644
--- a/src/components/user_card/user_card.scss
+++ b/src/components/user_card/user_card.scss
@@ -58,7 +58,6 @@
   }
 
   &-bio {
-    text-align: start;
     display: block;
     line-height: 1.3;
     padding: 1em;
diff --git a/src/components/user_card/user_card.vue b/src/components/user_card/user_card.vue
index 57f922d7..406f329d 100644
--- a/src/components/user_card/user_card.vue
+++ b/src/components/user_card/user_card.vue
@@ -299,6 +299,7 @@
         :html="user.description_html"
         :emoji="user.emoji"
         :handle-links="true"
+        :style='{"text-align": this.$store.getters.mergedConfig.centerAlignBio ? "center" : "start"}'
       />
     </div>
     <teleport to="#modal">
diff --git a/src/i18n/de.json b/src/i18n/de.json
index d5a7b1c0..ed68bfbf 100644
--- a/src/i18n/de.json
+++ b/src/i18n/de.json
@@ -482,6 +482,7 @@
         "blocks_tab": "Blocks",
         "bot": "Dies ist ein Bot Account",
         "btnRadius": "Knöpfe",
+        "center_align_bio": "Zentrale Textausrichtung in der Bio",
         "cBlue": "Blau (Antworten, folgt dir)",
         "cGreen": "Grün (Retweet)",
         "cOrange": "Orange (Favorisieren)",
diff --git a/src/i18n/en.json b/src/i18n/en.json
index 44971a51..6318e9f5 100644
--- a/src/i18n/en.json
+++ b/src/i18n/en.json
@@ -488,6 +488,7 @@
         "blocks_tab": "Blocks",
         "bot": "This is a bot account",
         "btnRadius": "Buttons",
+        "center_align_bio": "Center text in user bio",
         "cBlue": "Blue (Reply, follow)",
         "cGreen": "Green (Retweet)",
         "cOrange": "Orange (Favorite)",
diff --git a/src/modules/config.js b/src/modules/config.js
index 038bb24e..a4d69096 100644
--- a/src/modules/config.js
+++ b/src/modules/config.js
@@ -56,6 +56,7 @@ export const defaultState = {
   autohideFloatingPostButton: false,
   pauseOnUnfocused: true,
   displayPageBackgrounds: true,
+  centerAlignBio: false,
   stopGifs: undefined,
   replyVisibility: 'all',
   thirdColumnMode: 'notifications',