refactor: countdown view redesign

- allow selecting multiple events
- follow selected
- remove past events
This commit is contained in:
Carlos Valente
2025-06-03 21:45:17 +02:00
committed by Carlos Valente
parent 93977ebc48
commit b2b115c329
22 changed files with 955 additions and 672 deletions
@@ -28,8 +28,10 @@ const translationsList = {
zh: langZhCn,
};
export type TranslationKey = keyof typeof langEn;
interface TranslationContextValue {
getLocalizedString: (key: keyof typeof langEn, lang?: string) => string;
getLocalizedString: (key: TranslationKey, lang?: string) => string;
}
const TranslationContext = createContext<TranslationContextValue>({
@@ -40,7 +42,7 @@ export const TranslationProvider = ({ children }: PropsWithChildren) => {
const { data } = useSettings();
const getLocalizedString = useCallback(
(key: keyof typeof langEn, lang = data?.language || 'en'): string => {
(key: TranslationKey, lang = data?.language || 'en'): string => {
if (lang in translationsList) {
if (key in translationsList[lang as keyof typeof translationsList]) {
return translationsList[lang as keyof typeof translationsList][key];