feat(in-142): match stats tab

pull/12/head
Ruslan Khayrullin 3 years ago
parent 773dd2dba8
commit 6f694eeb9f
  1. 3
      public/images/matchTabs/bets.svg
  2. 3
      public/images/matchTabs/chat.svg
  3. 6
      public/images/matchTabs/players.svg
  4. 4
      public/images/matchTabs/plays.svg
  5. 12
      public/images/matchTabs/stats.svg
  6. 3
      public/images/matchTabs/watch.svg
  7. 2
      src/config/lexics/indexLexics.tsx
  8. 1
      src/features/MatchSidePlaylists/components/PlayersPlaylists/styled.tsx
  9. 243
      src/features/MatchSidePlaylists/components/PlayersTable/index.tsx
  10. 86
      src/features/MatchSidePlaylists/components/PlayersTable/styled.tsx
  11. 31
      src/features/MatchSidePlaylists/components/TabPlayers/index.tsx
  12. 5
      src/features/MatchSidePlaylists/components/TabStats/config.tsx
  13. 34
      src/features/MatchSidePlaylists/components/TabStats/index.tsx
  14. 108
      src/features/MatchSidePlaylists/components/TabStats/styled.tsx
  15. 2
      src/features/MatchSidePlaylists/components/TabVideo/index.tsx
  16. 23
      src/features/MatchSidePlaylists/components/TabWatch/index.tsx
  17. 276
      src/features/MatchSidePlaylists/components/TeamsStats/index.tsx
  18. 56
      src/features/MatchSidePlaylists/components/TeamsStats/styled.tsx
  19. 3
      src/features/MatchSidePlaylists/config.tsx
  20. 12
      src/features/MatchSidePlaylists/hooks.tsx
  21. 43
      src/features/MatchSidePlaylists/index.tsx
  22. 79
      src/features/MatchSidePlaylists/styled.tsx
  23. 2
      src/features/Tooltip/index.tsx

@ -0,0 +1,3 @@
<svg width="22" height="16" viewBox="0 0 22 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M20.75 6.5C20.9489 6.5 21.1397 6.42098 21.2803 6.28033C21.421 6.13968 21.5 5.94891 21.5 5.75V2C21.5 1.60218 21.342 1.22064 21.0607 0.93934C20.7794 0.658035 20.3978 0.5 20 0.5H2C1.60218 0.5 1.22064 0.658035 0.93934 0.93934C0.658035 1.22064 0.5 1.60218 0.5 2V5.75C0.5 5.94891 0.579018 6.13968 0.71967 6.28033C0.860322 6.42098 1.05109 6.5 1.25 6.5C1.64782 6.5 2.02936 6.65804 2.31066 6.93934C2.59196 7.22064 2.75 7.60218 2.75 8C2.75 8.39782 2.59196 8.77936 2.31066 9.06066C2.02936 9.34196 1.64782 9.5 1.25 9.5C1.05109 9.5 0.860322 9.57902 0.71967 9.71967C0.579018 9.86032 0.5 10.0511 0.5 10.25V14C0.5 14.3978 0.658035 14.7794 0.93934 15.0607C1.22064 15.342 1.60218 15.5 2 15.5H20C20.3978 15.5 20.7794 15.342 21.0607 15.0607C21.342 14.7794 21.5 14.3978 21.5 14V10.25C21.5 10.0511 21.421 9.86032 21.2803 9.71967C21.1397 9.57902 20.9489 9.5 20.75 9.5C20.3522 9.5 19.9706 9.34196 19.6893 9.06066C19.408 8.77936 19.25 8.39782 19.25 8C19.25 7.60218 19.408 7.22064 19.6893 6.93934C19.9706 6.65804 20.3522 6.5 20.75 6.5ZM20 10.9025V14H14.75V11.75H13.25V14H2V10.9025C2.642 10.7347 3.21025 10.3588 3.61582 9.8336C4.02139 9.3084 4.24139 8.66356 4.24139 8C4.24139 7.33644 4.02139 6.6916 3.61582 6.1664C3.21025 5.64121 2.642 5.2653 2 5.0975V2H13.25V4.25H14.75V2H20V5.0975C19.358 5.2653 18.7898 5.64121 18.3842 6.1664C17.9786 6.6916 17.7586 7.33644 17.7586 8C17.7586 8.66356 17.9786 9.3084 18.3842 9.8336C18.7898 10.3588 19.358 10.7347 20 10.9025Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

@ -0,0 +1,3 @@
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M18 0H2C0.9 0 0 0.9 0 2V20L4 16H18C19.1 16 20 15.1 20 14V2C20 0.9 19.1 0 18 0ZM18 14H4L2 16V2H18V14Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 229 B

