From 439cff5c16dd44823688ee290aa2fa393c9ff25e Mon Sep 17 00:00:00 2001 From: Chris Whong Date: Fri, 15 Nov 2019 11:55:16 -0500 Subject: [PATCH] feat: style selected column header when stats are displayed --- app/components/Body.tsx | 3 ++- app/components/BodyTable.tsx | 5 +++-- app/components/DetailsBar.tsx | 4 ++-- app/scss/_body.scss | 16 +++++++++++----- 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/app/components/Body.tsx b/app/components/Body.tsx index 766f1975..42657d25 100644 --- a/app/components/Body.tsx +++ b/app/components/Body.tsx @@ -115,8 +115,9 @@ const Body: React.FunctionComponent = (props) => { ? : Promise setDetailsBar: (index: number) => void pageInfo: PageInfo @@ -95,7 +96,7 @@ export default class BodyTable extends React.Component { } render () { - const { body, headers, pageInfo, setDetailsBar } = this.props + const { body, headers, pageInfo, highlighedColumnIndex, setDetailsBar } = this.props const { fetchedAll } = pageInfo const tableRows = body.map((row, i) => { @@ -128,7 +129,7 @@ export default class BodyTable extends React.Component { {headers && headers.map((d: any, j: number) => { return ( - +
setDetailsBar(j)}>{d}
) diff --git a/app/components/DetailsBar.tsx b/app/components/DetailsBar.tsx index cf29bd05..8c289b3a 100644 --- a/app/components/DetailsBar.tsx +++ b/app/components/DetailsBar.tsx @@ -2,7 +2,7 @@ import * as React from 'react' import { Details, DetailsType, StatsDetails } from '../models/details' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { faTimes } from '@fortawesome/free-solid-svg-icons' -import Stat from './stats/Stat' +import Stat from './StatsChart' export interface DetailsBarProps { details: Details @@ -19,7 +19,7 @@ const DetailsBar: React.FunctionComponent = (props) => { return (

{statsDetails.title}

- +
) } diff --git a/app/scss/_body.scss b/app/scss/_body.scss index 05350ece..6c414609 100644 --- a/app/scss/_body.scss +++ b/app/scss/_body.scss @@ -42,6 +42,15 @@ // body table #body-table-container { + th:hover:not(.highlighted) { + background: #dcdcdc; + } + + .highlighted { + background: #cdcdcd; + font-weight: 600; + text-decoration: underline; + } .cell { display: block; @@ -56,7 +65,7 @@ white-space: nowrap; } - th:first-child .cell, td:first-child .cell { + th:first-child .cell, td:first-child .cell, td:nth-child(2) .cell { border-left: none; } @@ -71,10 +80,7 @@ top: 0; background: #e6e6e6; font-weight: 500; - } - - thead .cell { - border-bottom: 1px solid #ECECEC; + cursor: pointer; } tfoot {