From 4bd90cdb4bf101582086d98dbdf4c4eb60a8b7a5 Mon Sep 17 00:00:00 2001 From: Andrei Dekterev Date: Wed, 30 Mar 2022 20:05:25 +0700 Subject: [PATCH] fix(#2352 and 2354): add bulgarian language and fix preview images --- src/config/languages.tsx | 5 +++++ .../AuthServiceApp/components/LanguageSelect/styled.tsx | 1 + src/features/MatchCard/CardFrontside/hooks.tsx | 2 ++ src/react-app-env.d.ts | 2 +- 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/config/languages.tsx b/src/config/languages.tsx index be20c61a..6bf78545 100644 --- a/src/config/languages.tsx +++ b/src/config/languages.tsx @@ -59,6 +59,11 @@ export const langsList = [ locale: 'zh', title: '中文', }, + { + className: 'bg', + locale: 'bg', + title: 'Български', + }, ] as const export type Languages = typeof langsList[number]['locale'] diff --git a/src/features/AuthServiceApp/components/LanguageSelect/styled.tsx b/src/features/AuthServiceApp/components/LanguageSelect/styled.tsx index 8bced6fa..1621ccff 100644 --- a/src/features/AuthServiceApp/components/LanguageSelect/styled.tsx +++ b/src/features/AuthServiceApp/components/LanguageSelect/styled.tsx @@ -115,6 +115,7 @@ type Position = { } const flagPositions: Record = { + bg: { col: 10, row: 1 }, cz: { col: 1, row: 3 }, de: { col: 5, row: 4 }, es: { col: 12, row: 10 }, diff --git a/src/features/MatchCard/CardFrontside/hooks.tsx b/src/features/MatchCard/CardFrontside/hooks.tsx index 24431de6..756a45e8 100644 --- a/src/features/MatchCard/CardFrontside/hooks.tsx +++ b/src/features/MatchCard/CardFrontside/hooks.tsx @@ -24,6 +24,8 @@ export const useCardPreview = ({ useEffect(() => { (async () => { + if (!currentPreviewURL) return + const image = await fetch(String(currentPreviewURL), { headers: { Authorization: `Bearer ${readToken()}`, diff --git a/src/react-app-env.d.ts b/src/react-app-env.d.ts index 4fdbd7a9..42a9c0f5 100644 --- a/src/react-app-env.d.ts +++ b/src/react-app-env.d.ts @@ -5,7 +5,7 @@ declare namespace NodeJS { export interface ProcessEnv { REACT_APP_CLIENT: 'instat' | 'facr', REACT_APP_ENV: 'production' | 'preproduction' | 'staging', - REACT_APP_STAGE: 'staging' | 'a-staging' | 'b-staging' | 'c-staging' | 'd-staging', + REACT_APP_STAGE: 'staging' | 'a-staging' | 'b-staging' | 'c-staging' | 'd-staging' | 'e-staging', REACT_APP_TYPE: 'auth-service' | 'ott', } }