@ -0,0 +1,6 @@
<svg width="21" height="21" viewBox="0 0 21 21" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M15.1862 14.29C15.1862 14.29 14.4125 13.347 13.7596 13.1778C11.7528 12.67 10.8824 12.0414 10.5681 11.6787C10.689 11.582 10.8099 11.4611 10.9308 11.3402C12.2606 9.84117 12.0672 7.32661 12.043 7.0123C11.8979 3.99001 9.6735 3.26466 8.36787 3.31301C7.06224 3.26466 4.83783 4.01418 4.69276 7.0123C4.66859 7.30244 4.47516 9.81698 5.80497 11.3402C5.92586 11.4853 6.07093 11.6304 6.216 11.7271C6.16764 11.7512 6.14346 11.7754 6.14346 11.7996C5.78079 12.1865 4.93455 12.7184 3.07282 13.2019C2.37164 13.3712 1.59794 14.5076 1.59794 14.5076C1.59794 14.5076 0.928283 15.9908 1.10911 16.1968C2.86924 18.199 5.44868 19.4641 8.31951 19.4641C11.3689 19.4641 14.0895 18.0368 15.8487 15.8148C15.6145 14.8567 15.1862 14.29 15.1862 14.29ZM3.41131 14.5801C2.90357 14.701 2.7585 15.3296 2.7585 15.8374C4.2092 17.1914 6.16764 18.0376 8.31951 18.0376C10.5681 18.0376 12.5991 17.1188 14.0981 15.6681C14.0503 14.7595 13.6004 14.6312 13.4268 14.5817L13.4211 14.5801C12.3331 14.3142 11.5111 13.9998 10.9066 13.6855C10.3021 14.4834 9.35918 14.967 8.34369 14.967C7.35238 14.967 6.4336 14.5076 5.82914 13.7339C5.22469 14.024 4.4268 14.3142 3.41131 14.5801ZM8.36787 10.9775C9.02068 10.9775 9.50425 10.7841 9.86692 10.3731C10.6648 9.47849 10.6648 7.73765 10.5923 7.13319V7.08483C10.5439 6.06934 10.1812 5.36817 9.52843 5.0055C9.02505 4.73093 8.50002 4.73784 8.38365 4.73938C8.37705 4.73946 8.37176 4.73953 8.36787 4.73953H8.27115C8.10191 4.73953 7.61834 4.73953 7.15895 5.0055C6.50614 5.36817 6.14346 6.06934 6.09511 7.08483V7.13319C6.02257 7.73765 6.04675 9.47849 6.84463 10.3731C7.20731 10.7599 7.69087 10.9775 8.34369 10.9775H8.36787ZM8.29533 12.4282C8.02937 12.4282 7.76341 12.4041 7.5458 12.3557C7.42491 12.525 7.25567 12.7426 7.03806 12.936C7.35238 13.3228 7.83594 13.5404 8.34369 13.5404C8.89979 13.5404 9.38336 13.2745 9.72185 12.8635C9.52843 12.67 9.38336 12.5008 9.28664 12.3315C9.02068 12.3799 8.75472 12.4282 8.4404 12.4282H8.29533Z" fill="white"/>
<rect x="13.3672" y="4.10608" width="6.14323" height="1.53581" rx="0.767904" fill="white"/>
<rect x="13.3672" y="6.40979" width="6.14323" height="1.53581" rx="0.767904" fill="white"/>
<rect x="13.3672" y="8.7135" width="6.14323" height="1.53581" rx="0.767904" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

@ -0,0 +1,4 @@
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M8.9915 0.666626C4.3915 0.666626 0.666504 4.39996 0.666504 8.99996C0.666504 13.6 4.3915 17.3333 8.9915 17.3333C13.5998 17.3333 17.3332 13.6 17.3332 8.99996C17.3332 4.39996 13.5998 0.666626 8.9915 0.666626ZM8.99984 15.6666C5.3165 15.6666 2.33317 12.6833 2.33317 8.99996C2.33317 5.31663 5.3165 2.33329 8.99984 2.33329C12.6832 2.33329 15.6665 5.31663 15.6665 8.99996C15.6665 12.6833 12.6832 15.6666 8.99984 15.6666Z" fill="white"/>
<path d="M9.4165 5.45829C9.4165 5.11311 9.13668 4.83329 8.7915 4.83329C8.44633 4.83329 8.1665 5.11311 8.1665 5.45829V9.2671C8.1665 9.61837 8.3508 9.94387 8.65201 10.1246L12.0317 12.1524C12.3139 12.3217 12.6797 12.2316 12.851 11.9507C13.0246 11.666 12.9321 11.2942 12.6453 11.1241L9.90623 9.49886C9.60263 9.31873 9.4165 8.99187 9.4165 8.63885V5.45829Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 908 B

@ -0,0 +1,12 @@
<svg width="22" height="18" viewBox="0 0 22 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M21.1 0H0.9C0.4 0 0 0.4 0 0.9V17.1C0 17.5 0.4 18 0.9 18H21.1C21.5 18 22 17.5 22 17.1V0.9C22 0.4 21.5 0 21.1 0ZM20 16H2V2H20V16Z" fill="white"/>
<path d="M13.5 4H9C8.44772 4 8 4.44772 8 5C8 5.55228 8.44772 6 9 6H13.5C14.0523 6 14.5 5.55228 14.5 5C14.5 4.44772 14.0523 4 13.5 4Z" fill="white"/>
<path d="M13.5 8H9C8.44772 8 8 8.44772 8 9C8 9.55228 8.44772 10 9 10H13.5C14.0523 10 14.5 9.55228 14.5 9C14.5 8.44772 14.0523 8 13.5 8Z" fill="white"/>
<path d="M13.5 12H9C8.44772 12 8 12.4477 8 13C8 13.5523 8.44772 14 9 14H13.5C14.0523 14 14.5 13.5523 14.5 13C14.5 12.4477 14.0523 12 13.5 12Z" fill="white"/>
<path d="M4 13C4 13.5523 4.44772 14 5 14C5.55228 14 6 13.5523 6 13C6 12.4477 5.55228 12 5 12C4.44772 12 4 12.4477 4 13Z" fill="white"/>
<path d="M4 9C4 9.55228 4.44772 10 5 10C5.55228 10 6 9.55228 6 9C6 8.44772 5.55228 8 5 8C4.44772 8 4 8.44772 4 9Z" fill="white"/>
<path d="M4 5C4 5.55228 4.44772 6 5 6C5.55228 6 6 5.55228 6 5C6 4.44772 5.55228 4 5 4C4.44772 4 4 4.44772 4 5Z" fill="white"/>
<path d="M16.5 13C16.5 13.5523 16.9477 14 17.5 14C18.0523 14 18.5 13.5523 18.5 13C18.5 12.4477 18.0523 12 17.5 12C16.9477 12 16.5 12.4477 16.5 13Z" fill="white"/>
<path d="M16.5 9C16.5 9.55228 16.9477 10 17.5 10C18.0523 10 18.5 9.55228 18.5 9C18.5 8.44772 18.0523 8 17.5 8C16.9477 8 16.5 8.44772 16.5 9Z" fill="white"/>
<path d="M16.5 5C16.5 5.55228 16.9477 6 17.5 6C18.0523 6 18.5 5.55228 18.5 5C18.5 4.44772 18.0523 4 17.5 4C16.9477 4 16.5 4.44772 16.5 5Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

