import * as _ from 'lodash'; import {Card, CardHeader, CardText} from 'material-ui/Card'; import * as React from 'react'; import {colors} from 'ts/utils/colors'; export interface QuestionProps { prompt: string; answer: React.ReactNode; shouldDisplayExpanded: boolean; } interface QuestionState { isExpanded: boolean; } export class Question extends React.Component { constructor(props: QuestionProps) { super(props); this.state = { isExpanded: props.shouldDisplayExpanded, }; } public render() { return (
{this.props.answer}
); } private onExchangeChange() { this.setState({ isExpanded: !this.state.isExpanded, }); } }