[fix] steam id32 + avatar
This commit is contained in:
@@ -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