diff --git a/src/components/Article/ArticleParts/InteractionButtons/ArticleInteractionButtons.tsx b/src/components/Article/ArticleParts/InteractionButtons/ArticleInteractionButtons.tsx index 410d472..6301918 100755 --- a/src/components/Article/ArticleParts/InteractionButtons/ArticleInteractionButtons.tsx +++ b/src/components/Article/ArticleParts/InteractionButtons/ArticleInteractionButtons.tsx @@ -12,6 +12,7 @@ import { } from "components/icons"; import classNames from "classnames"; import { Transition } from "@headlessui/react"; +import Link from "components/typography/Link"; const interactionButtonsStore = [ { @@ -46,6 +47,7 @@ type ArticleButtonProps = { children?: React.ReactNode; className?: string; emphasis?: "high" | "low"; + articleID?: string, } & Omit, "">; export function ArticleInteractionButtons({ @@ -53,6 +55,7 @@ export function ArticleInteractionButtons({ children, openAbstract = () => { }, className, + articleID, emphasis = "high", //to change displaying of component ...props }: ArticleButtonProps) { @@ -70,18 +73,31 @@ export function ArticleInteractionButtons({ ); - const fileInteractionButtons = interactionButtonsStore.map((button) => { return ( - + button.title === 'Read file' ? + + + + : + ); }); diff --git a/src/components/ArticleSearchResult.tsx b/src/components/ArticleSearchResult.tsx index bce62e9..c569005 100644 --- a/src/components/ArticleSearchResult.tsx +++ b/src/components/ArticleSearchResult.tsx @@ -37,7 +37,7 @@ export const ArticleSearchResult = ({ searchItem }: Props) => { - + {searchItem.title} diff --git a/src/components/BaseLayout.tsx b/src/components/BaseLayout.tsx index 2c143c9..237777d 100755 --- a/src/components/BaseLayout.tsx +++ b/src/components/BaseLayout.tsx @@ -1,3 +1,4 @@ +import { joinClassnames } from "core/helpers"; import React from "react"; import { Footer } from "./parts/Footer"; import Header from "./parts/Header"; @@ -10,10 +11,10 @@ type Props = { function BaseLayout({ header, footer, children, className }: Props) { return ( -
+
-
{children}
+
{children}
diff --git a/src/components/fetchAnArticle/AnArticle.tsx b/src/components/fetchAnArticle/AnArticle.tsx index 240d53c..11c8d26 100644 --- a/src/components/fetchAnArticle/AnArticle.tsx +++ b/src/components/fetchAnArticle/AnArticle.tsx @@ -46,7 +46,10 @@ const AnArticle = () => {
- + {article?.tags && (
) => { } }; -export function capitalization (str: string) { - return str.substring(0,1).toUpperCase() + str.substring(1); +export function capitalization(str: string): string { + return str.substring(0, 1).toUpperCase() + str.substring(1); } -export function formatNumber(num: number) { +export function formatNumber(num: number): string { return num.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, '$1 '); +} + +export function joinClassnames(first?: string, second?: string): string { + return [ + first ?? '', + second ?? '', + ].join(''); } \ No newline at end of file diff --git a/src/index.tsx b/src/index.tsx index ed9b2e9..7e200b3 100755 --- a/src/index.tsx +++ b/src/index.tsx @@ -17,6 +17,8 @@ import { store } from "store/store"; import { Provider } from "react-redux"; import { SearchResultsPage } from "pages/SearchResultsPage"; import AnArticle from "components/fetchAnArticle/AnArticle"; +import NotFound from "components/fetchAnArticle/NotFound"; +import AnArticleBody from "components/fetchAnArticle/AnArticleBody"; const rootElement = document.getElementById("root"); if (!rootElement) throw new Error("Failed to find the root element"); @@ -33,7 +35,10 @@ root.render( } /> } /> } /> - } /> + + } /> + } /> + } /> diff --git a/src/pages/SearchResultsPage.tsx b/src/pages/SearchResultsPage.tsx index ca4e486..cca667b 100644 --- a/src/pages/SearchResultsPage.tsx +++ b/src/pages/SearchResultsPage.tsx @@ -13,7 +13,7 @@ export const SearchResultsPage = () => { -
left bar
+