feat/confirm-pack-delete: add modal to confirm pack delete

This commit is contained in:
Guilherme Viana 2024-04-14 11:13:53 -03:00
parent 034ea6d817
commit dc0d36b07a
8 changed files with 903 additions and 794 deletions

View File

@ -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"
}
}

View File

@ -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"
}
}

View File

@ -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"
}
}

View File

@ -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%',
})

View File

@ -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<Game[]>([]);
const [filteredLibrary, setFilteredLibrary] = useState<Game[]>([])
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 <p>{t("deleting")}</p>;
}
if (isGameDeleting(game?.id)) {
return <p>{t('deleting')}</p>
}
if (isGameDownloading) {
return (
<>
<p>{progress}</p>
if (isGameDownloading) {
return (
<>
<p>{progress}</p>
{gameDownloading?.status !== "downloading" ? (
<p>{t(gameDownloading?.status)}</p>
) : (
<>
<p>
{prettyBytes(gameDownloading?.bytesDownloaded)} /{" "}
{finalDownloadSize}
</p>
<p>
{numPeers} peers / {numSeeds} seeds
</p>
</>
)}
</>
);
}
{gameDownloading?.status !== 'downloading' ? (
<p>{t(gameDownloading?.status)}</p>
) : (
<>
<p>
{prettyBytes(gameDownloading?.bytesDownloaded)} / {finalDownloadSize}
</p>
<p>
{numPeers} peers / {numSeeds} seeds
</p>
</>
)}
</>
)
}
if (game?.status === "seeding") {
return (
<>
<p>{game?.repack.title}</p>
<p>{t("completed")}</p>
</>
);
}
if (game?.status === "cancelled") return <p>{t("cancelled")}</p>;
if (game?.status === "downloading_metadata")
return <p>{t("starting_download")}</p>;
if (game?.status === 'seeding') {
return (
<>
<p>{game?.repack.title}</p>
<p>{t('completed')}</p>
</>
)
}
if (game?.status === 'cancelled') return <p>{t('cancelled')}</p>
if (game?.status === 'downloading_metadata') return <p>{t('starting_download')}</p>
if (game?.status === "paused") {
return (
<>
<p>{formatDownloadProgress(game.progress)}</p>
<p>{t("paused")}</p>
</>
);
}
};
if (game?.status === 'paused') {
return (
<>
<p>{formatDownloadProgress(game.progress)}</p>
<p>{t('paused')}</p>
</>
)
}
}
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 (
<>
<Button onClick={() => pauseDownload(game.id)} theme="outline">
{t("pause")}
</Button>
<Button onClick={() => cancelDownload(game.id)} theme="outline">
{t("cancel")}
</Button>
</>
);
}
if (isGameDownloading) {
return (
<>
<Button
onClick={() => pauseDownload(game.id)}
theme='outline'
>
{t('pause')}
</Button>
<Button
onClick={() => cancelDownload(game.id)}
theme='outline'
>
{t('cancel')}
</Button>
</>
)
}
if (game?.status === "paused") {
return (
<>
<Button onClick={() => resumeDownload(game.id)} theme="outline">
{t("resume")}
</Button>
<Button onClick={() => cancelDownload(game.id)} theme="outline">
{t("cancel")}
</Button>
</>
);
}
if (game?.status === 'paused') {
return (
<>
<Button
onClick={() => resumeDownload(game.id)}
theme='outline'
>
{t('resume')}
</Button>
<Button
onClick={() => cancelDownload(game.id)}
theme='outline'
>
{t('cancel')}
</Button>
</>
)
}
if (game?.status === "seeding") {
return (
<>
<Button
onClick={() => openGame(game.id)}
theme="outline"
disabled={deleting}
>
{t("launch")}
</Button>
<Button
onClick={() => deleteGame(game.id)}
theme="outline"
disabled={deleting}
>
{t("delete")}
</Button>
</>
);
}
if (game?.status === 'seeding') {
return (
<>
<Button
onClick={() => openGame(game.id)}
theme='outline'
disabled={deleting}
>
{t('launch')}
</Button>
<Button
onClick={() => deleteGame(game.id)}
theme='outline'
disabled={deleting}
>
{t('delete')}
</Button>
</>
)
}
if (game?.status === "downloading_metadata") {
return (
<Button onClick={() => cancelDownload(game.id)} theme="outline">
{t("cancel")}
</Button>
);
}
if (game?.status === 'downloading_metadata') {
return (
<Button
onClick={() => cancelDownload(game.id)}
theme='outline'
>
{t('cancel')}
</Button>
)
}
return (
<>
<Button
onClick={() => navigate(`/game/${game.shop}/${game.objectID}`)}
theme="outline"
disabled={deleting}
>
{t("download_again")}
</Button>
<Button
onClick={() => removeGame(game.id)}
theme="outline"
disabled={deleting}
>
{t("remove")}
</Button>
</>
);
};
return (
<>
<Button
onClick={() => navigate(`/game/${game.shop}/${game.objectID}`)}
theme='outline'
disabled={deleting}
>
{t('download_again')}
</Button>
<Button
onClick={() => removeGame(game.id)}
theme='outline'
disabled={deleting}
>
{t('remove')}
</Button>
</>
)
}
const handleFilter: React.ChangeEventHandler<HTMLInputElement> = (event) => {
setFilteredLibrary(
library.filter((game) =>
game.title
.toLowerCase()
.includes(event.target.value.toLocaleLowerCase())
)
);
};
const handleFilter: React.ChangeEventHandler<HTMLInputElement> = (event) => {
setFilteredLibrary(
library.filter((game) =>
game.title.toLowerCase().includes(event.target.value.toLocaleLowerCase())
)
)
}
return (
<section className={styles.downloadsContainer}>
<TextField placeholder={t("filter")} onChange={handleFilter} />
return (
<section className={styles.downloadsContainer}>
<TextField
placeholder={t('filter')}
onChange={handleFilter}
/>
<ul className={styles.downloads}>
{filteredLibrary.map((game) => {
return (
<li
key={game.id}
className={styles.download({
cancelled: game.status === "cancelled",
})}
>
<AsyncImage
src={steamUrlBuilder.library(game.objectID)}
className={styles.downloadCover}
alt={game.title}
/>
<div className={styles.downloadRightContent}>
<div className={styles.downloadDetails}>
<button
type="button"
className={styles.downloadTitle}
onClick={() =>
navigate(`/game/${game.shop}/${game.objectID}`)
}
>
{game.title}
</button>
<ul className={styles.downloads}>
{filteredLibrary.map((game) => {
return (
<li
key={game.id}
className={styles.download({
cancelled: game.status === 'cancelled',
})}
>
<AsyncImage
src={steamUrlBuilder.library(game.objectID)}
className={styles.downloadCover}
alt={game.title}
/>
<div className={styles.downloadRightContent}>
<div className={styles.downloadDetails}>
<button
type='button'
className={styles.downloadTitle}
onClick={() => navigate(`/game/${game.shop}/${game.objectID}`)}
>
{game.title}
</button>
{getGameInfo(game)}
</div>
{getGameInfo(game)}
</div>
<div className={styles.downloadActions}>
{getGameActions(game)}
</div>
</div>
</li>
);
})}
</ul>
</section>
);
<div className={styles.downloadActions}>{getGameActions(game)}</div>
</div>
</li>
)
})}
</ul>
</section>
)
}

