import React from 'react'; class ResponseSortFields extends React.Component { constructor(props: any) { super(props) this.stateSpecificClass = this.stateSpecificClass.bind(this) this.renderAscendingArrow = this.renderAscendingArrow.bind(this) this.renderSortField = this.renderSortField.bind(this) } stateSpecificClass(stateName: string) { if (this.props.sorting === stateName) { return ' is-active'; } } renderAscendingArrow(stateName: string) { if (this.props.sorting === stateName) { return this.props.ascending ? ' ⬆' : ' ⬇'; } } renderSortField(displayName: string, stateName: string) { return (
  • {displayName} {this.renderAscendingArrow(stateName)}
  • ); } render() { return ( ); } } export { ResponseSortFields }