|
|
@@ -1,18 +1,9 @@
|
|
|
import { useState } from "react";
|
|
|
import { Button, Dropdown, Space, Typography } from "antd";
|
|
|
-import {
|
|
|
- ShareAltOutlined,
|
|
|
- ExportOutlined,
|
|
|
- ForkOutlined,
|
|
|
- InboxOutlined,
|
|
|
-} from "@ant-design/icons";
|
|
|
+import { ShareAltOutlined, ExportOutlined } from "@ant-design/icons";
|
|
|
|
|
|
import ExportModal from "./ExportModal";
|
|
|
import { ArticleType } from "../article/Article";
|
|
|
-import AddToAnthology from "../article/AddToAnthology";
|
|
|
-import { useAppSelector } from "../../hooks";
|
|
|
-import { currentUser } from "../../reducers/current-user";
|
|
|
-import { fullUrl } from "../../utils";
|
|
|
|
|
|
const { Text } = Typography;
|
|
|
|
|
|
@@ -33,8 +24,6 @@ const ShareButtonWidget = ({
|
|
|
anthologyId,
|
|
|
}: IWidget) => {
|
|
|
const [exportOpen, setExportOpen] = useState(false);
|
|
|
- const [addToAnthologyOpen, setAddToAnthologyOpen] = useState(false);
|
|
|
- const user = useAppSelector(currentUser);
|
|
|
|
|
|
return (
|
|
|
<>
|
|
|
@@ -60,20 +49,18 @@ const ShareButtonWidget = ({
|
|
|
case "export":
|
|
|
setExportOpen(true);
|
|
|
break;
|
|
|
- case "add_to_anthology":
|
|
|
- setAddToAnthologyOpen(true);
|
|
|
- break;
|
|
|
- case "fork":
|
|
|
- const url = `/studio/${user?.nickName}/article/create?parent=${articleId}`;
|
|
|
- window.open(fullUrl(url), "_blank");
|
|
|
- break;
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
|
},
|
|
|
}}
|
|
|
>
|
|
|
- <Button type="text" icon={<ShareAltOutlined color="#fff" />} />
|
|
|
+ <Button
|
|
|
+ type="text"
|
|
|
+ icon={
|
|
|
+ <ShareAltOutlined style={{ color: "white", cursor: "pointer" }} />
|
|
|
+ }
|
|
|
+ />
|
|
|
</Dropdown>
|
|
|
<ExportModal
|
|
|
type={type}
|
|
|
@@ -85,13 +72,6 @@ const ShareButtonWidget = ({
|
|
|
open={exportOpen}
|
|
|
onClose={() => setExportOpen(false)}
|
|
|
/>
|
|
|
- {articleId ? (
|
|
|
- <AddToAnthology
|
|
|
- open={addToAnthologyOpen}
|
|
|
- onClose={(isOpen: boolean) => setAddToAnthologyOpen(isOpen)}
|
|
|
- articleIds={[articleId]}
|
|
|
- />
|
|
|
- ) : undefined}
|
|
|
</>
|
|
|
);
|
|
|
};
|