Skip to content

Commit

Permalink
chore: more relaxed CSP
Browse files Browse the repository at this point in the history
  • Loading branch information
thegrannychaseroperation committed Nov 5, 2024
1 parent 2840110 commit 0451bc5
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 71 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ jobs:
MAIN_VITE_ANALYTICS_API_URL: ${{ vars.MAIN_VITE_ANALYTICS_API_URL }}
RENDERER_VITE_INTERCOM_APP_ID: ${{ vars.RENDERER_VITE_INTERCOM_APP_ID }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build Windows
if: matrix.os == 'windows-latest'
run: yarn build:win
Expand All @@ -59,7 +58,6 @@ jobs:
MAIN_VITE_ANALYTICS_API_URL: ${{ vars.MAIN_VITE_ANALYTICS_API_URL }}
RENDERER_VITE_INTERCOM_APP_ID: ${{ vars.RENDERER_VITE_INTERCOM_APP_ID }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create artifact
uses: actions/upload-artifact@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<title>Hydra</title>
<meta
http-equiv="Content-Security-Policy"
content="default-src 'self' *.intercom.io wss://nexus-websocket-a.intercom.io; script-src 'self' *.intercom.io *.intercomcdn.com; style-src 'self' 'unsafe-inline'; img-src 'self' data: *; media-src 'self' local: data: *; font-src 'self' https://fonts.intercomcdn.com"
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 *;"
/>
</head>
<body>
Expand Down
2 changes: 2 additions & 0 deletions src/renderer/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ export interface AppProps {
children: React.ReactNode;
}

console.log(import.meta.env);

Intercom({
app_id: import.meta.env.RENDERER_VITE_INTERCOM_APP_ID,
});
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/components/sidebar/sidebar.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export const sidebar = recipe({
borderRight: `solid 1px ${vars.color.border}`,
position: "relative",
overflow: "hidden",
justifyContent: "space-between",
},
variants: {
resizing: {
Expand Down Expand Up @@ -132,7 +133,6 @@ export const helpButton = style({
display: "flex",
alignItems: "center",
cursor: "pointer",
boxShadow: "0px 0px 15px 0px rgba(0, 0, 0, 0.6)",
borderTop: `solid 1px ${vars.color.border}`,
transition: "background-color ease 0.1s",
":hover": {
Expand Down
139 changes: 72 additions & 67 deletions src/renderer/src/components/sidebar/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,75 +188,80 @@ export function Sidebar() {
maxWidth: sidebarWidth,
}}
>
<SidebarProfile />

<div className={styles.content}>
<section className={styles.section}>
<ul className={styles.menu}>
{routes.map(({ nameKey, path, render }) => (
<li
key={nameKey}
className={styles.menuItem({
active: location.pathname === path,
})}
>
<button
type="button"
className={styles.menuItemButton}
onClick={() => handleSidebarItemClick(path)}
<div
style={{ display: "flex", flexDirection: "column", overflow: "hidden" }}
>
<SidebarProfile />

<div className={styles.content}>
<section className={styles.section}>
<ul className={styles.menu}>
{routes.map(({ nameKey, path, render }) => (
<li
key={nameKey}
className={styles.menuItem({
active: location.pathname === path,
})}
>
{render()}
<span>{t(nameKey)}</span>
</button>
</li>
))}
</ul>
</section>

<section className={styles.section}>
<small className={styles.sectionTitle}>{t("my_library")}</small>

<TextField
ref={filterRef}
placeholder={t("filter")}
onChange={handleFilter}
theme="dark"
/>

<ul className={styles.menu}>
{filteredLibrary.map((game) => (
<li
key={game.id}
className={styles.menuItem({
active:
location.pathname === `/game/${game.shop}/${game.objectID}`,
muted: game.status === "removed",
})}
>
<button
type="button"
className={styles.menuItemButton}
onClick={(event) => handleSidebarGameClick(event, game)}
<button
type="button"
className={styles.menuItemButton}
onClick={() => handleSidebarItemClick(path)}
>
{render()}
<span>{t(nameKey)}</span>
</button>
</li>
))}
</ul>
</section>

<section className={styles.section}>
<small className={styles.sectionTitle}>{t("my_library")}</small>

<TextField
ref={filterRef}
placeholder={t("filter")}
onChange={handleFilter}
theme="dark"
/>

<ul className={styles.menu}>
{filteredLibrary.map((game) => (
<li
key={game.id}
className={styles.menuItem({
active:
location.pathname ===
`/game/${game.shop}/${game.objectID}`,
muted: game.status === "removed",
})}
>
{game.iconUrl ? (
<img
className={styles.gameIcon}
src={game.iconUrl}
alt={game.title}
loading="lazy"
/>
) : (
<SteamLogo className={styles.gameIcon} />
)}

<span className={styles.menuItemButtonLabel}>
{getGameTitle(game)}
</span>
</button>
</li>
))}
</ul>
</section>
<button
type="button"
className={styles.menuItemButton}
onClick={(event) => handleSidebarGameClick(event, game)}
>
{game.iconUrl ? (
<img
className={styles.gameIcon}
src={game.iconUrl}
alt={game.title}
loading="lazy"
/>
) : (
<SteamLogo className={styles.gameIcon} />
)}

<span className={styles.menuItemButtonLabel}>
{getGameTitle(game)}
</span>
</button>
</li>
))}
</ul>
</section>
</div>
</div>

{hasActiveSubscription && (
Expand Down

0 comments on commit 0451bc5

Please sign in to comment.