|
|
|
|
@ -1,3 +1,5 @@ |
|
|
|
|
import { Link } from 'react-router-dom' |
|
|
|
|
|
|
|
|
|
import styled, { css } from 'styled-components/macro' |
|
|
|
|
|
|
|
|
|
import { isMobileDevice } from 'config' |
|
|
|
|
@ -15,8 +17,12 @@ type ContainerProps = { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export const Container = styled.div<ContainerProps>` |
|
|
|
|
--bgColor: #333; |
|
|
|
|
|
|
|
|
|
${({ isExpanded }) => (isExpanded |
|
|
|
|
? '' |
|
|
|
|
? css` |
|
|
|
|
--bgColor: rgba(51, 51, 51, 0.7); |
|
|
|
|
` |
|
|
|
|
: css` |
|
|
|
|
position: relative; |
|
|
|
|
`)}
|
|
|
|
|
@ -27,15 +33,21 @@ type TableWrapperProps = { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export const TableWrapper = styled.div<TableWrapperProps>` |
|
|
|
|
display: flex; |
|
|
|
|
max-width: 100%; |
|
|
|
|
max-height: calc(100vh - 235px); |
|
|
|
|
max-height: calc(100vh - 203px); |
|
|
|
|
border-radius: 5px; |
|
|
|
|
overflow-x: auto; |
|
|
|
|
scroll-behavior: smooth; |
|
|
|
|
background-color: #333333; |
|
|
|
|
background:
|
|
|
|
|
linear-gradient(180deg, #292929 44px, var(--bgColor) 44px), |
|
|
|
|
linear-gradient(-90deg, #333 8px, var(--bgColor) 8px); |
|
|
|
|
z-index: 50; |
|
|
|
|
|
|
|
|
|
${customScrollbar} |
|
|
|
|
|
|
|
|
|
::-webkit-scrollbar-thumb:vertical { |
|
|
|
|
background: linear-gradient(180deg, transparent 44px, #3F3F3F 44px); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
${({ isExpanded }) => (isExpanded |
|
|
|
|
? css` |
|
|
|
|
@ -45,194 +57,217 @@ export const TableWrapper = styled.div<TableWrapperProps>` |
|
|
|
|
: '')} |
|
|
|
|
` |
|
|
|
|
|
|
|
|
|
export const Table = styled.div` |
|
|
|
|
flex-grow: 1; |
|
|
|
|
export const Table = styled.table` |
|
|
|
|
border-radius: 5px; |
|
|
|
|
border-spacing: 0; |
|
|
|
|
border-collapse: collapse;
|
|
|
|
|
letter-spacing: -0.078px; |
|
|
|
|
table-layout: fixed; |
|
|
|
|
` |
|
|
|
|
|
|
|
|
|
export const Tooltip = styled(TooltipWrapper)` |
|
|
|
|
left: auto; |
|
|
|
|
display: block; |
|
|
|
|
padding: 2px 10px; |
|
|
|
|
border-radius: 6px; |
|
|
|
|
transform: none; |
|
|
|
|
font-size: 11px; |
|
|
|
|
line-height: 1; |
|
|
|
|
color: ${({ theme }) => theme.colors.black}; |
|
|
|
|
z-index: 999; |
|
|
|
|
|
|
|
|
|
::before { |
|
|
|
|
display: none; |
|
|
|
|
} |
|
|
|
|
` |
|
|
|
|
|
|
|
|
|
export const ParamShortTitle = styled(T9n)` |
|
|
|
|
type ParamShortTitleProps = { |
|
|
|
|
showLeftArrow?: boolean, |
|
|
|
|
sortDirection: 'asc' | 'desc', |
|
|
|
|
sorted?: boolean, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export const ParamShortTitle = styled(T9n)<ParamShortTitleProps>` |
|
|
|
|
position: relative; |
|
|
|
|
text-transform: uppercase; |
|
|
|
|
` |
|
|
|
|
|
|
|
|
|
export const Row = styled.div` |
|
|
|
|
display: flex; |
|
|
|
|
width: 100%; |
|
|
|
|
height: 45px; |
|
|
|
|
border-bottom: 0.5px solid rgba(255, 255, 255, 0.5); |
|
|
|
|
::before { |
|
|
|
|
position: absolute; |
|
|
|
|
content: ''; |
|
|
|
|
top: 50%; |
|
|
|
|
left: -9px; |
|
|
|
|
translate: 0 -50%; |
|
|
|
|
rotate: ${({ sortDirection }) => (sortDirection === 'asc' ? 0 : 180)}deg; |
|
|
|
|
width: 7px; |
|
|
|
|
height: 7px; |
|
|
|
|
background-image: url(/images/sortUp.svg); |
|
|
|
|
background-size: cover; |
|
|
|
|
|
|
|
|
|
${({ sorted }) => (sorted |
|
|
|
|
? '' |
|
|
|
|
: css` |
|
|
|
|
display: none; |
|
|
|
|
`)}
|
|
|
|
|
|
|
|
|
|
:first-child { |
|
|
|
|
position: sticky; |
|
|
|
|
left: 0; |
|
|
|
|
top: 0; |
|
|
|
|
z-index: 1; |
|
|
|
|
${({ showLeftArrow }) => (showLeftArrow |
|
|
|
|
? '' |
|
|
|
|
: css` |
|
|
|
|
z-index: 1; |
|
|
|
|
`)}
|
|
|
|
|
} |
|
|
|
|
` |
|
|
|
|
|
|
|
|
|
type TdProps = { |
|
|
|
|
export const PlayerNum = styled.span` |
|
|
|
|
display: inline-block; |
|
|
|
|
width: 17px; |
|
|
|
|
flex-shrink: 0; |
|
|
|
|
color: rgba(255, 255, 255, 0.5); |
|
|
|
|
` |
|
|
|
|
|
|
|
|
|
export const PlayerName = styled(Link)` |
|
|
|
|
display: inline-block; |
|
|
|
|
vertical-align: middle; |
|
|
|
|
text-overflow: ellipsis; |
|
|
|
|
color: ${({ theme }) => theme.colors.white}; |
|
|
|
|
overflow: hidden; |
|
|
|
|
` |
|
|
|
|
|
|
|
|
|
type CellContainerProps = { |
|
|
|
|
as?: 'td' | 'th', |
|
|
|
|
clickable?: boolean, |
|
|
|
|
columnWidth?: number, |
|
|
|
|
headerCell?: boolean, |
|
|
|
|
sorted?: boolean, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export const Cell = styled.div.attrs(({ clickable }: TdProps) => ({ |
|
|
|
|
export const CellContainer = styled.td.attrs(({ clickable }: CellContainerProps) => ({ |
|
|
|
|
...clickable && { tabIndex: 0 }, |
|
|
|
|
}))<TdProps>` |
|
|
|
|
position: relative; |
|
|
|
|
}))<CellContainerProps>` |
|
|
|
|
display: flex; |
|
|
|
|
justify-content: center; |
|
|
|
|
align-items: center; |
|
|
|
|
flex-shrink: 0; |
|
|
|
|
width: ${({ columnWidth }) => (columnWidth ? `${columnWidth}px` : 'auto')}; |
|
|
|
|
min-width: 30px; |
|
|
|
|
font-size: 11px; |
|
|
|
|
color: ${({ |
|
|
|
|
clickable, |
|
|
|
|
headerCell, |
|
|
|
|
theme, |
|
|
|
|
}) => (clickable && !headerCell ? '#5EB2FF' : theme.colors.white)}; |
|
|
|
|
font-weight: ${({ sorted }) => (sorted ? 'bold' : 'normal')}; |
|
|
|
|
color: ${({ clickable, theme }) => (clickable ? '#5EB2FF' : theme.colors.white)}; |
|
|
|
|
white-space: nowrap; |
|
|
|
|
background-color: #333333; |
|
|
|
|
background-color: var(--bgColor); |
|
|
|
|
|
|
|
|
|
${Tooltip} { |
|
|
|
|
top: 35px; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
:hover { |
|
|
|
|
${Tooltip} { |
|
|
|
|
display: block; |
|
|
|
|
} |
|
|
|
|
:first-child { |
|
|
|
|
position: sticky; |
|
|
|
|
left: 0; |
|
|
|
|
justify-content: unset; |
|
|
|
|
padding-left: 10px; |
|
|
|
|
text-align: left; |
|
|
|
|
cursor: unset; |
|
|
|
|
z-index: 1; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
${({ headerCell }) => (headerCell |
|
|
|
|
? '' |
|
|
|
|
: css` |
|
|
|
|
:first-child { |
|
|
|
|
justify-content: unset; |
|
|
|
|
padding-left: 13px; |
|
|
|
|
color: ${({ theme }) => theme.colors.white}; |
|
|
|
|
} |
|
|
|
|
`)}
|
|
|
|
|
|
|
|
|
|
${({ sorted }) => (sorted |
|
|
|
|
${({ clickable }) => (clickable |
|
|
|
|
? css` |
|
|
|
|
font-weight: bold; |
|
|
|
|
cursor: pointer; |
|
|
|
|
` |
|
|
|
|
: '')} |
|
|
|
|
|
|
|
|
|
${({ clickable, headerCell }) => (clickable || headerCell |
|
|
|
|
${({ as, sorted }) => (as === 'th' |
|
|
|
|
? css` |
|
|
|
|
cursor: pointer; |
|
|
|
|
font-weight: ${sorted ? '700' : '600'}; |
|
|
|
|
font-size: ${sorted ? 13 : 11}px; |
|
|
|
|
` |
|
|
|
|
: '')} |
|
|
|
|
` |
|
|
|
|
|
|
|
|
|
type FirstColumnProps = { |
|
|
|
|
columnWidth?: number, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export const FirstColumn = styled.div<FirstColumnProps>` |
|
|
|
|
export const Header = styled.thead` |
|
|
|
|
position: sticky; |
|
|
|
|
left: 0; |
|
|
|
|
width: ${({ columnWidth }) => (columnWidth ? `${columnWidth}px` : 'auto')}; |
|
|
|
|
` |
|
|
|
|
|
|
|
|
|
export const PlayerNum = styled.span` |
|
|
|
|
display: inline-block; |
|
|
|
|
width: 20px; |
|
|
|
|
flex-shrink: 0; |
|
|
|
|
text-align: center; |
|
|
|
|
color: rgba(255, 255, 255, 0.5); |
|
|
|
|
` |
|
|
|
|
|
|
|
|
|
type PlayerNameProps = { |
|
|
|
|
columnWidth?: number, |
|
|
|
|
} |
|
|
|
|
top: 0; |
|
|
|
|
z-index: 2; |
|
|
|
|
|
|
|
|
|
export const PlayerName = styled.span<PlayerNameProps>` |
|
|
|
|
display: inline-block; |
|
|
|
|
margin-top: 2px; |
|
|
|
|
text-overflow: ellipsis; |
|
|
|
|
overflow: hidden; |
|
|
|
|
${CellContainer} { |
|
|
|
|
background-color: #292929; |
|
|
|
|
color: ${({ theme }) => theme.colors.white}; |
|
|
|
|
cursor: pointer; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
${({ columnWidth }) => (columnWidth |
|
|
|
|
? css` |
|
|
|
|
max-width: calc(${columnWidth}px - 31px); |
|
|
|
|
` |
|
|
|
|
: css` |
|
|
|
|
max-width: 110px; |
|
|
|
|
`)}
|
|
|
|
|
${CellContainer}:first-child { |
|
|
|
|
cursor: unset; |
|
|
|
|
} |
|
|
|
|
` |
|
|
|
|
|
|
|
|
|
export const PlayerNameWrapper = styled.span` |
|
|
|
|
export const Row = styled.tr` |
|
|
|
|
position: relative; |
|
|
|
|
display: flex; |
|
|
|
|
width: 100%; |
|
|
|
|
height: 45px; |
|
|
|
|
border-bottom: 0.5px solid ${({ theme }) => theme.colors.secondary}; |
|
|
|
|
z-index: 1; |
|
|
|
|
|
|
|
|
|
${Tooltip} { |
|
|
|
|
top: 15px; |
|
|
|
|
:last-child:not(:first-child) { |
|
|
|
|
border: none; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
:hover { |
|
|
|
|
${Tooltip} { |
|
|
|
|
display: block; |
|
|
|
|
${CellContainer}:not(th) { |
|
|
|
|
background-color: #484848; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
${PlayerName} { |
|
|
|
|
text-decoration: underline; |
|
|
|
|
font-weight: 600; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
` |
|
|
|
|
|
|
|
|
|
export const Arrow = styled(ArrowBase)` |
|
|
|
|
width: 10px; |
|
|
|
|
height: 10px; |
|
|
|
|
|
|
|
|
|
${isMobileDevice |
|
|
|
|
? css` |
|
|
|
|
border-color: ${({ theme }) => theme.colors.white}; |
|
|
|
|
` |
|
|
|
|
: ''};
|
|
|
|
|
` |
|
|
|
|
|
|
|
|
|
const ArrowButton = styled(ArrowButtonBase)` |
|
|
|
|
position: absolute; |
|
|
|
|
width: 17px; |
|
|
|
|
margin-top: 2px; |
|
|
|
|
background-color: #333333; |
|
|
|
|
width: 20px; |
|
|
|
|
height: 44px; |
|
|
|
|
margin-top: 0; |
|
|
|
|
z-index: 3; |
|
|
|
|
background-color: #292929; |
|
|
|
|
|
|
|
|
|
${isMobileDevice |
|
|
|
|
? css` |
|
|
|
|
height: 45px; |
|
|
|
|
margin-top: 0; |
|
|
|
|
margin-top: 0; |
|
|
|
|
` |
|
|
|
|
: ''}; |
|
|
|
|
` |
|
|
|
|
|
|
|
|
|
export const ArrowButtonRight = styled(ArrowButton)` |
|
|
|
|
right: 0; |
|
|
|
|
border-top-right-radius: 5px; |
|
|
|
|
|
|
|
|
|
${Arrow} { |
|
|
|
|
left: auto; |
|
|
|
|
right: 7px; |
|
|
|
|
} |
|
|
|
|
` |
|
|
|
|
|
|
|
|
|
export const ArrowButtonLeft = styled(ArrowButton)` |
|
|
|
|
left: 75px; |
|
|
|
|
right: -5px; |
|
|
|
|
` |
|
|
|
|
|
|
|
|
|
export const Arrow = styled(ArrowBase)` |
|
|
|
|
width: 10px; |
|
|
|
|
height: 10px; |
|
|
|
|
|
|
|
|
|
${isMobileDevice |
|
|
|
|
? css` |
|
|
|
|
border-color: ${({ theme }) => theme.colors.white}; |
|
|
|
|
` |
|
|
|
|
: ''};
|
|
|
|
|
` |
|
|
|
|
type ExpandButtonProps = { |
|
|
|
|
isExpanded?: boolean, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export const ExpandButton = styled(ArrowButton)` |
|
|
|
|
export const ExpandButton = styled(ArrowButton)<ExpandButtonProps>` |
|
|
|
|
left: 20px; |
|
|
|
|
top: 0; |
|
|
|
|
|
|
|
|
|
${Arrow} { |
|
|
|
|
left: 0; |
|
|
|
|
left: ${({ isExpanded }) => (isExpanded ? -6 : -2)}px; |
|
|
|
|
|
|
|
|
|
:last-child { |
|
|
|
|
margin-left: 7px; |
|
|
|
|
|