From 06d82e113398f3e1e89827b619619092ac0402f2 Mon Sep 17 00:00:00 2001 From: DrMint <29893320+DrMint@users.noreply.github.com> Date: Fri, 12 May 2023 12:52:52 +0200 Subject: [PATCH] Small fixes --- .env.example | 6 +++--- public/local-data/websiteInterfaces.json | 15 ++++++++++----- src/components/Panels/SearchPopup.tsx | 2 +- src/graphql/icuParams.ts | 1 + .../localDataGetWebsiteInterfaces.graphql | 1 + src/helpers/libraryItem.ts | 3 +++ src/helpers/videos.ts | 4 ++-- src/pages/archives/videos/c/[uid].tsx | 2 +- src/pages/archives/videos/index.tsx | 3 ++- src/pages/archives/videos/v/[uid].tsx | 14 +++++++++----- src/pages/contents/all.tsx | 2 +- src/pages/library/[slug]/index.tsx | 4 ++-- src/pages/library/[slug]/reader.tsx | 3 ++- src/pages/library/index.tsx | 2 +- src/pages/news/index.tsx | 2 +- src/pages/wiki/index.tsx | 2 +- src/pages/wiki/weapons/index.tsx | 2 +- 17 files changed, 42 insertions(+), 26 deletions(-) diff --git a/.env.example b/.env.example index b1315e0..2ca96f3 100755 --- a/.env.example +++ b/.env.example @@ -1,4 +1,4 @@ -# /!\ For URLs, don't include the traling '/' +# /!\ For URLs, don't include the trailing '/' # ┌─────────────────────┐ # │ PRIVATE VARIABLES │ @@ -26,9 +26,9 @@ SMTP_PASSWORD=mypassword123 NEXT_PUBLIC_URL_CMS=https://url-to.strapi-accords-library.com NEXT_PUBLIC_URL_IMG=https://url-to.img-accords-library.com -NEXT_PUBLIC_URL_WATCH=https://url-to.watch-accords-library.com NEXT_PUBLIC_URL_SELF=https://url-to-front-accords-library.com -NEXT_PUBLIC_URL_SCANS_DOWNLOAD=https://url-to.search-accords-library.com +NEXT_PUBLIC_URL_SCANS=https://url-to.scans-accords-library.com/ +NEXT_PUBLIC_URL_VIDEOS=https://url-to.videos-accords-library.com/ ## MEILISEARCH diff --git a/public/local-data/websiteInterfaces.json b/public/local-data/websiteInterfaces.json index 3b6890a..bfc7ea6 100644 --- a/public/local-data/websiteInterfaces.json +++ b/public/local-data/websiteInterfaces.json @@ -186,7 +186,8 @@ "level_x": "Level {x}", "story_x": "Story {x}", "player_name_tooltip": "Certain in-game texts use the player's name as part of the dialogue/narration. If you want to see your name in the transcript found on this website, feel free to enter your player's name here. If left empty, '(player)' will be used instead.", - "download_scans": "Download scans" + "download_scans": "Download scans", + "search_placeholder": "Search..." } }, { @@ -374,7 +375,8 @@ "level_x": "Niveau {x}", "story_x": "Histoire {x}", "player_name_tooltip": "Certains textes dans les jeux utilisent le nom du joueur dans les dialogue/la narration. Si vous voulez voir votre nom dans les transcriptions se trouvant sur ce site web, n'hésitez pas à entrer votre nom de joueur ici. S'il n'est pas renseigné, '(player)' sera utilisé à la place.", - "download_scans": "Télécharger les scans" + "download_scans": "Télécharger les scans", + "search_placeholder": "Rechercher ..." } }, { @@ -562,7 +564,8 @@ "level_x": null, "story_x": null, "player_name_tooltip": null, - "download_scans": null + "download_scans": null, + "search_placeholder": null } }, { @@ -750,7 +753,8 @@ "level_x": null, "story_x": null, "player_name_tooltip": null, - "download_scans": null + "download_scans": null, + "search_placeholder": null } }, { @@ -938,7 +942,8 @@ "level_x": null, "story_x": null, "player_name_tooltip": null, - "download_scans": null + "download_scans": null, + "search_placeholder": null } } ] diff --git a/src/components/Panels/SearchPopup.tsx b/src/components/Panels/SearchPopup.tsx index 8f5bbcf..a991da5 100644 --- a/src/components/Panels/SearchPopup.tsx +++ b/src/components/Panels/SearchPopup.tsx @@ -212,7 +212,7 @@ export const SearchPopup = (): JSX.Element => { ref={searchInputRef} onChange={fetchSearchResults} value={query} - placeholder={format("search_title")} + placeholder={format("search_placeholder")} />
diff --git a/src/graphql/icuParams.ts b/src/graphql/icuParams.ts index a99db81..0e11bc0 100644 --- a/src/graphql/icuParams.ts +++ b/src/graphql/icuParams.ts @@ -185,4 +185,5 @@ export interface ICUParams { story_x: { x: Date | boolean | number | string }; player_name_tooltip: never; download_scans: never; + search_placeholder: never; } diff --git a/src/graphql/operations/local-data/localDataGetWebsiteInterfaces.graphql b/src/graphql/operations/local-data/localDataGetWebsiteInterfaces.graphql index 7b58d10..070ea4c 100644 --- a/src/graphql/operations/local-data/localDataGetWebsiteInterfaces.graphql +++ b/src/graphql/operations/local-data/localDataGetWebsiteInterfaces.graphql @@ -192,6 +192,7 @@ query localDataGetWebsiteInterfaces { story_x player_name_tooltip download_scans + search_placeholder } } } diff --git a/src/helpers/libraryItem.ts b/src/helpers/libraryItem.ts index 48642a5..9415855 100644 --- a/src/helpers/libraryItem.ts +++ b/src/helpers/libraryItem.ts @@ -13,3 +13,6 @@ export const isUntangibleGroupItem = ( metadata.__typename === "ComponentMetadataGroup" && (metadata.subtype?.data?.attributes?.slug === "variant-set" || metadata.subtype?.data?.attributes?.slug === "relation-set"); + +export const getScanArchiveURL = (slug: string): string => + `${process.env.NEXT_PUBLIC_URL_SCANS}/${slug}.zip`; diff --git a/src/helpers/videos.ts b/src/helpers/videos.ts index 5d46fe3..68292f2 100644 --- a/src/helpers/videos.ts +++ b/src/helpers/videos.ts @@ -1,5 +1,5 @@ export const getVideoThumbnailURL = (uid: string): string => - `${process.env.NEXT_PUBLIC_URL_WATCH}/videos/${uid}.webp`; + `${process.env.NEXT_PUBLIC_URL_VIDEOS}/${uid}.webp`; export const getVideoFile = (uid: string): string => - `${process.env.NEXT_PUBLIC_URL_WATCH}/videos/${uid}.mp4`; + `${process.env.NEXT_PUBLIC_URL_VIDEOS}/${uid}.mp4`; diff --git a/src/pages/archives/videos/c/[uid].tsx b/src/pages/archives/videos/c/[uid].tsx index df06c9c..206b207 100644 --- a/src/pages/archives/videos/c/[uid].tsx +++ b/src/pages/archives/videos/c/[uid].tsx @@ -168,7 +168,7 @@ const Channel = ({ channel, ...otherProps }: Props): JSX.Element => { { setPage(1); diff --git a/src/pages/archives/videos/index.tsx b/src/pages/archives/videos/index.tsx index bbdea5f..dea87d9 100644 --- a/src/pages/archives/videos/index.tsx +++ b/src/pages/archives/videos/index.tsx @@ -160,7 +160,7 @@ const Videos = ({ ...otherProps }: Props): JSX.Element => { { setPage(1); @@ -195,6 +195,7 @@ const Videos = ({ ...otherProps }: Props): JSX.Element => { { + setPage(1); toggleOnlyShowGone(); }} /> diff --git a/src/pages/archives/videos/v/[uid].tsx b/src/pages/archives/videos/v/[uid].tsx index eee3e08..d3dd69e 100644 --- a/src/pages/archives/videos/v/[uid].tsx +++ b/src/pages/archives/videos/v/[uid].tsx @@ -18,7 +18,6 @@ import { getVideoFile } from "helpers/videos"; import { getOpenGraph } from "helpers/openGraph"; import { atoms } from "contexts/atoms"; import { useAtomGetter, useAtomSetter } from "helpers/atoms"; -import { Link } from "components/Inputs/Link"; import { useFormat } from "hooks/useFormat"; import { getFormat } from "helpers/i18n"; @@ -80,7 +79,7 @@ const Video = ({ video, ...otherProps }: Props): JSX.Element => {

{video.title}

-
+

{prettyDate(video.published_date, router.locale)} @@ -99,9 +98,14 @@ const Video = ({ video, ...otherProps }: Props): JSX.Element => { : prettyShortenNumber(video.likes)}

)} - -
diff --git a/src/pages/contents/all.tsx b/src/pages/contents/all.tsx index 6c7549e..fa3bf4e 100644 --- a/src/pages/contents/all.tsx +++ b/src/pages/contents/all.tsx @@ -142,7 +142,7 @@ const Contents = (props: Props): JSX.Element => { { setPage(1); diff --git a/src/pages/library/[slug]/index.tsx b/src/pages/library/[slug]/index.tsx index b529f78..c010f89 100644 --- a/src/pages/library/[slug]/index.tsx +++ b/src/pages/library/[slug]/index.tsx @@ -38,7 +38,7 @@ import { isDefinedAndNotEmpty, } from "helpers/asserts"; import { useScrollTopOnChange } from "hooks/useScrollTopOnChange"; -import { isUntangibleGroupItem } from "helpers/libraryItem"; +import { getScanArchiveURL, isUntangibleGroupItem } from "helpers/libraryItem"; import { useDeviceSupportsHover } from "hooks/useMediaQuery"; import { WithLabel } from "components/Inputs/WithLabel"; import { cJoin, cIf } from "helpers/className"; @@ -533,7 +533,7 @@ const LibrarySlug = ({ item, itemId, ...otherProps }: Props): JSX.Element => { )} {item.download_available && (