Skip to content

Commit

Permalink
Try and fix logo url
Browse files Browse the repository at this point in the history
  • Loading branch information
Kadrian committed Oct 14, 2024
1 parent 7c965e2 commit 34753bd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
14 changes: 10 additions & 4 deletions frontend/src/js/header/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import styled from "@emotion/styled";
import { FC } from "react";
import { useTranslation } from "react-i18next";
import { useSelector } from "react-redux";

Expand All @@ -10,6 +9,7 @@ import { canViewEntityPreview, useHideLogoutButton } from "../user/selectors";

import { HelpMenu } from "./HelpMenu";
import LogoutButton from "./LogoutButton";
import { useTheme } from "@emotion/react";

const Root = styled("header")`
background-color: ${({ theme }) => theme.col.bg};
Expand Down Expand Up @@ -51,7 +51,6 @@ const Spacer = styled("span")`
const Logo = styled("div")`
height: 40px;
width: ${({ theme }) => theme.img.logoWidth};
background-image: url(${({ theme }) => theme.img.logo});
background-repeat: no-repeat;
background-position-y: 50%;
background-size: ${({ theme }) => theme.img.logoBackgroundSize};
Expand All @@ -68,7 +67,7 @@ const Headline = styled("h1")`
color: ${({ theme }) => theme.col.blueGrayDark};
`;

const Header: FC = () => {
const Header = () => {
const { t } = useTranslation();
const canViewHistory = useSelector<StateT, boolean>(canViewEntityPreview);
const hideLogoutButton = useHideLogoutButton();
Expand All @@ -77,10 +76,17 @@ const Header: FC = () => {
StateT["startup"]["config"]
>((state) => state.startup.config);

const theme = useTheme();
const logo = theme.img.logo;

console.log(theme.img.logo);

return (
<Root>
<OverflowHidden>
<Logo />
<Logo style={{
backgroundImage: `url(${logo})`
}} />
<Spacer />
<Headline>{t("headline")}</Headline>
</OverflowHidden>
Expand Down
1 change: 1 addition & 0 deletions frontend/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export default defineConfig({
build: {
sourcemap: true,
minify: "terser",
assetsInlineLimit: 0,
},
envPrefix: "REACT_APP_",
plugins: [
Expand Down

0 comments on commit 34753bd

Please sign in to comment.