update,
This commit is contained in:
@@ -26,19 +26,26 @@ import { PencilSimple as PencilSimpleIcon } from '@phosphor-icons/react/dist/ssr
|
||||
import { Plus as PlusIcon } from '@phosphor-icons/react/dist/ssr/Plus';
|
||||
import { ShieldWarning as ShieldWarningIcon } from '@phosphor-icons/react/dist/ssr/ShieldWarning';
|
||||
import { User as UserIcon } from '@phosphor-icons/react/dist/ssr/User';
|
||||
import type { RecordModel } from 'pocketbase';
|
||||
import PocketBase from 'pocketbase';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import { paths } from '@/paths';
|
||||
import { dayjs } from '@/lib/dayjs';
|
||||
import { logger } from '@/lib/default-logger';
|
||||
import { PropertyItem } from '@/components/core/property-item';
|
||||
import { PropertyList } from '@/components/core/property-list';
|
||||
import { toast } from '@/components/core/toaster';
|
||||
// import { getLessonTypeById } from '@/components/dashboard/lesson_type/http-actions';
|
||||
import { LessonTypeDefaultValue, type LessonType } from '@/components/dashboard/lesson_type/ILessonType';
|
||||
import { defaultLessonType } from '@/components/dashboard/lesson_type/interfaces';
|
||||
import { Notifications } from '@/components/dashboard/lesson_type/notifications';
|
||||
import { Payments } from '@/components/dashboard/lesson_type/payments';
|
||||
import type { Address } from '@/components/dashboard/lesson_type/shipping-address';
|
||||
import { ShippingAddress } from '@/components/dashboard/lesson_type/shipping-address';
|
||||
|
||||
const pb = new PocketBase(process.env.NEXT_PUBLIC_POCKETBASE_URL);
|
||||
|
||||
export default function Page(): React.JSX.Element {
|
||||
const { t } = useTranslation();
|
||||
const { typeId } = useParams<{ typeId: string }>();
|
||||
@@ -51,17 +58,20 @@ export default function Page(): React.JSX.Element {
|
||||
}
|
||||
|
||||
React.useEffect(() => {
|
||||
// getLessonTypeById(typeId)
|
||||
// .then((lessonType: LessonType) => {
|
||||
// setIsLoading(false);
|
||||
// setShowLessonType(lessonType);
|
||||
// })
|
||||
// .catch((err) => {
|
||||
// // console.error(err);
|
||||
// console.error(t('lessonType.load_error'));
|
||||
// });
|
||||
// console.log('hello');
|
||||
}, []);
|
||||
if (typeId) {
|
||||
pb.collection('LessonsTypes')
|
||||
.getOne(typeId)
|
||||
.then((lessonType: RecordModel) => {
|
||||
setShowLessonType({ ...defaultLessonType, ...lessonType });
|
||||
setIsLoading(false);
|
||||
})
|
||||
.catch((err) => {
|
||||
logger.error(err);
|
||||
toast(t('dashboard.lessonTypes.list.error'));
|
||||
});
|
||||
}
|
||||
}, [typeId]);
|
||||
|
||||
if (isLoading) return <div>{t('common.loading')}</div>;
|
||||
|
||||
return (
|
||||
|
@@ -14,6 +14,11 @@ import { LessonTypeEditForm } from '@/components/dashboard/lesson_type/lesson-ty
|
||||
|
||||
export default function Page(): React.JSX.Element {
|
||||
const { t } = useTranslation();
|
||||
|
||||
React.useEffect(() => {
|
||||
console.log('helloworld');
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<Box
|
||||
sx={{
|
||||
|
14
002_source/cms/src/app/helloworld/page.tsx
Normal file
14
002_source/cms/src/app/helloworld/page.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
'use client';
|
||||
|
||||
import * as React from 'react';
|
||||
import useEnhancedEffect from '@mui/utils/useEnhancedEffect';
|
||||
|
||||
function Page(): React.JSX.Element {
|
||||
React.useLayoutEffect(() => {
|
||||
console.log('helloworld');
|
||||
}, []);
|
||||
|
||||
return <>helloworld</>;
|
||||
}
|
||||
|
||||
export default Page;
|
Reference in New Issue
Block a user