首页跳转到编辑页

This commit is contained in:
tianyaxiang 2025-02-02 15:07:48 +08:00
parent ea0b0c8fd5
commit 36f917b70c
3 changed files with 37 additions and 11 deletions

View File

@ -14,7 +14,7 @@ export function CodeThemeSelector({ value, onChange }: CodeThemeSelectorProps) {
<div className="flex items-center gap-4">
<Label></Label>
<Select value={value} onValueChange={onChange}>
<SelectTrigger className="w-[180px]">
<SelectTrigger className="w-[140px]">
<SelectValue placeholder="选择代码主题" />
</SelectTrigger>
<SelectContent>

View File

@ -1,7 +1,7 @@
'use client'
import { useState } from 'react'
import { Copy, Plus, Save, Smartphone, Settings } from 'lucide-react'
import { Copy, Plus, Save, Smartphone, Settings, Github } from 'lucide-react'
import { cn } from '@/lib/utils'
import { WechatStylePicker } from '../../template/WechatStylePicker'
import { TemplateManager } from '../../template/TemplateManager'
@ -173,21 +173,31 @@ export function EditorToolbar({
<Save className="h-4 w-4" />
<span></span>
</button>
<button
onClick={handleCopy}
className="inline-flex items-center justify-center gap-1.5 px-3 py-1.5 rounded-md hover:bg-muted text-sm transition-colors"
>
<Copy className="h-4 w-4" />
<span></span>
</button>
<button
onClick={handleCopyPreview}
className="inline-flex items-center justify-center gap-1.5 px-3 py-1.5 rounded-md bg-primary text-primary-foreground hover:bg-primary/90 text-sm transition-colors"
>
<Copy className="h-4 w-4" />
<span></span>
<span></span>
</button>
<div className="flex items-center gap-1">
<ThemeToggle />
<Button
variant="ghost"
size="icon"
asChild
>
<Link
href="https://github.com/tianyaxiang/neurapress"
target="_blank"
rel="noopener noreferrer"
>
<Github className="h-5 w-5" />
<span className="sr-only">GitHub</span>
</Link>
</Button>
</div>
</div>
</div>
</div>

View File

@ -5,6 +5,8 @@ import { usePathname } from 'next/navigation'
import { cn } from '@/lib/utils'
import { ThemeToggle } from '@/components/theme-toggle'
import { Logo } from '@/components/icons/Logo'
import { Github } from 'lucide-react'
import { Button } from '@/components/ui/button'
const navigation = [
{ name: '微信公众号', href: '/wechat' },
@ -48,6 +50,20 @@ export function MainNav() {
</p>
<ThemeToggle />
<Button
variant="ghost"
size="icon"
asChild
>
<Link
href="https://github.com/tianyaxiang/neurapress"
target="_blank"
rel="noopener noreferrer"
>
<Github className="h-5 w-5" />
<span className="sr-only">GitHub</span>
</Link>
</Button>
</div>
</div>
</div>