Skip to content

Commit

Permalink
Make editor logo changable
Browse files Browse the repository at this point in the history
  • Loading branch information
ciegler committed Apr 15, 2024
1 parent 9acd178 commit 3b4ded2
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 3 deletions.
55 changes: 55 additions & 0 deletions public/editor-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 33 additions & 3 deletions src/main/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ 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,20 +91,50 @@ function Header() {
);
}

const LogoPicture: React.FC = () => {
/*Should I import defines plugin, like it is in studio? How?*/

Check warning on line 95 in src/main/Header.tsx

View workflow job for this annotation

GitHub Actions / test

Expected space or tab after '/*' in comment
const path = (filename:string) => "/" + filename;

return (
<div>

Check warning on line 99 in src/main/Header.tsx

View workflow job for this annotation

GitHub Actions / test

Expected indentation of 4 spaces but found 6
<picture css={{

Check warning on line 100 in src/main/Header.tsx

View workflow job for this annotation

GitHub Actions / test

Expected indentation of 6 spaces but found 8
height: "100%",

Check warning on line 101 in src/main/Header.tsx

View workflow job for this annotation

GitHub Actions / test

Expected indentation of 8 spaces but found 10
display: "flex",

Check warning on line 102 in src/main/Header.tsx

View workflow job for this annotation

GitHub Actions / test

Expected indentation of 8 spaces but found 10
opacity: useColorScheme().scheme === "dark" ? 0.8 : 1.0,

Check warning on line 103 in src/main/Header.tsx

View workflow job for this annotation

GitHub Actions / test

Expected indentation of 8 spaces but found 10
paddingLeft: 8,

Check warning on line 104 in src/main/Header.tsx

View workflow job for this annotation

GitHub Actions / test

Expected indentation of 8 spaces but found 10
alignItems: "center",

Check warning on line 105 in src/main/Header.tsx

View workflow job for this annotation

GitHub Actions / test

Expected indentation of 8 spaces but found 10
"> *": {

Check warning on line 106 in src/main/Header.tsx

View workflow job for this annotation

GitHub Actions / test

Expected indentation of 8 spaces but found 10
height: "calc(100% - 0.5px)",

Check warning on line 107 in src/main/Header.tsx

View workflow job for this annotation

GitHub Actions / test

Expected indentation of 10 spaces but found 12
},
}}>
<source srcSet={path("editor-logo.svg")}></source>
<img src={path("editor-logo.svg")} alt="Opencast Editor Logo"/>
</picture>
;
</div>
)
}

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

const { t } = useTranslation();
const {t } = useTranslation();
const { scheme } = useColorScheme();



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",
"&:hover": {
Expand All @@ -117,7 +147,7 @@ const Logo: React.FC = () => {

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

0 comments on commit 3b4ded2

Please sign in to comment.