fix: fixing bottom panel scss

This commit is contained in:
Chubby Granny Chaser
2024-11-28 10:13:23 +00:00
parent f66bdd706b
commit f35c34fa63
10 changed files with 78 additions and 152 deletions

View File

@@ -6,8 +6,45 @@
<title>Hydra</title>
<meta
http-equiv="Content-Security-Policy"
content="default-src 'self'; script-src *; style-src 'self' 'unsafe-inline'; img-src 'self' data: local: *; media-src 'self' local: data: *; connect-src *; font-src *;"
content="default-src 'self'; script-src * 'unsafe-inline'; style-src 'self' 'unsafe-inline' https://do.featurebase.app/js/sdk.css; img-src 'self' data: local: *; media-src 'self' local: data: *; connect-src *; font-src *;"
/>
<script>
!(function (e, t) {
const a = "featurebase-sdk";
function n() {
if (!t.getElementById(a)) {
var e = t.createElement("script");
(e.id = a),
(e.src = "https://do.featurebase.app/js/sdk.js"),
t
.getElementsByTagName("script")[0]
.parentNode.insertBefore(
e,
t.getElementsByTagName("script")[0]
);
}
}
"function" != typeof e.Featurebase &&
(e.Featurebase = function () {
(e.Featurebase.q = e.Featurebase.q || []).push(arguments);
}),
"complete" === t.readyState || "interactive" === t.readyState
? n()
: t.addEventListener("DOMContentLoaded", n);
})(window, document);
</script>
<script>
Featurebase("initialize_feedback_widget", {
organization: "https://hydralauncher.featurebase.app", // Replace this with your organization name, copy-paste the subdomain part from your Featurebase workspace url (e.g. https://*yourorg*.featurebase.app)
theme: "light", // required
placement: "right", // optional - remove to hide the floating button
email: "youruser@example.com", // optional
defaultBoard: "yourboardname", // optional - preselect a board
locale: "en", // Change the language, view all available languages from https://help.featurebase.app/en/articles/8879098-using-featurebase-in-my-language
metadata: null, // Attach session-specific metadata to feedback. Refer to the advanced section for the details: https://help.featurebase.app/en/articles/3774671-advanced#7k8iriyap66
});
</script>
</head>
<body>
<div id="root"></div>

View File

@@ -1,7 +1,7 @@
@use "../../scss/globals.scss";
.bottom-panel {
width: "100%";
width: 100%;
border-top: solid 1px globals.$border-color;
background-color: globals.$background-color;
padding: calc(globals.$spacing-unit / 2) calc(globals.$spacing-unit * 2);

View File

@@ -66,7 +66,8 @@ declare global {
) => Promise<ShopDetails | null>;
getRandomGame: () => Promise<Steam250Game>;
getHowLongToBeat: (
title: string
shop: GameShop,
objectId: string
) => Promise<HowLongToBeatCategory[] | null>;
getGames: (take?: number, skip?: number) => Promise<CatalogueEntry[]>;
searchGameRepacks: (query: string) => Promise<GameRepack[]>;

View File

@@ -97,8 +97,10 @@ export function Sidebar() {
});
} else {
try {
const howLongToBeat =
await window.electron.getHowLongToBeat(gameTitle);
const howLongToBeat = await window.electron.getHowLongToBeat(
shop,
objectId
);
if (howLongToBeat) {
howLongToBeatEntriesTable.add({

View File

@@ -45,22 +45,25 @@ export function ProfileContent() {
return userProfile?.relation?.status === "ACCEPTED";
}, [userProfile]);
const buildUserGameDetailsPath = (game: UserGame) => {
if (!userProfile?.hasActiveSubscription || game.achievementCount === 0) {
return buildGameDetailsPath({
...game,
objectId: game.objectId,
});
}
const buildUserGameDetailsPath = useCallback(
(game: UserGame) => {
if (!userProfile?.hasActiveSubscription || game.achievementCount === 0) {
return buildGameDetailsPath({
...game,
objectId: game.objectId,
});
}
const userParams = userProfile
? {
userId: userProfile.id,
}
: undefined;
const userParams = userProfile
? {
userId: userProfile.id,
}
: undefined;
return buildGameAchievementPath({ ...game }, userParams);
};
return buildGameAchievementPath({ ...game }, userParams);
},
[userProfile]
);
const formatPlayTime = useCallback(
(playTimeInSeconds = 0) => {
@@ -176,7 +179,7 @@ export function ProfileContent() {
game.achievementCount > 0 && (
<div
style={{
color: "white",
color: "#fff",
width: "100%",
display: "flex",
flexDirection: "column",
@@ -232,6 +235,8 @@ export function ProfileContent() {
borderRadius: 4,
width: "100%",
height: "100%",
minWidth: "100%",
minHeight: "100%",
}}
/>
</button>
@@ -259,6 +264,7 @@ export function ProfileContent() {
userStats,
numberFormatter,
t,
buildUserGameDetailsPath,
formatPlayTime,
navigate,
]);