02191605
This commit is contained in:
parent
4fb0fa49e7
commit
139bb5c742
|
@ -7,7 +7,6 @@ import { useAuth } from "@web/src/providers/auth-provider";
|
||||||
export default function StudentCoursesPage() {
|
export default function StudentCoursesPage() {
|
||||||
const [currentPage, setCurrentPage] = useState(1);
|
const [currentPage, setCurrentPage] = useState(1);
|
||||||
const { user } = useAuth()
|
const { user } = useAuth()
|
||||||
|
|
||||||
const { data: paginationRes, refetch } = api.course.findManyWithPagination.useQuery({
|
const { data: paginationRes, refetch } = api.course.findManyWithPagination.useQuery({
|
||||||
page: currentPage,
|
page: currentPage,
|
||||||
pageSize: 8,
|
pageSize: 8,
|
||||||
|
@ -19,12 +18,10 @@ export default function StudentCoursesPage() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const handlePageChange = (page: number) => {
|
const handlePageChange = (page: number) => {
|
||||||
setCurrentPage(page);
|
setCurrentPage(page);
|
||||||
refetch()
|
refetch()
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="bg-slate-50 px-4 py-8 sm:px-6 lg:px-8">
|
<div className="bg-slate-50 px-4 py-8 sm:px-6 lg:px-8">
|
||||||
<div className="mx-auto max-w-7xl">
|
<div className="mx-auto max-w-7xl">
|
||||||
|
|
|
@ -2,7 +2,6 @@ import HeroSection from './components/HeroSection';
|
||||||
import CategorySection from './components/CategorySection';
|
import CategorySection from './components/CategorySection';
|
||||||
import CoursesSection from './components/CoursesSection';
|
import CoursesSection from './components/CoursesSection';
|
||||||
import FeaturedTeachersSection from './components/FeaturedTeachersSection';
|
import FeaturedTeachersSection from './components/FeaturedTeachersSection';
|
||||||
|
|
||||||
const HomePage = () => {
|
const HomePage = () => {
|
||||||
const mockCourses = [
|
const mockCourses = [
|
||||||
{
|
{
|
||||||
|
|
|
@ -8,6 +8,7 @@ const { Content } = Layout;
|
||||||
export function MainLayout() {
|
export function MainLayout() {
|
||||||
return (
|
return (
|
||||||
<Layout className="min-h-screen">
|
<Layout className="min-h-screen">
|
||||||
|
|
||||||
<MainHeader />
|
<MainHeader />
|
||||||
<Content className="mt-16 bg-gray-50">
|
<Content className="mt-16 bg-gray-50">
|
||||||
<Outlet />
|
<Outlet />
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
import MindEditor from "@web/src/components/common/editor/MindEditor";
|
||||||
|
import MindElixir, { MindElixirInstance } from "mind-elixir";
|
||||||
|
import { useEffect, useRef } from "react";
|
||||||
export default function PathsPage() {
|
export default function PathsPage() {
|
||||||
return <>paths</>
|
return <MindEditor></MindEditor>
|
||||||
}
|
}
|
|
@ -0,0 +1,28 @@
|
||||||
|
import { MindElixirInstance } from "packages/mind-elixir-core/dist/types";
|
||||||
|
import { useRef, useEffect } from "react";
|
||||||
|
import MindElixir from 'mind-elixir';
|
||||||
|
|
||||||
|
export default function MindEditor() {
|
||||||
|
const me = useRef<MindElixirInstance>();
|
||||||
|
useEffect(() => {
|
||||||
|
const instance = new MindElixir({
|
||||||
|
el: "#map",
|
||||||
|
direction: MindElixir.SIDE,
|
||||||
|
draggable: true, // default true
|
||||||
|
contextMenu: true, // default true
|
||||||
|
toolBar: true, // default true
|
||||||
|
nodeMenu: true, // default true
|
||||||
|
keypress: true // default true
|
||||||
|
|
||||||
|
});
|
||||||
|
// instance.install(NodeMenu);
|
||||||
|
instance.init(MindElixir.new("新主题"));
|
||||||
|
me.current = instance;
|
||||||
|
}, []);
|
||||||
|
return <div >
|
||||||
|
<div>
|
||||||
|
1
|
||||||
|
</div>
|
||||||
|
<div id="map" style={{ width: "100%" }} />
|
||||||
|
</div>
|
||||||
|
}
|
|
@ -123,4 +123,9 @@
|
||||||
.custom-table .ant-table-tbody>tr:last-child>td {
|
.custom-table .ant-table-tbody>tr:last-child>td {
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
/* 去除最后一行的底部边框 */
|
/* 去除最后一行的底部边框 */
|
||||||
|
}
|
||||||
|
|
||||||
|
#map {
|
||||||
|
height: 600px;
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
|
@ -24,6 +24,7 @@ import CourseSettingForm from "../components/models/course/editor/form/CourseSet
|
||||||
import CourseEditorLayout from "../components/models/course/editor/layout/CourseEditorLayout";
|
import CourseEditorLayout from "../components/models/course/editor/layout/CourseEditorLayout";
|
||||||
import { MainLayout } from "../app/main/layout/MainLayout";
|
import { MainLayout } from "../app/main/layout/MainLayout";
|
||||||
import CoursesPage from "../app/main/courses/page";
|
import CoursesPage from "../app/main/courses/page";
|
||||||
|
import PathsPage from "../app/main/paths/page";
|
||||||
|
|
||||||
interface CustomIndexRouteObject extends IndexRouteObject {
|
interface CustomIndexRouteObject extends IndexRouteObject {
|
||||||
name?: string;
|
name?: string;
|
||||||
|
@ -61,6 +62,11 @@ export const routes: CustomRouteObject[] = [
|
||||||
{
|
{
|
||||||
index: true,
|
index: true,
|
||||||
element: <HomePage />,
|
element: <HomePage />,
|
||||||
|
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "paths",
|
||||||
|
element: <PathsPage></PathsPage>
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "courses",
|
path: "courses",
|
||||||
|
|
|
@ -12,7 +12,6 @@ events {
|
||||||
http {
|
http {
|
||||||
include /etc/nginx/mime.types;
|
include /etc/nginx/mime.types;
|
||||||
default_type application/octet-stream;
|
default_type application/octet-stream;
|
||||||
|
|
||||||
log_format main
|
log_format main
|
||||||
'$remote_addr - $remote_user [$time_local] "$request" '
|
'$remote_addr - $remote_user [$time_local] "$request" '
|
||||||
'$status $body_bytes_sent "$http_referer" '
|
'$status $body_bytes_sent "$http_referer" '
|
||||||
|
|
Loading…
Reference in New Issue