@ -0,0 +1,3 @@
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M8 12.5C8 13.324 8.94076 13.7944 9.6 13.3L12.9333 10.8C13.4667 10.4 13.4667 9.6 12.9333 9.2L9.6 6.7C8.94076 6.20557 8 6.67595 8 7.5V12.5ZM10 0C4.48 0 0 4.48 0 10C0 15.52 4.48 20 10 20C15.52 20 20 15.52 20 10C20 4.48 15.52 0 10 0ZM10 18C5.59 18 2 14.41 2 10C2 5.59 5.59 2 10 2C14.41 2 18 5.59 18 10C18 14.41 14.41 18 10 18Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 451 B

@ -22,6 +22,7 @@ const matchPopupLexics = {
match_interviews: 13031,
match_settings: 13490,
no_data: 15397,
others: 19902,
players_episodes: 13398,
playlist_format: 13406,
playlist_format_all_actions: 13408,
@ -31,6 +32,7 @@ const matchPopupLexics = {
sec_before: 13411,
selected_player_actions: 13413,
started_streaming_at: 16042,
stats: 18179,
streamed_live_on: 16043,
video: 1017,
views: 13440,

@ -6,7 +6,6 @@ export const Wrapper = styled.div`
display: flex;
flex-direction: column;
align-items: center;
margin-top: 25px;
`
export const List = styled.ul`

@ -0,0 +1,243 @@
import {
Table,
Thead,
Th,
Tbody,
Tr,
Td,
PlayerNum,
ParamShortTitle,
} from './styled'
export const PlayersTable = () => (
<Table>
<Thead>
<Th />
<Th>
<ParamShortTitle>Min</ParamShortTitle>
</Th>
<Th sorted>
<ParamShortTitle>Pt</ParamShortTitle>
</Th>
<Th>
<ParamShortTitle>Reb</ParamShortTitle>
</Th>
<Th>
<ParamShortTitle>Ass</ParamShortTitle>
</Th>
<Th>
<ParamShortTitle>To</ParamShortTitle>
</Th>
</Thead>
<Tbody>
<Tr>
<Td><PlayerNum>57</PlayerNum> Selikhov</Td>
<Td clickable>97</Td>
<Td sorted>12</Td>
<Td>2</Td>
<Td>1</Td>
<Td>4</Td>
</Tr>
<Tr>
<Td><PlayerNum>57</PlayerNum> Selikhov</Td>
<Td clickable>97</Td>
<Td sorted>12</Td>
<Td>2</Td>
<Td>1</Td>
<Td>4</Td>
</Tr>
<Tr>
<Td><PlayerNum>57</PlayerNum> Selikhov</Td>
<Td clickable>97</Td>
<Td sorted>12</Td>
<Td>2</Td>
<Td>1</Td>
<Td>4</Td>
</Tr>
<Tr>
<Td><PlayerNum>57</PlayerNum> Selikhov</Td>
<Td clickable>97</Td>
<Td sorted>12</Td>
<Td>2</Td>
<Td>1</Td>
<Td>4</Td>
</Tr>
<Tr>
<Td><PlayerNum>57</PlayerNum> Selikhov</Td>
<Td clickable>97</Td>
<Td sorted>12</Td>
<Td>2</Td>
<Td>1</Td>
<Td>4</Td>
</Tr>
<Tr>
<Td><PlayerNum>57</PlayerNum> Selikhov</Td>
<Td clickable>97</Td>
<Td sorted>12</Td>
<Td>2</Td>
<Td>1</Td>
<Td>4</Td>
</Tr>
<Tr>
<Td><PlayerNum>57</PlayerNum> Selikhov</Td>
<Td clickable>97</Td>
<Td sorted>12</Td>
<Td>2</Td>
<Td>1</Td>
<Td>4</Td>
</Tr>
<Tr>
<Td><PlayerNum>57</PlayerNum> Selikhov</Td>
<Td clickable>97</Td>
<Td sorted>12</Td>
<Td>2</Td>
<Td>1</Td>
<Td>4</Td>
</Tr>
<Tr>
<Td><PlayerNum>57</PlayerNum> Selikhov</Td>
<Td clickable>97</Td>
<Td sorted>12</Td>
<Td>2</Td>
<Td>1</Td>
<Td>4</Td>
</Tr>
<Tr>
<Td><PlayerNum>57</PlayerNum> Selikhov</Td>
<Td clickable>97</Td>
<Td sorted>12</Td>
<Td>2</Td>
<Td>1</Td>
<Td>4</Td>
</Tr>
<Tr>
<Td><PlayerNum>57</PlayerNum> Selikhov</Td>
<Td clickable>97</Td>
<Td sorted>12</Td>
<Td>2</Td>
<Td>1</Td>
<Td>4</Td>
</Tr>
<Tr>
<Td><PlayerNum>57</PlayerNum> Selikhov</Td>
<Td clickable>97</Td>
<Td sorted>12</Td>
<Td>2</Td>
<Td>1</Td>
<Td>4</Td>
</Tr>
<Tr>
<Td><PlayerNum>57</PlayerNum> Selikhov</Td>
<Td clickable>97</Td>
<Td sorted>12</Td>
<Td>2</Td>
<Td>1</Td>
<Td>4</Td>
</Tr>
<Tr>
<Td><PlayerNum>57</PlayerNum> Selikhov</Td>
<Td clickable>97</Td>
<Td sorted>12</Td>
<Td>2</Td>
<Td>1</Td>
<Td>4</Td>
</Tr>
<Tr>
<Td><PlayerNum>57</PlayerNum> Selikhov</Td>
<Td clickable>97</Td>
<Td sorted>12</Td>
<Td>2</Td>
<Td>1</Td>
<Td>4</Td>
</Tr>
<Tr>
<Td><PlayerNum>57</PlayerNum> Selikhov</Td>
<Td clickable>97</Td>
<Td sorted>12</Td>
<Td>2</Td>
<Td>1</Td>
<Td>4</Td>
</Tr>
<Tr>
<Td><PlayerNum>57</PlayerNum> Selikhov</Td>
<Td clickable>97</Td>
<Td sorted>12</Td>
<Td>2</Td>
<Td>1</Td>
<Td>4</Td>
</Tr>
<Tr>
<Td><PlayerNum>57</PlayerNum> Selikhov</Td>
<Td clickable>97</Td>
<Td sorted>12</Td>
<Td>2</Td>
<Td>1</Td>
<Td>4</Td>
</Tr>
<Tr>
<Td><PlayerNum>57</PlayerNum> Selikhov</Td>
<Td clickable>97</Td>
<Td sorted>12</Td>
<Td>2</Td>
<Td>1</Td>
<Td>4</Td>
</Tr>
<Tr>
<Td><PlayerNum>57</PlayerNum> Selikhov</Td>
<Td clickable>97</Td>
<Td sorted>12</Td>
<Td>2</Td>
<Td>1</Td>
<Td>4</Td>
</Tr>
<Tr>
<Td><PlayerNum>57</PlayerNum> Selikhov</Td>
<Td clickable>97</Td>
<Td sorted>12</Td>
<Td>2</Td>
<Td>1</Td>
<Td>4</Td>
</Tr>
<Tr>
<Td><PlayerNum>57</PlayerNum> Selikhov</Td>
<Td clickable>97</Td>
<Td sorted>12</Td>
<Td>2</Td>
<Td>1</Td>
<Td>4</Td>
</Tr>
<Tr>
<Td><PlayerNum>57</PlayerNum> Selikhov</Td>
<Td clickable>97</Td>
<Td sorted>12</Td>
<Td>2</Td>
<Td>1</Td>
<Td>4</Td>
</Tr>
<Tr>
<Td><PlayerNum>57</PlayerNum> Selikhov</Td>
<Td clickable>97</Td>
<Td sorted>12</Td>
<Td>2</Td>
<Td>1</Td>
<Td>4</Td>
</Tr>
<Tr>
<Td><PlayerNum>57</PlayerNum> Selikhov</Td>
<Td clickable>97</Td>
<Td sorted>12</Td>
<Td>2</Td>
<Td>1</Td>
<Td>4</Td>
</Tr>
<Tr>
<Td><PlayerNum>57</PlayerNum> Selikhov</Td>
<Td clickable>97</Td>
<Td sorted>12</Td>
<Td>2</Td>
<Td>1</Td>
<Td>4</Td>
</Tr>
</Tbody>
</Table>
)

@ -0,0 +1,86 @@
import styled, { css } from 'styled-components/macro'
import { customScrollbar } from 'features/Common'
export const Table = styled.table`
width: 100%;
border-radius: 5px;
border-collapse: collapse;
letter-spacing: -0.078px;
background-color: #333333;
table-layout: fixed;
${customScrollbar}
`
export const Thead = styled.thead`
height: 45px;
border-bottom: 0.5px solid rgba(255, 255, 255, 0.5);
`
type ThProps = {
sorted?: boolean,
}
export const Th = styled.th<ThProps>`
font-size: 11px;
color: ${({ theme }) => theme.colors.white};
text-transform: uppercase;
:first-child {
width: 115px;
}
${({ sorted }) => (sorted
? ''
: css`
opacity: 0.5;
`)}
`
export const ParamShortTitle = styled.span``
export const Tbody = styled.tbody``
export const Tr = styled.tr`
height: 45px;
border-bottom: 0.5px solid rgba(255, 255, 255, 0.5);
:last-child {
border-bottom: none;
}
`
type TdProps = {
clickable?: boolean,
sorted?: boolean,
}
export const Td = styled.td<TdProps>`
font-size: 11px;
text-align: center;
color: ${({ clickable, theme }) => (clickable ? '#5EB2FF' : theme.colors.white)};
:first-child {
padding-left: 13px;
text-align: left;
color: ${({ theme }) => theme.colors.white};
}
${({ sorted }) => (sorted
? css`
font-weight: bold;
`
: '')}
${({ clickable }) => (clickable
? css`
cursor: pointer;
`
: '')}
`
export const PlayerNum = styled.span`
color: rgba(255, 255, 255, 0.5);
`

@ -0,0 +1,31 @@
import isEmpty from 'lodash/isEmpty'
import type { Playlists, PlaylistOption } from 'features/MatchPage/types'
import type { MatchInfo } from 'requests'
import { PlayersPlaylists } from '../PlayersPlaylists'
type Props = {
onSelect: (option: PlaylistOption) => void,
playlists: Playlists,
profile: MatchInfo,
selectedPlaylist?: PlaylistOption,
}
export const TabPlayers = ({
onSelect,
playlists,
profile,
selectedPlaylist,
}: Props) => {
if (isEmpty(playlists.players.team1)) return null
return (
<PlayersPlaylists
profile={profile}
players={playlists.players}
selectedMathPlaylist={selectedPlaylist}
onSelect={onSelect}
/>
)
}

@ -0,0 +1,5 @@
export enum Tabs {
TEAMS,
TEAM1,
TEAM2,
}

@ -0,0 +1,34 @@
import { Tooltip } from 'features/Tooltip'
import { PlayersTable } from '../PlayersTable'
import { TeamsStats } from '../TeamsStats'
import {
Container,
Header,
TabList,
Tab,
Switch,
SwitchTitle,
SwitchButton,
} from './styled'
export const TabStats = () => (
<Container>
<Header>
<TabList>
<Tab selected>Teams</Tab>
<Tab>DIN</Tab>
<Tab>SPA</Tab>
</TabList>
<Switch>
<SwitchTitle>Final Stats</SwitchTitle>
<SwitchButton>
<Tooltip lexic='others' />
</SwitchButton>
</Switch>
</Header>
<PlayersTable />
{/* <TeamsStats /> */}
</Container>
)

@ -0,0 +1,108 @@
import styled, { css } from 'styled-components/macro'
import { TooltipWrapper } from 'features/Tooltip'
export const Container = styled.div``
export const Header = styled.div`
display: flex;
justify-content: space-between;
margin-bottom: 23px;
`
export const TabList = styled.div.attrs({ role: 'tablist' })`
display: flex;
`
type TabProps = {
selected?: boolean,
}
export const Tab = styled.div.attrs(({ selected }: TabProps) => ({
'aria-pressed': selected,
role: 'tab',
}))<TabProps>`
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 15px 10px;
font-size: 12px;
color: ${({ theme }) => theme.colors.white};
opacity: ${({ selected }) => (selected ? '1' : '0.4')};
cursor: pointer;
border-bottom: 2px solid transparent;
${({ selected, theme }) => (selected
? css`
border-color: ${theme.colors.white};
`
: '')}
`
export const Switch = styled.div`
display: flex;
`
export const SwitchTitle = styled.span`
font-size: 12px;
color: ${({ theme }) => theme.colors.white};
`
export const SwitchButton = styled.button`
position: relative;
width: 20px;
height: 7px;
margin-left: 5px;
margin-top: 5px;
border-radius: 2px;
border: none;
border: 1px solid ${({ theme }) => theme.colors.white};
cursor: pointer;
${TooltipWrapper} {
left: auto;
right: 0;
padding: 2px 10px;
border-radius: 6px;
transform: none;
::before {
display: none;
}
}
:hover {
${TooltipWrapper} {
display: block;
}
}
${({ theme }) => (true // Позже будет добавлен пропс
? css`
background-image: linear-gradient(
to right,
${theme.colors.white} 33.333%,
${theme.colors.black} 33.333%,
${theme.colors.black} 66.666%,
${theme.colors.white} 66.666%,
${theme.colors.white} 72%,
${theme.colors.black} 72%,
${theme.colors.black} 100%)
`
: css`
border-color: transparent;
background-image: linear-gradient(
to right,
${theme.colors.white} 33.333%,
${theme.colors.black} 33.333%,
${theme.colors.black} 38%,
${theme.colors.white} 38%,
${theme.colors.white} 66.666%,
${theme.colors.black} 66.666%,
${theme.colors.black} 72%,
${theme.colors.white} 72%,
${theme.colors.white} 100%)
`
)}
`

@ -77,6 +77,8 @@ export const TabVideo = ({
setOverflow(hasScroll)
}, [ref, selectedDate])
if (tournamentData.matches.length <= 1) return null
return (
<Fragment>
<VideoDate

@ -1,21 +1,25 @@
import { Fragment } from 'react'
import isEmpty from 'lodash/isEmpty'
import size from 'lodash/size'
import type { PlaylistOption, Playlists } from 'features/MatchPage/types'
import type {
PlaylistOption,
Playlists,
TournamentData,
} from 'features/MatchPage/types'
import type { MatchInfo } from 'requests'
import { DropdownSection } from '../DropdownSection'
import { MatchPlaylists } from '../MatchPlaylists'
import { SideInterviews } from '../SideInterviews'
import { PlayersPlaylists } from '../PlayersPlaylists'
import { TabVideo } from '../../components/TabVideo'
type Props = {
onSelect: (option: PlaylistOption) => void,
playlists: Playlists,
profile: MatchInfo,
selectedPlaylist?: PlaylistOption,
tournamentData: TournamentData,
}
export const TabWatch = ({
@ -23,6 +27,7 @@ export const TabWatch = ({
playlists,
profile,
selectedPlaylist,
tournamentData,
}: Props) => (
<Fragment>
<MatchPlaylists
@ -41,13 +46,9 @@ export const TabWatch = ({
onSelect={onSelect}
/>
</DropdownSection>
{!isEmpty(playlists.players.team1) && (
<PlayersPlaylists
profile={profile}
players={playlists.players}
selectedMathPlaylist={selectedPlaylist}
onSelect={onSelect}
/>
)}
<TabVideo
profile={profile}
tournamentData={tournamentData}
/>
</Fragment>
)

@ -0,0 +1,276 @@
import {
Container,
Row,
TeamShortName,
ParamValueContainer,
ParamValue,
ParamTitle,
} from './styled'
export const TeamsStats = () => (
<Container>
<Row>
<TeamShortName>DIN</TeamShortName>
<TeamShortName>SPA</TeamShortName>
</Row>
<Row>
<ParamValueContainer>
<ParamValue clickable>90</ParamValue>
</ParamValueContainer>
<ParamTitle>Points</ParamTitle>
<ParamValue clickable>123</ParamValue>
</Row>
<Row>
<ParamValueContainer>
<ParamValue>90</ParamValue>
</ParamValueContainer>
<ParamTitle>Points</ParamTitle>
<ParamValue>123</ParamValue>
</Row>
<Row>
<ParamValueContainer>
<ParamValue>90</ParamValue>
</ParamValueContainer>
<ParamTitle>Points</ParamTitle>
<ParamValue>123</ParamValue>
</Row>
<Row>
<ParamValueContainer>
<ParamValue>90</ParamValue>
</ParamValueContainer>
<ParamTitle>Points</ParamTitle>
<ParamValue>123</ParamValue>
</Row>
<Row>
<ParamValueContainer>
<ParamValue>90</ParamValue>
</ParamValueContainer>
<ParamTitle>Points</ParamTitle>
<ParamValue>123</ParamValue>
</Row>
<Row>
<ParamValueContainer>
<ParamValue>90</ParamValue>
</ParamValueContainer>
<ParamTitle>Points</ParamTitle>
<ParamValue>123</ParamValue>
</Row>
<Row>
<ParamValueContainer>
<ParamValue>90</ParamValue>
</ParamValueContainer>
<ParamTitle>Points</ParamTitle>
<ParamValue>123</ParamValue>
</Row>
<Row>
<ParamValueContainer>
<ParamValue>90</ParamValue>
</ParamValueContainer>
<ParamTitle>Points</ParamTitle>
<ParamValue>123</ParamValue>
</Row>
<Row>
<ParamValueContainer>
<ParamValue>90</ParamValue>
</ParamValueContainer>
<ParamTitle>Points</ParamTitle>
<ParamValue>123</ParamValue>
</Row>
<Row>
<ParamValueContainer>
<ParamValue>90</ParamValue>
</ParamValueContainer>
<ParamTitle>Points</ParamTitle>
<ParamValue>123</ParamValue>
</Row>
<Row>
<ParamValueContainer>
<ParamValue>90</ParamValue>
</ParamValueContainer>
<ParamTitle>Points</ParamTitle>
<ParamValue>123</ParamValue>
</Row>
<Row>
<ParamValueContainer>
<ParamValue>90</ParamValue>
</ParamValueContainer>
<ParamTitle>Points</ParamTitle>
<ParamValue>123</ParamValue>
</Row>
<Row>
<ParamValueContainer>
<ParamValue>90</ParamValue>
</ParamValueContainer>
<ParamTitle>Points</ParamTitle>
<ParamValue>123</ParamValue>
</Row>
<Row>
<ParamValueContainer>
<ParamValue>90</ParamValue>
</ParamValueContainer>
<ParamTitle>Points</ParamTitle>
<ParamValue>123</ParamValue>
</Row>
<Row>
<ParamValueContainer>
<ParamValue>90</ParamValue>
</ParamValueContainer>
<ParamTitle>Points</ParamTitle>
<ParamValue>123</ParamValue>
</Row>
<Row>
<ParamValueContainer>
<ParamValue>90</ParamValue>
</ParamValueContainer>
<ParamTitle>Points</ParamTitle>
<ParamValue>123</ParamValue>
</Row>
<Row>
<ParamValueContainer>
<ParamValue>90</ParamValue>
</ParamValueContainer>
<ParamTitle>Points</ParamTitle>
<ParamValue>123</ParamValue>
</Row>
<Row>
<ParamValueContainer>
<ParamValue>90</ParamValue>
</ParamValueContainer>
<ParamTitle>Points</ParamTitle>
<ParamValue>123</ParamValue>
</Row>
<Row>
<ParamValueContainer>
<ParamValue>90</ParamValue>
</ParamValueContainer>
<ParamTitle>Points</ParamTitle>
<ParamValue>123</ParamValue>
</Row>
<Row>
<ParamValueContainer>
<ParamValue>90</ParamValue>
</ParamValueContainer>
<ParamTitle>Points</ParamTitle>
<ParamValue>123</ParamValue>
</Row>
<Row>
<ParamValueContainer>
<ParamValue>90</ParamValue>
</ParamValueContainer>
<ParamTitle>Points</ParamTitle>
<ParamValue>123</ParamValue>
</Row>
<Row>
<ParamValueContainer>
<ParamValue>90</ParamValue>
</ParamValueContainer>
<ParamTitle>Points</ParamTitle>
<ParamValue>123</ParamValue>
</Row>
<Row>
<ParamValueContainer>
<ParamValue>90</ParamValue>
</ParamValueContainer>
<ParamTitle>Points</ParamTitle>
<ParamValue>123</ParamValue>
</Row>
<Row>
<ParamValueContainer>
<ParamValue>90</ParamValue>
</ParamValueContainer>
<ParamTitle>Points</ParamTitle>
<ParamValue>123</ParamValue>
</Row>
<Row>
<ParamValueContainer>
<ParamValue>90</ParamValue>
</ParamValueContainer>
<ParamTitle>Points</ParamTitle>
<ParamValue>123</ParamValue>
</Row>
<Row>
<ParamValueContainer>
<ParamValue>90</ParamValue>
</ParamValueContainer>
<ParamTitle>Points</ParamTitle>
<ParamValue>123</ParamValue>
</Row>
<Row>
<ParamValueContainer>
<ParamValue>90</ParamValue>
</ParamValueContainer>
<ParamTitle>Points</ParamTitle>
<ParamValue>123</ParamValue>
</Row>
<Row>
<ParamValueContainer>
<ParamValue>90</ParamValue>
</ParamValueContainer>
<ParamTitle>Points</ParamTitle>
<ParamValue>123</ParamValue>
</Row>
<Row>
<ParamValueContainer>
<ParamValue>90</ParamValue>
</ParamValueContainer>
<ParamTitle>Points</ParamTitle>
<ParamValue>123</ParamValue>
</Row>
<Row>
<ParamValueContainer>
<ParamValue>90</ParamValue>
</ParamValueContainer>
<ParamTitle>Points</ParamTitle>
<ParamValue>123</ParamValue>
</Row>
<Row>
<ParamValueContainer>
<ParamValue>90</ParamValue>
</ParamValueContainer>
<ParamTitle>Points</ParamTitle>
<ParamValue>123</ParamValue>
</Row>
<Row>
<ParamValueContainer>
<ParamValue>90</ParamValue>
</ParamValueContainer>
<ParamTitle>Points</ParamTitle>
<ParamValue>123</ParamValue>
</Row>
<Row>
<ParamValueContainer>
<ParamValue>90</ParamValue>
</ParamValueContainer>
<ParamTitle>Points</ParamTitle>
<ParamValue>123</ParamValue>
</Row>
<Row>
<ParamValueContainer>
<ParamValue>90</ParamValue>
</ParamValueContainer>
<ParamTitle>Points</ParamTitle>
<ParamValue>123</ParamValue>
</Row>
<Row>
<ParamValueContainer>
<ParamValue>90</ParamValue>
</ParamValueContainer>
<ParamTitle>Points</ParamTitle>
<ParamValue>123</ParamValue>
</Row>
<Row>
<ParamValueContainer>
<ParamValue>90</ParamValue>
</ParamValueContainer>
<ParamTitle>Points</ParamTitle>
<ParamValue>123</ParamValue>
</Row>
<Row>
<ParamValueContainer>
<ParamValue>90</ParamValue>
</ParamValueContainer>
<ParamTitle>Points</ParamTitle>
<ParamValue>123</ParamValue>
</Row>
</Container>
)

@ -0,0 +1,56 @@
import styled, { css } from 'styled-components/macro'
import { customScrollbar } from 'features/Common'
export const Container = styled.div`
width: 100%;
font-size: 11px;
background-color: #333333;
${customScrollbar}
`
export const TeamShortName = styled.span`
color: ${({ theme }) => theme.colors.white};
letter-spacing: -0.078px;
text-transform: uppercase;
font-weight: 600;
opacity: 0.5;
`
export const Row = styled.div`
display: flex;
justify-content: space-between;
align-items: center;
height: 45px;
padding: 0 12px;
border-bottom: 0.5px solid rgba(255, 255, 255, 0.5);
:last-child {
border-bottom: none;
}
`
export const ParamValueContainer = styled.div``
type TParamValue = {
clickable?: boolean,
}
export const ParamValue = styled.span<TParamValue>`
color: ${({ clickable, theme }) => (clickable ? '#5EB2FF' : theme.colors.white)};
${({ clickable }) => (clickable
? css`
cursor: pointer;
`
: '')}
`
export const ParamTitle = styled.span`
color: ${({ theme }) => theme.colors.white};
letter-spacing: -0.078px;
text-transform: uppercase;
font-weight: 600;
opacity: 0.5;
`

@ -1,5 +1,6 @@
export enum Tabs {
WATCH,
EVENTS,
VIDEO
STATS,
PLAYERS,
}

@ -15,7 +15,6 @@ export const useMatchSidePlaylists = () => {
closePopup,
events,
matchPlaylists: playlists,
tournamentData,
} = useMatchPageStore()
const [selectedTab, setSelectedTab] = useState<Tabs>(Tabs.WATCH)
const isWatchTabVisible = useMemo(() => {
@ -35,10 +34,6 @@ export const useMatchSidePlaylists = () => {
events.length > 0
), [events])
const isVideoTabVisible = useMemo(() => (
tournamentData.matches.length > 1
), [tournamentData])
useEffect(() => {
switch (true) {
case isWatchTabVisible:
@ -47,11 +42,8 @@ export const useMatchSidePlaylists = () => {
case isEventTabVisible:
setSelectedTab(Tabs.EVENTS)
break
case isVideoTabVisible:
setSelectedTab(Tabs.VIDEO)
break
}
}, [isEventTabVisible, isVideoTabVisible, isWatchTabVisible])
}, [isEventTabVisible, isWatchTabVisible])
useEffect(() => {
if (selectedTab !== Tabs.EVENTS) closePopup()
@ -59,7 +51,7 @@ export const useMatchSidePlaylists = () => {
return {
isEventTabVisible,
isVideoTabVisible,
isStatsTabVisible: true,
isWatchTabVisible,
onTabClick: setSelectedTab,
selectedTab,

@ -6,8 +6,6 @@ import {
import type { TCircleAnimation, TSetCircleAnimation } from 'features/CircleAnimationBar'
import type { PlaylistOption } from 'features/MatchPage/types'
import { Tab, TabsGroup } from 'features/Common'
import { T9n } from 'features/T9n'
import { useMatchPageStore } from 'features/MatchPage/store'
import { useEventListener } from 'hooks'
@ -17,18 +15,24 @@ import { isIOS } from 'config/userAgent'
import { Tabs } from './config'
import { TabEvents } from './components/TabEvents'
import { TabWatch } from './components/TabWatch'
import { TabVideo } from './components/TabVideo'
import { TabPlayers } from './components/TabPlayers'
import { TabStats } from './components/TabStats'
import { useMatchSidePlaylists } from './hooks'
import {
Wrapper,
TabsWrapper,
TabsGroup,
Tab,
TabIcon,
TabTitle,
Container,
} from './styled'
const tabPanes = {
[Tabs.WATCH]: TabWatch,
[Tabs.EVENTS]: TabEvents,
[Tabs.VIDEO]: TabVideo,
[Tabs.STATS]: TabStats,
[Tabs.PLAYERS]: TabPlayers,
}
type Props = {
@ -38,6 +42,8 @@ type Props = {
setCircleAnimation?: TSetCircleAnimation,
}
const hasLessThanFourTabs = false
export const MatchSidePlaylists = ({
circleAnimation,
onSelect,
@ -54,7 +60,7 @@ export const MatchSidePlaylists = ({
const {
isEventTabVisible,
isVideoTabVisible,
isStatsTabVisible,
isWatchTabVisible,
onTabClick,
selectedTab,
@ -99,13 +105,14 @@ export const MatchSidePlaylists = ({
return (
<Wrapper ref={containerRef}>
<TabsWrapper>
<TabsGroup>
<TabsGroup hasLessThanFourTabs={hasLessThanFourTabs}>
{isWatchTabVisible ? (
<Tab
selected={selectedTab === Tabs.WATCH}
onClick={() => onTabClick(Tabs.WATCH)}
>
<T9n t='watch' />
<TabIcon icon='watch' />
<TabTitle t='watch' />
</Tab>
) : null}
{isEventTabVisible ? (
@ -113,15 +120,26 @@ export const MatchSidePlaylists = ({
selected={selectedTab === Tabs.EVENTS}
onClick={() => onTabClick(Tabs.EVENTS)}
>
<T9n t='actions' />
<TabIcon icon='plays' />
<TabTitle t='actions' />
</Tab>
) : null}
{isStatsTabVisible ? (
<Tab
selected={selectedTab === Tabs.PLAYERS}
onClick={() => onTabClick(Tabs.PLAYERS)}
>
<TabIcon icon='players' />
<TabTitle t='stats' />
</Tab>
) : null}
{isVideoTabVisible ? (
{isStatsTabVisible ? (
<Tab
selected={selectedTab === Tabs.VIDEO}
onClick={() => onTabClick(Tabs.VIDEO)}
selected={selectedTab === Tabs.STATS}
onClick={() => onTabClick(Tabs.STATS)}
>
<T9n t='video' />
<TabIcon icon='stats' />
<TabTitle t='stats' />
</Tab>
) : null}
</TabsGroup>
@ -130,7 +148,6 @@ export const MatchSidePlaylists = ({
<Container
hasScroll={hasTabPaneScroll}
ref={tabPaneContainerRef}
forVideoTab={selectedTab === Tabs.VIDEO}
>
<TabPane
setCircleAnimation={setCircleAnimation}

@ -4,6 +4,7 @@ import { devices } from 'config/devices'
import { isMobileDevice } from 'config/userAgent'
import { customScrollbar } from 'features/Common'
import { T9n } from 'features/T9n'
export const Wrapper = styled.div`
padding-right: 14px;
@ -19,7 +20,7 @@ export const Wrapper = styled.div`
`
export const TabsWrapper = styled.div`
padding-left: 14px;
padding: 0 30px;
${isMobileDevice
? css`
@ -28,14 +29,86 @@ export const TabsWrapper = styled.div`
: ''};
`
type TabsGroupProps = {
hasLessThanFourTabs?: boolean,
}
export const TabsGroup = styled.div.attrs({ role: 'tablist' })<TabsGroupProps>`
display: flex;
height: 45px;
padding-top: 10px;
${({ hasLessThanFourTabs }) => (hasLessThanFourTabs
? css`
height: 40px;
${Tab} {
justify-content: initial;
flex-direction: row;
gap: 5px;
}
`
: '')}
${isMobileDevice
? css`
`
: ''};
`
type TabProps = {
selected?: boolean,
}
export const Tab = styled.div.attrs(({ selected }: TabProps) => ({
'aria-pressed': selected,
role: 'tab',
}))<TabProps>`
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: center;
flex: 1;
opacity: ${({ selected }) => (selected ? '1' : '0.4')};
cursor: pointer;
:hover {
opacity: 1;
}
`
type TabIconProps = {
icon: 'watch' | 'plays' | 'players' | 'stats',
}
export const TabIcon = styled.div<TabIconProps>`
width: 20px;
height: 20px;
background-image: url(/images/matchTabs/${({ icon }) => `${icon}.svg`});
background-repeat: no-repeat;
background-position: center;
background-size: contain;
${({ icon }) => (icon === 'players'
? css`
background-size: 23px;
`
: '')}
`
export const TabTitle = styled(T9n)`
font-size: 8px;
text-transform: uppercase;
color: ${({ theme }) => theme.colors.white};
`
type TContainer = {
forVideoTab?: boolean,
hasScroll: boolean,
}
export const Container = styled.div<TContainer>`
width: 320px;
margin-top: 14px;
margin-top: 23px;
max-height: calc(100vh - 130px);
overflow-y: ${({ forVideoTab }) => (forVideoTab ? 'hidden' : 'auto')};
padding-right: ${({ forVideoTab }) => (forVideoTab ? '0' : '')};

@ -25,7 +25,7 @@ export const TooltipWrapper = styled(TooltipBlockWrapper)`
`
type Props = {
children: ReactNode,
children?: ReactNode,
lexic: string,
}

Loading…
Cancel
Save