@@ -36,12 +59,47 @@ import { db } from "@renderer/store/db";
import { useTypedI18n } from "@renderer/i18n";
const { t } = useTypedI18n();
+const roleTranslationKeys: Record
= {
+ contributor: "lobby.views.profile.roleContributor",
+ admin: "lobby.views.profile.roleAdmin",
+ moderator: "lobby.views.profile.roleModerator",
+ tournament_winner: "lobby.views.profile.roleTournamentWinner",
+ tournament_caster: "lobby.views.profile.roleTournamentCaster",
+};
+
+function formatRoles(roles: ReadonlyArray | undefined) {
+ if (!roles?.length) return "—";
+
+ return roles
+ .map((role) => {
+ if (role in roleTranslationKeys) {
+ return t(roleTranslationKeys[role]);
+ }
+ return role;
+ })
+ .join(", ");
+}
+
+const statusTranslationKeys: Record = {
+ offline: "lobby.views.profile.statusOffline",
+ menu: "lobby.views.profile.statusMenu",
+ playing: "lobby.views.profile.statusPlaying",
+ lobby: "lobby.views.profile.statusLobby",
+};
+
+function formatStatusLabel(status: string) {
+ if (status in statusTranslationKeys) {
+ return t(statusTranslationKeys[status]);
+ }
+ return status;
+}
+
const props = defineProps<{
userId: string;
}>();
-const user = useDexieLiveQueryWithDeps([() => props.userId], () => {
- return db.users.get(props.userId);
+const user = useDexieLiveQueryWithDeps([() => props.userId], async () => {
+ return await db.users.get(props.userId);
});
@@ -77,4 +135,79 @@ const user = useDexieLiveQueryWithDeps([() => props.userId], () => {
flex-direction: column;
gap: 3px;
}
+
+.profile-info {
+ display: grid;
+ grid-template-columns: max-content 1fr;
+ column-gap: 12px;
+ row-gap: 4px;
+ margin: 0;
+
+ dt {
+ color: rgba(255, 255, 255, 0.5);
+ white-space: nowrap;
+ }
+
+ dd {
+ margin: 0;
+ display: flex;
+ align-items: center;
+ }
+}
+.my-profile-note {
+ color: rgba(255, 255, 255, 0.5);
+}
+
+.status-dot {
+ display: inline-block;
+ width: 12px;
+ height: 12px;
+ margin-right: 3px;
+ border-radius: 50%;
+ vertical-align: middle;
+ position: relative;
+ top: -1px;
+ box-sizing: border-box;
+}
+
+.status-dot--offline {
+ background-color: #8d8d8d;
+}
+
+.status-dot--menu {
+ border: 2px solid #48c774;
+ background-color: transparent;
+}
+
+.status-dot--lobby {
+ background-color: #48c774;
+}
+
+.status-dot--playing {
+ background-color: #f1c40f;
+}
+.btn-find-clan {
+ align-self: center;
+ font-family: Rajdhani;
+ font-weight: bold;
+ font-size: 1rem;
+ padding: 3px 20px;
+ border: none;
+ border-radius: 2px;
+ text-align: center;
+ cursor: pointer;
+ position: relative;
+ overflow: hidden;
+ transition:
+ transform 0.3s ease,
+ box-shadow 0.3s ease;
+}
+.btn-find-clan {
+ color: #fff;
+ background: linear-gradient(90deg, #22c55e, #16a34a);
+ box-shadow: 0 0 15px rgba(34, 197, 94, 0.4);
+}
+.btn-find-clan:hover {
+ box-shadow: 0 0 25px rgba(34, 197, 94, 0.6);
+}