mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-01-23 21:44:55 +03:00
chore: merge with main
This commit is contained in:
parent
f7c2c2630d
commit
5fb33646ce
@ -1,10 +1,10 @@
|
|||||||
{
|
{
|
||||||
"name": "hydra",
|
"name": "hydra",
|
||||||
"version": "1.0.0",
|
"version": "1.1.1",
|
||||||
"description": "Hydra",
|
"description": "Hydra",
|
||||||
"main": "./out/main/index.js",
|
"main": "./out/main/index.js",
|
||||||
"author": "Los Broxas",
|
"author": "Los Broxas",
|
||||||
"homepage": "https://electron-vite.org",
|
"homepage": "https://hydralauncher.site",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/hydralauncher/hydra.git"
|
"url": "https://github.com/hydralauncher/hydra.git"
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"featured": "Destaque",
|
"featured": "Destaque",
|
||||||
"recently_added": "Novidades",
|
"recently_added": "Novidades",
|
||||||
"trending": "Populares",
|
"trending": "Populares",
|
||||||
"surprise_me": "Me surpreenda",
|
"surprise_me": "Surpreenda-me",
|
||||||
"no_results": "Nenhum resultado encontrado"
|
"no_results": "Nenhum resultado encontrado"
|
||||||
},
|
},
|
||||||
"sidebar": {
|
"sidebar": {
|
||||||
|
@ -13,11 +13,6 @@ export const hero = style({
|
|||||||
cursor: "pointer",
|
cursor: "pointer",
|
||||||
border: `solid 1px ${vars.color.borderColor}`,
|
border: `solid 1px ${vars.color.borderColor}`,
|
||||||
zIndex: "1",
|
zIndex: "1",
|
||||||
"@media": {
|
|
||||||
"(min-width: 1250px)": {
|
|
||||||
backgroundPosition: "center",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
export const heroMedia = style({
|
export const heroMedia = style({
|
||||||
|
@ -41,6 +41,7 @@ export function Modal({
|
|||||||
|
|
||||||
const isTopMostModal = () => {
|
const isTopMostModal = () => {
|
||||||
const openModals = document.querySelectorAll("[role=modal]");
|
const openModals = document.querySelectorAll("[role=modal]");
|
||||||
|
|
||||||
return (
|
return (
|
||||||
openModals.length &&
|
openModals.length &&
|
||||||
openModals[openModals.length - 1] === modalContentRef.current
|
openModals[openModals.length - 1] === modalContentRef.current
|
||||||
@ -48,34 +49,37 @@ export function Modal({
|
|||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const onKeyDown = (e: KeyboardEvent) => {
|
if (visible) {
|
||||||
if (e.key === "Escape" && isTopMostModal()) {
|
const onKeyDown = (e: KeyboardEvent) => {
|
||||||
handleCloseClick();
|
if (e.key === "Escape" && isTopMostModal()) {
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
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) {
|
|
||||||
handleCloseClick();
|
handleCloseClick();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
};
|
|
||||||
|
|
||||||
window.addEventListener("mousedown", onMouseDown);
|
const onMouseDown = (e: MouseEvent) => {
|
||||||
return () => window.removeEventListener("mousedown", onMouseDown);
|
if (!isTopMostModal()) return;
|
||||||
}, [handleCloseClick]);
|
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(() => {
|
useEffect(() => {
|
||||||
dispatch(toggleDragging(visible));
|
dispatch(toggleDragging(visible));
|
||||||
|
@ -7,7 +7,7 @@ export interface TextFieldProps
|
|||||||
React.InputHTMLAttributes<HTMLInputElement>,
|
React.InputHTMLAttributes<HTMLInputElement>,
|
||||||
HTMLInputElement
|
HTMLInputElement
|
||||||
> {
|
> {
|
||||||
theme?: RecipeVariants<typeof styles.textField>["theme"];
|
theme?: NonNullable<RecipeVariants<typeof styles.textField>>["theme"];
|
||||||
label?: string;
|
label?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -137,17 +137,19 @@ export function GameDetails() {
|
|||||||
repackId: number,
|
repackId: number,
|
||||||
downloadPath: string
|
downloadPath: string
|
||||||
) => {
|
) => {
|
||||||
return startDownload(
|
if (gameDetails) {
|
||||||
repackId,
|
return startDownload(
|
||||||
gameDetails.objectID,
|
repackId,
|
||||||
gameDetails.name,
|
gameDetails.objectID,
|
||||||
shop as GameShop,
|
gameDetails.name,
|
||||||
downloadPath
|
shop as GameShop,
|
||||||
).then(() => {
|
downloadPath
|
||||||
getGame();
|
).then(() => {
|
||||||
setShowRepacksModal(false);
|
getGame();
|
||||||
setShowSelectFolderModal(false);
|
setShowRepacksModal(false);
|
||||||
});
|
setShowSelectFolderModal(false);
|
||||||
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleRandomizerClick = async () => {
|
const handleRandomizerClick = async () => {
|
||||||
@ -261,7 +263,7 @@ export function GameDetails() {
|
|||||||
title: gameDetails?.name,
|
title: gameDetails?.name,
|
||||||
}),
|
}),
|
||||||
}}
|
}}
|
||||||
></div>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
Loading…
Reference in New Issue
Block a user