mirror of
https://github.com/PlayEdu/backend
synced 2025-07-16 15:01:22 +08:00
added: 测试页面
This commit is contained in:
parent
050912f60d
commit
d13de512fc
@ -1,3 +1,4 @@
|
|||||||
export * from "./footer";
|
export * from "./footer";
|
||||||
export * from "./header";
|
export * from "./header";
|
||||||
export * from "./leftMenu";
|
export * from "./leftMenu";
|
||||||
|
export * from "./uploadImageButton";
|
0
src/compenents/uploadImageButton/index.less
Normal file
0
src/compenents/uploadImageButton/index.less
Normal file
33
src/compenents/uploadImageButton/index.tsx
Normal file
33
src/compenents/uploadImageButton/index.tsx
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
import React, { useState } from "react";
|
||||||
|
import { Button, Drawer } from "antd";
|
||||||
|
|
||||||
|
export const UploadImageButton: React.FC = () => {
|
||||||
|
const [showModal, setShowModal] = useState<boolean>(false);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Button
|
||||||
|
onClick={() => {
|
||||||
|
setShowModal(true);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
上传图片
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
{showModal && (
|
||||||
|
<Drawer
|
||||||
|
title="Basic Drawer"
|
||||||
|
placement="right"
|
||||||
|
onClose={() => {
|
||||||
|
setShowModal(false);
|
||||||
|
}}
|
||||||
|
open={showModal}
|
||||||
|
>
|
||||||
|
<p>Some contents...</p>
|
||||||
|
<p>Some contents...</p>
|
||||||
|
<p>Some contents...</p>
|
||||||
|
</Drawer>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
@ -2,4 +2,5 @@ export * from "./home";
|
|||||||
export * from "./login";
|
export * from "./login";
|
||||||
export * from "./dashboard";
|
export * from "./dashboard";
|
||||||
export * from "./error";
|
export * from "./error";
|
||||||
export * from "./course";
|
export * from "./course";
|
||||||
|
export * from "./test";
|
0
src/pages/test/index.module.less
Normal file
0
src/pages/test/index.module.less
Normal file
10
src/pages/test/index.tsx
Normal file
10
src/pages/test/index.tsx
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import React from "react";
|
||||||
|
import { UploadImageButton } from "../../compenents";
|
||||||
|
|
||||||
|
export const TestPage: React.FC = () => {
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<UploadImageButton></UploadImageButton>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
@ -1,5 +1,12 @@
|
|||||||
import { RouteObject } from "react-router-dom";
|
import { RouteObject } from "react-router-dom";
|
||||||
import { Login, HomePage, Dashboard, ErrorPage, VodListPage } from "../pages";
|
import {
|
||||||
|
Login,
|
||||||
|
HomePage,
|
||||||
|
Dashboard,
|
||||||
|
ErrorPage,
|
||||||
|
VodListPage,
|
||||||
|
TestPage,
|
||||||
|
} from "../pages";
|
||||||
|
|
||||||
const routes: RouteObject[] = [
|
const routes: RouteObject[] = [
|
||||||
{
|
{
|
||||||
@ -20,6 +27,10 @@ const routes: RouteObject[] = [
|
|||||||
path: "/login",
|
path: "/login",
|
||||||
element: <Login />,
|
element: <Login />,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: "/test",
|
||||||
|
element: <TestPage />,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: "*",
|
path: "*",
|
||||||
element: <ErrorPage />,
|
element: <ErrorPage />,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user