diff --git a/client/src/pages/admin/AdminPage.tsx b/client/src/pages/admin/AdminPage.tsx index ee32e30b340c16fa9e55fb8632eaf63af30c6eef..a8b1746aa8ee4e7564a6f13dc074b11082002747 100644 --- a/client/src/pages/admin/AdminPage.tsx +++ b/client/src/pages/admin/AdminPage.tsx @@ -74,12 +74,6 @@ const AdminView: React.FC = () => { dispatch(getRoles()) dispatch(getTypes()) dispatch(getStatistics()) - axios.get('/api/competitions/1/codes').then((r) => console.log(r.data.items)) - /* axios.post('/api/competitions/1/teams/1/answers', { - question_id: 2, - data: { text: 'Hej svar 2' }, - score: 0, - }) */ }, []) const menuAdminItems = [ diff --git a/client/src/pages/views/JudgeViewPage.test.tsx b/client/src/pages/views/JudgeViewPage.test.tsx index 29de4d12e22fcaac0f6af990bc504077a977b470..2e15f0904705726d364672b87af478ddaf922fbb 100644 --- a/client/src/pages/views/JudgeViewPage.test.tsx +++ b/client/src/pages/views/JudgeViewPage.test.tsx @@ -9,7 +9,7 @@ import JudgeViewPage from './JudgeViewPage' it('renders judge view page', () => { const compRes: any = { data: { - slides: [{ id: 0, title: '' }], + slides: [{ id: 0, title: '', questions: [{ id: 0 }] }], }, } const teamsRes: any = { diff --git a/client/src/pages/views/JudgeViewPage.tsx b/client/src/pages/views/JudgeViewPage.tsx index 63967e3d0cdfc09856a612e8bf07a52af99f5936..5a806d237f190d6483bc8265ec0eac61c58e9151 100644 --- a/client/src/pages/views/JudgeViewPage.tsx +++ b/client/src/pages/views/JudgeViewPage.tsx @@ -108,7 +108,7 @@ const JudgeViewPage = ({ competitionId, code }: JudgeViewPageProps) => { > <div className={classes.toolbar} /> {currentQuestion && ( - <ScoreHeaderPaper rightDrawerWidth={rightDrawerWidth} elevation={4}> + <ScoreHeaderPaper $rightDrawerWidth={rightDrawerWidth} elevation={4}> <Typography variant="h4">{`${currentQuestion.name} (${currentQuestion.total_score}p)`}</Typography> </ScoreHeaderPaper> )} diff --git a/client/src/pages/views/styled.tsx b/client/src/pages/views/styled.tsx index bb78b4f8f18911e4d8d65507bd36c435a0022561..8f63892ade7928842c12d4dc73df988a505f4cea 100644 --- a/client/src/pages/views/styled.tsx +++ b/client/src/pages/views/styled.tsx @@ -1,4 +1,4 @@ -import { AppBar, Button, Drawer, Paper, Toolbar, Typography } from '@material-ui/core' +import { AppBar, Button, Card, Drawer, Paper, Toolbar, Typography } from '@material-ui/core' import styled from 'styled-components' export const JudgeAppBar = styled(AppBar)` @@ -148,13 +148,13 @@ export const ParticipantContainer = styled.div` ` interface ScoreHeaderPaperProps { - rightDrawerWidth: number + $rightDrawerWidth: number } -export const ScoreHeaderPaper = styled(Paper)<ScoreHeaderPaperProps>` +export const ScoreHeaderPaper = styled(Card)<ScoreHeaderPaperProps>` position: absolute; top: 66px; - width: ${(props) => (props ? props.rightDrawerWidth : 0)}px; + width: ${(props) => (props ? props.$rightDrawerWidth : 0)}px; height: 71px; display: flex; justify-content: center; @@ -163,9 +163,9 @@ export const ScoreHeaderPaper = styled(Paper)<ScoreHeaderPaperProps>` ` export const ScoreHeaderPadding = styled.div` - height: 93px; + min-height: 71px; ` export const ScoreFooterPadding = styled.div` - height: 322px; + min-height: 250px; ` diff --git a/client/src/reducers/presentationReducer.test.ts b/client/src/reducers/presentationReducer.test.ts index ee08e0685125f095274474430008f4ad4eaa357e..202d9406853628a32c77b9e42e1bcc502299889d 100644 --- a/client/src/reducers/presentationReducer.test.ts +++ b/client/src/reducers/presentationReducer.test.ts @@ -6,7 +6,8 @@ import presentationReducer from './presentationReducer' const initialState = { competition: { name: '', - id: 0, + id: 1, + background_image: undefined, city_id: 0, slides: [], year: 0, @@ -14,7 +15,8 @@ const initialState = { }, slide: { competition_id: 0, - id: 0, + background_image: undefined, + id: -1, order: 0, timer: 0, title: '', @@ -48,7 +50,7 @@ it('should handle SET_PRESENTATION_COMPETITION', () => { }) ).toEqual({ competition: testCompetition, - slide: testCompetition.slides[0], + slide: initialState.slide, code: initialState.code, timer: initialState.timer, })