From dc0d36b07ab2ce374ec40fc4d0995f39c8da7b4c Mon Sep 17 00:00:00 2001 From: Guilherme Viana Date: Sun, 14 Apr 2024 11:13:53 -0300 Subject: [PATCH 1/7] feat/confirm-pack-delete: add modal to confirm pack delete --- src/locales/en/translation.json | 223 ++++----- src/locales/es/translation.json | 223 ++++----- src/locales/pt/translation.json | 223 ++++----- src/renderer/pages/downloads/downloads.css.ts | 146 +++--- src/renderer/pages/downloads/downloads.tsx | 433 +++++++++--------- .../pages/game-details/delete-modal.css.ts | 10 + .../pages/game-details/delete-modal.tsx | 55 +++ .../pages/game-details/hero-panel.tsx | 384 ++++++++-------- 8 files changed, 903 insertions(+), 794 deletions(-) create mode 100644 src/renderer/pages/game-details/delete-modal.css.ts create mode 100644 src/renderer/pages/game-details/delete-modal.tsx diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json index 207613fd..a5e290b6 100644 --- a/src/locales/en/translation.json +++ b/src/locales/en/translation.json @@ -1,111 +1,116 @@ { - "catalogue": { - "featured": "Featured", - "recently_added": "Recently added", - "trending": "Trending", - "surprise_me": "✨ Surprise me" - }, - "sidebar": { - "catalogue": "Catalogue", - "downloads": "Downloads", - "settings": "Settings", - "my_library": "My library", - "downloading_metadata": "{{title}} (Downloading metadata…)", - "checking_files": "{{title}} ({{percentage}} - Checking files…)", - "paused": "{{title}} (Paused)", - "downloading": "{{title}} ({{percentage}} - Downloading…)", - "filter": "Filter library" - }, - "header": { - "search": "Search", - "catalogue": "Catalogue", - "downloads": "Downloads", - "search_results": "Search results", - "settings": "Settings" - }, - "bottom_panel": { - "no_downloads_in_progress": "No downloads in progress", - "downloading_metadata": "Downloading {{title}} metadata…", - "checking_files": "Checking {{title}} files… ({{percentage}} complete)", - "downloading": "Downloading {{title}}… ({{percentage}} complete) - Conclusion {{eta}} - {{speed}}", - "deleting": "Deleting files…" - }, - "game_details": { - "open_download_options": "Open download options", - "download_options_zero": "No download option", - "download_options_one": "{{count}} download option", - "download_options_other": "{{count}} download options", - "updated_at": "Updated {{updated_at}}", - "launch": "Launch", - "resume": "Resume", - "pause": "Pause", - "cancel": "Cancel", - "remove": "Remove", - "space_left_on_disk": "{{space}} left on disk", - "eta": "Conclusion {{eta}}", - "downloading_metadata": "Downloading metadata…", - "checking_files": "Checking files…", - "filter": "Filter repacks", - "requirements": "System requirements", - "minimum": "Minimum", - "recommended": "Recommended", - "no_minimum_requirements": "{{title}} doesn't provide minimum requirements information", - "no_recommended_requirements": "{{title}} doesn't provide recommended requirements information", - "paused_progress": "{{progress}} (Paused)", - "deleting": "Deleting files…", - "delete": "Remove all files", - "release_date": "Released in {{date}}", - "publisher": "Published by {{publisher}}", - "copy_link_to_clipboard": "Copy link", - "copied_link_to_clipboard": "Link copied" - }, - "activation": { - "title": "Activate Hydra", - "installation_id": "Installation ID:", - "enter_activation_code": "Enter your activation code", - "message": "If you don't know where to ask for this, then you shouldn't have this.", - "activate": "Activate", - "loading": "Loading…" - }, - "downloads": { - "launch": "Launch", - "resume": "Resume", - "pause": "Pause", - "eta": "Conclusion {{eta}}", - "paused": "Paused", - "verifying": "Verifying…", - "completed_at": "Completed in {{date}}", - "completed": "Completed", - "cancelled": "Cancelled", - "download_again": "Download again", - "cancel": "Cancel", - "filter": "Filter downloaded games", - "remove": "Remove", - "downloading_metadata": "Downloading metadata…", - "checking_files": "Checking files…", - "starting_download": "Starting download…", - "deleting": "Deleting files…", - "delete": "Remove all files" - }, - "settings": { - "downloads_path": "Downloads path", - "change": "Update", - "notifications": "Notifications", - "enable_download_notifications": "When a download is complete", - "enable_repack_list_notifications": "When a new repack is added" - }, - "notifications": { - "download_complete": "Download complete", - "game_ready_to_install": "{{title}} is ready to install", - "repack_list_updated": "Repack list updated", - "repack_count_one": "{{count}} repack added", - "repack_count_other": "{{count}} repacks added" - }, - "system_tray": { - "open": "Open Hydra", - "quit": "Quit" - }, - "game_card": { - "no_downloads": "No downloads available" - } + "catalogue": { + "featured": "Featured", + "recently_added": "Recently added", + "trending": "Trending", + "surprise_me": "✨ Surprise me" + }, + "sidebar": { + "catalogue": "Catalogue", + "downloads": "Downloads", + "settings": "Settings", + "my_library": "My library", + "downloading_metadata": "{{title}} (Downloading metadata…)", + "checking_files": "{{title}} ({{percentage}} - Checking files…)", + "paused": "{{title}} (Paused)", + "downloading": "{{title}} ({{percentage}} - Downloading…)", + "filter": "Filter library" + }, + "header": { + "search": "Search", + "catalogue": "Catalogue", + "downloads": "Downloads", + "search_results": "Search results", + "settings": "Settings" + }, + "bottom_panel": { + "no_downloads_in_progress": "No downloads in progress", + "downloading_metadata": "Downloading {{title}} metadata…", + "checking_files": "Checking {{title}} files… ({{percentage}} complete)", + "downloading": "Downloading {{title}}… ({{percentage}} complete) - Conclusion {{eta}} - {{speed}}", + "deleting": "Deleting files…" + }, + "game_details": { + "open_download_options": "Open download options", + "download_options_zero": "No download option", + "download_options_one": "{{count}} download option", + "download_options_other": "{{count}} download options", + "updated_at": "Updated {{updated_at}}", + "launch": "Launch", + "resume": "Resume", + "pause": "Pause", + "cancel": "Cancel", + "remove": "Remove", + "remove_from_list": "Remove from list", + "space_left_on_disk": "{{space}} left on disk", + "eta": "Conclusion {{eta}}", + "downloading_metadata": "Downloading metadata…", + "checking_files": "Checking files…", + "filter": "Filter repacks", + "requirements": "System requirements", + "minimum": "Minimum", + "recommended": "Recommended", + "no_minimum_requirements": "{{title}} doesn't provide minimum requirements information", + "no_recommended_requirements": "{{title}} doesn't provide recommended requirements information", + "paused_progress": "{{progress}} (Paused)", + "deleting": "Deleting files…", + "delete": "Remove all files", + "release_date": "Released in {{date}}", + "publisher": "Published by {{publisher}}", + "copy_link_to_clipboard": "Copy link", + "copied_link_to_clipboard": "Link copied", + "delete_modal_title": "Are you sure?", + "delete_modal_description": "This will remove all game files from your system." + }, + "activation": { + "title": "Activate Hydra", + "installation_id": "Installation ID:", + "enter_activation_code": "Enter your activation code", + "message": "If you don't know where to ask for this, then you shouldn't have this.", + "activate": "Activate", + "loading": "Loading…" + }, + "downloads": { + "launch": "Launch", + "resume": "Resume", + "pause": "Pause", + "eta": "Conclusion {{eta}}", + "paused": "Paused", + "verifying": "Verifying…", + "completed_at": "Completed in {{date}}", + "completed": "Completed", + "cancelled": "Cancelled", + "download_again": "Download again", + "cancel": "Cancel", + "filter": "Filter downloaded games", + "remove": "Remove", + "downloading_metadata": "Downloading metadata…", + "checking_files": "Checking files…", + "starting_download": "Starting download…", + "deleting": "Deleting files…", + "delete": "Remove all files", + "delete_modal_title": "Are you sure?", + "delete_modal_description": "This will remove all game files from your system." + }, + "settings": { + "downloads_path": "Downloads path", + "change": "Update", + "notifications": "Notifications", + "enable_download_notifications": "When a download is complete", + "enable_repack_list_notifications": "When a new repack is added" + }, + "notifications": { + "download_complete": "Download complete", + "game_ready_to_install": "{{title}} is ready to install", + "repack_list_updated": "Repack list updated", + "repack_count_one": "{{count}} repack added", + "repack_count_other": "{{count}} repacks added" + }, + "system_tray": { + "open": "Open Hydra", + "quit": "Quit" + }, + "game_card": { + "no_downloads": "No downloads available" + } } diff --git a/src/locales/es/translation.json b/src/locales/es/translation.json index 0153de88..1f7875c5 100644 --- a/src/locales/es/translation.json +++ b/src/locales/es/translation.json @@ -1,111 +1,116 @@ { - "catalogue": { - "featured": "Destacado", - "recently_added": "Recién Añadidos", - "trending": "Tendencias", - "surprise_me": "✨ ¡Sorpréndeme!" - }, - "sidebar": { - "catalogue": "Catálogo", - "downloads": "Descargas", - "settings": "Ajustes", - "my_library": "Mi biblioteca", - "downloading_metadata": "{{title}} (Descargando metadatos…)", - "checking_files": "{{title}} ({{percentage}} - Analizando archivos…)", - "paused": "{{title}} (Pausado)", - "downloading": "{{title}} ({{percentage}} - Descargando…)", - "filter": "Filtrar biblioteca" - }, - "header": { - "search": "Buscar", - "catalogue": "Catálogo", - "downloads": "Descargas", - "search_results": "Resultados de búsqueda", - "settings": "Ajustes" - }, - "bottom_panel": { - "no_downloads_in_progress": "Sin descargas en progreso", - "downloading_metadata": "Descargando metadatos de {{title}}…", - "checking_files": "Analizando archivos de {{title}} - ({{percentage}} completado)", - "downloading": "Descargando {{title}}… ({{percentage}} completado) - Finalizando {{eta}} - {{speed}}", - "deleting": "Eliminando archivos…" - }, - "game_details": { - "open_download_options": "Ver opciones de descargas", - "download_options_zero": "No hay opciones de descargas disponibles", - "download_options_one": "{{count}} opción de descarga", - "download_options_other": "{{count}} opciones de descargas", - "updated_at": "Actualizado el {{updated_at}}", - "launch": "Iniciar", - "resume": "Continuar", - "pause": "Pausa", - "cancel": "Cancelar", - "remove": "Eliminar", - "space_left_on_disk": "{{space}} restantes en el disco", - "eta": "Finalizando {{eta}}", - "downloading_metadata": "Descargando metadatos…", - "checking_files": "Analizando archivos…", - "filter": "Filtrar repacks", - "requirements": "Requisitos del Sistema", - "minimum": "Mínimos", - "recommended": "Recomendados", - "no_minimum_requirements": "Sin requisitos mínimos para {{title}}", - "no_recommended_requirements": "{{title}} no tiene requisitos recomendados", - "paused_progress": "{{progress}} (Pausado)", - "deleting": "Eliminando archivos…", - "delete": "Eliminar todos los archivos", - "release_date": "Fecha de lanzamiento {{date}}", - "publisher": "Publicado por {{publisher}}", - "copy_link_to_clipboard": "Copiar enlace", - "copied_link_to_clipboard": "Enlace copiado" - }, - "activation": { - "title": "Activar Hydra", - "installation_id": "ID de la Instalación:", - "enter_activation_code": "Introduce tu código de activación", - "message": "Si no sabes donde obtener el código, no deberías de tener esto.", - "activate": "Activar", - "loading": "Cargando…" - }, - "downloads": { - "launch": "Iniciar", - "resume": "Resumir", - "pause": "Pausa", - "eta": "Finalizando {{eta}}", - "paused": "En Pausa", - "verifying": "Verificando…", - "completed_at": "Completado el {{date}}", - "completed": "Completado", - "cancelled": "Cancelado", - "download_again": "Descargar de nuevo", - "cancel": "Cancelar", - "filter": "Buscar juegos descargados", - "remove": "Eliminar", - "downloading_metadata": "Descargando metadatos…", - "checking_files": "Verificando archivos…", - "starting_download": "Iniciando descarga…", - "deleting": "Eliminando archivos…", - "delete": "Eliminar todos los archivos" - }, - "settings": { - "downloads_path": "Ruta de descarga", - "change": "Cambiar", - "notifications": "Notificaciones", - "enable_download_notifications": "Cuando se completa una descarga", - "enable_repack_list_notifications": "Cuando se añade un repack nuevo" - }, - "notifications": { - "download_complete": "Descarga completada", - "game_ready_to_install": "{{title}} está listo para instalarse", - "repack_list_updated": "Lista de repacks actualizadas", - "repack_count_one": "{{count}} repack ha sido añadido", - "repack_count_other": "{{count}} repacks añadidos" - }, - "system_tray": { - "open": "Abrir Hydra", - "quit": "Salir" - }, - "game_card": { - "no_downloads": "No hay descargas disponibles" - } + "catalogue": { + "featured": "Destacado", + "recently_added": "Recién Añadidos", + "trending": "Tendencias", + "surprise_me": "✨ ¡Sorpréndeme!" + }, + "sidebar": { + "catalogue": "Catálogo", + "downloads": "Descargas", + "settings": "Ajustes", + "my_library": "Mi biblioteca", + "downloading_metadata": "{{title}} (Descargando metadatos…)", + "checking_files": "{{title}} ({{percentage}} - Analizando archivos…)", + "paused": "{{title}} (Pausado)", + "downloading": "{{title}} ({{percentage}} - Descargando…)", + "filter": "Filtrar biblioteca" + }, + "header": { + "search": "Buscar", + "catalogue": "Catálogo", + "downloads": "Descargas", + "search_results": "Resultados de búsqueda", + "settings": "Ajustes" + }, + "bottom_panel": { + "no_downloads_in_progress": "Sin descargas en progreso", + "downloading_metadata": "Descargando metadatos de {{title}}…", + "checking_files": "Analizando archivos de {{title}} - ({{percentage}} completado)", + "downloading": "Descargando {{title}}… ({{percentage}} completado) - Finalizando {{eta}} - {{speed}}", + "deleting": "Eliminando archivos…" + }, + "game_details": { + "open_download_options": "Ver opciones de descargas", + "download_options_zero": "No hay opciones de descargas disponibles", + "download_options_one": "{{count}} opción de descarga", + "download_options_other": "{{count}} opciones de descargas", + "updated_at": "Actualizado el {{updated_at}}", + "launch": "Iniciar", + "resume": "Continuar", + "pause": "Pausa", + "cancel": "Cancelar", + "remove": "Eliminar", + "remove_from_list": "Quitar de la lista", + "space_left_on_disk": "{{space}} restantes en el disco", + "eta": "Finalizando {{eta}}", + "downloading_metadata": "Descargando metadatos…", + "checking_files": "Analizando archivos…", + "filter": "Filtrar repacks", + "requirements": "Requisitos del Sistema", + "minimum": "Mínimos", + "recommended": "Recomendados", + "no_minimum_requirements": "Sin requisitos mínimos para {{title}}", + "no_recommended_requirements": "{{title}} no tiene requisitos recomendados", + "paused_progress": "{{progress}} (Pausado)", + "deleting": "Eliminando archivos…", + "delete": "Eliminar todos los archivos", + "release_date": "Fecha de lanzamiento {{date}}", + "publisher": "Publicado por {{publisher}}", + "copy_link_to_clipboard": "Copiar enlace", + "copied_link_to_clipboard": "Enlace copiado", + "delete_modal_title": "¿Estás seguro de esto?", + "delete_modal_description": "Esto eliminará todos los archivos del juego de tu sistema." + }, + "activation": { + "title": "Activar Hydra", + "installation_id": "ID de la Instalación:", + "enter_activation_code": "Introduce tu código de activación", + "message": "Si no sabes donde obtener el código, no deberías de tener esto.", + "activate": "Activar", + "loading": "Cargando…" + }, + "downloads": { + "launch": "Iniciar", + "resume": "Resumir", + "pause": "Pausa", + "eta": "Finalizando {{eta}}", + "paused": "En Pausa", + "verifying": "Verificando…", + "completed_at": "Completado el {{date}}", + "completed": "Completado", + "cancelled": "Cancelado", + "download_again": "Descargar de nuevo", + "cancel": "Cancelar", + "filter": "Buscar juegos descargados", + "remove": "Eliminar", + "downloading_metadata": "Descargando metadatos…", + "checking_files": "Verificando archivos…", + "starting_download": "Iniciando descarga…", + "deleting": "Eliminando archivos…", + "delete": "Eliminar todos los archivos", + "delete_modal_title": "¿Estás seguro de esto?", + "delete_modal_description": "Esto eliminará todos los archivos del juego de tu sistema." + }, + "settings": { + "downloads_path": "Ruta de descarga", + "change": "Cambiar", + "notifications": "Notificaciones", + "enable_download_notifications": "Cuando se completa una descarga", + "enable_repack_list_notifications": "Cuando se añade un repack nuevo" + }, + "notifications": { + "download_complete": "Descarga completada", + "game_ready_to_install": "{{title}} está listo para instalarse", + "repack_list_updated": "Lista de repacks actualizadas", + "repack_count_one": "{{count}} repack ha sido añadido", + "repack_count_other": "{{count}} repacks añadidos" + }, + "system_tray": { + "open": "Abrir Hydra", + "quit": "Salir" + }, + "game_card": { + "no_downloads": "No hay descargas disponibles" + } } diff --git a/src/locales/pt/translation.json b/src/locales/pt/translation.json index 722e7145..681b301d 100644 --- a/src/locales/pt/translation.json +++ b/src/locales/pt/translation.json @@ -1,111 +1,116 @@ { - "catalogue": { - "featured": "Destaque", - "recently_added": "Novidades", - "trending": "Populares", - "surprise_me": "✨ Me surpreenda" - }, - "sidebar": { - "catalogue": "Catálogo", - "downloads": "Downloads", - "settings": "Configurações", - "my_library": "Minha biblioteca", - "downloading_metadata": "{{title}} (Baixando metadados…)", - "checking_files": "{{title}} ({{percentage}} - Verificando arquivos…)", - "paused": "{{title}} (Pausado)", - "downloading": "{{title}} ({{percentage}} - Baixando…)", - "filter": "Filtrar biblioteca" - }, - "header": { - "search": "Buscar", - "catalogue": "Catálogo", - "downloads": "Downloads", - "search_results": "Resultados da busca", - "settings": "Configurações" - }, - "bottom_panel": { - "no_downloads_in_progress": "Sem downloads em andamento", - "downloading_metadata": "Baixando metadados de {{title}}…", - "checking_files": "Verificando arquivos de {{title}}… ({{percentage}} completo)", - "downloading": "Baixando {{title}}… ({{percentage}} completo) - Conclusão {{eta}} - {{speed}}", - "deleting": "Removendo arquivos…" - }, - "game_details": { - "open_download_options": "Ver opções de download", - "download_options_zero": "Sem opções de download", - "download_options_one": "{{count}} opção de download", - "download_options_other": "{{count}} opções de download", - "updated_at": "Atualizado {{updated_at}}", - "launch": "Abrir", - "resume": "Resumir", - "pause": "Pausar", - "cancel": "Cancelar", - "remove": "Remover", - "space_left_on_disk": "{{space}} livres em disco", - "eta": "Conclusão {{eta}}", - "downloading_metadata": "Baixando metadados…", - "checking_files": "Verificando arquivos…", - "filter": "Filtrar repacks", - "requirements": "Requisitos do sistema", - "minimum": "Mínimos", - "recommended": "Recomendados", - "no_minimum_requirements": "{{title}} não possui informações de requisitos mínimos", - "no_recommended_requirements": "{{title}} não possui informações de requisitos recomendados", - "paused_progress": "{{progress}} (Pausado)", - "deleting": "Removendo arquivos…", - "delete": "Apagar arquivos", - "release_date": "Lançado em {{date}}", - "publisher": "Publicado por {{publisher}}", - "copy_link_to_clipboard": "Copiar link", - "copied_link_to_clipboard": "Link copiado" - }, - "activation": { - "title": "Ativação", - "installation_id": "ID da instalação:", - "enter_activation_code": "Insira seu código de ativação", - "message": "Se você não sabe onde conseguir o código, talvez você não devesse estar aqui.", - "activate": "Ativar", - "loading": "Carregando…" - }, - "downloads": { - "launch": "Abrir", - "resume": "Resumir", - "pause": "Pausar", - "eta": "Conclusão {{eta}}", - "paused": "Pausado", - "verifying": "Verificando…", - "completed_at": "Concluído em {{date}}", - "completed": "Concluído", - "cancelled": "Cancelado", - "download_again": "Baixar novamente", - "cancel": "Cancelar", - "filter": "Filtrar jogos baixados", - "remove": "Remover", - "downloading_metadata": "Baixando metadados…", - "checking_files": "Verificando arquivos…", - "starting_download": "Iniciando download…", - "deleting": "Removendo arquivos…", - "delete": "Apagar arquivos" - }, - "settings": { - "downloads_path": "Diretório dos downloads", - "change": "Mudar", - "notifications": "Notificações", - "enable_download_notifications": "Quando um download for concluído", - "enable_repack_list_notifications": "Quando a lista de repacks for atualizada" - }, - "notifications": { - "download_complete": "Download concluído", - "game_ready_to_install": "{{title}} está pronto para ser instalado", - "repack_list_updated": "Lista de repacks atualizada", - "repack_count_one": "{{count}} novo repack", - "repack_count_other": "{{count}} novos repacks" - }, - "system_tray": { - "open": "Abrir Hydra", - "quit": "Fechar" - }, - "game_card": { - "no_downloads": "Sem downloads disponíveis" - } + "catalogue": { + "featured": "Destaque", + "recently_added": "Novidades", + "trending": "Populares", + "surprise_me": "✨ Me surpreenda" + }, + "sidebar": { + "catalogue": "Catálogo", + "downloads": "Downloads", + "settings": "Configurações", + "my_library": "Minha biblioteca", + "downloading_metadata": "{{title}} (Baixando metadados…)", + "checking_files": "{{title}} ({{percentage}} - Verificando arquivos…)", + "paused": "{{title}} (Pausado)", + "downloading": "{{title}} ({{percentage}} - Baixando…)", + "filter": "Filtrar biblioteca" + }, + "header": { + "search": "Buscar", + "catalogue": "Catálogo", + "downloads": "Downloads", + "search_results": "Resultados da busca", + "settings": "Configurações" + }, + "bottom_panel": { + "no_downloads_in_progress": "Sem downloads em andamento", + "downloading_metadata": "Baixando metadados de {{title}}…", + "checking_files": "Verificando arquivos de {{title}}… ({{percentage}} completo)", + "downloading": "Baixando {{title}}… ({{percentage}} completo) - Conclusão {{eta}} - {{speed}}", + "deleting": "Removendo arquivos…" + }, + "game_details": { + "open_download_options": "Ver opções de download", + "download_options_zero": "Sem opções de download", + "download_options_one": "{{count}} opção de download", + "download_options_other": "{{count}} opções de download", + "updated_at": "Atualizado {{updated_at}}", + "launch": "Abrir", + "resume": "Resumir", + "pause": "Pausar", + "cancel": "Cancelar", + "remove": "Remover", + "remove_from_list": "Remover da lista", + "space_left_on_disk": "{{space}} livres em disco", + "eta": "Conclusão {{eta}}", + "downloading_metadata": "Baixando metadados…", + "checking_files": "Verificando arquivos…", + "filter": "Filtrar repacks", + "requirements": "Requisitos do sistema", + "minimum": "Mínimos", + "recommended": "Recomendados", + "no_minimum_requirements": "{{title}} não possui informações de requisitos mínimos", + "no_recommended_requirements": "{{title}} não possui informações de requisitos recomendados", + "paused_progress": "{{progress}} (Pausado)", + "deleting": "Removendo arquivos…", + "delete": "Apagar arquivos", + "release_date": "Lançado em {{date}}", + "publisher": "Publicado por {{publisher}}", + "copy_link_to_clipboard": "Copiar link", + "copied_link_to_clipboard": "Link copiado", + "delete_modal_title": "Tem certeza disso?", + "delete_modal_description": "Isso apagará todos os arquivos do jogo de seu sistema." + }, + "activation": { + "title": "Ativação", + "installation_id": "ID da instalação:", + "enter_activation_code": "Insira seu código de ativação", + "message": "Se você não sabe onde conseguir o código, talvez você não devesse estar aqui.", + "activate": "Ativar", + "loading": "Carregando…" + }, + "downloads": { + "launch": "Abrir", + "resume": "Resumir", + "pause": "Pausar", + "eta": "Conclusão {{eta}}", + "paused": "Pausado", + "verifying": "Verificando…", + "completed_at": "Concluído em {{date}}", + "completed": "Concluído", + "cancelled": "Cancelado", + "download_again": "Baixar novamente", + "cancel": "Cancelar", + "filter": "Filtrar jogos baixados", + "remove": "Remover", + "downloading_metadata": "Baixando metadados…", + "checking_files": "Verificando arquivos…", + "starting_download": "Iniciando download…", + "deleting": "Removendo arquivos…", + "delete": "Apagar arquivos", + "delete_modal_title": "Tem certeza disso?", + "delete_modal_description": "Isso apagará todos os arquivos do jogo de seu sistema." + }, + "settings": { + "downloads_path": "Diretório dos downloads", + "change": "Mudar", + "notifications": "Notificações", + "enable_download_notifications": "Quando um download for concluído", + "enable_repack_list_notifications": "Quando a lista de repacks for atualizada" + }, + "notifications": { + "download_complete": "Download concluído", + "game_ready_to_install": "{{title}} está pronto para ser instalado", + "repack_list_updated": "Lista de repacks atualizada", + "repack_count_one": "{{count}} novo repack", + "repack_count_other": "{{count}} novos repacks" + }, + "system_tray": { + "open": "Abrir Hydra", + "quit": "Fechar" + }, + "game_card": { + "no_downloads": "Sem downloads disponíveis" + } } diff --git a/src/renderer/pages/downloads/downloads.css.ts b/src/renderer/pages/downloads/downloads.css.ts index 6d34bbe1..224a4a64 100644 --- a/src/renderer/pages/downloads/downloads.css.ts +++ b/src/renderer/pages/downloads/downloads.css.ts @@ -1,89 +1,89 @@ -import { SPACING_UNIT, vars } from "@renderer/theme.css"; -import { style } from "@vanilla-extract/css"; -import { recipe } from "@vanilla-extract/recipes"; +import { SPACING_UNIT, vars } from '@renderer/theme.css' +import { style } from '@vanilla-extract/css' +import { recipe } from '@vanilla-extract/recipes' export const downloadTitle = style({ - fontWeight: "bold", - cursor: "pointer", - color: vars.color.bodyText, - textAlign: "left", - marginBottom: `${SPACING_UNIT}px`, - fontSize: "16px", - display: "block", - ":hover": { - textDecoration: "underline", - }, -}); + fontWeight: 'bold', + cursor: 'pointer', + color: vars.color.bodyText, + textAlign: 'left', + marginBottom: `${SPACING_UNIT}px`, + fontSize: '16px', + display: 'block', + ':hover': { + textDecoration: 'underline', + }, +}) export const downloads = style({ - width: "100%", - gap: `${SPACING_UNIT * 2}px`, - display: "flex", - flexDirection: "column", - margin: "0", - padding: "0", - marginTop: `${SPACING_UNIT * 3}px`, -}); + width: '100%', + gap: `${SPACING_UNIT * 2}px`, + display: 'flex', + flexDirection: 'column', + margin: '0', + padding: '0', + marginTop: `${SPACING_UNIT * 3}px`, +}) export const downloadCover = style({ - width: "280px", - minWidth: "280px", - height: "auto", - objectFit: "cover", - objectPosition: "center", - borderRight: `solid 1px ${vars.color.borderColor}`, -}); + width: '280px', + minWidth: '280px', + height: 'auto', + objectFit: 'cover', + objectPosition: 'center', + borderRight: `solid 1px ${vars.color.borderColor}`, +}) export const download = recipe({ - base: { - width: "100%", - backgroundColor: vars.color.background, - display: "flex", - borderRadius: "8px", - border: `solid 1px ${vars.color.borderColor}`, - overflow: "hidden", - boxShadow: "0px 0px 15px 0px #000000", - transition: "all ease 0.2s", - height: "140px", - minHeight: "140px", - maxHeight: "140px", - }, - variants: { - cancelled: { - true: { - opacity: vars.opacity.disabled, - ":hover": { - opacity: "1", - }, - }, - }, - }, -}); + base: { + width: '100%', + backgroundColor: vars.color.background, + display: 'flex', + borderRadius: '8px', + border: `solid 1px ${vars.color.borderColor}`, + overflow: 'hidden', + boxShadow: '0px 0px 15px 0px #000000', + transition: 'all ease 0.2s', + height: '140px', + minHeight: '140px', + maxHeight: '140px', + }, + variants: { + cancelled: { + true: { + opacity: vars.opacity.disabled, + ':hover': { + opacity: '1', + }, + }, + }, + }, +}) export const downloadDetails = style({ - display: "flex", - flexDirection: "column", - flex: "1", - justifyContent: "center", - gap: `${SPACING_UNIT / 2}px`, - fontSize: "14px", -}); + display: 'flex', + flexDirection: 'column', + flex: '1', + justifyContent: 'center', + gap: `${SPACING_UNIT / 2}px`, + fontSize: '14px', +}) export const downloadRightContent = style({ - display: "flex", - padding: `${SPACING_UNIT * 2}px`, - flex: "1", -}); + display: 'flex', + padding: `${SPACING_UNIT * 2}px`, + flex: '1', +}) export const downloadActions = style({ - display: "flex", - alignItems: "center", - gap: `${SPACING_UNIT}px`, -}); + display: 'flex', + alignItems: 'center', + gap: `${SPACING_UNIT}px`, +}) export const downloadsContainer = style({ - display: "flex", - padding: `${SPACING_UNIT * 3}px`, - flexDirection: "column", - width: "100%", -}); + display: 'flex', + padding: `${SPACING_UNIT * 3}px`, + flexDirection: 'column', + width: '100%', +}) diff --git a/src/renderer/pages/downloads/downloads.tsx b/src/renderer/pages/downloads/downloads.tsx index f0fd8038..290a3be8 100644 --- a/src/renderer/pages/downloads/downloads.tsx +++ b/src/renderer/pages/downloads/downloads.tsx @@ -1,246 +1,255 @@ -import { useTranslation } from "react-i18next"; -import { useNavigate } from "react-router-dom"; -import prettyBytes from "pretty-bytes"; +import prettyBytes from 'pretty-bytes' +import { useTranslation } from 'react-i18next' +import { useNavigate } from 'react-router-dom' -import { AsyncImage, Button, TextField } from "@renderer/components"; -import { formatDownloadProgress, steamUrlBuilder } from "@renderer/helpers"; -import { useDownload, useLibrary } from "@renderer/hooks"; -import type { Game } from "@types"; +import { AsyncImage, Button, TextField } from '@renderer/components' +import { formatDownloadProgress, steamUrlBuilder } from '@renderer/helpers' +import { useDownload, useLibrary } from '@renderer/hooks' +import type { Game } from '@types' -import * as styles from "./downloads.css"; -import { useEffect, useState } from "react"; +import { useEffect, useState } from 'react' +import * as styles from './downloads.css' export function Downloads() { - const { library, updateLibrary } = useLibrary(); + const { library, updateLibrary } = useLibrary() - const { t } = useTranslation("downloads"); + const { t } = useTranslation('downloads') - const navigate = useNavigate(); + const navigate = useNavigate() - const [filteredLibrary, setFilteredLibrary] = useState([]); + const [filteredLibrary, setFilteredLibrary] = useState([]) - const { - game: gameDownloading, - progress, - isDownloading, - numPeers, - numSeeds, - pauseDownload, - resumeDownload, - cancelDownload, - deleteGame, - isGameDeleting, - } = useDownload(); + const { + game: gameDownloading, + progress, + isDownloading, + numPeers, + numSeeds, + pauseDownload, + resumeDownload, + cancelDownload, + deleteGame, + isGameDeleting, + } = useDownload() - useEffect(() => { - setFilteredLibrary(library); - }, [library]); + useEffect(() => { + setFilteredLibrary(library) + }, [library]) - const openGame = (gameId: number) => - window.electron.openGame(gameId).then(() => { - updateLibrary(); - }); + const openGame = (gameId: number) => + window.electron.openGame(gameId).then(() => { + updateLibrary() + }) - const removeGame = (gameId: number) => - window.electron.removeGame(gameId).then(() => { - updateLibrary(); - }); + const removeGame = (gameId: number) => + window.electron.removeGame(gameId).then(() => { + updateLibrary() + }) - const getFinalDownloadSize = (game: Game) => { - const isGameDownloading = isDownloading && gameDownloading?.id === game?.id; + const getFinalDownloadSize = (game: Game) => { + const isGameDownloading = isDownloading && gameDownloading?.id === game?.id - if (!game) return "N/A"; - if (game.fileSize) return prettyBytes(game.fileSize); + if (!game) return 'N/A' + if (game.fileSize) return prettyBytes(game.fileSize) - if (gameDownloading?.fileSize && isGameDownloading) - return prettyBytes(gameDownloading.fileSize); + if (gameDownloading?.fileSize && isGameDownloading) return prettyBytes(gameDownloading.fileSize) - return game.repack?.fileSize ?? "N/A"; - }; + return game.repack?.fileSize ?? 'N/A' + } - const getGameInfo = (game: Game) => { - const isGameDownloading = isDownloading && gameDownloading?.id === game?.id; - const finalDownloadSize = getFinalDownloadSize(game); + const getGameInfo = (game: Game) => { + const isGameDownloading = isDownloading && gameDownloading?.id === game?.id + const finalDownloadSize = getFinalDownloadSize(game) - if (isGameDeleting(game?.id)) { - return

{t("deleting")}

; - } + if (isGameDeleting(game?.id)) { + return

{t('deleting')}

+ } - if (isGameDownloading) { - return ( - <> -

{progress}

+ if (isGameDownloading) { + return ( + <> +

{progress}

- {gameDownloading?.status !== "downloading" ? ( -

{t(gameDownloading?.status)}

- ) : ( - <> -

- {prettyBytes(gameDownloading?.bytesDownloaded)} /{" "} - {finalDownloadSize} -

-

- {numPeers} peers / {numSeeds} seeds -

- - )} - - ); - } + {gameDownloading?.status !== 'downloading' ? ( +

{t(gameDownloading?.status)}

+ ) : ( + <> +

+ {prettyBytes(gameDownloading?.bytesDownloaded)} / {finalDownloadSize} +

+

+ {numPeers} peers / {numSeeds} seeds +

+ + )} + + ) + } - if (game?.status === "seeding") { - return ( - <> -

{game?.repack.title}

-

{t("completed")}

- - ); - } - if (game?.status === "cancelled") return

{t("cancelled")}

; - if (game?.status === "downloading_metadata") - return

{t("starting_download")}

; + if (game?.status === 'seeding') { + return ( + <> +

{game?.repack.title}

+

{t('completed')}

+ + ) + } + if (game?.status === 'cancelled') return

{t('cancelled')}

+ if (game?.status === 'downloading_metadata') return

{t('starting_download')}

- if (game?.status === "paused") { - return ( - <> -

{formatDownloadProgress(game.progress)}

-

{t("paused")}

- - ); - } - }; + if (game?.status === 'paused') { + return ( + <> +

{formatDownloadProgress(game.progress)}

+

{t('paused')}

+ + ) + } + } - const getGameActions = (game: Game) => { - const isGameDownloading = isDownloading && gameDownloading?.id === game?.id; + const getGameActions = (game: Game) => { + const isGameDownloading = isDownloading && gameDownloading?.id === game?.id - const deleting = isGameDeleting(game.id); + const deleting = isGameDeleting(game.id) - if (isGameDownloading) { - return ( - <> - - - - ); - } + if (isGameDownloading) { + return ( + <> + + + + ) + } - if (game?.status === "paused") { - return ( - <> - - - - ); - } + if (game?.status === 'paused') { + return ( + <> + + + + ) + } - if (game?.status === "seeding") { - return ( - <> - - - - ); - } + if (game?.status === 'seeding') { + return ( + <> + + + + ) + } - if (game?.status === "downloading_metadata") { - return ( - - ); - } + if (game?.status === 'downloading_metadata') { + return ( + + ) + } - return ( - <> - - - - ); - }; + return ( + <> + + + + ) + } - const handleFilter: React.ChangeEventHandler = (event) => { - setFilteredLibrary( - library.filter((game) => - game.title - .toLowerCase() - .includes(event.target.value.toLocaleLowerCase()) - ) - ); - }; + const handleFilter: React.ChangeEventHandler = (event) => { + setFilteredLibrary( + library.filter((game) => + game.title.toLowerCase().includes(event.target.value.toLocaleLowerCase()) + ) + ) + } - return ( -
- + return ( +
+ -
    - {filteredLibrary.map((game) => { - return ( -
  • - -
    -
    - +
      + {filteredLibrary.map((game) => { + return ( +
    • + +
      +
      + - {getGameInfo(game)} -
      + {getGameInfo(game)} +
      -
      - {getGameActions(game)} -
      -
    -
  • - ); - })} -
-
- ); +
{getGameActions(game)}
+ + + ) + })} + +
+ ) } diff --git a/src/renderer/pages/game-details/delete-modal.css.ts b/src/renderer/pages/game-details/delete-modal.css.ts new file mode 100644 index 00000000..67679ce3 --- /dev/null +++ b/src/renderer/pages/game-details/delete-modal.css.ts @@ -0,0 +1,10 @@ +import { SPACING_UNIT } from '@renderer/theme.css' +import { style } from '@vanilla-extract/css' + +export const deleteActionsButtonsCtn = style({ + display: 'flex', + width: '100%', + justifyContent: 'center', + alignItems: 'center', + gap: `${SPACING_UNIT}px`, +}) diff --git a/src/renderer/pages/game-details/delete-modal.tsx b/src/renderer/pages/game-details/delete-modal.tsx new file mode 100644 index 00000000..56655723 --- /dev/null +++ b/src/renderer/pages/game-details/delete-modal.tsx @@ -0,0 +1,55 @@ +import { Button, Modal } from '@renderer/components' +import { useTranslation } from 'react-i18next' +import * as styles from './delete-modal.css' + +type DeleteModalProps = { + visible: boolean + title: string + description: string + onClose: () => void + deleting: boolean + deleteGame: () => void +} + +export function DeleteModal({ + description, + onClose, + title, + visible, + deleting, + deleteGame, +}: DeleteModalProps) { + const { t } = useTranslation('game_details') + + return ( + +
+ + + +
+
+ ) +} diff --git a/src/renderer/pages/game-details/hero-panel.tsx b/src/renderer/pages/game-details/hero-panel.tsx index 6189a261..99a00d10 100644 --- a/src/renderer/pages/game-details/hero-panel.tsx +++ b/src/renderer/pages/game-details/hero-panel.tsx @@ -1,209 +1,229 @@ -import { useMemo } from "react"; -import { useTranslation } from "react-i18next"; -import prettyBytes from "pretty-bytes"; -import { format } from "date-fns"; +import { format } from 'date-fns' +import prettyBytes from 'pretty-bytes' +import { useMemo, useState } from 'react' +import { useTranslation } from 'react-i18next' -import { Button } from "@renderer/components"; -import { useDownload, useLibrary } from "@renderer/hooks"; -import type { Game, ShopDetails } from "@types"; +import { Button } from '@renderer/components' +import { useDownload, useLibrary } from '@renderer/hooks' +import type { Game, ShopDetails } from '@types' -import * as styles from "./hero-panel.css"; -import { formatDownloadProgress } from "@renderer/helpers"; +import { formatDownloadProgress } from '@renderer/helpers' +import { DeleteModal } from './delete-modal' +import * as styles from './hero-panel.css' export interface HeroPanelProps { - game: Game | null; - gameDetails: ShopDetails | null; - color: string; - openRepacksModal: () => void; - getGame: () => void; + game: Game | null + gameDetails: ShopDetails | null + color: string + openRepacksModal: () => void + getGame: () => void } -export function HeroPanel({ - game, - gameDetails, - color, - openRepacksModal, - getGame, -}: HeroPanelProps) { - const { t } = useTranslation("game_details"); +export function HeroPanel({ game, gameDetails, color, openRepacksModal, getGame }: HeroPanelProps) { + const { t } = useTranslation('game_details') - const { - game: gameDownloading, - isDownloading, - progress, - eta, - numPeers, - numSeeds, - resumeDownload, - pauseDownload, - cancelDownload, - deleteGame, - removeGame, - isGameDeleting, - } = useDownload(); - const { updateLibrary } = useLibrary(); + const { + game: gameDownloading, + isDownloading, + progress, + eta, + numPeers, + numSeeds, + resumeDownload, + pauseDownload, + cancelDownload, + deleteGame, + removeGame, + isGameDeleting, + } = useDownload() + const { updateLibrary } = useLibrary() - const isGameDownloading = isDownloading && gameDownloading?.id === game?.id; + const [showDeleteModal, setShowDeleteModal] = useState(false) - const openGame = (gameId: number) => - window.electron.openGame(gameId).then(() => { - updateLibrary(); - }); + const isGameDownloading = isDownloading && gameDownloading?.id === game?.id - const finalDownloadSize = useMemo(() => { - if (!game) return "N/A"; - if (game.fileSize) return prettyBytes(game.fileSize); + const openGame = (gameId: number) => + window.electron.openGame(gameId).then(() => { + updateLibrary() + }) - if (gameDownloading?.fileSize && isGameDownloading) - return prettyBytes(gameDownloading.fileSize); + const finalDownloadSize = useMemo(() => { + if (!game) return 'N/A' + if (game.fileSize) return prettyBytes(game.fileSize) - return game.repack?.fileSize ?? "N/A"; - }, [game, isGameDownloading, gameDownloading]); + if (gameDownloading?.fileSize && isGameDownloading) return prettyBytes(gameDownloading.fileSize) - const getInfo = () => { - if (!gameDetails) return null; + return game.repack?.fileSize ?? 'N/A' + }, [game, isGameDownloading, gameDownloading]) - if (isGameDeleting(game?.id)) { - return

{t("deleting")}

; - } + const getInfo = () => { + if (!gameDetails) return null - if (isGameDownloading) { - return ( - <> -

- {progress} - {eta && {t("eta", { eta })}} -

+ if (isGameDeleting(game?.id)) { + return

{t('deleting')}

+ } - {gameDownloading?.status !== "downloading" ? ( - <> -

{t(gameDownloading?.status)}

- {eta && {t("eta", { eta })}} - - ) : ( -

- {prettyBytes(gameDownloading?.bytesDownloaded)} /{" "} - {finalDownloadSize} - - {numPeers} peers / {numSeeds} seeds - -

- )} - - ); - } + if (isGameDownloading) { + return ( + <> +

+ {progress} + {eta && {t('eta', { eta })}} +

- if (game?.status === "paused") { - return ( - <> -

- {t("paused_progress", { - progress: formatDownloadProgress(game.progress), - })} -

-

- {prettyBytes(game.bytesDownloaded)} / {finalDownloadSize} -

- - ); - } + {gameDownloading?.status !== 'downloading' ? ( + <> +

{t(gameDownloading?.status)}

+ {eta && {t('eta', { eta })}} + + ) : ( +

+ {prettyBytes(gameDownloading?.bytesDownloaded)} / {finalDownloadSize} + + {numPeers} peers / {numSeeds} seeds + +

+ )} + + ) + } - const lastUpdate = format(gameDetails.repacks[0].uploadDate!, "dd/MM/yyyy"); - const repacksCount = gameDetails.repacks.length; + if (game?.status === 'paused') { + return ( + <> +

+ {t('paused_progress', { + progress: formatDownloadProgress(game.progress), + })} +

+

+ {prettyBytes(game.bytesDownloaded)} / {finalDownloadSize} +

+ + ) + } - return ( - <> -

{t("updated_at", { updated_at: lastUpdate })}

-

{t("download_options", { count: repacksCount })}

- - ); - }; + const lastUpdate = format(gameDetails.repacks[0].uploadDate!, 'dd/MM/yyyy') + const repacksCount = gameDetails.repacks.length - const getActions = () => { - const deleting = isGameDeleting(game?.id); + return ( + <> +

{t('updated_at', { updated_at: lastUpdate })}

+

{t('download_options', { count: repacksCount })}

+ + ) + } - if (isGameDownloading) { - return ( - <> - - - - ); - } + const getActions = () => { + const deleting = isGameDeleting(game?.id) - if (game?.status === "paused") { - return ( - <> - - - - ); - } + if (isGameDownloading) { + return ( + <> + + + + ) + } - if (game?.status === "seeding") { - return ( - <> - - - - ); - } + if (game?.status === 'paused') { + return ( + <> + + + + ) + } - if (game?.status === "cancelled") { - return ( - <> - - - - ); - } + if (game?.status === 'seeding') { + return ( + <> + - return ( - - ); - }; + - return ( -
-
{getInfo()}
-
{getActions()}
-
- ); + setShowDeleteModal(false)} + deleting={deleting} + deleteGame={() => deleteGame(game.id).then(getGame)} + /> + + ) + } + + if (game?.status === 'cancelled') { + return ( + <> + + + + ) + } + + return ( + + ) + } + + return ( +
+
{getInfo()}
+
{getActions()}
+
+ ) } From 1d5aba762a4cde25d0602c1f918db6868dabaf53 Mon Sep 17 00:00:00 2001 From: Guilherme Viana Date: Sun, 14 Apr 2024 11:18:54 -0300 Subject: [PATCH 2/7] feat/confirm-pack-delete: adjust styles --- src/renderer/pages/game-details/delete-modal.css.ts | 2 +- src/renderer/pages/game-details/delete-modal.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/renderer/pages/game-details/delete-modal.css.ts b/src/renderer/pages/game-details/delete-modal.css.ts index 67679ce3..c8d02d35 100644 --- a/src/renderer/pages/game-details/delete-modal.css.ts +++ b/src/renderer/pages/game-details/delete-modal.css.ts @@ -4,7 +4,7 @@ import { style } from '@vanilla-extract/css' export const deleteActionsButtonsCtn = style({ display: 'flex', width: '100%', - justifyContent: 'center', + justifyContent: 'end', alignItems: 'center', gap: `${SPACING_UNIT}px`, }) diff --git a/src/renderer/pages/game-details/delete-modal.tsx b/src/renderer/pages/game-details/delete-modal.tsx index 56655723..891e4389 100644 --- a/src/renderer/pages/game-details/delete-modal.tsx +++ b/src/renderer/pages/game-details/delete-modal.tsx @@ -34,7 +34,7 @@ export function DeleteModal({ deleteGame() onClose() }} - theme='primary' + theme='outline' disabled={deleting} > {t('delete')} @@ -44,7 +44,7 @@ export function DeleteModal({ onClick={() => { onClose() }} - theme='outline' + theme='primary' disabled={deleting} > {t('cancel')} From a1d6cda450f15caa507f7c0e90b154ecaf639a9b Mon Sep 17 00:00:00 2001 From: Guilherme Viana Date: Sun, 14 Apr 2024 11:26:54 -0300 Subject: [PATCH 3/7] fix/confirm-pack-delete: fix wrong typography --- src/locales/en/translation.json | 2 +- src/locales/es/translation.json | 2 +- src/locales/pt/translation.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json index a5e290b6..491e362c 100644 --- a/src/locales/en/translation.json +++ b/src/locales/en/translation.json @@ -60,7 +60,7 @@ "copy_link_to_clipboard": "Copy link", "copied_link_to_clipboard": "Link copied", "delete_modal_title": "Are you sure?", - "delete_modal_description": "This will remove all game files from your system." + "delete_modal_description": "This will remove all game files from your system" }, "activation": { "title": "Activate Hydra", diff --git a/src/locales/es/translation.json b/src/locales/es/translation.json index 1f7875c5..73478ea8 100644 --- a/src/locales/es/translation.json +++ b/src/locales/es/translation.json @@ -60,7 +60,7 @@ "copy_link_to_clipboard": "Copiar enlace", "copied_link_to_clipboard": "Enlace copiado", "delete_modal_title": "¿Estás seguro de esto?", - "delete_modal_description": "Esto eliminará todos los archivos del juego de tu sistema." + "delete_modal_description": "Esto eliminará todos los archivos del juego de tu sistema" }, "activation": { "title": "Activar Hydra", diff --git a/src/locales/pt/translation.json b/src/locales/pt/translation.json index 681b301d..87c2a707 100644 --- a/src/locales/pt/translation.json +++ b/src/locales/pt/translation.json @@ -60,7 +60,7 @@ "copy_link_to_clipboard": "Copiar link", "copied_link_to_clipboard": "Link copiado", "delete_modal_title": "Tem certeza disso?", - "delete_modal_description": "Isso apagará todos os arquivos do jogo de seu sistema." + "delete_modal_description": "Isso apagará todos os arquivos do jogo do seu sistema" }, "activation": { "title": "Ativação", From 5f05cb25b27d4ff0c4a74e721f8031d294591859 Mon Sep 17 00:00:00 2001 From: Guilherme Viana Date: Mon, 15 Apr 2024 09:37:19 -0300 Subject: [PATCH 4/7] fix: adjust & clear merge conflict issues --- src/locales/en/translation.json | 4 +--- src/locales/es/translation.json | 4 +--- src/locales/fr/translation.json | 5 ++++- src/locales/pt/translation.json | 4 +--- src/renderer/pages/downloads/downloads.tsx | 2 +- src/renderer/pages/game-details/hero-panel.tsx | 1 + 6 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json index 50eb3ab8..92e357b6 100644 --- a/src/locales/en/translation.json +++ b/src/locales/en/translation.json @@ -91,9 +91,7 @@ "checking_files": "Checking files…", "starting_download": "Starting download…", "deleting": "Deleting files…", - "delete": "Remove all files", - "delete_modal_title": "Are you sure?", - "delete_modal_description": "This will remove all game files from your system." + "delete": "Remove all files" }, "settings": { "downloads_path": "Downloads path", diff --git a/src/locales/es/translation.json b/src/locales/es/translation.json index ad17895b..15e85198 100644 --- a/src/locales/es/translation.json +++ b/src/locales/es/translation.json @@ -91,9 +91,7 @@ "checking_files": "Verificando archivos…", "starting_download": "Iniciando descarga…", "deleting": "Eliminando archivos…", - "delete": "Eliminar todos los archivos", - "delete_modal_title": "¿Estás seguro de esto?", - "delete_modal_description": "Esto eliminará todos los archivos del juego de tu sistema." + "delete": "Eliminar todos los archivos" }, "settings": { "downloads_path": "Ruta de descarga", diff --git a/src/locales/fr/translation.json b/src/locales/fr/translation.json index 72ef899b..aacad35c 100644 --- a/src/locales/fr/translation.json +++ b/src/locales/fr/translation.json @@ -41,6 +41,7 @@ "pause": "Pause", "cancel": "Annuler", "remove": "Supprimer", + "remove_from_list": "Retirer de la liste", "space_left_on_disk": "{{space}} restant sur le disque", "eta": "Conclusion dans {{eta}}", "downloading_metadata": "Téléchargement des métadonnées en cours…", @@ -57,7 +58,9 @@ "release_date": "Sorti le {{date}}", "publisher": "Édité par {{publisher}}", "copy_link_to_clipboard": "Copier le lien", - "copied_link_to_clipboard": "Lien copié" + "copied_link_to_clipboard": "Lien copié", + "delete_modal_title": "Êtes-vous sûr de cela?", + "delete_modal_description": "Cela effacera tous les fichiers de jeu de votre système" }, "activation": { "title": "Activer Hydra", diff --git a/src/locales/pt/translation.json b/src/locales/pt/translation.json index adf9b0e7..9a991be3 100644 --- a/src/locales/pt/translation.json +++ b/src/locales/pt/translation.json @@ -91,9 +91,7 @@ "checking_files": "Verificando arquivos…", "starting_download": "Iniciando download…", "deleting": "Removendo arquivos…", - "delete": "Apagar arquivos", - "delete_modal_title": "Tem certeza disso?", - "delete_modal_description": "Isso apagará todos os arquivos do jogo de seu sistema." + "delete": "Apagar arquivos" }, "settings": { "downloads_path": "Diretório dos downloads", diff --git a/src/renderer/pages/downloads/downloads.tsx b/src/renderer/pages/downloads/downloads.tsx index 01fe61f8..0165105d 100644 --- a/src/renderer/pages/downloads/downloads.tsx +++ b/src/renderer/pages/downloads/downloads.tsx @@ -187,7 +187,7 @@ export function Downloads() { theme="outline" disabled={deleting} > - {t("remove")} + {t("remove_from_list")} ); diff --git a/src/renderer/pages/game-details/hero-panel.tsx b/src/renderer/pages/game-details/hero-panel.tsx index 0c16e9b9..6bf84d33 100644 --- a/src/renderer/pages/game-details/hero-panel.tsx +++ b/src/renderer/pages/game-details/hero-panel.tsx @@ -9,6 +9,7 @@ import type { Game, ShopDetails } from "@types"; import { formatDownloadProgress } from "@renderer/helpers"; import { BinaryNotFoundModal } from "../shared-modals/binary-not-found-modal"; +import { DeleteModal } from "./delete-modal"; import * as styles from "./hero-panel.css"; export interface HeroPanelProps { From 99ad11a3e5cb3127670638d8f57230daa859b316 Mon Sep 17 00:00:00 2001 From: Guilherme Viana Date: Mon, 15 Apr 2024 09:37:34 -0300 Subject: [PATCH 5/7] style: format code --- src/renderer/pages/downloads/downloads.css.ts | 146 +++++++++--------- .../pages/game-details/delete-modal.css.ts | 16 +- .../pages/game-details/delete-modal.tsx | 94 +++++------ 3 files changed, 128 insertions(+), 128 deletions(-) diff --git a/src/renderer/pages/downloads/downloads.css.ts b/src/renderer/pages/downloads/downloads.css.ts index 224a4a64..6d34bbe1 100644 --- a/src/renderer/pages/downloads/downloads.css.ts +++ b/src/renderer/pages/downloads/downloads.css.ts @@ -1,89 +1,89 @@ -import { SPACING_UNIT, vars } from '@renderer/theme.css' -import { style } from '@vanilla-extract/css' -import { recipe } from '@vanilla-extract/recipes' +import { SPACING_UNIT, vars } from "@renderer/theme.css"; +import { style } from "@vanilla-extract/css"; +import { recipe } from "@vanilla-extract/recipes"; export const downloadTitle = style({ - fontWeight: 'bold', - cursor: 'pointer', - color: vars.color.bodyText, - textAlign: 'left', - marginBottom: `${SPACING_UNIT}px`, - fontSize: '16px', - display: 'block', - ':hover': { - textDecoration: 'underline', - }, -}) + fontWeight: "bold", + cursor: "pointer", + color: vars.color.bodyText, + textAlign: "left", + marginBottom: `${SPACING_UNIT}px`, + fontSize: "16px", + display: "block", + ":hover": { + textDecoration: "underline", + }, +}); export const downloads = style({ - width: '100%', - gap: `${SPACING_UNIT * 2}px`, - display: 'flex', - flexDirection: 'column', - margin: '0', - padding: '0', - marginTop: `${SPACING_UNIT * 3}px`, -}) + width: "100%", + gap: `${SPACING_UNIT * 2}px`, + display: "flex", + flexDirection: "column", + margin: "0", + padding: "0", + marginTop: `${SPACING_UNIT * 3}px`, +}); export const downloadCover = style({ - width: '280px', - minWidth: '280px', - height: 'auto', - objectFit: 'cover', - objectPosition: 'center', - borderRight: `solid 1px ${vars.color.borderColor}`, -}) + width: "280px", + minWidth: "280px", + height: "auto", + objectFit: "cover", + objectPosition: "center", + borderRight: `solid 1px ${vars.color.borderColor}`, +}); export const download = recipe({ - base: { - width: '100%', - backgroundColor: vars.color.background, - display: 'flex', - borderRadius: '8px', - border: `solid 1px ${vars.color.borderColor}`, - overflow: 'hidden', - boxShadow: '0px 0px 15px 0px #000000', - transition: 'all ease 0.2s', - height: '140px', - minHeight: '140px', - maxHeight: '140px', - }, - variants: { - cancelled: { - true: { - opacity: vars.opacity.disabled, - ':hover': { - opacity: '1', - }, - }, - }, - }, -}) + base: { + width: "100%", + backgroundColor: vars.color.background, + display: "flex", + borderRadius: "8px", + border: `solid 1px ${vars.color.borderColor}`, + overflow: "hidden", + boxShadow: "0px 0px 15px 0px #000000", + transition: "all ease 0.2s", + height: "140px", + minHeight: "140px", + maxHeight: "140px", + }, + variants: { + cancelled: { + true: { + opacity: vars.opacity.disabled, + ":hover": { + opacity: "1", + }, + }, + }, + }, +}); export const downloadDetails = style({ - display: 'flex', - flexDirection: 'column', - flex: '1', - justifyContent: 'center', - gap: `${SPACING_UNIT / 2}px`, - fontSize: '14px', -}) + display: "flex", + flexDirection: "column", + flex: "1", + justifyContent: "center", + gap: `${SPACING_UNIT / 2}px`, + fontSize: "14px", +}); export const downloadRightContent = style({ - display: 'flex', - padding: `${SPACING_UNIT * 2}px`, - flex: '1', -}) + display: "flex", + padding: `${SPACING_UNIT * 2}px`, + flex: "1", +}); export const downloadActions = style({ - display: 'flex', - alignItems: 'center', - gap: `${SPACING_UNIT}px`, -}) + display: "flex", + alignItems: "center", + gap: `${SPACING_UNIT}px`, +}); export const downloadsContainer = style({ - display: 'flex', - padding: `${SPACING_UNIT * 3}px`, - flexDirection: 'column', - width: '100%', -}) + display: "flex", + padding: `${SPACING_UNIT * 3}px`, + flexDirection: "column", + width: "100%", +}); diff --git a/src/renderer/pages/game-details/delete-modal.css.ts b/src/renderer/pages/game-details/delete-modal.css.ts index c8d02d35..4d04c7a2 100644 --- a/src/renderer/pages/game-details/delete-modal.css.ts +++ b/src/renderer/pages/game-details/delete-modal.css.ts @@ -1,10 +1,10 @@ -import { SPACING_UNIT } from '@renderer/theme.css' -import { style } from '@vanilla-extract/css' +import { SPACING_UNIT } from "@renderer/theme.css"; +import { style } from "@vanilla-extract/css"; export const deleteActionsButtonsCtn = style({ - display: 'flex', - width: '100%', - justifyContent: 'end', - alignItems: 'center', - gap: `${SPACING_UNIT}px`, -}) + display: "flex", + width: "100%", + justifyContent: "end", + alignItems: "center", + gap: `${SPACING_UNIT}px`, +}); diff --git a/src/renderer/pages/game-details/delete-modal.tsx b/src/renderer/pages/game-details/delete-modal.tsx index 891e4389..29531383 100644 --- a/src/renderer/pages/game-details/delete-modal.tsx +++ b/src/renderer/pages/game-details/delete-modal.tsx @@ -1,55 +1,55 @@ -import { Button, Modal } from '@renderer/components' -import { useTranslation } from 'react-i18next' -import * as styles from './delete-modal.css' +import { Button, Modal } from "@renderer/components"; +import { useTranslation } from "react-i18next"; +import * as styles from "./delete-modal.css"; type DeleteModalProps = { - visible: boolean - title: string - description: string - onClose: () => void - deleting: boolean - deleteGame: () => void -} + visible: boolean; + title: string; + description: string; + onClose: () => void; + deleting: boolean; + deleteGame: () => void; +}; export function DeleteModal({ - description, - onClose, - title, - visible, - deleting, - deleteGame, + description, + onClose, + title, + visible, + deleting, + deleteGame, }: DeleteModalProps) { - const { t } = useTranslation('game_details') + const { t } = useTranslation("game_details"); - return ( - -
- + return ( + +
+ - -
-
- ) + +
+
+ ); } From 8836984454fa6a90df6edb07c6a95d817df1801e Mon Sep 17 00:00:00 2001 From: Guilherme Viana Date: Mon, 15 Apr 2024 15:42:31 -0300 Subject: [PATCH 6/7] fix/confirm-pack-delete: adjust code --- .../pages/game-details/delete-modal.tsx | 34 ++++++------------- .../pages/game-details/hero-panel.tsx | 2 -- 2 files changed, 11 insertions(+), 25 deletions(-) diff --git a/src/renderer/pages/game-details/delete-modal.tsx b/src/renderer/pages/game-details/delete-modal.tsx index 29531383..b77f912d 100644 --- a/src/renderer/pages/game-details/delete-modal.tsx +++ b/src/renderer/pages/game-details/delete-modal.tsx @@ -2,51 +2,39 @@ import { Button, Modal } from "@renderer/components"; import { useTranslation } from "react-i18next"; import * as styles from "./delete-modal.css"; -type DeleteModalProps = { +interface DeleteModalProps { visible: boolean; - title: string; - description: string; onClose: () => void; deleting: boolean; deleteGame: () => void; -}; +} export function DeleteModal({ - description, onClose, - title, visible, deleting, deleteGame, }: DeleteModalProps) { const { t } = useTranslation("game_details"); + function handleDeleteGame() { + deleteGame(); + onClose(); + } + return (
- -
diff --git a/src/renderer/pages/game-details/hero-panel.tsx b/src/renderer/pages/game-details/hero-panel.tsx index 6bf84d33..a3df6825 100644 --- a/src/renderer/pages/game-details/hero-panel.tsx +++ b/src/renderer/pages/game-details/hero-panel.tsx @@ -179,8 +179,6 @@ export function HeroPanel({ setShowDeleteModal(false)} deleting={deleting} deleteGame={() => deleteGame(game.id).then(getGame)} From cc9990096d91e257fc7d752b0c3e9dc12d44a27f Mon Sep 17 00:00:00 2001 From: Guilherme Viana Date: Mon, 15 Apr 2024 15:44:45 -0300 Subject: [PATCH 7/7] fix/confirm-pack-delete: adjust code round 2 --- src/renderer/pages/game-details/delete-modal.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/renderer/pages/game-details/delete-modal.tsx b/src/renderer/pages/game-details/delete-modal.tsx index b77f912d..f446fd7b 100644 --- a/src/renderer/pages/game-details/delete-modal.tsx +++ b/src/renderer/pages/game-details/delete-modal.tsx @@ -17,10 +17,10 @@ export function DeleteModal({ }: DeleteModalProps) { const { t } = useTranslation("game_details"); - function handleDeleteGame() { + const handleDeleteGame = () => { deleteGame(); onClose(); - } + }; return (