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() {
|
||||
const [currentPage, setCurrentPage] = useState(1);
|
||||
const { user } = useAuth()
|
||||
|
||||
const { data: paginationRes, refetch } = api.course.findManyWithPagination.useQuery({
|
||||
page: currentPage,
|
||||
pageSize: 8,
|
||||
|
@ -19,12 +18,10 @@ export default function StudentCoursesPage() {
|
|||
}
|
||||
}
|
||||
});
|
||||
|
||||
const handlePageChange = (page: number) => {
|
||||
setCurrentPage(page);
|
||||
refetch()
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="bg-slate-50 px-4 py-8 sm:px-6 lg:px-8">
|
||||
<div className="mx-auto max-w-7xl">
|
||||
|
|
|
@ -2,7 +2,6 @@ import HeroSection from './components/HeroSection';
|
|||
import CategorySection from './components/CategorySection';
|
||||
import CoursesSection from './components/CoursesSection';
|
||||
import FeaturedTeachersSection from './components/FeaturedTeachersSection';
|
||||
|
||||
const HomePage = () => {
|
||||
const mockCourses = [
|
||||
{
|
||||
|
|
|
@ -8,6 +8,7 @@ const { Content } = Layout;
|
|||
export function MainLayout() {
|
||||
return (
|
||||
<Layout className="min-h-screen">
|
||||
|
||||
<MainHeader />
|
||||
<Content className="mt-16 bg-gray-50">
|
||||
<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() {
|
||||
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>
|
||||
}
|
|
@ -124,3 +124,8 @@
|
|||
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 { MainLayout } from "../app/main/layout/MainLayout";
|
||||
import CoursesPage from "../app/main/courses/page";
|
||||
import PathsPage from "../app/main/paths/page";
|
||||
|
||||
interface CustomIndexRouteObject extends IndexRouteObject {
|
||||
name?: string;
|
||||
|
@ -61,6 +62,11 @@ export const routes: CustomRouteObject[] = [
|
|||
{
|
||||
index: true,
|
||||
element: <HomePage />,
|
||||
|
||||
},
|
||||
{
|
||||
path: "paths",
|
||||
element: <PathsPage></PathsPage>
|
||||
},
|
||||
{
|
||||
path: "courses",
|
||||
|
|
|
@ -12,7 +12,6 @@ events {
|
|||
http {
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
log_format main
|
||||
'$remote_addr - $remote_user [$time_local] "$request" '
|
||||
'$status $body_bytes_sent "$http_referer" '
|
||||
|
|
Loading…
Reference in New Issue