mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 03:59:50 +02:00
feat: incremtal loading
This commit is contained in:
1 parent
11e87bd519
commit
de6137d1a5
5 files changed
+98
-10
No files matched your search
@@ -1,23 +1,26 @@
|
||||
import { useGameStrings } from "../../hooks/useGameStrings";
|
||||
import type { Avatar } from "../../protos/avatar";
|
||||
import type { SkeletonProps } from "../../types/SkeletonProps";
|
||||
import { Text } from "../Text";
|
||||
import "./index.css";
|
||||
|
||||
interface Props {
|
||||
avatar: Avatar;
|
||||
}
|
||||
|
||||
export function AvatarCard({ avatar }: Props) {
|
||||
export function AvatarCard(props: SkeletonProps<Avatar>) {
|
||||
const profileAvatarEntityStrings = useGameStrings("ProfileAvatarEntity");
|
||||
|
||||
return (
|
||||
<div className="avatar-card">
|
||||
<div
|
||||
className="avatar-image"
|
||||
style={{ backgroundImage: `url(/api/avatars/${avatar.name}.webp)` }}
|
||||
style={{
|
||||
backgroundImage: props.skeleton
|
||||
? undefined
|
||||
: `url(/api/avatars/${props.name}.webp)`,
|
||||
}}
|
||||
/>
|
||||
<Text align="center" className="avatar-label">
|
||||
{profileAvatarEntityStrings[avatar.stuff_ui!.display_name]}
|
||||
{props.skeleton
|
||||
? "LOADING"
|
||||
: profileAvatarEntityStrings[props.stuff_ui!.display_name]}
|
||||
</Text>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user