diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 88467f6a..472ed853 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -27,7 +27,7 @@ body: label: Expected behavior description: A clear and concise description of what you expected to happen. validations: - required: true + required: false - type: textarea id: screenshots attributes: @@ -56,3 +56,12 @@ body: description: Please provide any additional information and context about your problem. validations: required: false + - type: checkboxes + id: terms + attributes: + label: Before opening this Issue + options: + - label: I have searched the issues of this repository and believe that this is not a duplicate. + required: true + - label: I am aware that Hydra team does not offer any support or help regarding the downloaded games. + required: true diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json index e2726b79..08c9fda2 100644 --- a/src/locales/en/translation.json +++ b/src/locales/en/translation.json @@ -270,6 +270,7 @@ "pending": "Pending", "no_pending_invites": "You have no pending invites", "no_blocked_users": "You have no blocked users", - "friend_code_copied": "Friend code copied" + "friend_code_copied": "Friend code copied", + "undo_friendship_modal_text": "This will undo your friendship with {{displayName}}" } } diff --git a/src/locales/es/translation.json b/src/locales/es/translation.json index 0800b0c9..9cc7af9d 100644 --- a/src/locales/es/translation.json +++ b/src/locales/es/translation.json @@ -177,9 +177,6 @@ "download_count_zero": "No hay descargas en la lista", "download_count_one": "{{countFormatted}} descarga en la lista", "download_count_other": "{{countFormatted}} descargas en la lista", - "download_options_zero": "No hay descargas disponibles", - "download_options_one": "{{countFormatted}} descarga disponible", - "download_options_other": "{{countFormatted}} descargas disponibles", "download_source_url": "Descargar URL de origen", "add_download_source_description": "Introduce la URL con el archivo .json", "download_source_up_to_date": "Al día", @@ -261,6 +258,18 @@ "undo_friendship": "Eliminar amistad", "request_accepted": "Solicitud aceptada", "user_blocked_successfully": "Usuario bloqueado exitosamente", - "user_block_modal_text": "Esto va a bloquear a {{displayName}}" + "user_block_modal_text": "Esto va a bloquear a {{displayName}}", + "settings": "Ajustes", + "public": "Público", + "private": "Privado", + "friends_only": "Solo Amigos", + "privacy": "Privacidad", + "blocked_users": "Usuarios bloqueados", + "unblock": "Desbloquear", + "no_friends_added": "Todavía no tienes amigos añadidos", + "pending": "Pendiente", + "no_pending_invites": "No tienes invitaciones pendientes", + "no_blocked_users": "No has bloqueado a ningún usuario", + "friend_code_copied": "Código de amigo copiado" } } diff --git a/src/locales/pt/translation.json b/src/locales/pt/translation.json index 36d38c96..a97a81cf 100644 --- a/src/locales/pt/translation.json +++ b/src/locales/pt/translation.json @@ -273,6 +273,7 @@ "pending": "Pendentes", "no_pending_invites": "Você não possui convites de amizade pendentes", "no_blocked_users": "Você não tem nenhum usuário bloqueado", - "friend_code_copied": "Código de amigo copiado" + "friend_code_copied": "Código de amigo copiado", + "undo_friendship_modal_text": "Isso irá remover sua amizade com {{displayName}}" } } diff --git a/src/locales/ru/translation.json b/src/locales/ru/translation.json index f6f18d11..89d16b28 100644 --- a/src/locales/ru/translation.json +++ b/src/locales/ru/translation.json @@ -177,9 +177,6 @@ "download_count_zero": "В списке нет загрузок", "download_count_one": "{{countFormatted}} загрузка в списке", "download_count_other": "{{countFormatted}} загрузок в списке", - "download_options_zero": "Нет доступных загрузок", - "download_options_one": "{{countFormatted}} вариант загрузки доступен", - "download_options_other": "{{countFormatted}} вариантов загрузки доступно", "download_source_url": "Ссылка на источник", "add_download_source_description": "Вставьте ссылку на .json-файл", "download_source_up_to_date": "Обновлён", @@ -241,6 +238,38 @@ "successfully_signed_out": "Успешный выход из аккаунта", "sign_out": "Выйти", "playing_for": "Сыграно {{amount}}", - "sign_out_modal_text": "Ваша библиотека связана с текущей учетной записью. При выходе из системы ваша библиотека станет недоступна, и прогресс не будет сохранен. Выйти?" + "sign_out_modal_text": "Ваша библиотека связана с текущей учетной записью. При выходе из системы ваша библиотека станет недоступна, и прогресс не будет сохранен. Выйти?", + "add_friends": "Добавить друзей", + "add": "Добавить", + "friend_code": "Код друга", + "see_profile": "Просмотреть профиль", + "sending": "Отправка", + "friend_request_sent": "Запрос в друзья отправлен", + "friends": "Друзья", + "friends_list": "Список друзей", + "user_not_found": "Пользователь не найден", + "block_user": "Заблокировать пользователя", + "add_friend": "Добавить друга", + "request_sent": "Запрос отправлен", + "request_received": "Запрос получен", + "accept_request": "Принять запрос", + "ignore_request": "Игнорировать запрос", + "cancel_request": "Отменить запрос", + "undo_friendship": "Удалить друга", + "request_accepted": "Запрос принят", + "user_blocked_successfully": "Пользователь успешно заблокирован", + "user_block_modal_text": "{{displayName}} будет заблокирован", + "settings": "Настройки", + "public": "Публичный", + "private": "Приватный", + "friends_only": "Только друзья", + "privacy": "Приватность", + "blocked_users": "Заблокированные пользователи", + "unblock": "Разблокировать", + "no_friends_added": "Вы ещё не добавили ни одного друга", + "pending": "Ожидание", + "no_pending_invites": "У вас нет запросов ожидающих ответа", + "no_blocked_users": "Вы не заблокировали ни одного пользователя", + "friend_code_copied": "Код друга скопирован" } } diff --git a/src/main/index.ts b/src/main/index.ts index 93481f61..24c367fd 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -106,10 +106,15 @@ app.on("browser-window-created", (_, window) => { const handleDeepLinkPath = (uri?: string) => { if (!uri) return; - const url = new URL(uri); - if (url.host === "install-source") { - WindowManager.redirect(`settings${url.search}`); + try { + const url = new URL(uri); + + if (url.host === "install-source") { + WindowManager.redirect(`settings${url.search}`); + } + } catch (error) { + logger.error("Error handling deep link", uri, error); } }; diff --git a/src/renderer/src/components/header/header.css.ts b/src/renderer/src/components/header/header.css.ts index 0e82aaef..12855986 100644 --- a/src/renderer/src/components/header/header.css.ts +++ b/src/renderer/src/components/header/header.css.ts @@ -104,6 +104,7 @@ export const section = style({ alignItems: "center", gap: `${SPACING_UNIT * 2}px`, height: "100%", + overflow: "hidden", }); export const backButton = recipe({ @@ -136,11 +137,15 @@ export const backButton = recipe({ export const title = recipe({ base: { transition: "all ease 0.2s", + overflow: "hidden", + textOverflow: "ellipsis", + width: "100%", }, variants: { hasBackButton: { true: { transform: "translateX(28px)", + width: "calc(100% - 28px)", }, }, }, diff --git a/src/renderer/src/components/header/header.tsx b/src/renderer/src/components/header/header.tsx index d3315098..c37e4b44 100644 --- a/src/renderer/src/components/header/header.tsx +++ b/src/renderer/src/components/header/header.tsx @@ -72,7 +72,7 @@ export function Header({ onSearch, onClear, search }: HeaderProps) { isWindows: window.electron.platform === "win32", })} > -
+
- {userDetails && receivedRequests.length > 0 && !gameRunning && ( -
- -
+ {showPendingRequests && ( + )} ); diff --git a/src/renderer/src/pages/user/user-confirm-undo-friendship-modal.tsx b/src/renderer/src/pages/user/user-confirm-undo-friendship-modal.tsx new file mode 100644 index 00000000..cfdb5d06 --- /dev/null +++ b/src/renderer/src/pages/user/user-confirm-undo-friendship-modal.tsx @@ -0,0 +1,40 @@ +import { Button, Modal } from "@renderer/components"; +import * as styles from "./user.css"; +import { useTranslation } from "react-i18next"; + +export interface UserConfirmUndoFriendshipModalProps { + visible: boolean; + displayName: string; + onConfirm: () => void; + onClose: () => void; +} + +export function UserConfirmUndoFriendshipModal({ + visible, + displayName, + onConfirm, + onClose, +}: UserConfirmUndoFriendshipModalProps) { + const { t } = useTranslation("user_profile"); + + return ( + +
+

{t("undo_friendship_modal_text", { displayName })}

+
+ + + +
+
+
+ ); +} diff --git a/src/renderer/src/pages/user/user-content.tsx b/src/renderer/src/pages/user/user-content.tsx index c334389e..f4a46ccd 100644 --- a/src/renderer/src/pages/user/user-content.tsx +++ b/src/renderer/src/pages/user/user-content.tsx @@ -34,6 +34,7 @@ import { UserProfileSettingsModal } from "./user-profile-settings-modal"; import { UserSignOutModal } from "./user-sign-out-modal"; import { UserFriendModalTab } from "../shared-modals/user-friend-modal"; import { UserBlockModal } from "./user-block-modal"; +import { UserConfirmUndoFriendshipModal } from "./user-confirm-undo-friendship-modal"; const MAX_MINUTES_TO_SHOW_IN_PLAYTIME = 120; @@ -68,6 +69,7 @@ export function UserContent({ useState(false); const [showSignOutModal, setShowSignOutModal] = useState(false); const [showUserBlockModal, setShowUserBlockModal] = useState(false); + const [showUndoFriendshipModal, setShowUndoFriendshipModal] = useState(false); const [currentGame, setCurrentGame] = useState(null); const { gameRunning } = useAppSelector((state) => state.gameRunning); @@ -213,17 +215,12 @@ export function UserContent({ } if (userProfile.relation.status === "ACCEPTED") { - const userId = - userProfile.relation.AId === userDetails?.id - ? userProfile.relation.BId - : userProfile.relation.AId; - return ( <> @@ -291,6 +288,13 @@ export function UserContent({ displayName={userProfile.displayName} /> + setShowUndoFriendshipModal(false)} + onConfirm={() => handleFriendAction(userProfile.id, "UNDO")} + displayName={userProfile.displayName} + /> +
-

{userProfile.displayName}

+

+ {userProfile.displayName} +

{currentGame && (
setForm({ ...form, displayName: e.target.value })} /> diff --git a/src/renderer/src/pages/user/user.css.ts b/src/renderer/src/pages/user/user.css.ts index 4e1c2139..6bcb30b0 100644 --- a/src/renderer/src/pages/user/user.css.ts +++ b/src/renderer/src/pages/user/user.css.ts @@ -23,6 +23,7 @@ export const profileContentBox = style({ export const profileAvatarContainer = style({ width: "96px", + minWidth: "96px", height: "96px", borderRadius: "50%", display: "flex", @@ -100,6 +101,14 @@ export const profileInformation = style({ alignItems: "flex-start", color: "#c0c1c7", zIndex: 1, + overflow: "hidden", +}); + +export const profileDisplayName = style({ + fontWeight: "bold", + overflow: "hidden", + textOverflow: "ellipsis", + width: "100%", }); export const profileContent = style({