Skip to content

Commit

Permalink
Merge 19c61ff into 632370c
Browse files Browse the repository at this point in the history
  • Loading branch information
rileyjbauer committed Dec 4, 2018
2 parents 632370c + 19c61ff commit dbe0240
Show file tree
Hide file tree
Showing 5 changed files with 16,816 additions and 70 deletions.
37 changes: 21 additions & 16 deletions frontend/src/components/CollapseButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,24 @@ interface CollapseButtonProps {
sectionName: string;
}

export default (props: CollapseButtonProps) => {
const collapseSections = props.compareComponent.state.collapseSections;
const sectionName = props.sectionName;
return <div>
<Button onClick={() => {
collapseSections[sectionName] = !collapseSections[sectionName];
props.compareComponent.setState({ collapseSections });
}} title='Expand/Collapse this section' className={css.collapseBtn}>
<ExpandedIcon className={classes(
css.icon,
collapseSections[sectionName] ? css.collapsed : '',
)} />
{sectionName}
</Button>
</div>;
};
class CollapseButton extends React.Component<CollapseButtonProps> {

public render(): JSX.Element {
const collapseSections = this.props.compareComponent.state.collapseSections;
const sectionName = this.props.sectionName;
return <div>
<Button onClick={() => {
collapseSections[sectionName] = !collapseSections[sectionName];
this.props.compareComponent.setState({ collapseSections });
}} title='Expand/Collapse this section' className={css.collapseBtn}>
<ExpandedIcon className={classes(
css.icon,
collapseSections[sectionName] ? css.collapsed : '',
)} />
{sectionName}
</Button>
</div>;
}
}

export default CollapseButton;
Loading

0 comments on commit dbe0240

Please sign in to comment.