[fix] steam id32 + avatar
This commit is contained in:
@@ -40,7 +40,7 @@ const SteamUsers = ({ className }: { className?: string }) => {
|
||||
className="flex gap-2 transition rounded-lg bg-zinc-50 dark:bg-zinc-900"
|
||||
>
|
||||
<img
|
||||
src={user.avatar || "/logo_square.png"}
|
||||
src={user.avatar ? `data:image/png;base64,${user.avatar}` : "/logo_square.png"}
|
||||
alt="avatar"
|
||||
className="w-20 h-20 rounded-l-lg"
|
||||
/>
|
||||
@@ -56,13 +56,11 @@ const SteamUsers = ({ className }: { className?: string }) => {
|
||||
<Chip size="sm" className="bg-zinc-200 dark:bg-zinc-800">
|
||||
{user.steam_id64?.toString()}
|
||||
</Chip>
|
||||
<Chip size="sm" className="bg-zinc-200 dark:bg-zinc-800">
|
||||
{user.recent}
|
||||
</Chip>
|
||||
|
||||
<Chip size="sm" className="bg-zinc-200 dark:bg-zinc-800">
|
||||
{user.avatar}
|
||||
</Chip>
|
||||
{user.recent > 0 && (
|
||||
<Chip size="sm" color="primary">
|
||||
最近登录
|
||||
</Chip>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex items-end gap-2 p-2">
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
import { useSteamStore } from "@/store/steam"
|
||||
import { useRouter } from "next/navigation"
|
||||
|
||||
const Header = () => {
|
||||
const steam = useSteamStore()
|
||||
const router = useRouter()
|
||||
|
||||
return (
|
||||
<div className="pt-6 select-none pb-9" data-tauri-drag-region>
|
||||
<h1 className="mb-0.5 text-xl font-semibold tracking-wide w-fit">
|
||||
<h1 className="mb-0.5 text-xl font-semibold tracking-wide w-fit active:scale-95 transition cursor-pointer" onClick={() => router.push('/users')}>
|
||||
{steam.currentUser()?.persona_name || 'CS工具箱'}
|
||||
</h1>
|
||||
<p className="text-sm font-light tracking-wide text-zinc-400 w-fit">
|
||||
<p className="text-sm font-light tracking-wide transition cursor-pointer text-zinc-400 w-fit active:scale-95" onClick={() => router.push('/users')}>
|
||||
{steam.currentUser()?.account_name || '本周使用CS工具箱 114 小时'}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
"use client"
|
||||
import { cn } from "@heroui/react"
|
||||
import { cn, user } from "@heroui/react"
|
||||
import { Home, MonitorOne, Movie, Setting, Terminal, Toolkit } from "@icon-park/react"
|
||||
import { usePathname, useRouter } from "next/navigation"
|
||||
import type { ReactNode } from "react"
|
||||
@@ -7,6 +7,7 @@ import { getVersion } from "@tauri-apps/api/app"
|
||||
|
||||
// import { platform } from "@tauri-apps/plugin-os"
|
||||
import { useAppStore } from "@/store/app"
|
||||
import { useSteamStore } from "@/store/steam"
|
||||
|
||||
interface SideButtonProps {
|
||||
route: string
|
||||
@@ -46,12 +47,17 @@ const SideButton = ({
|
||||
}
|
||||
|
||||
const Avatar = () => {
|
||||
const steam = useSteamStore()
|
||||
const router = useRouter()
|
||||
const path = usePathname()
|
||||
|
||||
return (
|
||||
<img
|
||||
src="/logo_square.png"
|
||||
src={
|
||||
steam.currentUser()?.avatar
|
||||
? `data:image/png;base64,${steam.currentUser()?.avatar}`
|
||||
: "/logo_square.png"
|
||||
}
|
||||
alt="avatar"
|
||||
draggable={false}
|
||||
className={cn(
|
||||
|
||||
Reference in New Issue
Block a user