;
diff --git a/client/cms/src/components/events/kyc/kyc.types.ts b/client/cms/src/components/events/kyc/kyc.types.ts
new file mode 100644
index 0000000..4a9f0a1
--- /dev/null
+++ b/client/cms/src/components/events/kyc/kyc.types.ts
@@ -0,0 +1,8 @@
+export type KycSubmission = {
+ method: 'cnrid';
+ cnrid: string;
+ name: string;
+} | {
+ method: 'passport';
+ passportId: string;
+};
diff --git a/client/cms/src/components/events/types.ts b/client/cms/src/components/events/types.ts
new file mode 100644
index 0000000..6564ba3
--- /dev/null
+++ b/client/cms/src/components/events/types.ts
@@ -0,0 +1,11 @@
+export interface EventInfo {
+ type: 'official' | 'party';
+ eventId: string;
+ isJoined: boolean;
+ requireKyc: boolean;
+ coverImage: string;
+ eventName: string;
+ description: string;
+ startTime: Date;
+ endTime: Date;
+}
diff --git a/client/cms/src/components/hoc/with-fallback.tsx b/client/cms/src/components/hoc/with-fallback.tsx
deleted file mode 100644
index 5d4c0e6..0000000
--- a/client/cms/src/components/hoc/with-fallback.tsx
+++ /dev/null
@@ -1,20 +0,0 @@
-import type { ReactNode } from 'react';
-import React, { Suspense } from 'react';
-
-export function withFallback(
- Component: React.ComponentType
,
- fallback: ReactNode,
-) {
- const Wrapped: React.FC
= (props) => {
- return (
-
-
-
- );
- };
-
- Wrapped.displayName = `withFallback(${Component.displayName! || Component.name || 'Component'
- })`;
-
- return Wrapped;
-}
diff --git a/client/cms/src/components/login-form.tsx b/client/cms/src/components/login-form.tsx
index 5447440..68afe8e 100644
--- a/client/cms/src/components/login-form.tsx
+++ b/client/cms/src/components/login-form.tsx
@@ -13,6 +13,7 @@ import {
} from '@/components/ui/field';
import { Input } from '@/components/ui/input';
import { useGetMagicLink } from '@/hooks/data/useGetMagicLink';
+import { ver } from '@/lib/apiVersion';
import { cn } from '@/lib/utils';
export function LoginForm({
@@ -32,7 +33,7 @@ export function LoginForm({
event.preventDefault();
const formData = new FormData(formRef.current!);
const email = formData.get('email')! as string;
- mutateAsync({ body: { email, turnstile_token: token!, ...oauthParams } }).then(() => {
+ mutateAsync({ body: { email, turnstile_token: token!, ...oauthParams }, headers: ver('20260205') }).then(() => {
void navigate({ to: '/magicLinkSent', search: { email } });
}).catch((error) => {
console.error(error);
diff --git a/client/cms/src/components/profile/edit-profile.dialog.container.tsx b/client/cms/src/components/profile/edit-profile.dialog.container.tsx
new file mode 100644
index 0000000..d8ade1b
--- /dev/null
+++ b/client/cms/src/components/profile/edit-profile.dialog.container.tsx
@@ -0,0 +1,16 @@
+import type { ServiceUserUserInfoData } from '@/client';
+import { useUpdateUser } from '@/hooks/data/useUpdateUser';
+import { ver } from '@/lib/apiVersion';
+import { EditProfileDialogView } from './edit-profile.dialog.view';
+
+export function EditProfileDialogContainer({ data }: { data: ServiceUserUserInfoData }) {
+ const { mutateAsync } = useUpdateUser();
+ return (
+ {
+ await mutateAsync({ body: data, headers: ver('20260205') });
+ }}
+ />
+ );
+}
diff --git a/client/cms/src/components/profile/edit-profile-dialog.tsx b/client/cms/src/components/profile/edit-profile.dialog.view.tsx
similarity index 89%
rename from client/cms/src/components/profile/edit-profile-dialog.tsx
rename to client/cms/src/components/profile/edit-profile.dialog.view.tsx
index 47be953..ed4f5dd 100644
--- a/client/cms/src/components/profile/edit-profile-dialog.tsx
+++ b/client/cms/src/components/profile/edit-profile.dialog.view.tsx
@@ -1,5 +1,9 @@
+import type { ServiceUserUserInfoData } from '@/client';
import { useForm } from '@tanstack/react-form';
-import { useState } from 'react';
+import {
+ useEffect,
+ useState,
+} from 'react';
import { toast } from 'sonner';
import z from 'zod';
import { Button } from '@/components/ui/button';
@@ -20,22 +24,16 @@ import {
import {
Input,
} from '@/components/ui/input';
-import { useUpdateUser } from '@/hooks/data/useUpdateUser';
-import { useUserInfo } from '@/hooks/data/useUserInfo';
import { Switch } from '../ui/switch';
const formSchema = z.object({
username: z.string().min(5),
nickname: z.string(),
subtitle: z.string(),
- avatar: z.url().or(z.literal('')),
+ avatar: z.string().url().or(z.literal('')),
allow_public: z.boolean(),
});
-export function EditProfileDialog() {
- const { data } = useUserInfo();
- const user = data.data!;
- const { mutateAsync } = useUpdateUser();
-
+export function EditProfileDialogView({ user, updateProfile }: { user: ServiceUserUserInfoData; updateProfile: (data: ServiceUserUserInfoData) => Promise }) {
const form = useForm({
defaultValues: {
avatar: user.avatar,
@@ -51,7 +49,7 @@ export function EditProfileDialog() {
value,
}) => {
try {
- await mutateAsync({ body: value });
+ await updateProfile(value);
toast.success('个人资料更新成功');
}
catch (error) {
@@ -63,11 +61,14 @@ export function EditProfileDialog() {
const [open, setOpen] = useState(false);
- if (!open) {
- setTimeout(() => {
- form.reset();
- }, 200);
- }
+ useEffect(() => {
+ if (!open) {
+ const id = setTimeout(() => {
+ form.reset();
+ }, 200);
+ return () => clearTimeout(id);
+ }
+ }, [open, form]);
return (