diff --git a/src/main.jsx b/src/main.jsx index a9f9ec0..0b75844 100644 --- a/src/main.jsx +++ b/src/main.jsx @@ -14,6 +14,7 @@ import SignOut from "./views/SignOut"; import Index from "./views/index"; import ErrorPage from "./views/error-page"; import PlanNewest from "./views/plan/Newest"; +import PlanDetail from "./views/plan/Detail"; configure({ useProxies: "ifavailable", @@ -31,25 +32,15 @@ const router = createBrowserRouter([ errorElement: , children: [ { index: true, element: }, - { - path: "plan/newest", - element: , - } - ], - // path: "/test-404", - // element: , + { path: "plan/newest", element: }, + { path: "plan/:planId", element: } + ] }, { element: , children: [ - { - path: "/login", - element: , - }, - { - path: "/sign-out", - element: , - } + { path: "/login", element: }, + { path: "/sign-out", element: } ] } ]); diff --git a/src/views/plan/Detail.jsx b/src/views/plan/Detail.jsx new file mode 100644 index 0000000..9dfa2b9 --- /dev/null +++ b/src/views/plan/Detail.jsx @@ -0,0 +1,94 @@ +import { useParams } from "react-router-dom"; +import { useEffect } from 'react'; +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'; + +const { Title } = Typography; + +const planListColumns = [ + { + title: 'Name', + dataIndex: 'name', + key: 'name', + render: (text) => {text}, + }, + { + title: 'Age', + dataIndex: 'age', + key: 'age', + }, + { + title: 'Address', + dataIndex: 'address', + key: 'address', + }, + { + title: 'Tags', + key: 'tags', + dataIndex: 'tags', + render: (_, { tags }) => ( + <> + {tags.map((tag) => { + let color = tag.length > 5 ? 'geekblue' : 'green'; + if (tag === 'loser') { + color = 'volcano'; + } + return ( + + {tag.toUpperCase()} + + ); + })} + + ), + }, + { + title: 'Action', + key: 'action', + render: (_, record) => ( + + Invite {record.name} + Delete + + ), + }, +]; + +function Detail() { + const { planId } = useParams(); + const { plan } = useStore(); + const { planList } = plan; + + useEffect(() => { + console.info('Detail.useEffect: ' + planId); + }, []); + + return ( + + Plan Detail + + + + Group Date: + + + + + + + + + + + + + + ); +} + +export default observer(Detail); \ No newline at end of file