Skip to content
Snippets Groups Projects
Commit 496600a5 authored by Emil's avatar Emil
Browse files

Merge branch '46-add-presentation-style-settings' of...

Merge branch '46-add-presentation-style-settings' of https://gitlab.liu.se/tddd96-grupp11/teknikattan-scoring-system into HEAD
parents 844dab21 56f4e740
No related branches found
No related tags found
2 merge requests!51Resolve "Add routes and template for Presentation view",!45Resolve "Finish competition settings panel layout"
Pipeline #38971 passed
...@@ -51,6 +51,7 @@ const useStyles = makeStyles((theme: Theme) => ...@@ -51,6 +51,7 @@ const useStyles = makeStyles((theme: Theme) =>
}, },
rightDrawerPaper: { rightDrawerPaper: {
width: rightDrawerWidth, width: rightDrawerWidth,
background: '#EAEAEA',
}, },
// necessary for content to be below app bar // necessary for content to be below app bar
toolbar: theme.mixins.toolbar, toolbar: theme.mixins.toolbar,
......
...@@ -9,18 +9,27 @@ const useStyles = makeStyles((theme: Theme) => ...@@ -9,18 +9,27 @@ const useStyles = makeStyles((theme: Theme) =>
'& > *': { '& > *': {
margin: theme.spacing(1), margin: theme.spacing(1),
width: '100%', width: '100%',
background: 'white',
}, },
}, },
textInput: { textInput: {
margin: theme.spacing(2), margin: theme.spacing(2),
width: '87%', width: '87%',
background: 'white',
}, },
textCenter: { textCenter: {
textAlign: 'center', textAlign: 'center',
background: 'white',
}, },
center: { center: {
display: 'flex', display: 'flex',
justifyContent: 'center', justifyContent: 'center',
background: 'white',
},
importedImage: {
width: 70,
height: 50,
background: 'white',
}, },
}) })
) )
...@@ -43,8 +52,8 @@ const CompetitionSettings: React.FC = () => { ...@@ -43,8 +52,8 @@ const CompetitionSettings: React.FC = () => {
<Divider /> <Divider />
<TextField className={classes.textInput} id="outlined-basic" label="Stad" variant="outlined" /> <TextField className={classes.textInput} id="outlined-basic" label="Stad" variant="outlined" />
</form> </form>
<List> <List>
<Divider />
<ListItem> <ListItem>
<ListItemText className={classes.textCenter} primary="Lag" /> <ListItemText className={classes.textCenter} primary="Lag" />
</ListItem> </ListItem>
...@@ -60,6 +69,15 @@ const CompetitionSettings: React.FC = () => { ...@@ -60,6 +69,15 @@ const CompetitionSettings: React.FC = () => {
<Button>Lägg till lag</Button> <Button>Lägg till lag</Button>
</ListItem> </ListItem>
</List> </List>
<ListItem button>
<img
id="temp source, todo: add image source to elements of pictureList"
src="https://i1.wp.com/stickoutmedia.se/wp-content/uploads/2021/01/placeholder-3.png?ssl=1"
className={classes.importedImage}
/>
<ListItemText className={classes.textCenter} primary="Välj bakgrundsbild ..." />
</ListItem>
</div> </div>
) )
} }
......
...@@ -15,11 +15,3 @@ it('renders slide settings tab', () => { ...@@ -15,11 +15,3 @@ it('renders slide settings tab', () => {
tabs.children().at(1).simulate('click') tabs.children().at(1).simulate('click')
expect(wrapper.text().includes('2')).toBe(true) //TODO: check that SlideSettings exists expect(wrapper.text().includes('2')).toBe(true) //TODO: check that SlideSettings exists
}) })
it('renders style settings tab', () => {
const wrapper = mount(<SettingsPanel />)
const tabs = wrapper.find('.MuiTabs-flexContainer')
expect(wrapper.find(CompetitionSettings).length).toEqual(1)
tabs.children().at(2).simulate('click')
expect(wrapper.text().includes('3')).toBe(true) //TODO: check that StyleSettings exists
})
...@@ -13,10 +13,8 @@ function TabContent(props: TabPanelProps) { ...@@ -13,10 +13,8 @@ function TabContent(props: TabPanelProps) {
const { activeTab } = props const { activeTab } = props
if (activeTab === 0) { if (activeTab === 0) {
return <CompetitionSettings /> return <CompetitionSettings />
} else if (activeTab === 1) {
return <SlideSettings />
} }
return <div>3</div> return <SlideSettings />
} }
const SettingsPanel: React.FC = () => { const SettingsPanel: React.FC = () => {
...@@ -27,7 +25,6 @@ const SettingsPanel: React.FC = () => { ...@@ -27,7 +25,6 @@ const SettingsPanel: React.FC = () => {
<Tabs value={activeTab} onChange={(event, val) => setActiveTab(val)} aria-label="simple tabs example"> <Tabs value={activeTab} onChange={(event, val) => setActiveTab(val)} aria-label="simple tabs example">
<SettingsTab label="Tävling" /> <SettingsTab label="Tävling" />
<SettingsTab label="Sida" /> <SettingsTab label="Sida" />
<SettingsTab label="Stil" />
</Tabs> </Tabs>
</AppBar> </AppBar>
<TabContent activeTab={activeTab} /> <TabContent activeTab={activeTab} />
......
import { import {
Button, Button,
Checkbox, Checkbox,
Divider,
FormControl, FormControl,
Grid,
InputLabel, InputLabel,
List, List,
ListItem, ListItem,
...@@ -11,7 +9,6 @@ import { ...@@ -11,7 +9,6 @@ import {
MenuItem, MenuItem,
Select, Select,
TextField, TextField,
Typography,
} from '@material-ui/core' } from '@material-ui/core'
import { createStyles, makeStyles, Theme } from '@material-ui/core/styles' import { createStyles, makeStyles, Theme } from '@material-ui/core/styles'
import CloseIcon from '@material-ui/icons/Close' import CloseIcon from '@material-ui/icons/Close'
...@@ -24,29 +21,39 @@ const useStyles = makeStyles((theme: Theme) => ...@@ -24,29 +21,39 @@ const useStyles = makeStyles((theme: Theme) =>
'& > *': { '& > *': {
margin: theme.spacing(1), margin: theme.spacing(1),
width: '100%', width: '100%',
background: 'white',
}, },
}, },
textInput: { textInput: {
margin: theme.spacing(2), margin: theme.spacing(2),
width: '87%', width: '87%',
background: 'white',
}, },
textCenter: { textCenter: {
textAlign: 'center', textAlign: 'center',
background: 'white',
}, },
center: { center: {
display: 'flex', display: 'flex',
justifyContent: 'center', justifyContent: 'center',
background: 'white',
}, },
slideTypeSelection: { dropDown: {
margin: theme.spacing(2), margin: theme.spacing(2),
width: '87%', width: '87%',
background: 'white',
}, },
clickableIcon: { clickableIcon: {
cursor: 'pointer', cursor: 'pointer',
background: 'white',
}, },
importedImage: { importedImage: {
width: 70, width: 70,
height: 50, height: 50,
background: 'white',
},
whiteBackground: {
background: 'white',
}, },
}) })
) )
...@@ -88,39 +95,39 @@ const SlideSettings: React.FC = () => { ...@@ -88,39 +95,39 @@ const SlideSettings: React.FC = () => {
return ( return (
<div className={classes.textInputContainer}> <div className={classes.textInputContainer}>
<FormControl variant="outlined" className={classes.slideTypeSelection}> <div className={classes.whiteBackground}>
<InputLabel id="slide-type-selection-label">Sidtyp</InputLabel> <FormControl variant="outlined" className={classes.dropDown}>
<Select value={slideTypeSelected} label="Sidtyp" defaultValue="informationSlide" onChange={handleChange}> <InputLabel id="slide-type-selection-label">Sidtyp</InputLabel>
<MenuItem value="informationSlide"> <Select value={slideTypeSelected} label="Sidtyp" defaultValue="informationSlide" onChange={handleChange}>
<Button>Informationssida</Button> <MenuItem value="informationSlide">
</MenuItem> <Button>Informationssida</Button>
<MenuItem value="textQuestion"> </MenuItem>
<Button>Skriftlig fråga</Button> <MenuItem value="textQuestion">
</MenuItem> <Button>Skriftlig fråga</Button>
<MenuItem value="practicalQuestion"> </MenuItem>
<Button>Praktisk fråga</Button> <MenuItem value="practicalQuestion">
</MenuItem> <Button>Praktisk fråga</Button>
<MenuItem value="multipleChoiceQuestion"> </MenuItem>
<Button>Flervalsfråga</Button> <MenuItem value="multipleChoiceQuestion">
</MenuItem> <Button>Flervalsfråga</Button>
</Select> </MenuItem>
</FormControl> </Select>
<Divider /> </FormControl>
</div>
<Grid container spacing={0} justify="space-evenly" alignItems="center"> <ListItem>
<Grid item> <TextField
<Typography variant="subtitle2">Timer (s):</Typography> id="standard-number"
</Grid> variant="outlined"
<Divider orientation="vertical" flexItem /> placeholder="Antal sekunder"
<Grid item> helperText="Lämna blank för att inte använda timerfunktionen"
<TextField margin="dense" id="outlined-basic" label="Antal sekunder" variant="outlined" /> label="Timer"
</Grid> type="number"
</Grid> />
<Divider /> </ListItem>
<List> <List>
<Divider /> <ListItem divider>
<ListItem>
<ListItemText <ListItemText
className={classes.textCenter} className={classes.textCenter}
primary="Svarsalternativ" primary="Svarsalternativ"
...@@ -140,11 +147,9 @@ const SlideSettings: React.FC = () => { ...@@ -140,11 +147,9 @@ const SlideSettings: React.FC = () => {
<Button>Lägg till svarsalternativ</Button> <Button>Lägg till svarsalternativ</Button>
</ListItem> </ListItem>
</List> </List>
<Divider />
<List> <List>
<Divider /> <ListItem divider>
<ListItem>
<ListItemText className={classes.textCenter} primary="Text" /> <ListItemText className={classes.textCenter} primary="Text" />
</ListItem> </ListItem>
{texts.map((text) => ( {texts.map((text) => (
...@@ -160,11 +165,9 @@ const SlideSettings: React.FC = () => { ...@@ -160,11 +165,9 @@ const SlideSettings: React.FC = () => {
<Button>Lägg till text</Button> <Button>Lägg till text</Button>
</ListItem> </ListItem>
</List> </List>
<Divider />
<List> <List>
<Divider /> <ListItem divider>
<ListItem>
<ListItemText className={classes.textCenter} primary="Bilder" /> <ListItemText className={classes.textCenter} primary="Bilder" />
</ListItem> </ListItem>
{pictures.map((picture) => ( {pictures.map((picture) => (
...@@ -184,6 +187,15 @@ const SlideSettings: React.FC = () => { ...@@ -184,6 +187,15 @@ const SlideSettings: React.FC = () => {
<Button>Lägg till bild</Button> <Button>Lägg till bild</Button>
</ListItem> </ListItem>
</List> </List>
<ListItem button>
<img
id="temp source, todo: add image source to elements of pictureList"
src="https://i1.wp.com/stickoutmedia.se/wp-content/uploads/2021/01/placeholder-3.png?ssl=1"
className={classes.importedImage}
/>
<ListItemText className={classes.textCenter}>Välj bakgrundsbild ...</ListItemText>
</ListItem>
</div> </div>
) )
} }
......
...@@ -3,5 +3,5 @@ import styled from 'styled-components' ...@@ -3,5 +3,5 @@ import styled from 'styled-components'
export const SettingsTab = styled(Tab)` export const SettingsTab = styled(Tab)`
height: 64px; height: 64px;
min-width: 130px; min-width: 195px;
` `
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment