[feat] user-related layout and styles
This commit is contained in:
BIN
public/logo_rounded.png
Normal file
BIN
public/logo_rounded.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 48 KiB |
BIN
public/logo_square.png
Normal file
BIN
public/logo_square.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 45 KiB |
@@ -10,7 +10,7 @@ import {
|
|||||||
import { ToolButton } from "@/components/window/ToolButton"
|
import { ToolButton } from "@/components/window/ToolButton"
|
||||||
import { cn } from "@heroui/react"
|
import { cn } from "@heroui/react"
|
||||||
import {
|
import {
|
||||||
AssemblyLine, SettingConfig,
|
AssemblyLine, HardDisk, SettingConfig,
|
||||||
UploadOne
|
UploadOne
|
||||||
} from "@icon-park/react"
|
} from "@icon-park/react"
|
||||||
import { usePathname, useRouter } from "next/navigation"
|
import { usePathname, useRouter } from "next/navigation"
|
||||||
@@ -24,7 +24,7 @@ export default function PreferenceLayout({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex w-full gap-3">
|
<div className="flex w-full gap-3">
|
||||||
<Card className="flex-grow max-w-ful">
|
{/* <Card className="flex-grow max-w-ful">
|
||||||
<CardHeader>
|
<CardHeader>
|
||||||
<CardIcon
|
<CardIcon
|
||||||
type="menu"
|
type="menu"
|
||||||
@@ -46,14 +46,14 @@ export default function PreferenceLayout({
|
|||||||
<UploadOne />
|
<UploadOne />
|
||||||
云同步
|
云同步
|
||||||
</ToolButton>
|
</ToolButton>
|
||||||
{/* <ToolButton>
|
<ToolButton>
|
||||||
<HardDisk />
|
<HardDisk />
|
||||||
保存
|
保存
|
||||||
</ToolButton> */}
|
</ToolButton>
|
||||||
</CardTool>
|
</CardTool>
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
<CardBody>{children}</CardBody>
|
<CardBody>{children}</CardBody>
|
||||||
</Card>
|
</Card> */}
|
||||||
{/* Steam用户区域 */}
|
{/* Steam用户区域 */}
|
||||||
<SteamUsers />
|
<SteamUsers />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,10 +1,13 @@
|
|||||||
import { User } from "@icon-park/react"
|
import { User } from "@icon-park/react"
|
||||||
import { Card, CardBody, CardHeader, CardIcon } from "../window/Card"
|
import { Card, CardBody, CardHeader, CardIcon } from "../window/Card"
|
||||||
import { cn } from "@heroui/react"
|
import { Button, Chip, cn, Code } from "@heroui/react"
|
||||||
|
import { useSteamStore } from "@/store/steam"
|
||||||
|
|
||||||
const SteamUsers = ({ className }: { className?: string }) => {
|
const SteamUsers = ({ className }: { className?: string }) => {
|
||||||
|
const steam = useSteamStore()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Card className={cn("max-w-96", className)}>
|
<Card /* className={cn("max-w-96", className)} */>
|
||||||
<CardHeader>
|
<CardHeader>
|
||||||
<CardIcon>
|
<CardIcon>
|
||||||
<User /> Steam用户
|
<User /> Steam用户
|
||||||
@@ -12,9 +15,36 @@ const SteamUsers = ({className}: {className?: string}) => {
|
|||||||
</CardHeader>
|
</CardHeader>
|
||||||
<CardBody>
|
<CardBody>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Rop紫</li>
|
{steam.state.users.map((user) => (
|
||||||
<li>载物</li>
|
<li
|
||||||
<li>宫监</li>
|
key={user.accountName}
|
||||||
|
className="flex gap-2 transition rounded-lg bg-zinc-50 dark:bg-zinc-900"
|
||||||
|
>
|
||||||
|
<img
|
||||||
|
src={user.avatar || "/logo_square.png"}
|
||||||
|
alt="avatar"
|
||||||
|
className="w-20 h-20 rounded-l-lg"
|
||||||
|
/>
|
||||||
|
<div className="flex flex-col flex-grow justify-center gap-2 p-0.5">
|
||||||
|
<h3 className="text-2xl font-semibold">{user.personaName}</h3>
|
||||||
|
<div className="flex gap-3">
|
||||||
|
<Chip size="sm" className="bg-zinc-200 dark:bg-zinc-800">
|
||||||
|
{user.accountName}
|
||||||
|
</Chip>
|
||||||
|
<Chip size="sm" className="bg-zinc-200 dark:bg-zinc-800">
|
||||||
|
{user.steamID32}
|
||||||
|
</Chip>
|
||||||
|
<Chip size="sm" className="bg-zinc-200 dark:bg-zinc-800">
|
||||||
|
{user.steamID64}
|
||||||
|
</Chip>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="flex items-end gap-2 p-2">
|
||||||
|
<Button size="sm">切换登录</Button>
|
||||||
|
<Button size="sm">选择</Button>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
))}
|
||||||
</ul>
|
</ul>
|
||||||
</CardBody>
|
</CardBody>
|
||||||
</Card>
|
</Card>
|
||||||
|
|||||||
@@ -1,11 +1,15 @@
|
|||||||
|
import { useSteamStore } from "@/store/steam"
|
||||||
|
|
||||||
const Header = () => {
|
const Header = () => {
|
||||||
|
const steam = useSteamStore()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="pt-6 select-none pb-9" data-tauri-drag-region>
|
<div className="pt-6 select-none pb-9" data-tauri-drag-region>
|
||||||
<h1 className="text-xl font-medium tracking-wide w-fit">
|
<h1 className="text-xl font-medium tracking-wide w-fit">
|
||||||
Faze.Rop紫本人
|
{steam.currentUser().personaName || 'CS工具箱'}
|
||||||
</h1>
|
</h1>
|
||||||
<p className="text-sm font-light tracking-wide text-zinc-400 w-fit">
|
<p className="text-sm font-light tracking-wide text-zinc-400 w-fit">
|
||||||
本周使用CS工具箱 114 小时
|
{steam.currentUser().accountName || '本周使用CS工具箱 114 小时'}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -50,16 +50,16 @@ const Avatar = () => {
|
|||||||
const path = usePathname()
|
const path = usePathname()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<button
|
<img
|
||||||
onClick={() => router.push("/users")}
|
src="/logo_square.png"
|
||||||
|
alt="avatar"
|
||||||
|
draggable={false}
|
||||||
className={cn(
|
className={cn(
|
||||||
"w-12 h-12 bg-gray-700 rounded-full shadow-2xl cursor-pointer transition active:scale-95 shadow-purple-800",
|
"w-12 h-12 bg-gray-700 rounded-full shadow-lg cursor-pointer transition active:scale-95 shadow-purple-900/50",
|
||||||
path.startsWith("/users") && "shadow-sm"
|
path.startsWith("/users") && "shadow-sm"
|
||||||
)}
|
)}
|
||||||
type="button"
|
onClick={() => router.push("/users")}
|
||||||
>
|
/>
|
||||||
<img src="favicon.ico" alt="avatar" draggable={false} />
|
|
||||||
</button>
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ const defaultValue = {
|
|||||||
users: [
|
users: [
|
||||||
{
|
{
|
||||||
steamID64: "76561198052315353",
|
steamID64: "76561198052315353",
|
||||||
steamID32: "STEAM_0:0:46157676",
|
steamID32: "46157676",
|
||||||
accountName: "wrr",
|
accountName: "wrr_account",
|
||||||
personaName: "wrr",
|
personaName: "wrr",
|
||||||
recent: 0,
|
recent: 0,
|
||||||
avatar: "",
|
avatar: "",
|
||||||
|
|||||||
Reference in New Issue
Block a user