|
@@ -1,4 +1,4 @@
|
|
|
-import { useParams } from "react-router-dom";
|
|
|
|
|
|
|
+import { useNavigate, useParams } from "react-router-dom";
|
|
|
import { Col, Row } from "antd";
|
|
import { Col, Row } from "antd";
|
|
|
|
|
|
|
|
import AnthologyDetail from "../../../components/article/AnthologyDetail";
|
|
import AnthologyDetail from "../../../components/article/AnthologyDetail";
|
|
@@ -6,6 +6,7 @@ import AnthologyDetail from "../../../components/article/AnthologyDetail";
|
|
|
const Widget = () => {
|
|
const Widget = () => {
|
|
|
// TODO
|
|
// TODO
|
|
|
const { id } = useParams(); //url 参数
|
|
const { id } = useParams(); //url 参数
|
|
|
|
|
+ const navigate = useNavigate();
|
|
|
|
|
|
|
|
const pageMaxWidth = "960px";
|
|
const pageMaxWidth = "960px";
|
|
|
return (
|
|
return (
|
|
@@ -13,7 +14,16 @@ const Widget = () => {
|
|
|
<Row>
|
|
<Row>
|
|
|
<Col flex="auto"></Col>
|
|
<Col flex="auto"></Col>
|
|
|
<Col flex={pageMaxWidth}>
|
|
<Col flex={pageMaxWidth}>
|
|
|
- <AnthologyDetail aid={id} />
|
|
|
|
|
|
|
+ <AnthologyDetail
|
|
|
|
|
+ onArticleSelect={(anthologyId: string, keys: string[]) => {
|
|
|
|
|
+ if (keys[0]) {
|
|
|
|
|
+ navigate(
|
|
|
|
|
+ `/article/article/${keys[0]}?mode=read&anthology=${anthologyId}`
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+ }}
|
|
|
|
|
+ aid={id}
|
|
|
|
|
+ />
|
|
|
</Col>
|
|
</Col>
|
|
|
<Col flex="auto"></Col>
|
|
<Col flex="auto"></Col>
|
|
|
</Row>
|
|
</Row>
|