mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-02-09 03:37:45 +03:00
feat: refactoring notification window
This commit is contained in:
parent
d5b1bcdc7f
commit
beaa919c80
@ -85,12 +85,6 @@ export const mergeAchievements = async (
|
|||||||
shop,
|
shop,
|
||||||
achievementsInfo
|
achievementsInfo
|
||||||
);
|
);
|
||||||
|
|
||||||
WindowManager.notificationWindow?.setBounds({ y: 50 });
|
|
||||||
|
|
||||||
setTimeout(() => {
|
|
||||||
WindowManager.notificationWindow?.setBounds({ y: -9999 });
|
|
||||||
}, 4000);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const mergedLocalAchievements = unlockedAchievements.concat(newAchievements);
|
const mergedLocalAchievements = unlockedAchievements.concat(newAchievements);
|
||||||
|
@ -104,19 +104,21 @@ export class WindowManager {
|
|||||||
maximizable: false,
|
maximizable: false,
|
||||||
autoHideMenuBar: true,
|
autoHideMenuBar: true,
|
||||||
minimizable: false,
|
minimizable: false,
|
||||||
focusable: true,
|
focusable: false,
|
||||||
skipTaskbar: true,
|
skipTaskbar: true,
|
||||||
frame: false,
|
frame: false,
|
||||||
width: 240,
|
width: 240,
|
||||||
height: 60,
|
height: 60,
|
||||||
x: 25,
|
x: 25,
|
||||||
y: -9999,
|
y: 25,
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
preload: path.join(__dirname, "../preload/index.mjs"),
|
preload: path.join(__dirname, "../preload/index.mjs"),
|
||||||
sandbox: false,
|
sandbox: false,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.notificationWindow.setIgnoreMouseEvents(true);
|
||||||
|
this.notificationWindow.webContents.openDevTools();
|
||||||
this.notificationWindow.setVisibleOnAllWorkspaces(true, {
|
this.notificationWindow.setVisibleOnAllWorkspaces(true, {
|
||||||
visibleOnFullScreen: true,
|
visibleOnFullScreen: true,
|
||||||
});
|
});
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data: local: *; media-src 'self' local: data: *;"
|
content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data: local: *; media-src 'self' local: data: *;"
|
||||||
/>
|
/>
|
||||||
</head>
|
</head>
|
||||||
<body style="background-color: #1c1c1c">
|
<body>
|
||||||
<div id="root"></div>
|
<div id="root"></div>
|
||||||
<script type="module" src="/src/main.tsx"></script>
|
<script type="module" src="/src/main.tsx"></script>
|
||||||
</body>
|
</body>
|
||||||
|
@ -35,7 +35,6 @@ globalStyle("body", {
|
|||||||
userSelect: "none",
|
userSelect: "none",
|
||||||
fontFamily: "Noto Sans, sans-serif",
|
fontFamily: "Noto Sans, sans-serif",
|
||||||
fontSize: vars.size.body,
|
fontSize: vars.size.body,
|
||||||
background: vars.color.background,
|
|
||||||
color: vars.color.body,
|
color: vars.color.body,
|
||||||
margin: "0",
|
margin: "0",
|
||||||
});
|
});
|
||||||
|
@ -28,7 +28,7 @@ import {
|
|||||||
import { store } from "./store";
|
import { store } from "./store";
|
||||||
|
|
||||||
import resources from "@locales";
|
import resources from "@locales";
|
||||||
import { Achievemnt } from "./pages/achievement/achievement";
|
import { Achievement } from "./pages/achievement/achievement";
|
||||||
|
|
||||||
import "./workers";
|
import "./workers";
|
||||||
import { RepacksContextProvider } from "./context";
|
import { RepacksContextProvider } from "./context";
|
||||||
@ -70,7 +70,7 @@ ReactDOM.createRoot(document.getElementById("root")!).render(
|
|||||||
<Route path="/settings" Component={Settings} />
|
<Route path="/settings" Component={Settings} />
|
||||||
<Route path="/profile/:userId" Component={Profile} />
|
<Route path="/profile/:userId" Component={Profile} />
|
||||||
</Route>
|
</Route>
|
||||||
<Route path="/achievement-notification" Component={Achievemnt} />
|
<Route path="/achievement-notification" Component={Achievement} />
|
||||||
</Routes>
|
</Routes>
|
||||||
</HashRouter>
|
</HashRouter>
|
||||||
</RepacksContextProvider>
|
</RepacksContextProvider>
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
import { useEffect, useMemo, useState } from "react";
|
import { useEffect, useMemo, useState } from "react";
|
||||||
import achievementSound from "@renderer/assets/audio/achievement.wav";
|
import achievementSound from "@renderer/assets/audio/achievement.wav";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
import { vars } from "@renderer/theme.css";
|
||||||
|
|
||||||
export function Achievemnt() {
|
export function Achievement() {
|
||||||
const { t } = useTranslation("achievement");
|
const { t } = useTranslation("achievement");
|
||||||
|
|
||||||
const [achievementInfo, setAchievementInfo] = useState<{
|
const [achievementInfo, setAchievementInfo] = useState<{
|
||||||
@ -39,7 +40,7 @@ export function Achievemnt() {
|
|||||||
};
|
};
|
||||||
}, [audio]);
|
}, [audio]);
|
||||||
|
|
||||||
if (!achievementInfo) return <p>Nada</p>;
|
if (!achievementInfo) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
@ -48,6 +49,7 @@ export function Achievemnt() {
|
|||||||
flexDirection: "row",
|
flexDirection: "row",
|
||||||
gap: "8px",
|
gap: "8px",
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
|
background: vars.color.background,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
|
@ -4021,6 +4021,11 @@ delayed-stream@~1.0.0:
|
|||||||
resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619"
|
resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619"
|
||||||
integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==
|
integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==
|
||||||
|
|
||||||
|
delegates@^1.0.0:
|
||||||
|
version "1.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a"
|
||||||
|
integrity sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==
|
||||||
|
|
||||||
detect-libc@^2.0.0, detect-libc@^2.0.1:
|
detect-libc@^2.0.0, detect-libc@^2.0.1:
|
||||||
version "2.0.3"
|
version "2.0.3"
|
||||||
resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-2.0.3.tgz#f0cd503b40f9939b894697d19ad50895e30cf700"
|
resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-2.0.3.tgz#f0cd503b40f9939b894697d19ad50895e30cf700"
|
||||||
@ -7230,7 +7235,7 @@ read-binary-file-arch@^1.0.6:
|
|||||||
dependencies:
|
dependencies:
|
||||||
debug "^4.3.4"
|
debug "^4.3.4"
|
||||||
|
|
||||||
readable-stream@^3.1.1, readable-stream@^3.4.0:
|
readable-stream@^3.1.1, readable-stream@^3.4.0, readable-stream@^3.6.0:
|
||||||
version "3.6.2"
|
version "3.6.2"
|
||||||
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.2.tgz#56a9b36ea965c00c5a93ef31eb111a0f11056967"
|
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.2.tgz#56a9b36ea965c00c5a93ef31eb111a0f11056967"
|
||||||
integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==
|
integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==
|
||||||
|
Loading…
Reference in New Issue
Block a user