Skip to content

Commit

Permalink
Merge pull request #1035 from lkiesow/header
Browse files Browse the repository at this point in the history
Make Studio and Editor look alike
  • Loading branch information
Arnei authored Apr 20, 2023
2 parents 9888bb0 + 2b21801 commit ca997e8
Show file tree
Hide file tree
Showing 5 changed files with 132 additions and 3 deletions.
95 changes: 95 additions & 0 deletions public/opencast-editor.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import React from 'react';
import Body from './main/Body';
import Header from './main/Header';
import { GlobalStyle } from './cssStyles';
import { useSelector } from 'react-redux';
import { selectThemeState } from './redux/themeSlice';

function App() {
const theme = useSelector(selectThemeState);

return (
<div className="App" css={theme}>
<GlobalStyle />
<Header />
<Body />
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion src/main/Body.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const Body: React.FC<{}> = () => {
const bodyStyle = css({
display: 'flex',
flexDirection: 'row',
height: '100%',
height: 'calc(100% - 48px)',
});

return (
Expand Down
32 changes: 32 additions & 0 deletions src/main/Header.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import React from 'react';

import { useSelector } from "react-redux"
import { selectThemeState } from "../redux/themeSlice"
import { css } from '@emotion/react'

function Header() {
const themeState = useSelector(selectThemeState);

const header = themeState.startsWith('high-contrast-')
? css({
height: '46px',
backgroundColor: '#000',
borderBottom: '2px solid white'
})
: css({
height: '48px',
backgroundColor: '#333333',
})

const logo = css({
height: '48px',
})

return (
<div css={header}>
<img src="opencast-editor.svg" css={logo} alt="Opencast Editor" />
</div>
);
}

export default Header;
2 changes: 1 addition & 1 deletion src/main/Timeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const Timeline: React.FC<{
setCurrentlyAt: ActionCreatorWithPayload<number, string>,
setIsPlaying: ActionCreatorWithPayload<boolean, string>,
}> = ({
timelineHeight = 250,
timelineHeight = 200,
styleByActiveSegment = true,
selectCurrentlyAt,
selectIsPlaying,
Expand Down

0 comments on commit ca997e8

Please sign in to comment.