Skip to content
Snippets Groups Projects
Commit 88b59d1e authored by esikkala's avatar esikkala
Browse files

InfoHeader: add info icon

parent a83f680d
No related branches found
No related tags found
No related merge requests found
...@@ -8,6 +8,8 @@ import ExpandMoreIcon from '@material-ui/icons/ExpandMore' ...@@ -8,6 +8,8 @@ import ExpandMoreIcon from '@material-ui/icons/ExpandMore'
import Typography from '@material-ui/core/Typography' import Typography from '@material-ui/core/Typography'
import Grid from '@material-ui/core/Grid' import Grid from '@material-ui/core/Grid'
// import Divider from '@material-ui/core/Divider'; // import Divider from '@material-ui/core/Divider';
import IconButton from '@material-ui/core/IconButton'
import InfoIcon from '@material-ui/icons/InfoOutlined'
import intl from 'react-intl-universal' import intl from 'react-intl-universal'
const styles = theme => ({ const styles = theme => ({
...@@ -34,6 +36,15 @@ const styles = theme => ({ ...@@ -34,6 +36,15 @@ const styles = theme => ({
display: 'block', display: 'block',
marginBottom: `${theme.spacing(1)}px !important` marginBottom: `${theme.spacing(1)}px !important`
}, },
headingContainer: {
display: 'flex'
},
infoIconButton: {
marginLeft: theme.spacing(0.5)
},
infoIcon: {
fontSize: 32
},
label: { label: {
marginTop: theme.spacing(1), marginTop: theme.spacing(1),
height: 32, height: 32,
...@@ -84,14 +95,17 @@ const InfoHeader = props => { ...@@ -84,14 +95,17 @@ const InfoHeader = props => {
id='panel1a-header' id='panel1a-header'
IconButtonProps={{ onClick: handleExpandButtonOnClick }} IconButtonProps={{ onClick: handleExpandButtonOnClick }}
> >
<Typography component='h1' variant='h4'> <div className={props.classes.headingContainer}>
{props.pageType === 'facetResults' && intl.get(`perspectives.${props.resultClass}.label`)} <Typography component='h1' variant='h4'>
{props.pageType === 'instancePage' && intl.get(`perspectives.${props.resultClass}.instancePage.label`)} {props.pageType === 'facetResults' && intl.get(`perspectives.${props.resultClass}.label`)}
</Typography> {props.pageType === 'instancePage' && intl.get(`perspectives.${props.resultClass}.instancePage.label`)}
</Typography>
<IconButton className={props.classes.infoIconButton} onClick={handleExpandButtonOnClick}>
<InfoIcon className={props.classes.infoIcon} />
</IconButton>
</div>
{props.pageType === 'instancePage' && {props.pageType === 'instancePage' &&
<> <Typography className={props.classes.label} component='h1' variant='h6'>{generateLabel()}</Typography>}
<Typography className={props.classes.label} component='h1' variant='h6'>{generateLabel()}</Typography>
</>}
</AccordionSummary> </AccordionSummary>
<AccordionDetails <AccordionDetails
className={props.classes.content} className={props.classes.content}
......
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