@@ -3,7 +3,7 @@ import pluginQuery from '@tanstack/eslint-plugin-query';
|
|||||||
|
|
||||||
export default antfu({
|
export default antfu({
|
||||||
gitignore: true,
|
gitignore: true,
|
||||||
ignores: ['**/node_modules/**', '**/dist/**', 'bun.lock', '**/routeTree.gen.ts', '**/ui/**'],
|
ignores: ['**/node_modules/**', '**/dist/**', 'bun.lock', '**/routeTree.gen.ts', '**/ui/**', 'src/components/editor/**/*'],
|
||||||
react: true,
|
react: true,
|
||||||
stylistic: {
|
stylistic: {
|
||||||
semi: true,
|
semi: true,
|
||||||
|
|||||||
33
client/cms/src/components/profile/edit-bio-dialog.tsx
Normal file
33
client/cms/src/components/profile/edit-bio-dialog.tsx
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
import { Pencil } from 'lucide-react';
|
||||||
|
import { PlateEditor } from '@/components/editor/plate-editor';
|
||||||
|
import { Button } from '@/components/ui/button';
|
||||||
|
import {
|
||||||
|
Dialog,
|
||||||
|
DialogClose,
|
||||||
|
DialogContent,
|
||||||
|
DialogFooter,
|
||||||
|
DialogTrigger,
|
||||||
|
} from '@/components/ui/dialog';
|
||||||
|
|
||||||
|
export function EditBioDialog() {
|
||||||
|
return (
|
||||||
|
<Dialog>
|
||||||
|
<DialogTrigger asChild>
|
||||||
|
<Button className="absolute top-4 right-4" size="icon-sm" variant="outline">
|
||||||
|
<Pencil />
|
||||||
|
</Button>
|
||||||
|
</DialogTrigger>
|
||||||
|
<DialogContent className="sm:max-w-[425px] max-h-128">
|
||||||
|
<PlateEditor />
|
||||||
|
<DialogFooter>
|
||||||
|
<DialogClose asChild>
|
||||||
|
<Button variant="outline">取消</Button>
|
||||||
|
</DialogClose>
|
||||||
|
<DialogClose asChild>
|
||||||
|
<Button type="submit">保存</Button>
|
||||||
|
</DialogClose>
|
||||||
|
</DialogFooter>
|
||||||
|
</DialogContent>
|
||||||
|
</Dialog>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -3,6 +3,7 @@ import Markdown from 'react-markdown';
|
|||||||
import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar';
|
import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar';
|
||||||
import { useUserInfo } from '@/hooks/data/useUserInfo';
|
import { useUserInfo } from '@/hooks/data/useUserInfo';
|
||||||
import { base64ToUtf8 } from '@/lib/utils';
|
import { base64ToUtf8 } from '@/lib/utils';
|
||||||
|
import { EditBioDialog } from './edit-bio-dialog';
|
||||||
import { EditProfileDialog } from './edit-profile-dialog';
|
import { EditProfileDialog } from './edit-profile-dialog';
|
||||||
|
|
||||||
export function MainProfile() {
|
export function MainProfile() {
|
||||||
@@ -30,9 +31,10 @@ export function MainProfile() {
|
|||||||
<EditProfileDialog />
|
<EditProfileDialog />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<section className="rounded-md border border-muted w-full flex-1 lg:flex-auto min-h-72 lg:h-full mt-4 lg:mt-0 p-6 prose dark:prose-invert max-w-[1012px] self-center">
|
<section className="relative rounded-md border border-muted w-full flex-1 lg:flex-auto min-h-72 lg:h-full mt-4 lg:mt-0 p-6 prose dark:prose-invert max-w-[1012px] self-center">
|
||||||
{/* Bio */}
|
{/* Bio */}
|
||||||
<Markdown>{base64ToUtf8(user.bio)}</Markdown>
|
<Markdown>{base64ToUtf8(user.bio)}</Markdown>
|
||||||
|
<EditBioDialog />
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user