|
|
@@ -2,6 +2,7 @@ import { useNavigate, useParams } from "react-router-dom";
|
|
|
import { Col, Row } from "antd";
|
|
|
|
|
|
import AnthologyDetail from "../../../components/article/AnthologyDetail";
|
|
|
+import { fullUrl } from "../../../utils";
|
|
|
|
|
|
const Widget = () => {
|
|
|
// TODO
|
|
|
@@ -15,14 +16,19 @@ const Widget = () => {
|
|
|
<Col flex="auto"></Col>
|
|
|
<Col flex={pageMaxWidth}>
|
|
|
<AnthologyDetail
|
|
|
- onArticleSelect={(anthologyId: string, keys: string[]) => {
|
|
|
- if (keys[0]) {
|
|
|
- navigate(
|
|
|
- `/article/article/${keys[0]}?mode=read&anthology=${anthologyId}`
|
|
|
- );
|
|
|
+ aid={id}
|
|
|
+ onArticleClick={(
|
|
|
+ anthologyId: string,
|
|
|
+ articleId: string,
|
|
|
+ target: string
|
|
|
+ ) => {
|
|
|
+ let url = `/article/article/${articleId}?mode=read&anthology=${anthologyId}`;
|
|
|
+ if (target === "_blank") {
|
|
|
+ window.open(fullUrl(url), "_blank");
|
|
|
+ } else {
|
|
|
+ navigate(url);
|
|
|
}
|
|
|
}}
|
|
|
- aid={id}
|
|
|
/>
|
|
|
</Col>
|
|
|
<Col flex="auto"></Col>
|