chore: merge with main

This commit is contained in:
Hydra 2024-04-30 03:59:35 +01:00
parent f7c2c2630d
commit 5fb33646ce
No known key found for this signature in database
7 changed files with 194 additions and 193 deletions

View File

@ -1,10 +1,10 @@
{
"name": "hydra",
"version": "1.0.0",
"version": "1.1.1",
"description": "Hydra",
"main": "./out/main/index.js",
"author": "Los Broxas",
"homepage": "https://electron-vite.org",
"homepage": "https://hydralauncher.site",
"repository": {
"type": "git",
"url": "https://github.com/hydralauncher/hydra.git"

View File

@ -3,7 +3,7 @@
"featured": "Destaque",
"recently_added": "Novidades",
"trending": "Populares",
"surprise_me": "Me surpreenda",
"surprise_me": "Surpreenda-me",
"no_results": "Nenhum resultado encontrado"
},
"sidebar": {

View File

@ -13,11 +13,6 @@ export const hero = style({
cursor: "pointer",
border: `solid 1px ${vars.color.borderColor}`,
zIndex: "1",
"@media": {
"(min-width: 1250px)": {
backgroundPosition: "center",
},
},
});
export const heroMedia = style({

View File

@ -41,6 +41,7 @@ export function Modal({
const isTopMostModal = () => {
const openModals = document.querySelectorAll("[role=modal]");
return (
openModals.length &&
openModals[openModals.length - 1] === modalContentRef.current
@ -48,34 +49,37 @@ export function Modal({
};
useEffect(() => {
const onKeyDown = (e: KeyboardEvent) => {
if (e.key === "Escape" && isTopMostModal()) {
handleCloseClick();
}
};
window.addEventListener("keydown", onKeyDown);
return () => window.removeEventListener("keydown", onKeyDown);
}, [handleCloseClick]);
useEffect(() => {
const onMouseDown = (e: MouseEvent) => {
if (!isTopMostModal()) return;
if (modalContentRef.current) {
const clickedOutsideContent = modalContentRef.current.contains(
e.target as Node
);
if (clickedOutsideContent) {
if (visible) {
const onKeyDown = (e: KeyboardEvent) => {
if (e.key === "Escape" && isTopMostModal()) {
handleCloseClick();
}
}
};
};
window.addEventListener("mousedown", onMouseDown);
return () => window.removeEventListener("mousedown", onMouseDown);
}, [handleCloseClick]);
const onMouseDown = (e: MouseEvent) => {
if (!isTopMostModal()) return;
if (modalContentRef.current) {
const clickedWithinModal = modalContentRef.current.contains(
e.target as Node
);
if (!clickedWithinModal) {
handleCloseClick();
}
}
};
window.addEventListener("keydown", onKeyDown);
window.addEventListener("mousedown", onMouseDown);
return () => {
window.removeEventListener("keydown", onKeyDown);
window.removeEventListener("mousedown", onMouseDown);
};
}
return () => {};
}, [handleCloseClick, visible]);
useEffect(() => {
dispatch(toggleDragging(visible));

View File

@ -7,7 +7,7 @@ export interface TextFieldProps
React.InputHTMLAttributes<HTMLInputElement>,
HTMLInputElement
> {
theme?: RecipeVariants<typeof styles.textField>["theme"];
theme?: NonNullable<RecipeVariants<typeof styles.textField>>["theme"];
label?: string;
}

View File

@ -137,17 +137,19 @@ export function GameDetails() {
repackId: number,
downloadPath: string
) => {
return startDownload(
repackId,
gameDetails.objectID,
gameDetails.name,
shop as GameShop,
downloadPath
).then(() => {
getGame();
setShowRepacksModal(false);
setShowSelectFolderModal(false);
});
if (gameDetails) {
return startDownload(
repackId,
gameDetails.objectID,
gameDetails.name,
shop as GameShop,
downloadPath
).then(() => {
getGame();
setShowRepacksModal(false);
setShowSelectFolderModal(false);
});
}
};
const handleRandomizerClick = async () => {
@ -261,7 +263,7 @@ export function GameDetails() {
title: gameDetails?.name,
}),
}}
></div>
/>
</div>
</div>
</section>