diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json index 133ea55..56f2981 100755 --- a/public/locales/en/translation.json +++ b/public/locales/en/translation.json @@ -1,7 +1,7 @@ { "serv": { - "goHome": "Home", - "noSuchPath": "We don't have this page" + "goHome": "Home page", + "noSuchPath": "We don't have such a page" }, "sidemenu": { "dashboard": "Dashboard", @@ -19,45 +19,110 @@ "hellousr": "Hello, {{username}}", "edit": "Edit", "language": "Language", - "selectLanguage": "Select language", + "selectLanguage": "Select a language", "save": "Save", "cancel": "Cancel", "account": { - "info": "Personal information", + "info": "Personal Information", "mail": "Mail", - "connect": "Add account", - "connectedAccounts_one": "Connected account", - "connectedAccounts_other": "Connected accounts", - "settings": "Account settings" + "connect": "Add Account", + "connectedAccounts_one": "Linked Account", + "connectedAccounts_other": "Linked Accounts", + "settings": "Account Settings" }, "security": { "password": { "caption": "Password", - "twoFactor": "Two factor authentication (2FA)", - "description": "Keep your account secure by enabling 2FA via SMS or using a temporary one-time passcode (TOTP) from an authenticator app." + "twoFactor": "Two-factor authentication (2FA)", + "description": "Protect your account by enabling 2FA via SMS or using a temporary one-time password (OTP) from the authentication app." }, "activity": { "caption": "Device activity" } }, "search": { - "label": "Search for something.." + "label": "We will find something.." }, "subscriptions": { - "subscribed": "Service have been connected" + "subscribed": "The service is attached to the account" }, "viewHistory": "View history", - "logOutEverywhere": "log out from all devices", + "logOutEverywhere": "Log out from all devices", "back": "Back", - "logOut": "Log out", + "logOut": "Exit", "failures": { "subscriptions": { - "failure": "Failed to connect service", - "exists": "Service have already been connected", - "confirmation": "Invalid confirmation information provided" + "failure": "Failed to attach the service to your account", + "exists": "The service was already attached to your account earlier", + "confirmation": "Invalid password" }, "services": { - "fork": "Failed to authenticate in service" + "fork": "Failed to perform authorization in the service" } + }, + "articlePage": { + "abstract": "Abstract", + "keywords": "Keywords" + }, + "navbar": { + "createNew": "Create an article", + "about": { + "navTitle": "About the project", + "aboutProject": "About Scipaper", + "contacts": "Contacts", + "help": "Help" + }, + "library": { + "navTitle": "My library", + "publications": "Publications", + "favorites": "Favorites", + "collections": "Collections", + "recentViewed": "History" + }, + "auth": { + "signIn": "Sign In", + "signUp": "Sign Up" + } + }, + "footer": { + "accountSettings": "Account Settings", + "about": "About Scipaper", + "help": "Help", + "contactUs": "Contacts", + "allRightsReserved": "All rights reserved", + "termsOfUse": "Terms of Use", + "privacyPolicy": "Privacy Policy", + "coockiesPolicy": "coockies Usage Policy", + "supportedBy": "Created" + }, + "mainPage": { + "title": "Scientific Library with free access", + "search": "Search", + "article_one": "Articles", + "article_few": "Articles", + "article_many": "Articles", + "advancedSearch": "Advanced search", + "featuredArticles": { + "title": "Popular articles", + "descriptionPart1": "Choose the one you are interested in", + "descriptionPart2": "Scientific category", + "categories": { + "Medical": "Medical", + "TechnicsAndTechlonogies": "Technics and Technology", + "Fundamental": "Fundamental", + "Humanitarian": "Humanitarian", + "Agricultural": "Agricultural", + "Social": "Social" + } + }, + "featuredAuthors": "Popular authors", + "more": "More", + "showAll": "Show all" + }, + "searchResults": { + "title": "Search results", + "totalResults":"Total results", + "nothingFound": "Nothing found" } -} \ No newline at end of file + +} 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/MainPage/sections/FeaturedArticlesCards.tsx b/src/components/MainPage/sections/FeaturedArticlesCards.tsx index bfb2a07..78f10f9 100755 --- a/src/components/MainPage/sections/FeaturedArticlesCards.tsx +++ b/src/components/MainPage/sections/FeaturedArticlesCards.tsx @@ -98,10 +98,10 @@ const FeaturedArticlesCards = () => { const navigationPrevRef = useRef(null); const navigationNextRef = useRef(null); const paginationRef = useRef(null); - const [t, i18next] = useTranslation() + const [t, i18next] = useTranslation(); return ( -
+
{t("mainPage.featuredAuthors")} + + {t("mainPage.featuredAuthors")} + {/* Featured Authors section */} -
+
- {t('mainPage.more')} + {t("mainPage.more")} diff --git a/src/components/fetchAnArticle/AnArticle.tsx b/src/components/fetchAnArticle/AnArticle.tsx index 240d53c..73a8f91 100644 --- a/src/components/fetchAnArticle/AnArticle.tsx +++ b/src/components/fetchAnArticle/AnArticle.tsx @@ -33,7 +33,7 @@ const AnArticle = () => { ) : ( <> - + {article?.topic}
@@ -46,28 +46,24 @@ const AnArticle = () => {
- + {article?.tags && (
- - {t('articlePage.keywords')} + + {t("articlePage.keywords")} - {article?.tags}
)}
- - {t('articlePage.abstract')} + + {t("articlePage.abstract")} {article?.summary !== undefined ? ( diff --git a/src/components/fetchAnArticle/AnArticleBody.tsx b/src/components/fetchAnArticle/AnArticleBody.tsx index 55d7f95..0329981 100644 --- a/src/components/fetchAnArticle/AnArticleBody.tsx +++ b/src/components/fetchAnArticle/AnArticleBody.tsx @@ -27,7 +27,7 @@ const AnArticleBody = () => { {shouldShowLoading ? ( <> - +
{ ) : ( <> - + {article?.topic}
diff --git a/src/components/fetchAnArticle/AskeletonArticle.tsx b/src/components/fetchAnArticle/AskeletonArticle.tsx index f0b9702..d8bdcfc 100644 --- a/src/components/fetchAnArticle/AskeletonArticle.tsx +++ b/src/components/fetchAnArticle/AskeletonArticle.tsx @@ -3,7 +3,7 @@ import "react-loading-skeleton/dist/skeleton.css"; const AskeletonArticle = () => { return ( <> - +
diff --git a/src/components/typography/Link.tsx b/src/components/typography/Link.tsx index c01bb6b..8b55a57 100755 --- a/src/components/typography/Link.tsx +++ b/src/components/typography/Link.tsx @@ -51,6 +51,7 @@ export default function Link({ : style } aria-disabled={disabled} + className="flex items-center" {...props} > {children} diff --git a/src/core/helpers.ts b/src/core/helpers.ts index c655cd5..fe40fa8 100755 --- a/src/core/helpers.ts +++ b/src/core/helpers.ts @@ -8,10 +8,17 @@ export const handleScrollTo = (e: React.MouseEvent) => { } }; -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..9f61062 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,11 +35,15 @@ root.render( } /> } /> } /> - } /> + + } /> + } /> + } /> - }> + } /> + }> diff --git a/src/pages/SearchResultsPage.tsx b/src/pages/SearchResultsPage.tsx index 94217a7..e6d3f35 100644 --- a/src/pages/SearchResultsPage.tsx +++ b/src/pages/SearchResultsPage.tsx @@ -14,7 +14,7 @@ export const SearchResultsPage = () => { -
+