Add library covers and configurable footer visibility

This commit is contained in:
ShukeBta
2026-07-16 13:17:52 +08:00
parent cc056077ee
commit 06b25564ea
18 changed files with 232 additions and 21 deletions
+12
View File
@@ -1,5 +1,9 @@
import { useEffect, useState } from 'react'
import { Github, Globe, Send } from 'lucide-react'
import { publicAPI } from '../api/public'
import { useAuthStore } from '../stores/auth'
const LINKS = [
{ href: 'https://github.com/ShukeBta/MediaStationGo', icon: Github, label: '开源仓库' },
{ href: 'https://github.com/ShukeBta', icon: Globe, label: '作者主页' },
@@ -7,6 +11,14 @@ const LINKS = [
]
export function AppFooter({ className = '' }: { className?: string }) {
const role = useAuthStore((state) => state.user?.role)
const [hideForUsers, setHideForUsers] = useState(false)
useEffect(() => {
publicAPI.uiConfig().then((config) => setHideForUsers(config.hide_community_links_for_users)).catch(() => undefined)
}, [])
if (hideForUsers && role !== 'admin') return null
return (
<footer className={`flex items-center justify-center gap-1 ${className}`}>
{LINKS.map((link, i) => (