@@ -449,3 +464,37 @@ function BioTextarea({ initialValue }: { initialValue: User["bio"] }) {
);
}
+
+function FavBadgeSelect({
+ parentRouteData,
+}: {
+ parentRouteData: UserPageLoaderData;
+}) {
+ const { t } = useTranslation(["user"]);
+
+ // user's current favorite badge is the initial value
+ const initialBadge = parentRouteData.badges.find(
+ (badge) => badge.id === parentRouteData.favoriteBadgeId
+ );
+
+ return (
+
+
+
+
+ );
+}
diff --git a/migrations/023-add-user-fav-badge.js b/migrations/023-add-user-fav-badge.js
new file mode 100644
index 000000000..ffab64c1e
--- /dev/null
+++ b/migrations/023-add-user-fav-badge.js
@@ -0,0 +1,5 @@
+module.exports.up = function (db) {
+ db.prepare(
+ /* sql */ `alter table "User" add "favoriteBadgeId" integer not null default 0`
+ ).run();
+};
diff --git a/public/locales/en/user.json b/public/locales/en/user.json
index 0947f29a8..821abc649 100644
--- a/public/locales/en/user.json
+++ b/public/locales/en/user.json
@@ -11,6 +11,7 @@
"sens": "Sens",
"weaponPool": "Weapon pool",
"discordExplanation": "Username, profile picture, YouTube, Twitter and Twitch accounts come from your Discord account. See <1>FAQ1> for more information.",
+ "favoriteBadge": "Favorite Badge",
"results.title": "Results",
"results.placing": "Placing",
diff --git a/public/locales/zh/user.json b/public/locales/zh/user.json
index 04cff1782..4112a7d23 100644
--- a/public/locales/zh/user.json
+++ b/public/locales/zh/user.json
@@ -11,6 +11,7 @@
"sens": "感度",
"weaponPool": "武器池",
"discordExplanation": "用户名、头像、Youtube、Twitter和Twitch账号皆来自你的Discord账号。查看 <1>FAQ1> 以获得更多相关信息。",
+ "favoriteBadge": "最喜爱的徽章",
"results.title": "成绩",
"results.placing": "排名",