配置 mdx 与 turbopack 继承;修复退出登录后循环跳转的问题;button 统一复用可导出样式并微调样式

This commit is contained in:
2025-06-06 16:17:33 +08:00
parent 7fff0308d0
commit ce4f7e272c
11 changed files with 175 additions and 68 deletions

View File

@@ -54,7 +54,7 @@ export default function Provider(props: ProviderProps) {
// 用户信息
// ======================
const profile = useProfileStore(store=>store.profile)
const profile = useProfileStore(store => store.profile)
// ======================
// render
@@ -144,7 +144,7 @@ export default function Provider(props: ProviderProps) {
</>
: (
<Link href={`/admin`}>
<Button theme={`gradient`}>
<Button theme={`gradient`} className={`h-12`}>
</Button>
</Link>

View File

@@ -3,22 +3,23 @@ import {Button} from '@/components/ui/button'
import {logout} from '@/actions/auth'
import {useProfileStore} from '@/components/providers/StoreProvider'
import {useRouter} from 'next/navigation'
import {toast} from 'sonner'
export type ProfileProps = {}
export default function Profile(props: ProfileProps) {
const router = useRouter()
const refreshProfile = useProfileStore(store => store.refreshProfile)
const doLogout = async () => {
const resp = await logout()
if (resp.success) {
await refreshProfile()
refreshProfile().then()
router.replace('/')
}
}
return (
<div className="flex gap-2 items-center">
<Button theme={`error`} onClick={doLogout}>
<Button theme={`fail`} onClick={doLogout}>
退
</Button>
</div>

View File

@@ -231,7 +231,7 @@ export default function WhitelistPage(props: WhitelistPageProps) {
</Button>
<Button
theme={`error`}
theme={`fail`}
className={`ml-2`}
disabled={selection.size === 0 || wait}
onClick={() => confirmRemove()}>
@@ -277,7 +277,7 @@ export default function WhitelistPage(props: WhitelistPageProps) {
<Button
className={`h-9 w-9`}
onClick={() => confirmRemove(row.original.id)}
theme={`error`}
theme={`fail`}
disabled={wait}
>
<Trash2 className="w-4 h-4"/>
@@ -332,7 +332,7 @@ export default function WhitelistPage(props: WhitelistPageProps) {
</AlertDialogHeader>
<AlertDialogFooter>
<Button theme="outline" onClick={() => setAlertVisible(false)}></Button>
<Button theme="error" onClick={() => remove()}></Button>
<Button theme="fail" onClick={() => remove()}></Button>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>