Fixed typing errors and cleanup of debounce in useEffect

This commit is contained in:
Kelvin 2025-01-11 14:59:49 -03:00
parent 0f5910756b
commit ca7bc62285
28 changed files with 31 additions and 30 deletions

View file

@ -48,7 +48,7 @@
"catalogue": { "catalogue": {
"next_page": "الصفحة التالية", "next_page": "الصفحة التالية",
"previous_page": "الصفحة السابقة", "previous_page": "الصفحة السابقة",
"go_up_buttom": "العودة إلى الأعلى" "go_up_button": "العودة إلى الأعلى"
}, },
"game_details": { "game_details": {
"open_download_options": "افتح خيارات التنزيل", "open_download_options": "افتح خيارات التنزيل",

View file

@ -32,7 +32,7 @@
"catalogue": { "catalogue": {
"next_page": "Наступная старонка", "next_page": "Наступная старонка",
"previous_page": "Папярэдняя старонка", "previous_page": "Папярэдняя старонка",
"go_up_buttom": "Вярнуцца да пачатку" "go_up_button": "Вярнуцца да пачатку"
}, },
"game_details": { "game_details": {
"open_download_options": "Адкрыць варыянты сцягвання", "open_download_options": "Адкрыць варыянты сцягвання",

View file

@ -48,7 +48,7 @@
"catalogue": { "catalogue": {
"next_page": "Следваща страница", "next_page": "Следваща страница",
"previous_page": "Предишна страница", "previous_page": "Предишна страница",
"go_up_buttom": "Обратно към върха" "go_up_button": "Обратно към върха"
}, },
"game_details": { "game_details": {
"open_download_options": "Варианти за изтегляне", "open_download_options": "Варианти за изтегляне",

View file

@ -42,7 +42,7 @@
"catalogue": { "catalogue": {
"next_page": "Pàgina següent", "next_page": "Pàgina següent",
"previous_page": "Pàgina anterior", "previous_page": "Pàgina anterior",
"go_up_buttom": "Torneu a la part superior" "go_up_button": "Torneu a la part superior"
}, },
"game_details": { "game_details": {
"open_download_options": "Obre les opcions de baixada", "open_download_options": "Obre les opcions de baixada",

View file

@ -48,7 +48,7 @@
"catalogue": { "catalogue": {
"next_page": "Další strana", "next_page": "Další strana",
"previous_page": "Předchozí strana", "previous_page": "Předchozí strana",
"go_up_buttom": "Vraťte se na vrchol" "go_up_button": "Vraťte se na vrchol"
}, },
"game_details": { "game_details": {
"open_download_options": "Otevřít možnosti stahování", "open_download_options": "Otevřít možnosti stahování",

View file

@ -46,7 +46,7 @@
"catalogue": { "catalogue": {
"next_page": "Næste side", "next_page": "Næste side",
"previous_page": "Forrige side", "previous_page": "Forrige side",
"go_up_buttom": "Gå tilbage til toppen" "go_up_button": "Gå tilbage til toppen"
}, },
"game_details": { "game_details": {
"open_download_options": "Åben download muligheder", "open_download_options": "Åben download muligheder",

View file

@ -42,7 +42,7 @@
"catalogue": { "catalogue": {
"next_page": "Nächste Seite", "next_page": "Nächste Seite",
"previous_page": "Vorherige Seite", "previous_page": "Vorherige Seite",
"go_up_buttom": "Zurück nach oben gehen" "go_up_button": "Zurück nach oben gehen"
}, },
"game_details": { "game_details": {
"open_download_options": "Download-Optionen öffnen", "open_download_options": "Download-Optionen öffnen",

View file

@ -55,7 +55,7 @@
"result_count": "{{resultCount}} results", "result_count": "{{resultCount}} results",
"filter_count": "{{filterCount}} available", "filter_count": "{{filterCount}} available",
"clear_filters": "Clear {{filterCount}} selected", "clear_filters": "Clear {{filterCount}} selected",
"go_up_buttom": "Back to top" "go_up_button": "Back to top"
}, },
"game_details": { "game_details": {
"open_download_options": "Open download options", "open_download_options": "Open download options",

View file

@ -55,7 +55,7 @@
"result_count": "{{resultCount}} resultados", "result_count": "{{resultCount}} resultados",
"filter_count": "{{filterCount}} disponibles", "filter_count": "{{filterCount}} disponibles",
"clear_filters": "Limpiar {{filterCount}} seleccionados", "clear_filters": "Limpiar {{filterCount}} seleccionados",
"go_up_buttom": "Vuelve a la cima" "go_up_button": "Vuelve a la cima"
}, },
"game_details": { "game_details": {
"open_download_options": "Ver opciones de descargas", "open_download_options": "Ver opciones de descargas",

View file

@ -47,7 +47,7 @@
"catalogue": { "catalogue": {
"next_page": "Järgmine leht", "next_page": "Järgmine leht",
"previous_page": "Eelmine leht", "previous_page": "Eelmine leht",
"go_up_buttom": "Minge tippu" "go_up_button": "Minge tippu"
}, },
"game_details": { "game_details": {
"open_download_options": "Ava allalaadimise valikud", "open_download_options": "Ava allalaadimise valikud",

View file

@ -32,7 +32,7 @@
"catalogue": { "catalogue": {
"next_page": "صفحه‌ی بعدی", "next_page": "صفحه‌ی بعدی",
"previous_page": "صفحه‌ی قبلی", "previous_page": "صفحه‌ی قبلی",
"go_up_buttom": "به بالا برگردید" "go_up_button": "به بالا برگردید"
}, },
"game_details": { "game_details": {
"open_download_options": "بازکردن آپشن‌های دانلود", "open_download_options": "بازکردن آپشن‌های دانلود",

View file

@ -121,6 +121,6 @@
"catalogue": { "catalogue": {
"next_page": "Page suivante", "next_page": "Page suivante",
"previous_page": "Page précédente", "previous_page": "Page précédente",
"go_up_buttom": "Retourner au sommet" "go_up_button": "Retourner au sommet"
} }
} }

View file

@ -32,7 +32,7 @@
"catalogue": { "catalogue": {
"next_page": "Következő olda", "next_page": "Következő olda",
"previous_page": "Előző olda", "previous_page": "Előző olda",
"go_up_buttom": "Menj vissza a tetejére" "go_up_button": "Menj vissza a tetejére"
}, },
"game_details": { "game_details": {
"open_download_options": "Letöltési lehetőségek", "open_download_options": "Letöltési lehetőségek",

View file

@ -42,7 +42,7 @@
"catalogue": { "catalogue": {
"next_page": "Halaman Berikutnya", "next_page": "Halaman Berikutnya",
"previous_page": "Halaman Sebelumnya", "previous_page": "Halaman Sebelumnya",
"go_up_buttom": "Kembali ke atas" "go_up_button": "Kembali ke atas"
}, },
"game_details": { "game_details": {
"open_download_options": "Buka opsi unduhan", "open_download_options": "Buka opsi unduhan",

View file

@ -32,7 +32,7 @@
"catalogue": { "catalogue": {
"next_page": "Pagina successiva", "next_page": "Pagina successiva",
"previous_page": "Pagina precedente", "previous_page": "Pagina precedente",
"go_up_buttom": "Torna in cima" "go_up_button": "Torna in cima"
}, },
"game_details": { "game_details": {
"open_download_options": "Apri opzioni di download", "open_download_options": "Apri opzioni di download",

View file

@ -41,7 +41,7 @@
"catalogue": { "catalogue": {
"next_page": "Келесі бет", "next_page": "Келесі бет",
"previous_page": "Алдыңғы бет", "previous_page": "Алдыңғы бет",
"go_up_buttom": "Жоғарыға оралу" "go_up_button": "Жоғарыға оралу"
}, },
"game_details": { "game_details": {
"open_download_options": "Жүктеу нұсқаларын ашу", "open_download_options": "Жүктеу нұсқаларын ашу",

View file

@ -32,7 +32,7 @@
"catalogue": { "catalogue": {
"next_page": "다음 페이지", "next_page": "다음 페이지",
"previous_page": "이전 페이지", "previous_page": "이전 페이지",
"go_up_buttom": "상단으로 돌아갑니다" "go_up_button": "상단으로 돌아갑니다"
}, },
"game_details": { "game_details": {
"open_download_options": "다운로드 선택지 열기", "open_download_options": "다운로드 선택지 열기",

View file

@ -46,7 +46,7 @@
"catalogue": { "catalogue": {
"next_page": "Neste side", "next_page": "Neste side",
"previous_page": "Forrige side", "previous_page": "Forrige side",
"go_up_buttom": "Gå tilbake til toppen" "go_up_button": "Gå tilbake til toppen"
}, },
"game_details": { "game_details": {
"open_download_options": "Åpne nedlastingsmuligheter", "open_download_options": "Åpne nedlastingsmuligheter",

View file

@ -32,7 +32,7 @@
"catalogue": { "catalogue": {
"next_page": "Volgende Pagina", "next_page": "Volgende Pagina",
"previous_page": "Vorige Pagina", "previous_page": "Vorige Pagina",
"go_up_buttom": "Ga terug naar de top" "go_up_button": "Ga terug naar de top"
}, },
"game_details": { "game_details": {
"open_download_options": "Open download Instellingen", "open_download_options": "Open download Instellingen",

View file

@ -32,7 +32,7 @@
"catalogue": { "catalogue": {
"next_page": "Następna strona", "next_page": "Następna strona",
"previous_page": "Poprzednia strona", "previous_page": "Poprzednia strona",
"go_up_buttom": "Wróć na szczyt" "go_up_button": "Wróć na szczyt"
}, },
"game_details": { "game_details": {
"open_download_options": "Otwórz opcje pobierania", "open_download_options": "Otwórz opcje pobierania",

View file

@ -296,7 +296,7 @@
"result_count": "{{resultCount}} resultados", "result_count": "{{resultCount}} resultados",
"filter_count": "{{filterCount}} disponíveis", "filter_count": "{{filterCount}} disponíveis",
"clear_filters": "Limpar {{filterCount}} selecionados", "clear_filters": "Limpar {{filterCount}} selecionados",
"go_up_buttom": "Voltar ao topo" "go_up_button": "Voltar ao topo"
}, },
"modal": { "modal": {
"close": "Botão de fechar" "close": "Botão de fechar"

View file

@ -274,7 +274,7 @@
"catalogue": { "catalogue": {
"next_page": "Página seguinte", "next_page": "Página seguinte",
"previous_page": "Página anterior", "previous_page": "Página anterior",
"go_up_buttom": "Voltar ao topo" "go_up_button": "Voltar ao topo"
}, },
"modal": { "modal": {
"close": "Botão de fechar" "close": "Botão de fechar"

View file

@ -33,7 +33,7 @@
"catalogue": { "catalogue": {
"next_page": "Pagina următoare", "next_page": "Pagina următoare",
"previous_page": "Pagina anterioară", "previous_page": "Pagina anterioară",
"go_up_buttom": "Înapoi în vârf" "go_up_button": "Înapoi în vârf"
}, },
"game_details": { "game_details": {
"open_download_options": "Deschide opțiunile de descărcare", "open_download_options": "Deschide opțiunile de descărcare",

View file

@ -55,7 +55,7 @@
"result_count": "{{resultCount}} результатов", "result_count": "{{resultCount}} результатов",
"filter_count": "{{filterCount}} доступных", "filter_count": "{{filterCount}} доступных",
"clear_filters": "Очистить {{filterCount}} выбранных", "clear_filters": "Очистить {{filterCount}} выбранных",
"go_up_buttom": "Вернуться на вершину" "go_up_button": "Вернуться на вершину"
}, },
"game_details": { "game_details": {
"open_download_options": "Открыть источники", "open_download_options": "Открыть источники",

View file

@ -32,7 +32,7 @@
"catalogue": { "catalogue": {
"next_page": "Sonraki sayfa", "next_page": "Sonraki sayfa",
"previous_page": "Önceki sayfa", "previous_page": "Önceki sayfa",
"go_up_buttom": "Tepeye dön" "go_up_button": "Tepeye dön"
}, },
"game_details": { "game_details": {
"open_download_options": "İndirme seçeneklerini aç", "open_download_options": "İndirme seçeneklerini aç",

View file

@ -41,7 +41,7 @@
"catalogue": { "catalogue": {
"next_page": "Наступна сторінка", "next_page": "Наступна сторінка",
"previous_page": "Попередня сторінка", "previous_page": "Попередня сторінка",
"go_up_buttom": "Назад до вершини" "go_up_button": "Назад до вершини"
}, },
"game_details": { "game_details": {
"open_download_options": "Відкрити варіанти завантаження", "open_download_options": "Відкрити варіанти завантаження",

View file

@ -47,7 +47,7 @@
"catalogue": { "catalogue": {
"next_page": "下一页", "next_page": "下一页",
"previous_page": "上一页", "previous_page": "上一页",
"go_up_buttom": "回到顶部" "go_up_button": "回到顶部"
}, },
"game_details": { "game_details": {
"open_download_options": "打开下载菜单", "open_download_options": "打开下载菜单",

View file

@ -36,7 +36,7 @@ const filterCategoryColors = {
const PAGE_SIZE = 20; const PAGE_SIZE = 20;
const TOTAL_ITEMS_TO_SHOW_GO_UP_BUTTOM = 10; const TOTAL_ITEMS_TO_SHOW_GO_UP_BUTTOM = 10;
const LIMIT_SCROLL_TO_DISAPEAR_GO_UP_BUTTOM = 500; const LIMIT_SCROLL_TO_DISAPEAR_GO_UP_BUTTON = 500;
export default function Catalogue() { export default function Catalogue() {
const abortControllerRef = useRef<AbortController | null>(null); const abortControllerRef = useRef<AbortController | null>(null);
@ -88,7 +88,7 @@ export default function Catalogue() {
const isGoUpButtonVisible = (results: any[], scrollTop: number) => { const isGoUpButtonVisible = (results: any[], scrollTop: number) => {
const withinLimit = results.length > 0 && results.length <= TOTAL_ITEMS_TO_SHOW_GO_UP_BUTTOM; const withinLimit = results.length > 0 && results.length <= TOTAL_ITEMS_TO_SHOW_GO_UP_BUTTOM;
return withinLimit && scrollTop >= LIMIT_SCROLL_TO_DISAPEAR_GO_UP_BUTTOM; return withinLimit && scrollTop >= LIMIT_SCROLL_TO_DISAPEAR_GO_UP_BUTTON;
}; };
useEffect(() => { useEffect(() => {
@ -111,6 +111,7 @@ export default function Catalogue() {
return () => { return () => {
ref?.removeEventListener("scroll", handleScroll); ref?.removeEventListener("scroll", handleScroll);
handleScroll.cancel();
}; };
}, [results]); }, [results]);
@ -381,7 +382,7 @@ export default function Catalogue() {
{t("result_count", { {t("result_count", {
resultCount: formatNumber(itemsCount), resultCount: formatNumber(itemsCount),
})} })}
, {t('go_up_buttom')} <ArrowUpIcon /> , {t('go_up_button')} <ArrowUpIcon />
</Button> </Button>
)} )}
</div> </div>