View File

@ -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`,
})

View File

@ -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 (
<Modal
visible={visible}
title={title}
description={description}
onClose={onClose}
>
<div className={styles.deleteActionsButtonsCtn}>
<Button
onClick={() => {
deleteGame()
onClose()
}}
theme='primary'
disabled={deleting}
>
{t('delete')}
</Button>
<Button
onClick={() => {
onClose()
}}
theme='outline'
disabled={deleting}
>
{t('cancel')}
</Button>
</div>
</Modal>
)
}

View File

@ -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 <p>{t("deleting")}</p>;
}
const getInfo = () => {
if (!gameDetails) return null
if (isGameDownloading) {
return (
<>
<p className={styles.downloadDetailsRow}>
{progress}
{eta && <small>{t("eta", { eta })}</small>}
</p>
if (isGameDeleting(game?.id)) {
return <p>{t('deleting')}</p>
}
{gameDownloading?.status !== "downloading" ? (
<>
<p>{t(gameDownloading?.status)}</p>
{eta && <small>{t("eta", { eta })}</small>}
</>
) : (
<p className={styles.downloadDetailsRow}>
{prettyBytes(gameDownloading?.bytesDownloaded)} /{" "}
{finalDownloadSize}
<small>
{numPeers} peers / {numSeeds} seeds
</small>
</p>
)}
</>
);
}
if (isGameDownloading) {
return (
<>
<p className={styles.downloadDetailsRow}>
{progress}
{eta && <small>{t('eta', { eta })}</small>}
</p>
if (game?.status === "paused") {
return (
<>
<p>
{t("paused_progress", {
progress: formatDownloadProgress(game.progress),
})}
</p>
<p>
{prettyBytes(game.bytesDownloaded)} / {finalDownloadSize}
</p>
</>
);
}
{gameDownloading?.status !== 'downloading' ? (
<>
<p>{t(gameDownloading?.status)}</p>
{eta && <small>{t('eta', { eta })}</small>}
</>
) : (
<p className={styles.downloadDetailsRow}>
{prettyBytes(gameDownloading?.bytesDownloaded)} / {finalDownloadSize}
<small>
{numPeers} peers / {numSeeds} seeds
</small>
</p>
)}
</>
)
}
const lastUpdate = format(gameDetails.repacks[0].uploadDate!, "dd/MM/yyyy");
const repacksCount = gameDetails.repacks.length;
if (game?.status === 'paused') {
return (
<>
<p>
{t('paused_progress', {
progress: formatDownloadProgress(game.progress),
})}
</p>
<p>
{prettyBytes(game.bytesDownloaded)} / {finalDownloadSize}
</p>
</>
)
}
return (
<>
<p>{t("updated_at", { updated_at: lastUpdate })}</p>
<p>{t("download_options", { count: repacksCount })}</p>
</>
);
};
const lastUpdate = format(gameDetails.repacks[0].uploadDate!, 'dd/MM/yyyy')
const repacksCount = gameDetails.repacks.length
const getActions = () => {
const deleting = isGameDeleting(game?.id);
return (
<>
<p>{t('updated_at', { updated_at: lastUpdate })}</p>
<p>{t('download_options', { count: repacksCount })}</p>
</>
)
}
if (isGameDownloading) {
return (
<>
<Button onClick={() => pauseDownload(game.id)} theme="outline">
{t("pause")}
</Button>
<Button onClick={() => cancelDownload(game.id)} theme="outline">
{t("cancel")}
</Button>
</>
);
}
const getActions = () => {
const deleting = isGameDeleting(game?.id)
if (game?.status === "paused") {
return (
<>
<Button onClick={() => resumeDownload(game.id)} theme="outline">
{t("resume")}
</Button>
<Button
onClick={() => cancelDownload(game.id).then(getGame)}
theme="outline"
>
{t("cancel")}
</Button>
</>
);
}
if (isGameDownloading) {
return (
<>
<Button
onClick={() => pauseDownload(game.id)}
theme='outline'
>
{t('pause')}
</Button>
<Button
onClick={() => cancelDownload(game.id)}
theme='outline'
>
{t('cancel')}
</Button>
</>
)
}
if (game?.status === "seeding") {
return (
<>
<Button
onClick={() => openGame(game.id)}
theme="outline"
disabled={deleting}
>
{t("launch")}
</Button>
<Button
onClick={() => deleteGame(game.id).then(getGame)}
theme="outline"
disabled={deleting}
>
{t("delete")}
</Button>
</>
);
}
if (game?.status === 'paused') {
return (
<>
<Button
onClick={() => resumeDownload(game.id)}
theme='outline'
>
{t('resume')}
</Button>
<Button
onClick={() => cancelDownload(game.id).then(getGame)}
theme='outline'
>
{t('cancel')}
</Button>
</>
)
}
if (game?.status === "cancelled") {
return (
<>
<Button
onClick={openRepacksModal}
theme="outline"
disabled={deleting}
>
{t("open_download_options")}
</Button>
<Button
onClick={() => removeGame(game.id).then(getGame)}
theme="outline"
disabled={deleting}
>
{t("remove")}
</Button>
</>
);
}
if (game?.status === 'seeding') {
return (
<>
<Button
onClick={() => openGame(game.id)}
theme='outline'
disabled={deleting}
>
{t('launch')}
</Button>
return (
<Button onClick={openRepacksModal} theme="outline">
{t("open_download_options")}
</Button>
);
};
<Button
onClick={() => setShowDeleteModal(true)}
theme='outline'
disabled={deleting}
>
{t('delete')}
</Button>
return (
<div style={{ backgroundColor: color }} className={styles.panel}>
<div className={styles.content}>{getInfo()}</div>
<div className={styles.actions}>{getActions()}</div>
</div>
);
<DeleteModal
visible={showDeleteModal}
title={t('delete_modal_title')}
description={t('delete_modal_description')}
onClose={() => setShowDeleteModal(false)}
deleting={deleting}
deleteGame={() => deleteGame(game.id).then(getGame)}
/>
</>
)
}
if (game?.status === 'cancelled') {
return (
<>
<Button
onClick={openRepacksModal}
theme='outline'
disabled={deleting}
>
{t('open_download_options')}
</Button>
<Button
onClick={() => removeGame(game.id).then(getGame)}
theme='outline'
disabled={deleting}
>
{t('remove_from_list')}
</Button>
</>
)
}
return (
<Button
onClick={openRepacksModal}
theme='outline'
>
{t('open_download_options')}
</Button>
)
}
return (
<div
style={{ backgroundColor: color }}
className={styles.panel}
>
<div className={styles.content}>{getInfo()}</div>
<div className={styles.actions}>{getActions()}</div>
</div>
)
}