- {emphasis === "low" && !children ? abstractButton : null}
- {children ? children : fileInteractionButtons}
+
+ {emphasis != "high" && abstractButton}
+ {readFileButton}
+ {downLoadButton}
+ {citeButton}
+
);
}
diff --git a/src/components/Article/ArticleParts/InteractionButtons/ArticleShareButton.tsx b/src/components/Article/ArticleParts/InteractionButtons/ArticleShareButton.tsx
new file mode 100644
index 0000000..4a5c734
--- /dev/null
+++ b/src/components/Article/ArticleParts/InteractionButtons/ArticleShareButton.tsx
@@ -0,0 +1,87 @@
+import { BASE_URL } from "core/httpClient";
+import { useRef, useState } from "react";
+import { useTranslation } from "react-i18next";
+import { Button } from "../../../Button/Button";
+import { SVGCopy, SVGShare, SVGXmark } from "../../../icons";
+import Typography from "../../../typography/Typography";
+import { CopyToClipboard } from "react-copy-to-clipboard";
+import { Popover } from "@headlessui/react";
+
+type Props = {
+ emphasis?: "high" | "low";
+ linktoCopy?: string;
+};
+
+export function ShareButton({ emphasis, linktoCopy }: Props) {
+ const [t, i18next] = useTranslation("translation", {
+ keyPrefix: "articlePage.interactionButtons",
+ });
+ const [copied, setCopied] = useState(false);
+
+ const copyValue =
+ BASE_URL != undefined && linktoCopy != undefined
+ ? BASE_URL + linktoCopy
+ : t("searchResults.nothingFound");
+
+ function onCopy() {
+ setCopied(true);
+ setTimeout(() => {
+ setCopied(false);
+ }, 1500);
+ };
+
+ const handleFocus = (event: any) => event.target.select();
+
+ return (
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {copied && (
+
+ {t("copied")}
+
+ )}
+
+
+
+
+
+
+
+ );
+}
diff --git a/src/components/ArticleSearchResult.tsx b/src/components/ArticleSearchResult.tsx
index c569005..a1571be 100644
--- a/src/components/ArticleSearchResult.tsx
+++ b/src/components/ArticleSearchResult.tsx
@@ -47,10 +47,11 @@ export const ArticleSearchResult = ({ searchItem }: Props) => {
{searchItem.tags}
);
- return {link}
;
+ return link;
}
diff --git a/src/core/httpClient.ts b/src/core/httpClient.ts
index 3b4d76b..83f7924 100755
--- a/src/core/httpClient.ts
+++ b/src/core/httpClient.ts
@@ -1,5 +1,5 @@
import axios from "axios";
-const BASE_URL = process.env.REACT_APP_INTEGRATOR_URL;
+export const BASE_URL = process.env.REACT_APP_INTEGRATOR_URL;
export const GRAPHQL_URL = process.env.REACT_APP_GRAPHQL_URL ?? "";
const instance = axios.create({
diff --git a/src/pages/SearchResultsPage.tsx b/src/pages/SearchResultsPage.tsx
index e6d3f35..00f7833 100644
--- a/src/pages/SearchResultsPage.tsx
+++ b/src/pages/SearchResultsPage.tsx
@@ -3,9 +3,6 @@ import BaseLayout from "components/BaseLayout";
import { SearchSection } from "components/SearchSection";
import { ColumnLayout } from "components/layouts/ThreeColumn/ColumnLayout";
import { SearchResultSection } from "components/SearchResultsSection";
-import { useSearchStoreImplementation } from "searchResults/data/searchStoreImplementation";
-import { useSearchViewModel } from "searchResults/controller/searchResultsViewModel";
-import { Loader } from "components/Loader/Loader";
import Fiter from "components/Filters/Filter";
export const SearchResultsPage = () => {
@@ -14,7 +11,7 @@ export const SearchResultsPage = () => {
-
+
diff --git a/src/searchResults/data/searchService.ts b/src/searchResults/data/searchService.ts
index dbf0cf6..0ddc137 100755
--- a/src/searchResults/data/searchService.ts
+++ b/src/searchResults/data/searchService.ts
@@ -10,7 +10,7 @@ const searchEndpoint = "/papers/search";
async function search(request: string): Promise {
try {
const response = await integratorApiClient.get(
- // searchEndpoint + `?query=` + request + `&limit=10&offset=0`
+ // searchEndpoint + `?query=` + request
"https://run.mocky.io/v3/ea705665-2479-4039-8b81-412e011fc145"
);
const dto = response.data;