mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 11:39:50 +02:00
feat: client side game strings
This commit is contained in:
1 parent
2d282a3261
commit
f5f3f70e35
7 files changed
+60
-13
No files matched your search
@@ -1,3 +1,5 @@
|
||||
import { api } from "../../core/api/dynamic";
|
||||
import { useAwait } from "../../hooks/useAwait";
|
||||
import type { Avatar } from "../../protos/avatar";
|
||||
import { Text } from "../Text";
|
||||
import "./index.css";
|
||||
@@ -7,13 +9,22 @@ interface Props {
|
||||
}
|
||||
|
||||
export function AvatarCard({ avatar }: Props) {
|
||||
// const { locale } = useLocale();
|
||||
const { locale } = { locale: "en" };
|
||||
const profileAvatarEntityStrings = useAwait(
|
||||
() => api.groupedGameStrings(locale, "ProfileAvatarEntity"),
|
||||
"profile-avatar-entity-strings"
|
||||
);
|
||||
|
||||
return (
|
||||
<div className="avatar-card">
|
||||
<div
|
||||
className="avatar-image"
|
||||
style={{ backgroundImage: `url(/api/avatars/${avatar.name}.webp)` }}
|
||||
/>
|
||||
<Text className="avatar-label">{avatar.name}</Text>
|
||||
<Text align="center" className="avatar-label">
|
||||
{profileAvatarEntityStrings[avatar.stuff_ui!.display_name]}
|
||||
</Text>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user