From 46c4fece4101f06c0b24d68d306440c0a1583221 Mon Sep 17 00:00:00 2001 From: DrMint Date: Mon, 6 Jun 2022 22:51:45 +0200 Subject: [PATCH] Added missing translations --- src/components/AppLayout.tsx | 35 ++++++++++--------- src/components/Library/PreviewCardCTAs.tsx | 13 +++---- .../operations/getWebsiteInterface.graphql | 8 +++++ src/pages/contents/[slug]/index.tsx | 4 +-- src/pages/contents/index.tsx | 5 ++- src/pages/library/[slug]/index.tsx | 2 ++ src/pages/library/index.tsx | 13 ++++--- src/pages/news/index.tsx | 3 +- 8 files changed, 46 insertions(+), 37 deletions(-) diff --git a/src/components/AppLayout.tsx b/src/components/AppLayout.tsx index 880de69..aff196b 100644 --- a/src/components/AppLayout.tsx +++ b/src/components/AppLayout.tsx @@ -4,7 +4,7 @@ import { UploadImageFragment } from "graphql/generated"; import { AppStaticProps } from "graphql/getAppStaticProps"; import { prettyLanguage, prettySlug } from "helpers/formatters"; import { getOgImage, ImageQuality, OgImage } from "helpers/img"; -import { getClient, Indexes, search, SearchResult } from "helpers/search"; +// import { getClient, Indexes, search, SearchResult } from "helpers/search"; import { Immutable } from "helpers/types"; import { useMediaMobile } from "hooks/useMediaQuery"; import { AnchorIds } from "hooks/useScrollTopOnChange"; @@ -18,7 +18,6 @@ import { Select } from "./Inputs/Select"; import { TextInput } from "./Inputs/TextInput"; import { MainPanel } from "./Panels/MainPanel"; import { Popup } from "./Popup"; -import { PreviewCard } from "./PreviewCard"; interface Props extends AppStaticProps { subPanel?: React.ReactNode; @@ -47,8 +46,10 @@ export function AppLayout(props: Immutable): JSX.Element { const isMobile = useMediaMobile(); const appLayout = useAppLayout(); - const [searchQuery, setSearchQuery] = useState(""); - const [searchResult, setSearchResult] = useState(); + /* + * const [searchQuery, setSearchQuery] = useState(""); + * const [searchResult, setSearchResult] = useState(); + */ const sensibilitySwipe = 1.1; @@ -88,19 +89,19 @@ export function AppLayout(props: Immutable): JSX.Element { }, }); - const client = getClient(); - - useEffect(() => { - if (searchQuery.length > 1) { - search(client, Indexes.Post, searchQuery).then((result) => { - setSearchResult(result); - }); - } else { - setSearchResult(undefined); - } - - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [searchQuery]); + /* + * const client = getClient(); + * useEffect(() => { + * if (searchQuery.length > 1) { + * search(client, Indexes.Post, searchQuery).then((result) => { + * setSearchResult(result); + * }); + * } else { + * setSearchResult(undefined); + * } + * // eslint-disable-next-line react-hooks/exhaustive-deps + * }, [searchQuery]); + */ const turnSubIntoContent = subPanel && !contentPanel; diff --git a/src/components/Library/PreviewCardCTAs.tsx b/src/components/Library/PreviewCardCTAs.tsx index 18a1cda..913ac16 100644 --- a/src/components/Library/PreviewCardCTAs.tsx +++ b/src/components/Library/PreviewCardCTAs.tsx @@ -2,16 +2,18 @@ import { Icon } from "components/Ico"; import { Button } from "components/Inputs/Button"; import { ToolTip } from "components/ToolTip"; import { useAppLayout } from "contexts/AppLayoutContext"; +import { AppStaticProps } from "graphql/getAppStaticProps"; import { LibraryItemUserStatus } from "helpers/types"; interface Props { id: string | null | undefined; displayCTAs: boolean; expand?: boolean; + langui: AppStaticProps["langui"]; } export function PreviewCardCTAs(props: Props): JSX.Element { - const { id, displayCTAs, expand = false } = props; + const { id, displayCTAs, expand = false, langui } = props; const appLayout = useAppLayout(); return ( @@ -22,11 +24,10 @@ export function PreviewCardCTAs(props: Props): JSX.Element { expand ? "gap-4" : "gap-2" }`} > - {/* TODO: Add to langui */} - +