diff --git a/src/global.css b/src/assets/global.css similarity index 100% rename from src/global.css rename to src/assets/global.css diff --git a/src/main.jsx b/src/main.jsx index 1f34802..a9f9ec0 100644 --- a/src/main.jsx +++ b/src/main.jsx @@ -7,11 +7,13 @@ import { } from "react-router-dom"; import RootStore from "./stores/Root"; import { StoreContext } from './stores/StoreContext'; -import "./global.css"; +import "./assets/global.css"; import App from "./views/App"; +import Login from "./views/Login"; +import SignOut from "./views/SignOut"; import Index from "./views/index"; -import ErrorPage from "./error-page"; -import Plan from "./views/Plan"; +import ErrorPage from "./views/error-page"; +import PlanNewest from "./views/plan/Newest"; configure({ useProxies: "ifavailable", @@ -30,8 +32,23 @@ const router = createBrowserRouter([ children: [ { index: true, element: }, { - path: "plan/:planId", - element: , + path: "plan/newest", + element: , + } + ], + // path: "/test-404", + // element: , + }, + { + element: , + children: [ + { + path: "/login", + element: , + }, + { + path: "/sign-out", + element: , } ] } @@ -40,12 +57,12 @@ const router = createBrowserRouter([ const rootStore = new RootStore(); ReactDOM.createRoot(document.getElementById("root")).render( - // + //
Loading...
} />
- //
+ //
); \ No newline at end of file diff --git a/src/views/App.jsx b/src/views/App.jsx index 263b8ae..5012f37 100644 --- a/src/views/App.jsx +++ b/src/views/App.jsx @@ -62,7 +62,7 @@ export default function App() { Plan }, + { key: 1, label: Plan }, { key: 2, label: Invoice }, { key: 3, label: Feedback } ] diff --git a/src/views/Index.jsx b/src/views/Index.jsx index 2b55a12..9034490 100644 --- a/src/views/Index.jsx +++ b/src/views/Index.jsx @@ -1,11 +1,11 @@ export default function Index() { return (

- This is a demo for React Router. + Global Highlights Hub
Check out{" "} - - the docs at reactrouter.com + + the docs at chinahighlights.com .

diff --git a/src/views/Login.jsx b/src/views/Login.jsx new file mode 100644 index 0000000..827a94b --- /dev/null +++ b/src/views/Login.jsx @@ -0,0 +1,109 @@ +import { Button, Checkbox, Form, Input, Row, Typography, Layout } from 'antd'; +const { Header, Footer, Sider, Content } = Layout; +const { Title } = Typography; +const headerStyle = { + textAlign: 'center', + // color: '#fff', + height: 64, + paddingInline: 50, + lineHeight: '64px', + backgroundColor: '#f5f5f5', +}; +const contentStyle = { + textAlign: 'center', + minHeight: 600, + lineHeight: '120px', + // color: '#fff', + // backgroundColor: '#108ee9', +}; +const footerStyle = { + textAlign: 'center', + // color: '#fff', + // backgroundColor: '#7dbcea', +}; +const onFinish = (values) => { + console.log('Success:', values); +}; +const onFinishFailed = (errorInfo) => { + console.log('Failed:', errorInfo); +}; +const Login = () => ( + +
+ Global Highlights Hub +
+ + +
+ + + + + + + + + + Remember me + + + + + +
+
+
+
Footer
+
+ +); +export default Login; \ No newline at end of file diff --git a/src/views/SignOut.jsx b/src/views/SignOut.jsx new file mode 100644 index 0000000..6da4c92 --- /dev/null +++ b/src/views/SignOut.jsx @@ -0,0 +1,42 @@ +import { Button, Checkbox, Form, Input, Row, Typography, Layout } from 'antd'; +const { Header, Footer, Sider, Content } = Layout; +const { Title } = Typography; +const headerStyle = { + textAlign: 'center', + // color: '#fff', + height: 64, + paddingInline: 50, + lineHeight: '64px', + backgroundColor: '#f5f5f5', +}; +const contentStyle = { + textAlign: 'center', + minHeight: 600, + lineHeight: '120px', + // color: '#fff', + // backgroundColor: '#108ee9', +}; +const footerStyle = { + textAlign: 'center', + // color: '#fff', + // backgroundColor: '#7dbcea', +}; +const onFinish = (values) => { + console.log('Success:', values); +}; +const onFinishFailed = (errorInfo) => { + console.log('Failed:', errorInfo); +}; +const SignOut = () => ( + +
+ Global Highlights Hub +
+ + See you. + +
Footer
+
+ +); +export default SignOut; \ No newline at end of file diff --git a/src/error-page.jsx b/src/views/error-page.jsx similarity index 100% rename from src/error-page.jsx rename to src/views/error-page.jsx diff --git a/src/views/Plan.jsx b/src/views/plan/Newest.jsx similarity index 84% rename from src/views/Plan.jsx rename to src/views/plan/Newest.jsx index c50345e..c9fb3cd 100644 --- a/src/views/Plan.jsx +++ b/src/views/plan/Newest.jsx @@ -4,7 +4,7 @@ import { observer } from "mobx-react"; import { toJS } from "mobx"; import moment from "moment"; import { Row, Col, Space, Button, Table, Tag, Typography, DatePicker } from 'antd'; -import { useStore } from '../stores/StoreContext.js'; +import { useStore } from '../../stores/StoreContext.js'; const { Title } = Typography; @@ -57,23 +57,19 @@ const planListColumns = [ }, ]; -function Plan() { +function Newest() { - const { planId } = useParams(); const { plan } = useStore(); const { planList } = plan; useEffect(() => { - console.info('planId: ' + planId); - }, [planId]); + console.info('Newest.useEffect'); + }, []); return ( Newest Plans - - Parameter: {planId} - Group Date: @@ -95,4 +91,4 @@ function Plan() { ); } -export default observer(Plan); \ No newline at end of file +export default observer(Newest); \ No newline at end of file