Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toggle sections by clicking header #223

Merged
merged 2 commits into from Jul 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions components/measurement/CommonDetails.js
Expand Up @@ -104,6 +104,7 @@ const CommonDetails = ({
<Box >
<Link color='blue7' href={measurementURL} download={downloadFilename}>
<Button
onClick={(e) => e.stopPropagation()}
fontSize={13}
mx={3}
px={3}>{intl.formatMessage({ id: 'Measurement.CommonDetails.RawMeasurement.Download' })}</Button>
Expand Down
10 changes: 7 additions & 3 deletions components/measurement/DetailsBox.js
Expand Up @@ -44,6 +44,10 @@ const StyledDetailsBox = styled(Box)`
border: 2px solid ${props => props.theme.colors.gray2};
`

const StyledDetailsBoxHeader = styled(Flex)`
cursor: pointer;
`

const CollapseTrigger = styled(MdExpandLess)`
cursor: pointer;
background-color: white;
Expand Down Expand Up @@ -73,14 +77,14 @@ export class DetailsBox extends React.Component {
return (
<StyledDetailsBox width={1} {...rest} mb={3}>
{title &&
<Flex px={3} py={2} bg='gray2' alignItems='center'>
<StyledDetailsBoxHeader px={3} py={2} bg='gray2' alignItems='center' onClick={() => this.onToggle()}>
<Box>
<Heading h={4}>{title}</Heading>
</Box>
<Box ml='auto'>
<CollapseTrigger size={36} isOpen={isOpen} onClick={() => this.onToggle()}/>
<CollapseTrigger size={36} isOpen={isOpen} />
</Box>
</Flex>
</StyledDetailsBoxHeader>
}
{isOpen &&
<Box p={3} flexWrap='wrap'>
Expand Down