Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make editor logo changeable #1336

Merged
merged 8 commits into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes
23 changes: 20 additions & 3 deletions src/main/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { LuKeyboard } from "react-icons/lu";
import { MainMenuStateNames } from "../types";
import { basicButtonStyle, BREAKPOINT_MEDIUM, BREAKPOINT_SMALL, flexGapReplacementStyle } from "../cssStyles";

import LogoSvg from "../img/opencast-editor.svg?react";
import { selectIsEnd } from "../redux/endSlice";
import { checkboxMenuItem, HeaderMenuItemDef, ProtoButton, useColorScheme, WithHeaderMenu } from "@opencast/appkit";
import { IconType } from "react-icons";
Expand Down Expand Up @@ -91,6 +90,23 @@ function Header() {
);
}

const LogoPicture: React.FC = () => {
const path = (filename:string) => import.meta.env.BASE_URL + filename;
return (
<div>
<picture css={{
height: "100%",
"> *": {
height: "calc(100% - 0.5px)",
},
}}>
<source srcSet={path("opencast-editor.svg")}></source>
<img src={path("opencast-editor.svg")} alt="Opencast Editor Logo"/>
</picture>
</div>
);
};

const Logo: React.FC = () => {

const { t } = useTranslation();
Expand All @@ -99,11 +115,12 @@ const Logo: React.FC = () => {
const logo = css({
paddingLeft: "8px",
opacity: scheme === "dark" ? "0.8" : "1",

display: "flex",
height: "100%",
"> *": {
height: "calc(100% - 12px)",
},
alignItems: "center",

// Unset a bunch of CSS to keep the logo clean
outline: "unset",
Expand All @@ -117,7 +134,7 @@ const Logo: React.FC = () => {

return (
<MainMenuButton
Icon={LogoSvg}
Icon={LogoPicture}
stateName={MainMenuStateNames.cutting}
bottomText={""}
ariaLabelText={t("mainMenu.cutting-button")}
Expand Down
Loading