feat(front): 前台切换到分组树 + 卡片组合
- 新 AppNext:首页按 /api/catalog2 的卡片勾选渲染(支持混合格式、每组条数),侧栏按分组树 + tree_hidden 渲染 - 分组页 /g/<key>、条目页 /g/<key>/i/<id>;条目在子树内递归查找,面包屑显示祖先链 - SPA 回落增加 /g/ 前缀;旧 /c/... 地址兼容 - 文档同步(路由、API、v19、限制) - 测试 59 passed;Playwright 验证首页/混合卡片/分组页/条目页/侧栏隐藏
This commit is contained in:
@@ -336,6 +336,33 @@
|
||||
background-color: var(--su-color-primary);
|
||||
}
|
||||
|
||||
/* 新前台:卡片内的分组块 / 分组页层级 */
|
||||
.card-group-block + .card-group-block {
|
||||
margin-top: var(--su-space-4);
|
||||
}
|
||||
|
||||
.card-group-title {
|
||||
margin: 0 0 var(--su-space-2);
|
||||
font-size: var(--su-font-size-md);
|
||||
font-weight: 600;
|
||||
color: var(--su-text-sub);
|
||||
}
|
||||
|
||||
.group-crumbs {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
padding: var(--su-space-2) var(--su-space-3);
|
||||
}
|
||||
|
||||
.group-crumb-sep {
|
||||
color: var(--su-text-muted);
|
||||
}
|
||||
|
||||
.group-child-block {
|
||||
margin-top: var(--su-space-2);
|
||||
}
|
||||
|
||||
/* 明细页的分组标题:与首页卡片标题同一套「色条 + 标题」 */
|
||||
.group-title {
|
||||
display: flex;
|
||||
|
||||
@@ -0,0 +1,572 @@
|
||||
import {
|
||||
Empty,
|
||||
Layout,
|
||||
Menu,
|
||||
Notice,
|
||||
Space,
|
||||
Toaster,
|
||||
type MenuItem,
|
||||
} from '@stash/ui'
|
||||
import { useEffect, useMemo, useRef, useState } from 'react'
|
||||
import { BackToTop } from './components/common/BackToTop'
|
||||
import { ArticleDetailView } from './components/content/ArticleDetailView'
|
||||
import { AppGrid } from './components/content/AppGrid'
|
||||
import { CesCardGrid } from './components/content/CesCardGrid'
|
||||
import { ItemDetailView } from './components/content/ItemDetailView'
|
||||
import { ItemEditor } from './components/content/ItemEditor'
|
||||
import { PosterGrid } from './components/content/PosterGrid'
|
||||
import { SectionCard } from './components/content/SectionCard'
|
||||
import { SiteHeader } from './components/header/SiteHeader'
|
||||
import { SearchBar } from './components/search/SearchBar'
|
||||
import { LoginDialog } from './components/auth/LoginDialog'
|
||||
import { ProfileCard } from './components/sidebar/ProfileCard'
|
||||
import { ServicePanel } from './components/sidebar/ServicePanel'
|
||||
import { useProjects } from './useProjects'
|
||||
import { fetchSession, logout, type SessionState } from './auth'
|
||||
import {
|
||||
fetchSettings,
|
||||
type SettingsDocument,
|
||||
type SiteSettings,
|
||||
} from './settings'
|
||||
import {
|
||||
appDetailModel,
|
||||
posterDetailModel,
|
||||
posterToRelatedItem,
|
||||
toRelatedItem,
|
||||
type ItemDetailModel,
|
||||
} from './data/detail'
|
||||
import type { AppItem, ArticleItem, PosterItem, RelatedItem } from './data/types'
|
||||
import { fetchManage, type CardItem, type GroupNode, type ManageData } from './manage'
|
||||
import './App.css'
|
||||
|
||||
/**
|
||||
* 新前台:分组树 + 卡片组合。
|
||||
*
|
||||
* 路由:
|
||||
* / 首页(卡片按勾选分组渲染)
|
||||
* /g/<分组 key> 分组页(自身条目 + 子分组)
|
||||
* /g/<分组 key>/i/<条目> 条目详情
|
||||
* 旧 /c/... 地址按第一个路径段当成分组 key,兼容老书签。
|
||||
*/
|
||||
type Route =
|
||||
| { kind: 'home' }
|
||||
| { kind: 'group'; key: string }
|
||||
| { kind: 'item'; key: string; itemId: string }
|
||||
|
||||
function parseRoute(pathname: string): Route {
|
||||
const segments = pathname.split('/').filter(Boolean)
|
||||
if (
|
||||
(segments[0] === 'g' || segments[0] === 'c') &&
|
||||
segments[1] !== undefined
|
||||
) {
|
||||
if (segments[2] === 'i' && segments[3] !== undefined) {
|
||||
return { kind: 'item', key: decodeURIComponent(segments[1]), itemId: decodeURIComponent(segments[3]) }
|
||||
}
|
||||
return { kind: 'group', key: decodeURIComponent(segments[1]) }
|
||||
}
|
||||
return { kind: 'home' }
|
||||
}
|
||||
|
||||
function useRoute() {
|
||||
const [route, setRoute] = useState<Route>(() => parseRoute(window.location.pathname))
|
||||
|
||||
useEffect(() => {
|
||||
const sync = () => setRoute(parseRoute(window.location.pathname))
|
||||
window.addEventListener('popstate', sync)
|
||||
return () => window.removeEventListener('popstate', sync)
|
||||
}, [])
|
||||
|
||||
const navigate = (path: string) => {
|
||||
if (window.location.pathname === path) return
|
||||
window.history.pushState({}, '', path)
|
||||
setRoute(parseRoute(path))
|
||||
document.getElementById('content-scroll')?.scrollTo({ top: 0 })
|
||||
window.scrollTo({ top: 0 })
|
||||
}
|
||||
|
||||
return { route, navigate }
|
||||
}
|
||||
|
||||
function findGroup(groups: GroupNode[], key: string): GroupNode | undefined {
|
||||
for (const group of groups) {
|
||||
if (group.key === key) return group
|
||||
const found = findGroup(group.children, key)
|
||||
if (found !== undefined) return found
|
||||
}
|
||||
return undefined
|
||||
}
|
||||
|
||||
function findPath(groups: GroupNode[], key: string, trail: GroupNode[] = []): GroupNode[] | undefined {
|
||||
for (const group of groups) {
|
||||
const next = [...trail, group]
|
||||
if (group.key === key) return next
|
||||
const found = findPath(group.children, key, next)
|
||||
if (found !== undefined) return found
|
||||
}
|
||||
return undefined
|
||||
}
|
||||
|
||||
function findEntryInGroup(
|
||||
group: GroupNode,
|
||||
entryId: string,
|
||||
): { group: GroupNode; entry: Record<string, unknown> } | undefined {
|
||||
const direct = group.entries.find((candidate) => candidate.id === entryId)
|
||||
if (direct !== undefined) {
|
||||
return { group, entry: direct as unknown as Record<string, unknown> }
|
||||
}
|
||||
for (const child of group.children) {
|
||||
const found = findEntryInGroup(child, entryId)
|
||||
if (found !== undefined) return found
|
||||
}
|
||||
return undefined
|
||||
}
|
||||
|
||||
function findEntry(
|
||||
groups: GroupNode[],
|
||||
groupKey: string,
|
||||
entryId: string,
|
||||
): { group: GroupNode; entry: Record<string, unknown> } | undefined {
|
||||
const group = findGroup(groups, groupKey)
|
||||
if (group === undefined) return undefined
|
||||
return findEntryInGroup(group, entryId)
|
||||
}
|
||||
|
||||
function groupEntryCount(group: GroupNode): number {
|
||||
return group.entries.length + group.children.reduce((total, child) => total + groupEntryCount(child), 0)
|
||||
}
|
||||
|
||||
/** 分组子树里的全部条目(格式沿根分组继承,所以可以放在同一个网格里) */
|
||||
function collectEntries(group: GroupNode): Record<string, unknown>[] {
|
||||
return [
|
||||
...(group.entries as unknown as Record<string, unknown>[]),
|
||||
...group.children.flatMap((child) => collectEntries(child)),
|
||||
]
|
||||
}
|
||||
|
||||
function defaultLimit(group: GroupNode): number {
|
||||
const fallback = group.format === 'apps' ? 4 : group.format === 'posters' ? 6 : 4
|
||||
return group.previewLimit ?? fallback
|
||||
}
|
||||
|
||||
function matches(entry: Record<string, unknown>, keyword: string): boolean {
|
||||
if (keyword === '') return true
|
||||
const text = [entry.name, entry.title, entry.description, entry.desc]
|
||||
.filter((value) => typeof value === 'string')
|
||||
.join(' ')
|
||||
.toLowerCase()
|
||||
return text.includes(keyword)
|
||||
}
|
||||
|
||||
export default function AppNext() {
|
||||
const { status, projects, error, live, refreshing, refresh } = useProjects()
|
||||
const { route, navigate } = useRoute()
|
||||
const [manage, setManage] = useState<ManageData>({ groups: [], cards: [] })
|
||||
const [loading, setLoading] = useState(true)
|
||||
const [keyword, setKeyword] = useState('')
|
||||
const [session, setSession] = useState<SessionState | null>(null)
|
||||
const [settings, setSettings] = useState<SettingsDocument | null>(null)
|
||||
const [loginOpen, setLoginOpen] = useState(false)
|
||||
const [editingKey, setEditingKey] = useState<string | null>(null)
|
||||
const [scrolled, setScrolled] = useState(false)
|
||||
const searchRef = useRef<HTMLInputElement>(null)
|
||||
|
||||
const load = () => {
|
||||
void fetchManage().then((data) => {
|
||||
setManage(data)
|
||||
setLoading(false)
|
||||
})
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
load()
|
||||
void fetchSession().then(setSession)
|
||||
void fetchSettings().then(setSettings)
|
||||
|
||||
const source = new EventSource('/api/catalog/events')
|
||||
source.onmessage = () => load()
|
||||
return () => source.close()
|
||||
}, [])
|
||||
|
||||
useEffect(() => {
|
||||
const sync = () => {
|
||||
const inner = document.getElementById('content-scroll')?.scrollTop ?? 0
|
||||
setScrolled(Math.max(inner, window.scrollY) > 4)
|
||||
}
|
||||
sync()
|
||||
window.addEventListener('scroll', sync, { passive: true })
|
||||
document.addEventListener('scroll', sync, { passive: true, capture: true })
|
||||
return () => {
|
||||
window.removeEventListener('scroll', sync)
|
||||
document.removeEventListener('scroll', sync, { capture: true })
|
||||
}
|
||||
}, [])
|
||||
|
||||
const site: SiteSettings = settings?.settings ?? {
|
||||
header: { enabled: true, speed: 24, items: [] },
|
||||
sidebar: {
|
||||
hidden: [],
|
||||
order: [],
|
||||
hidden_groups: [],
|
||||
shown_groups: [],
|
||||
group_order: {},
|
||||
tree_hidden: [],
|
||||
tree_order: {},
|
||||
},
|
||||
sections: { hidden: [], order: [], titles: {}, limits: {} },
|
||||
profile: {
|
||||
name: '本地管理员',
|
||||
role: '管理员',
|
||||
description: '',
|
||||
location: '',
|
||||
avatar: '',
|
||||
},
|
||||
}
|
||||
|
||||
const keywordLower = keyword.trim().toLowerCase()
|
||||
|
||||
const sidebarItems: MenuItem[] = useMemo(() => {
|
||||
const hidden = new Set(site.sidebar.tree_hidden)
|
||||
|
||||
const sortNodes = (nodes: GroupNode[], parentKey: string): GroupNode[] => {
|
||||
const ranks = new Map(
|
||||
(site.sidebar.tree_order[parentKey] ?? []).map((key, index) => [key, index] as const),
|
||||
)
|
||||
return [...nodes].sort((a, b) => {
|
||||
const left = ranks.get(a.key) ?? Number.MAX_SAFE_INTEGER
|
||||
const right = ranks.get(b.key) ?? Number.MAX_SAFE_INTEGER
|
||||
if (left === right) return a.sort - b.sort
|
||||
return left - right
|
||||
})
|
||||
}
|
||||
|
||||
const build = (nodes: GroupNode[], parentKey: string): MenuItem[] =>
|
||||
sortNodes(nodes, parentKey).flatMap((node) => {
|
||||
if (hidden.has(node.key)) return build(node.children, node.key)
|
||||
const children = build(node.children, node.key)
|
||||
return [
|
||||
{
|
||||
key: `g:${node.key}`,
|
||||
label: node.title,
|
||||
children: children.length > 0 ? children : undefined,
|
||||
},
|
||||
]
|
||||
})
|
||||
|
||||
return [{ key: 'home', label: '首页' }, ...build(manage.groups, '')]
|
||||
}, [manage.groups, site.sidebar.tree_hidden, site.sidebar.tree_order])
|
||||
|
||||
const activeKey =
|
||||
route.kind === 'home'
|
||||
? 'home'
|
||||
: route.kind === 'group'
|
||||
? `g:${route.key}`
|
||||
: `g:${route.key}`
|
||||
|
||||
function renderEntries(
|
||||
group: GroupNode,
|
||||
entries: Record<string, unknown>[],
|
||||
options: { detail?: boolean; limit?: number } = {},
|
||||
) {
|
||||
const filtered = entries.filter((entry) => matches(entry, keywordLower))
|
||||
const limit = options.limit ?? filtered.length
|
||||
const items = filtered.slice(0, limit)
|
||||
const open = (itemId: string) => navigate(`/g/${encodeURIComponent(group.key)}/i/${encodeURIComponent(itemId)}`)
|
||||
|
||||
if (group.format === 'posters') {
|
||||
return <PosterGrid items={items as unknown as PosterItem[]} onOpen={open} />
|
||||
}
|
||||
if (group.format === 'articles') {
|
||||
return <CesCardGrid items={items as unknown as ArticleItem[]} onOpen={open} />
|
||||
}
|
||||
return <AppGrid items={items as unknown as AppItem[]} onOpen={open} />
|
||||
}
|
||||
|
||||
function renderGroupBlock(group: GroupNode, limit: number, showTitle: boolean) {
|
||||
const all = collectEntries(group).filter((entry) => matches(entry, keywordLower))
|
||||
if (all.length === 0) return null
|
||||
return (
|
||||
<div key={group.key} className="card-group-block">
|
||||
{showTitle && <h3 className="card-group-title">{group.title}</h3>}
|
||||
{renderEntries(group, all, { limit })}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
function renderCard(card: CardItem) {
|
||||
const resolved = card.groups
|
||||
.map((ref) => ({ ref, group: findGroup(manage.groups, ref.groupKey) }))
|
||||
.filter((item): item is { ref: typeof item.ref; group: GroupNode } => item.group !== undefined)
|
||||
|
||||
const total = resolved.reduce((sum, item) => sum + groupEntryCount(item.group), 0)
|
||||
const first = resolved[0]?.group
|
||||
if (resolved.length === 0 || total === 0) return null
|
||||
|
||||
return (
|
||||
<SectionCard
|
||||
key={card.id}
|
||||
title={card.title}
|
||||
count={total}
|
||||
barColor={first?.barColor}
|
||||
onMore={() => first !== undefined && navigate(`/g/${encodeURIComponent(first.key)}`)}
|
||||
>
|
||||
{resolved.map(({ group, ref }) =>
|
||||
renderGroupBlock(group, ref.previewLimit ?? defaultLimit(group), resolved.length > 1),
|
||||
)}
|
||||
</SectionCard>
|
||||
)
|
||||
}
|
||||
|
||||
function renderHome() {
|
||||
const cards = manage.cards
|
||||
return (
|
||||
<div className="home-view">
|
||||
{loading && <Empty text="正在读取内容库…" />}
|
||||
{!loading && cards.length === 0 && <Empty text="后台还没有创建首页卡片" />}
|
||||
{cards.map(renderCard)}
|
||||
{keywordLower !== '' && cards.length > 0 && (
|
||||
<Notice title={`搜索结果:${keyword.trim()}`}>在卡片与分组内按标题过滤。</Notice>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
function renderGroupPage(key: string) {
|
||||
const group = findGroup(manage.groups, key)
|
||||
if (group === undefined) {
|
||||
return <Empty text={loading ? '正在读取内容库…' : '分组不存在'} />
|
||||
}
|
||||
|
||||
const trail = findPath(manage.groups, key) ?? [group]
|
||||
|
||||
return (
|
||||
<div className="detail-view">
|
||||
<nav className="detail-breadcrumb group-crumbs">
|
||||
<button type="button" className="link-button" onClick={() => navigate('/')}>
|
||||
首页
|
||||
</button>
|
||||
{trail.map((node) => (
|
||||
<span key={node.key}>
|
||||
<span className="group-crumb-sep">/</span>
|
||||
<button
|
||||
type="button"
|
||||
className="link-button"
|
||||
onClick={() => navigate(`/g/${encodeURIComponent(node.key)}`)}
|
||||
>
|
||||
{node.title}
|
||||
</button>
|
||||
</span>
|
||||
))}
|
||||
</nav>
|
||||
|
||||
<div className="detail-hero">
|
||||
<span className="detail-hero-icon" aria-hidden="true">
|
||||
{group.icon || '•'}
|
||||
</span>
|
||||
<h2 className="detail-hero-title">{group.title}</h2>
|
||||
<span className="detail-hero-count">[{groupEntryCount(group)}]</span>
|
||||
</div>
|
||||
|
||||
{group.entries.length > 0 ? (
|
||||
renderEntries(group, group.entries)
|
||||
) : group.children.some((child) => groupEntryCount(child) > 0) ? null : (
|
||||
<Empty text="这个分组还没有内容" />
|
||||
)}
|
||||
|
||||
<Space direction="column" gap="lg" align="stretch">
|
||||
{group.children.map((child) => (
|
||||
<section key={child.key} className="group-child-block">
|
||||
<div className="group-title">
|
||||
<span
|
||||
className="group-bar"
|
||||
style={{ backgroundColor: child.barColor || undefined }}
|
||||
aria-hidden="true"
|
||||
/>
|
||||
<h3>{child.title}</h3>
|
||||
<button
|
||||
type="button"
|
||||
className="link-button"
|
||||
onClick={() => navigate(`/g/${encodeURIComponent(child.key)}`)}
|
||||
>
|
||||
查看全部
|
||||
</button>
|
||||
</div>
|
||||
{child.entries.length > 0 ? (
|
||||
renderEntries(child, child.entries, { limit: 12 })
|
||||
) : (
|
||||
<Empty text="暂无内容" />
|
||||
)}
|
||||
</section>
|
||||
))}
|
||||
</Space>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
function renderItemPage(key: string, itemId: string) {
|
||||
const found = findEntry(manage.groups, key, itemId)
|
||||
if (found === undefined) {
|
||||
return <Empty text={loading ? '正在读取内容库…' : '条目不存在'} />
|
||||
}
|
||||
|
||||
const { group, entry } = found
|
||||
const trail = findPath(manage.groups, group.key) ?? [group]
|
||||
const crumbs = [
|
||||
{ label: '首页', href: '/' },
|
||||
...trail.map((node) => ({
|
||||
label: node.title,
|
||||
href: `/g/${encodeURIComponent(node.key)}`,
|
||||
})),
|
||||
{ label: String(entry.name ?? entry.title ?? entry.id) },
|
||||
]
|
||||
|
||||
if (group.format === 'articles') {
|
||||
const article = entry as unknown as ArticleItem
|
||||
return (
|
||||
<ArticleDetailView
|
||||
article={article}
|
||||
categoryId={group.key}
|
||||
categoryTitle={group.title}
|
||||
onNavigate={navigate}
|
||||
onEdit={() => setEditingKey(String(entry.id))}
|
||||
canEdit={session?.authenticated === true}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
const model: ItemDetailModel =
|
||||
group.format === 'posters'
|
||||
? posterDetailModel(entry as unknown as PosterItem)
|
||||
: appDetailModel(entry as unknown as AppItem)
|
||||
|
||||
const related: RelatedItem[] =
|
||||
group.format === 'posters'
|
||||
? group.entries
|
||||
.filter((item) => item.id !== entry.id)
|
||||
.slice(0, 4)
|
||||
.map((item) => posterToRelatedItem(item as unknown as PosterItem))
|
||||
: group.entries
|
||||
.filter((item) => item.id !== entry.id)
|
||||
.slice(0, 4)
|
||||
.map((item) => toRelatedItem(item as unknown as AppItem))
|
||||
|
||||
return (
|
||||
<ItemDetailView
|
||||
itemKey={String(entry.id)}
|
||||
crumbs={crumbs}
|
||||
model={model}
|
||||
related={related}
|
||||
onNavigate={navigate}
|
||||
onOpenItem={(next) => navigate(`/g/${encodeURIComponent(group.key)}/i/${encodeURIComponent(next)}`)}
|
||||
onEdit={() => setEditingKey(String(entry.id))}
|
||||
canEdit={session?.authenticated === true}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Toaster />
|
||||
<LoginDialog
|
||||
open={loginOpen}
|
||||
hasAdmin={session?.has_admin ?? true}
|
||||
onClose={() => setLoginOpen(false)}
|
||||
onSuccess={(next) => {
|
||||
setSession(next)
|
||||
setLoginOpen(false)
|
||||
}}
|
||||
/>
|
||||
|
||||
<ItemEditor
|
||||
open={editingKey !== null}
|
||||
itemKey={editingKey}
|
||||
onClose={() => setEditingKey(null)}
|
||||
onSaved={() => {
|
||||
setEditingKey(null)
|
||||
load()
|
||||
}}
|
||||
/>
|
||||
|
||||
<div className="site-background" aria-hidden="true" />
|
||||
|
||||
<Layout
|
||||
contained
|
||||
maxWidth={1380}
|
||||
gutter={20}
|
||||
siderWidth={240}
|
||||
gap={20}
|
||||
headerHeight={60}
|
||||
headerVariant="solid"
|
||||
siderBordered={false}
|
||||
contentPadding="none"
|
||||
contentOffset={88}
|
||||
height="screen"
|
||||
scrollable
|
||||
hideScrollbar
|
||||
contentId="content-scroll"
|
||||
className="app"
|
||||
header={
|
||||
<SiteHeader
|
||||
projectCount={projects.length}
|
||||
sampleProject={projects[0]?.name}
|
||||
live={live}
|
||||
headerItems={site.header.items}
|
||||
headerEnabled={site.header.enabled}
|
||||
headerSpeed={site.header.speed}
|
||||
authenticated={session?.authenticated === true}
|
||||
username={session?.username ?? undefined}
|
||||
onFocusSearch={() => searchRef.current?.focus()}
|
||||
onLogin={() => setLoginOpen(true)}
|
||||
onLogout={() => {
|
||||
void logout().then(() => setSession({ authenticated: false, has_admin: true }))
|
||||
}}
|
||||
onSettings={() => window.location.assign('/admin')}
|
||||
/>
|
||||
}
|
||||
sider={
|
||||
<div className="sidebar">
|
||||
<ProfileCard profile={site.profile} />
|
||||
<ServicePanel
|
||||
projects={projects}
|
||||
live={live}
|
||||
refreshing={refreshing}
|
||||
onRefresh={refresh}
|
||||
/>
|
||||
<div className="nav-card">
|
||||
<Menu
|
||||
items={sidebarItems}
|
||||
activeKey={activeKey}
|
||||
itemHeight={39}
|
||||
onSelect={(key) => {
|
||||
if (key === 'home') navigate('/')
|
||||
else navigate(`/g/${encodeURIComponent(key.slice(2))}`)
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
>
|
||||
<div className="content">
|
||||
<div className={`content-veil${scrolled ? ' is-visible' : ''}`} aria-hidden="true" />
|
||||
<SearchBar value={keyword} onChange={setKeyword} inputRef={searchRef} />
|
||||
<h1 className="sr-only">Stash 本地应用工作区</h1>
|
||||
|
||||
{status === 'error' && (
|
||||
<Notice
|
||||
tone="error"
|
||||
title="连不上 Stash 服务"
|
||||
action={{ label: '重试', onClick: refresh }}
|
||||
>
|
||||
{error}
|
||||
</Notice>
|
||||
)}
|
||||
|
||||
{route.kind === 'home' && renderHome()}
|
||||
{route.kind === 'group' && renderGroupPage(route.key)}
|
||||
{route.kind === 'item' && renderItemPage(route.key, route.itemId)}
|
||||
</div>
|
||||
</Layout>
|
||||
|
||||
<BackToTop visible={scrolled} />
|
||||
</>
|
||||
)
|
||||
}
|
||||
@@ -2,7 +2,7 @@ import { StrictMode } from 'react'
|
||||
import { createRoot } from 'react-dom/client'
|
||||
import '@stash/ui/style.css'
|
||||
import './index.css'
|
||||
import App from './App.tsx'
|
||||
import AppNext from './AppNext.tsx'
|
||||
import { AdminNext } from './components/admin/AdminNext'
|
||||
|
||||
/**
|
||||
@@ -23,5 +23,5 @@ if (path === '/login') {
|
||||
const root = createRoot(document.getElementById('root')!)
|
||||
|
||||
root.render(
|
||||
<StrictMode>{path === '/admin' ? <AdminNext /> : <App />}</StrictMode>,
|
||||
<StrictMode>{path === '/admin' ? <AdminNext /> : <AppNext />}</StrictMode>,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user