mirror of
https://github.com/snowykami/neo-blog.git
synced 2025-09-26 11:06:23 +00:00
feat: add sidebar component with context and mobile support
- Implemented Sidebar component with collapsible functionality. - Added SidebarProvider for managing open state and keyboard shortcuts. - Created SidebarTrigger, SidebarRail, and various sidebar elements (Header, Footer, Content, etc.). - Integrated mobile responsiveness using Sheet component. - Added utility hooks for mobile detection. feat: create table component for structured data display - Developed Table component with subcomponents: TableHeader, TableBody, TableFooter, TableRow, TableCell, and TableCaption. - Enhanced styling for better readability and usability. feat: implement tabs component for navigation - Created Tabs component with TabsList, TabsTrigger, and TabsContent for tabbed navigation. - Ensured accessibility and responsive design. feat: add toggle group component for grouped toggle buttons - Developed ToggleGroup and ToggleGroupItem components for managing toggle states. - Integrated context for consistent styling and behavior. feat: create toggle component for binary state representation - Implemented Toggle component with variant and size options. - Enhanced user interaction with visual feedback. feat: add tooltip component for contextual information - Developed Tooltip, TooltipTrigger, and TooltipContent for displaying additional information on hover. - Integrated animations for a smoother user experience. feat: implement mobile detection hook - Created useIsMobile hook to determine if the user is on a mobile device. - Utilized matchMedia for responsive design adjustments.
This commit is contained in:
@ -2,19 +2,16 @@ import { getPostById } from '@/api/post'
|
||||
import { cookies } from 'next/headers'
|
||||
import BlogPost from '@/components/blog-post/blog-post'
|
||||
|
||||
interface Props {
|
||||
params: Promise<{ id: string }>
|
||||
}
|
||||
|
||||
export default async function PostPage({ params }: Props) {
|
||||
// 这个是approuter固定的传入格式,无法更改
|
||||
export default async function PostPage({ params }: { params: { id: string } }) {
|
||||
const cookieStore = await cookies();
|
||||
const { id } = await params
|
||||
const post = await getPostById(id, cookieStore.get('token')?.value || '');
|
||||
const { id } = params;
|
||||
const post = await getPostById({id, token: cookieStore.get('token')?.value || ''});
|
||||
if (!post)
|
||||
return <div>文章不存在</div>
|
||||
return (
|
||||
<div className="flex flex-col h-100vh">
|
||||
<BlogPost post={post} />
|
||||
<BlogPost post={post} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
Reference in New Issue
Block a user