feat(in-354): fix styles for empty params

pull/100/head
Ruslan Khayrullin 3 years ago
parent 586bb03c66
commit b56dce119d
  1. 3
      src/features/MatchSidePlaylists/components/PlayersTable/Cell.tsx
  2. 1
      src/features/MatchSidePlaylists/components/PlayersTable/index.tsx
  3. 9
      src/features/MatchSidePlaylists/components/PlayersTable/styled.tsx
  4. 2
      src/features/MatchSidePlaylists/components/TeamsStatsTable/Cell.tsx
  5. 9
      src/features/MatchSidePlaylists/components/TeamsStatsTable/styled.tsx

@ -18,6 +18,7 @@ type CellProps = {
as?: 'td' | 'th', as?: 'td' | 'th',
clickable?: boolean, clickable?: boolean,
columnWidth?: number, columnWidth?: number,
hasValue?: boolean,
sorted?: boolean, sorted?: boolean,
tooltipText?: string, tooltipText?: string,
} & HTMLProps<HTMLTableCellElement> } & HTMLProps<HTMLTableCellElement>
@ -28,6 +29,7 @@ const CellFC = ({
children, children,
clickable, clickable,
columnWidth, columnWidth,
hasValue,
onClick, onClick,
sorted, sorted,
tooltipText, tooltipText,
@ -62,6 +64,7 @@ const CellFC = ({
clickable={clickable} clickable={clickable}
columnWidth={columnWidth} columnWidth={columnWidth}
sorted={sorted} sorted={sorted}
hasValue={hasValue}
onMouseOver={tooltipText && !isMobileDevice ? onMouseOver({ onMouseOver={tooltipText && !isMobileDevice ? onMouseOver({
anchorId, anchorId,
horizontalPosition: 'right', horizontalPosition: 'right',

@ -174,6 +174,7 @@ export const PlayersTable = (props: PlayersTableProps) => {
clickable={clickable} clickable={clickable}
sorted={sorted} sorted={sorted}
onClick={onClick} onClick={onClick}
hasValue={value !== '-'}
> >
{watchAllEpisodesTimer {watchAllEpisodesTimer
&& param.id === playingData.player.paramId && param.id === playingData.player.paramId

@ -130,6 +130,7 @@ type CellContainerProps = {
as?: 'td' | 'th', as?: 'td' | 'th',
clickable?: boolean, clickable?: boolean,
columnWidth?: number, columnWidth?: number,
hasValue?: boolean,
sorted?: boolean, sorted?: boolean,
} }
@ -144,7 +145,7 @@ export const CellContainer = styled.td.attrs(({ clickable }: CellContainerProps)
width: ${({ columnWidth }) => (columnWidth ? `${columnWidth}px` : 'auto')}; width: ${({ columnWidth }) => (columnWidth ? `${columnWidth}px` : 'auto')};
min-width: 30px; min-width: 30px;
font-size: 11px; font-size: 11px;
font-weight: ${({ clickable }) => (clickable ? 600 : 400)}; font-weight: ${({ clickable }) => (clickable ? 700 : 400)};
color: ${({ clickable, theme }) => (clickable ? '#5EB2FF' : theme.colors.white)}; color: ${({ clickable, theme }) => (clickable ? '#5EB2FF' : theme.colors.white)};
white-space: nowrap; white-space: nowrap;
background-color: var(--bgColor); background-color: var(--bgColor);
@ -171,6 +172,12 @@ export const CellContainer = styled.td.attrs(({ clickable }: CellContainerProps)
font-size: ${sorted ? 13 : 11}px; font-size: ${sorted ? 13 : 11}px;
` `
: '')} : '')}
${({ hasValue }) => (!hasValue
? css`
color: rgba(255, 255, 255, 0.5);
`
: '')}
` `
export const Row = styled.tr` export const Row = styled.tr`

@ -125,6 +125,7 @@ export const Cell = ({
clickable={isClickable(teamStatItem.param1)} clickable={isClickable(teamStatItem.param1)}
onClick={() => onParamClick(teamStatItem.param1)} onClick={() => onParamClick(teamStatItem.param1)}
data-param-id={teamStatItem.param1.id} data-param-id={teamStatItem.param1.id}
hasValue={Boolean(teamStatItem.param1.val)}
> >
{getDisplayedValue(teamStatItem.param1.val)} {getDisplayedValue(teamStatItem.param1.val)}
</ParamValue> </ParamValue>
@ -150,6 +151,7 @@ export const Cell = ({
clickable={isClickable(teamStatItem.param2)} clickable={isClickable(teamStatItem.param2)}
onClick={() => onParamClick(teamStatItem.param2!)} onClick={() => onParamClick(teamStatItem.param2!)}
data-param-id={teamStatItem.param2.id} data-param-id={teamStatItem.param2.id}
hasValue={Boolean(teamStatItem.param2.val)}
> >
{getDisplayedValue(teamStatItem.param2.val)} {getDisplayedValue(teamStatItem.param2.val)}
</ParamValue> </ParamValue>

@ -84,6 +84,7 @@ export const ParamValueContainer = styled.div``
type TParamValue = { type TParamValue = {
clickable?: boolean, clickable?: boolean,
hasValue?: boolean,
} }
export const ParamValue = styled.span.attrs(({ clickable }: TParamValue) => ({ export const ParamValue = styled.span.attrs(({ clickable }: TParamValue) => ({
@ -94,7 +95,7 @@ export const ParamValue = styled.span.attrs(({ clickable }: TParamValue) => ({
height: 15px; height: 15px;
text-align: center; text-align: center;
position: relative; position: relative;
font-weight: ${({ clickable }) => (clickable ? 600 : 400)}; font-weight: ${({ clickable }) => (clickable ? 700 : 400)};
color: ${({ clickable, theme }) => (clickable ? '#5EB2FF' : theme.colors.white)}; color: ${({ clickable, theme }) => (clickable ? '#5EB2FF' : theme.colors.white)};
${({ clickable }) => (clickable ${({ clickable }) => (clickable
@ -102,6 +103,12 @@ export const ParamValue = styled.span.attrs(({ clickable }: TParamValue) => ({
cursor: pointer; cursor: pointer;
` `
: '')} : '')}
${({ hasValue }) => (!hasValue
? css`
color: rgba(255, 255, 255, 0.5);
`
: '')}
` `
export const StatItemTitle = styled.span` export const StatItemTitle = styled.span`

Loading…
Cancel
Save