Revert "style(#2317): change style for home page in mobile devices"

This reverts commit ad4a33c812.
keep-around/ff4cf7bdec9a659667e4ebb944ae37d48fa84117
Andrei Dekterev 4 years ago
parent 161629a114
commit ff4cf7bdec
  1. 18
      package-lock.json
  2. 2
      package.json
  3. 25
      public/images/score-switch-mobile-off.svg
  4. 25
      public/images/score-switch-mobile-on.svg
  5. 66
      src/components/SportIcon/SportIcon.tsx
  6. 11
      src/config/lexics/indexLexics.tsx
  7. 4
      src/features/FavoritesMobilePopup/components/GroupBlock/index.tsx
  8. 11
      src/features/FavoritesMobilePopup/styled.tsx
  9. 6
      src/features/HeaderFilters/components/DateFilter/index.tsx
  10. 39
      src/features/HeaderFilters/components/DateFilter/styled.tsx
  11. 2
      src/features/HeaderFilters/components/DatePicker/styled.tsx
  12. 7
      src/features/HeaderFilters/store/hooks/index.tsx
  13. 18
      src/features/HeaderMenu/index.tsx
  14. 46
      src/features/HeaderMenu/styled.tsx
  15. 94
      src/features/HeaderMobile/index.tsx
  16. 234
      src/features/HeaderMobile/styled.tsx
  17. 4
      src/features/HomePage/hooks.tsx
  18. 4
      src/features/HomePage/index.tsx
  19. 38
      src/features/Icon/index.tsx
  20. 0
      src/features/Icons/Close/index.tsx
  21. 5
      src/features/Icons/Date/index.tsx
  22. 2
      src/features/ItemsList/index.tsx
  23. 86
      src/features/MatchCard/CardFrontside/index.tsx
  24. 179
      src/features/MatchCard/styled.tsx
  25. 2
      src/features/MatchPage/components/MatchDescription/index.tsx
  26. 2
      src/features/MatchPage/styled.tsx
  27. 2
      src/features/MatchPopup/components/LiveMatchPlaylist/index.tsx
  28. 3
      src/features/MatchPopup/components/LiveMatchPlaylist/styled.tsx
  29. 8
      src/features/MatchPopup/components/LivePlaylistPage/styled.tsx
  30. 2
      src/features/MatchPopup/components/SimplePlaylistButton/index.tsx
  31. 25
      src/features/MatchPopup/components/SimplePlaylistButton/styled.tsx
  32. 6
      src/features/MatchSwitches/components/ScoreSwitch/index.tsx
  33. 34
      src/features/MatchSwitches/styled.tsx
  34. 10
      src/features/Matches/components/MatchesList/index.tsx
  35. 27
      src/features/MatchesGrid/index.tsx
  36. 15
      src/features/Menu/styled.tsx
  37. 4
      src/features/Modal/index.tsx
  38. 2
      src/features/Modal/styled.tsx
  39. 6
      src/features/PopupComponents/BaseButton/index.tsx
  40. 2
      src/features/PopupComponents/CloseButton/index.tsx
  41. 2
      src/features/PreferencesPopup/components/TournamentInfo/index.tsx
  42. 4
      src/features/ProfileHeader/index.tsx
  43. 6
      src/features/ProfileHeader/styled.tsx
  44. 7
      src/features/Search/styled.tsx
  45. 27
      src/features/SportIcon/index.tsx
  46. 20
      src/features/SportsFilter/index.tsx
  47. 25
      src/features/SportsFilter/styled.tsx
  48. 89
      src/features/TournamentList/components/Tournament/index.tsx
  49. 86
      src/features/TournamentList/components/Tournament/styled.tsx
  50. 55
      src/features/TournamentList/hooks.tsx
  51. 35
      src/features/TournamentList/index.tsx
  52. 2
      src/features/UserFavorites/index.tsx
  53. 3
      src/libs/index.d.ts
  54. 11
      src/libs/index.ts
  55. 15
      src/libs/objects/Arrow.tsx
  56. 22
      src/libs/objects/Basketball.tsx
  57. 24
      src/libs/objects/Calendar.tsx
  58. 15
      src/libs/objects/Date.tsx
  59. 12
      src/libs/objects/Dollar.tsx
  60. 13
      src/libs/objects/Football.tsx
  61. 13
      src/libs/objects/Handball.tsx
  62. 11
      src/libs/objects/Hockey.tsx
  63. 14
      src/libs/objects/Star.tsx
  64. 19
      src/libs/objects/Volleyball.tsx
  65. 4
      src/requests/getMatches/types.tsx

18
package-lock.json generated

@ -50748,24 +50748,6 @@
"minimist": "^1.2.5" "minimist": "^1.2.5"
} }
}, },
"mobx": {
"version": "6.5.0",
"resolved": "https://registry.npmjs.org/mobx/-/mobx-6.5.0.tgz",
"integrity": "sha512-pHZ/cySF00FVENDWIDzJyoObFahK6Eg4d0papqm6d7yMkxWTZ/S/csqJX1A3PsYy4t5k3z2QnlwuCfMW5lSEwA=="
},
"mobx-react": {
"version": "7.3.0",
"resolved": "https://registry.npmjs.org/mobx-react/-/mobx-react-7.3.0.tgz",
"integrity": "sha512-RGEcwZokopqyJE5JPwXKB9FWMSqFM9NJVO2QPI+z6laJTJeBHqvPicjnKgY5mvihxTeXB1+72TnooqUePeGV1g==",
"requires": {
"mobx-react-lite": "^3.3.0"
}
},
"mobx-react-lite": {
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/mobx-react-lite/-/mobx-react-lite-3.3.0.tgz",
"integrity": "sha512-U/kMSFtV/bNVgY01FuiGWpRkaQVHozBq5CEBZltFvPt4FcV111hEWkgwqVg9GPPZSEuEdV438PEz8mk8mKpYlA=="
},
"move-concurrently": { "move-concurrently": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz", "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz",

@ -25,8 +25,6 @@
"hls.js": "^0.14.15", "hls.js": "^0.14.15",
"lodash": "^4.17.15", "lodash": "^4.17.15",
"m3u8-parser": "^4.7.0", "m3u8-parser": "^4.7.0",
"mobx": "^6.5.0",
"mobx-react": "^7.3.0",
"oidc-client": "^1.11.5", "oidc-client": "^1.11.5",
"react": "^17.0.2", "react": "^17.0.2",
"react-datepicker": "^3.1.3", "react-datepicker": "^3.1.3",

@ -1,22 +1,17 @@
<svg width="37" height="22" viewBox="0 0 37 22" fill="none" xmlns="http://www.w3.org/2000/svg"> <svg width="57" height="43" viewBox="0 0 57 43" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="37" y="17.5" width="36" height="14" rx="7" transform="rotate(-180 37 17.5)" fill="#3F3F3F"/> <path fill-rule="evenodd" clip-rule="evenodd" d="M21.857 3.09215C23.597 2.99215 25.335 3.00015 27.075 3.00015C27.087 3.00015 35.892 3.00015 35.892 3.00015C37.666 3.00015 39.404 2.99215 41.143 3.09215C42.724 3.18215 44.264 3.37415 45.797 3.80315C49.024 4.70515 51.842 6.58915 53.879 9.26015C55.904 11.9142 57 15.1632 57 18.4992C57 21.8392 55.904 25.0862 53.879 27.7402C51.842 30.4102 49.024 32.2952 45.797 33.1972C44.264 33.6262 42.724 33.8172 41.143 33.9082C39.404 34.0082 37.666 33.9992 35.926 33.9992C35.914 33.9992 27.107 34.0002 27.107 34.0002C25.335 33.9992 23.597 34.0082 21.857 33.9082C20.277 33.8172 18.737 33.6262 17.204 33.1972C13.977 32.2952 11.159 30.4102 9.122 27.7402C7.097 25.0862 6 21.8392 6 18.5002C6 15.1632 7.097 11.9142 9.122 9.26015C11.159 6.58915 13.977 4.70515 17.204 3.80315C18.737 3.37415 20.277 3.18215 21.857 3.09215Z" fill="#3F3F3F"/>
<g filter="url(#filter0_dd_24561_217032)"> <g filter="url(#filter0_d)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M10 1.5C5.02944 1.5 1 5.52944 1 10.5C1 15.4706 5.02944 19.5 10 19.5C14.9706 19.5 19 15.4706 19 10.5C19 5.52944 14.9706 1.5 10 1.5Z" fill="#9F9F9F"/> <path fill-rule="evenodd" clip-rule="evenodd" d="M21.5 32C28.9558 32 35 25.9558 35 18.5C35 11.0442 28.9558 5 21.5 5C14.0442 5 8 11.0442 8 18.5C8 25.9558 14.0442 32 21.5 32Z" fill="white"/>
</g> </g>
<defs> <defs>
<filter id="filter0_dd_24561_217032" x="0" y="0.5" width="20" height="21" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"> <filter id="filter0_d" x="0" y="0" width="43" height="43" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/> <feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/> <feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dy="1"/> <feOffset dy="3"/>
<feGaussianBlur stdDeviation="0.5"/> <feGaussianBlur stdDeviation="4"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.237602 0"/> <feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.15 0"/>
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_24561_217032"/> <feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/> <feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow" result="shape"/>
<feOffset/>
<feGaussianBlur stdDeviation="0.5"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.12 0"/>
<feBlend mode="normal" in2="effect1_dropShadow_24561_217032" result="effect2_dropShadow_24561_217032"/>
<feBlend mode="normal" in="SourceGraphic" in2="effect2_dropShadow_24561_217032" result="shape"/>
</filter> </filter>
</defs> </defs>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

@ -1,22 +1,17 @@
<svg width="37" height="22" viewBox="0 0 37 22" fill="none" xmlns="http://www.w3.org/2000/svg"> <svg width="57" height="43" viewBox="0 0 57 43" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect y="3.5" width="36" height="14" rx="7" fill="#294FC4"/> <path d="M15.857 3.09215C17.597 2.99215 19.335 3.00015 21.075 3.00015C21.087 3.00015 29.892 3.00015 29.892 3.00015C31.666 3.00015 33.404 2.99215 35.143 3.09215C36.724 3.18215 38.264 3.37415 39.797 3.80315C43.024 4.70515 45.842 6.58915 47.879 9.26015C49.904 11.9142 51 15.1632 51 18.4992C51 21.8392 49.904 25.0862 47.879 27.7402C45.842 30.4102 43.024 32.2952 39.797 33.1972C38.264 33.6262 36.724 33.8172 35.143 33.9082C33.404 34.0082 31.666 33.9992 29.926 33.9992C29.914 33.9992 21.107 34.0002 21.107 34.0002C19.335 33.9992 17.597 34.0082 15.857 33.9082C14.277 33.8172 12.737 33.6262 11.204 33.1972C7.977 32.2952 5.159 30.4102 3.122 27.7402C1.097 25.0862 0 21.8392 0 18.5002C0 15.1632 1.097 11.9142 3.122 9.26015C5.159 6.58915 7.977 4.70515 11.204 3.80315C12.737 3.37415 14.277 3.18215 15.857 3.09215Z" fill="#294FC4"/>
<g filter="url(#filter0_dd_24503_218575)"> <g filter="url(#filter0_d)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M27 19.5C31.9706 19.5 36 15.4706 36 10.5C36 5.52944 31.9706 1.5 27 1.5C22.0294 1.5 18 5.52944 18 10.5C18 15.4706 22.0294 19.5 27 19.5Z" fill="#9F9F9F"/> <path fill-rule="evenodd" clip-rule="evenodd" d="M35.5 32C42.9558 32 49 25.9558 49 18.5C49 11.0442 42.9558 5 35.5 5C28.0442 5 22 11.0442 22 18.5C22 25.9558 28.0442 32 35.5 32Z" fill="white"/>
</g> </g>
<defs> <defs>
<filter id="filter0_dd_24503_218575" x="17" y="0.5" width="20" height="21" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"> <filter id="filter0_d" x="14" y="0" width="43" height="43" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/> <feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/> <feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dy="1"/> <feOffset dy="3"/>
<feGaussianBlur stdDeviation="0.5"/> <feGaussianBlur stdDeviation="4"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.237602 0"/> <feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.15 0"/>
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_24503_218575"/> <feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/> <feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow" result="shape"/>
<feOffset/>
<feGaussianBlur stdDeviation="0.5"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.12 0"/>
<feBlend mode="normal" in2="effect1_dropShadow_24503_218575" result="effect2_dropShadow_24503_218575"/>
<feBlend mode="normal" in="SourceGraphic" in2="effect2_dropShadow_24503_218575" result="shape"/>
</filter> </filter>
</defs> </defs>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

@ -1,66 +0,0 @@
import styled from 'styled-components/macro'
import { SportTypes } from 'config'
import { getSportLexic } from 'helpers'
import { Icon } from 'features/Icon'
const IconWrap = styled.div`
display: flex;
height: 10px;
min-width: 10px;
color: white;
align-items: center;
`
type Props = {
fill?: string,
size?: number,
sport: SportTypes,
}
const sportIcons = {
basketball: {
color: '#f1903b',
icon: 'Basketball',
},
football: {
color: '#5CDD86',
icon: 'Football',
},
handball: {
color: '#F6BE4F',
icon: 'Handball',
},
hockey: {
color: '#5eb2ff',
icon: 'Hockey',
},
streetball: {
color: '#f1903b',
icon: 'Basketball',
},
volleyball: {
color: '#2D8B8A',
icon: 'Volleyball',
},
}
export const SportIcon = ({
fill,
size,
sport,
}: Props) => {
const sportType = getSportLexic(sport)
const IconSport = sportIcons[sportType].icon
return (
<IconWrap>
<Icon
refIcon={IconSport}
color={fill || sportIcons[sportType].color}
size={size || 10}
/>
</IconWrap>
)
}

@ -78,26 +78,18 @@ const preferencesPopupLexics = {
sport_types: 15088, sport_types: 15088,
} }
const sportsPopup = {
football_popup: 12980,
hockey_popup: 15217,
}
export const indexLexics = { export const indexLexics = {
add_to_favorites: 14967, add_to_favorites: 14967,
add_to_favorites_error: 12943, add_to_favorites_error: 12943,
all_matches_shown: 13386, all_matches_shown: 13386,
all_sports: 13824,
available_matches_shown: 13385, available_matches_shown: 13385,
basketball: 6960, basketball: 6960,
broadcast: 13049, broadcast: 13049,
check_connection: 15700, check_connection: 15700,
choose_sport: 17927,
cm: 817, cm: 817,
features: 13051, features: 13051,
football: 6958, football: 6958,
full_game: 13028, full_game: 13028,
futsal: 17670,
game_finished: 13026, game_finished: 13026,
game_time: 13029, game_time: 13029,
gender_female: 9648, gender_female: 9648,
@ -127,14 +119,12 @@ export const indexLexics = {
players_video: 13032, players_video: 13032,
round_highilights: 13050, round_highilights: 13050,
save: 828, save: 828,
scores: 14070,
search_results: 9014, search_results: 9014,
sport: 12993, sport: 12993,
team: 14973, team: 14973,
to_home: 13376, to_home: 13376,
tournament: 14974, tournament: 14974,
user_account: 12928, user_account: 12928,
volleyball: 9761,
watch_from_beginning: 13021, watch_from_beginning: 13021,
watch_from_last_pause: 13022, watch_from_last_pause: 13022,
watch_now: 13020, watch_now: 13020,
@ -145,5 +135,4 @@ export const indexLexics = {
...buyMatchPopupLexics, ...buyMatchPopupLexics,
...publicLexics, ...publicLexics,
...paymentLexics, ...paymentLexics,
...sportsPopup,
} }

@ -4,7 +4,7 @@ import map from 'lodash/map'
import type { UserFavorites } from 'requests/getUserSportFavs' import type { UserFavorites } from 'requests/getUserSportFavs'
import { T9n } from 'features/T9n' import { T9n } from 'features/T9n'
import { SportIcon } from 'components/SportIcon/SportIcon' import { SportIcon } from 'features/SportIcon'
import { useLexicsStore } from 'features/LexicsStore' import { useLexicsStore } from 'features/LexicsStore'
import { ProfileLink } from 'features/ProfileLink' import { ProfileLink } from 'features/ProfileLink'
import { UserSportFavImgWrapper } from 'features/UserFavorites/styled' import { UserSportFavImgWrapper } from 'features/UserFavorites/styled'
@ -70,7 +70,7 @@ export const GroupBlock = ({ groupBlock }: Props) => {
<EmptyDiv> <EmptyDiv>
<Name>{name}</Name> <Name>{name}</Name>
<CountryAndTeamInfo> <CountryAndTeamInfo>
<SportIcon sport={item.sport} size={12} /> <SportIcon sport={item.sport} />
<Flag src={`https://instatscout.com/images/flags/48/${item.info.country?.id}.png`} /> <Flag src={`https://instatscout.com/images/flags/48/${item.info.country?.id}.png`} />
<EmptySpan>{countryOrTeam}</EmptySpan> <EmptySpan>{countryOrTeam}</EmptySpan>
</CountryAndTeamInfo> </CountryAndTeamInfo>

@ -1,8 +1,6 @@
import styled, { css } from 'styled-components/macro' import styled from 'styled-components/macro'
import { devices } from 'config' import { devices } from 'config'
import { isMobileDevice } from 'config/userAgent'
import { Logo } from 'features/Logo' import { Logo } from 'features/Logo'
import { ModalContainer } from 'features/Modal/styled' import { ModalContainer } from 'features/Modal/styled'
import { Icon } from 'features/Menu/styled' import { Icon } from 'features/Menu/styled'
@ -29,13 +27,6 @@ export const Wrapper = styled.div`
rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.14) 0%,
rgba(255, 255, 255, 0) 100% rgba(255, 255, 255, 0) 100%
), rgba(0, 0, 0, 0.9); ), rgba(0, 0, 0, 0.9);
${isMobileDevice
? css`
padding: 5px;
`
: ''};
` `
export const HomeIcon = styled(Icon)` export const HomeIcon = styled(Icon)`

@ -3,8 +3,8 @@ import { Fragment } from 'react'
import map from 'lodash/map' import map from 'lodash/map'
import { OutsideClick } from 'features/OutsideClick' import { OutsideClick } from 'features/OutsideClick'
import { Date as DateIcon } from 'features/Icons/Date'
import { BodyBackdrop } from 'features/PageLayout' import { BodyBackdrop } from 'features/PageLayout'
import { Icon } from 'features/Icon'
import { useDateFilter } from './hooks' import { useDateFilter } from './hooks'
import { DatePicker } from '../DatePicker' import { DatePicker } from '../DatePicker'
@ -38,11 +38,11 @@ export const DateFilter = () => {
return ( return (
<Wrapper> <Wrapper>
<MonthWrapper> <MonthWrapper>
<MonthYear onClick={openDatePicker}> <MonthYear>
{date.month} {' '} {date.year} {date.month} {' '} {date.year}
</MonthYear> </MonthYear>
<DateButton isActive={isOpen} onClick={openDatePicker}> <DateButton isActive={isOpen} onClick={openDatePicker}>
<Icon refIcon='Calendar' color='#fff' /> <DateIcon />
</DateButton> </DateButton>
</MonthWrapper> </MonthWrapper>

@ -13,7 +13,7 @@ export const BaseButton = styled.button`
export const Wrapper = styled.div` export const Wrapper = styled.div`
position: relative; position: relative;
/* width: 32.8rem; */ width: 32.8rem;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
@ -25,8 +25,8 @@ export const Wrapper = styled.div`
${isMobileDevice ${isMobileDevice
? css` ? css`
/* padding-top: 4px; */ padding-top: 4px;
/* min-height: 84px; */ min-height: 84px;
justify-content: space-between; justify-content: space-between;
@media (max-width: 450px){ @media (max-width: 450px){
@ -41,7 +41,6 @@ export const MonthWrapper = styled.div`
text-align: center; text-align: center;
align-self: center; align-self: center;
width: 100%; width: 100%;
cursor: pointer;
@media (max-width: 750px) { @media (max-width: 750px) {
width: 32.8rem; width: 32.8rem;
@ -60,7 +59,7 @@ export const MonthYear = styled.span`
text-transform: uppercase; text-transform: uppercase;
${isMobileDevice ${isMobileDevice
? css` ? css`
font-size: 10px; font-size: 13px;
line-height: 24px; line-height: 24px;
` `
: ''}; : ''};
@ -78,13 +77,10 @@ export const DateButton = styled(BaseButton)<DateButtonProps>`
height: 1.26rem; height: 1.26rem;
color: #fff; color: #fff;
opacity: 0.5; opacity: 0.5;
margin-left: 10px;
${isMobileDevice ${isMobileDevice
? css` ? css`
position: static; top: 4px;
width: 9px;
height: 9px;
` `
: ''}; : ''};
@ -100,11 +96,11 @@ export const DateButton = styled(BaseButton)<DateButtonProps>`
${isMobileDevice ${isMobileDevice
? css` ? css`
/* right: 14px; right: 14px;
width: 16px; width: 16px;
height: 16px; */ height: 16px;
@media screen and (orientation: landscape){ @media screen and (orientation: landscape){
/* right: 20px; */ right: 20px;
} }
` `
: ''}; : ''};
@ -114,10 +110,10 @@ export const WeekDaysWrapper = styled.div`
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
/* margin-top: 0.567rem; */ margin-top: 0.567rem;
${isMobileDevice ${isMobileDevice
? css` ? css`
padding: 0 5px; padding: 0 20px;
` `
: ''}; : ''};
` `
@ -155,7 +151,7 @@ export const WeekDay = styled(BaseButton)<WeekDayProps>`
)}; )};
@media ${devices.mobile} { @media ${devices.mobile} {
width: 35px; width: 45px;
} }
` `
@ -190,9 +186,8 @@ export const ArrowButton = styled(BaseButton)`
height: 2.28rem; height: 2.28rem;
${isMobileDevice ${isMobileDevice
? css` ? css`
height: 100%; width: 15px;
padding: 0 5px; height: 14px;
width: 35px;
` `
: ''}; : ''};
@ -206,8 +201,8 @@ export const Arrow = styled.span<ArrowProps>`
width: 0.65rem; width: 0.65rem;
height: 0.65rem; height: 0.65rem;
position: absolute; position: absolute;
border-left: 0.3rem solid #fff; border-left: 0.15rem solid #fff;
border-bottom: 0.3rem solid #fff; border-bottom: 0.15rem solid #fff;
top: 50%; top: 50%;
left: 50%; left: 50%;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
@ -219,9 +214,7 @@ export const Arrow = styled.span<ArrowProps>`
)} )}
${isMobileDevice ${isMobileDevice
? css` ? css`
padding: 5px; border-left: 1px solid #fff;
border-left: 0.3rem solid #fff;
border-left: 0.3rem solid #fff;
width: 10px; width: 10px;
height: 10px; height: 10px;
` `

@ -15,7 +15,7 @@ export const Wrapper = styled.div`
width: 100%; width: 100%;
@media screen and (orientation: landscape){ @media screen and (orientation: landscape){
right: -24%; right: 15%;
} }
` `
: ''}; : ''};

@ -2,7 +2,6 @@ import {
useMemo, useMemo,
useEffect, useEffect,
useCallback, useCallback,
useState,
} from 'react' } from 'react'
import { useLocation } from 'react-router-dom' import { useLocation } from 'react-router-dom'
import { isToday } from 'date-fns' import { isToday } from 'date-fns'
@ -22,7 +21,6 @@ export const useFilters = () => {
serialize: serializeDate, serialize: serializeDate,
validator: isValidDate, validator: isValidDate,
}) })
const [selectedSport, setSelectedSport] = useState('all_sports')
const isTodaySelected = isToday(selectedDate) const isTodaySelected = isToday(selectedDate)
@ -43,16 +41,11 @@ export const useFilters = () => {
const store = useMemo(() => ({ const store = useMemo(() => ({
isTodaySelected, isTodaySelected,
selectedDate, selectedDate,
selectedSport,
setSelectedDate, setSelectedDate,
setSelectedSport,
}), [ }), [
isTodaySelected, isTodaySelected,
selectedDate, selectedDate,
selectedSport,
setSelectedDate, setSelectedDate,
setSelectedSport,
]) ])
return store return store

@ -1,18 +0,0 @@
import { Link } from 'react-router-dom'
import { PAGES } from 'config/pages'
import { Search } from 'features/Search'
import { Menu } from 'features/Menu'
import { HeaderGroup, HeaderLogo } from './styled'
export const HeaderMenu = () => (
<HeaderGroup>
<Search />
<Link to={PAGES.home}>
<HeaderLogo />
</Link>
<Menu />
</HeaderGroup>
)

@ -1,46 +0,0 @@
import styled, { css } from 'styled-components/macro'
import { client } from 'config/clients'
import { isMobileDevice } from 'config/userAgent'
import { Logo } from 'features/Logo'
type Props = {
height?: number,
marginTop?: number,
}
export const HeaderGroup = styled.div<Props>`
display: flex;
flex-direction: row;
align-items: center;
${({ height }) => (height ? `height: ${height}rem` : '')};
${({ marginTop }) => (marginTop ? `margin-top: ${marginTop}rem` : '')};
${isMobileDevice
? css`
position: relative;
justify-content: space-between;
:only-child {
flex-basis: 100px;
}
`
: ''};
`
export const HeaderLogo = styled(Logo)`
${({ isMatchPage }) => (isMatchPage ? css`
width: ${client.styles.matchLogoWidth}rem;
height: ${client.styles.matchLogoHeight}rem;
` : '')}
${isMobileDevice
? css`
width: 65px;
height: 15px;
margin: 5px 22px;
`
: ''}
`

@ -1,78 +1,28 @@
import { useState } from 'react' import { Link } from 'react-router-dom'
import { PAGES } from 'config'
import { ScoreSwitch } from 'features/MatchSwitches' import { ScoreSwitch } from 'features/MatchSwitches'
import { HeaderMenu } from 'features/HeaderMenu' import { Logo } from 'features/Logo'
import { DateFilter, useHeaderFiltersStore } from 'features/HeaderFilters' import { Menu } from 'features/Menu'
import { SportsFilter } from 'features/SportsFilter' import { Search } from 'features/Search'
import { T9n } from 'features/T9n'
import { import {
HeaderStyled, HeaderMobileWrapper,
ScBody, HeaderIconsWrapper,
ScSportsWrapper, IconFavWrapper,
ScModal,
ScHeaderTitle,
ScHeaderGroup,
ScSport,
} from './styled' } from './styled'
const sports = [ export const HeaderMobile = () => (
'all_sports', <HeaderMobileWrapper>
'basketball', <ScoreSwitch />
'football_popup', <Link to={PAGES.home}>
'handball', <Logo width={52} height={12} />
'hockey_popup', </Link>
'volleyball', <HeaderIconsWrapper>
] <IconFavWrapper />
<Search />
export const HeaderMobile = () => { <Menu />
const { selectedSport, setSelectedSport } = useHeaderFiltersStore() </HeaderIconsWrapper>
const [isOpen, setIsOpen] = useState(false) </HeaderMobileWrapper>
)
const onSportClick = (sport: string) => {
setSelectedSport(sport)
setIsOpen(false)
}
const onModalOpen = () => {
setIsOpen(true)
}
const onModalClose = () => {
setIsOpen(false)
}
return (
<HeaderStyled>
<HeaderMenu />
<DateFilter />
<ScSportsWrapper>
<SportsFilter
onModalOpen={onModalOpen}
open={isOpen}
sport={selectedSport}
/>
<ScoreSwitch />
</ScSportsWrapper>
<ScModal isOpen={isOpen} withCloseButton close={onModalClose}>
<ScHeaderGroup>
<ScHeaderTitle>
<T9n t='choose_sport' />
</ScHeaderTitle>
</ScHeaderGroup>
<ScBody>
{sports.map((sport) => (
<ScSport
key={sport}
onClick={() => onSportClick(sport)}
className={selectedSport === sport ? 'active' : ''}
active={selectedSport === sport}
>
<T9n t={sport} />
</ScSport>
))}
</ScBody>
</ScModal>
</HeaderStyled>
)
}

@ -1,223 +1,43 @@
import styled, { css } from 'styled-components/macro' import styled from 'styled-components/macro'
import { devices } from 'config/devices'
import isUndefined from 'lodash/isUndefined' export const HeaderMobileWrapper = styled.div`
width: 100%;
import { client } from 'config/clients' height: 40px;
import { isMobileDevice } from 'config/userAgent' background-color: rgba(255, 255, 255, 0.1);
import { Logo } from 'features/Logo'
import { ModalWindow } from 'features/Modal/styled'
import { Modal as BaseModal } from 'features/Modal'
import { customScrollbar } from 'features/Common'
export const DEFAULT_HEADER_COLOR = 'rgba(53, 96, 225, 0.56)'
export const defaultHeaderStyles = (
color: string = DEFAULT_HEADER_COLOR, headerImage: string | undefined | null,
) => {
if (headerImage && client.name !== 'facr') {
return css`background: url(${headerImage}.png);
background-size: 100% 100%;
@media (max-width: 450px){
background: url(${headerImage}_mobile.png);
background-size: 100% 100%;
}
`
}
if (color.includes('linear-gradient')) {
return css`
background: ${color};
z-index: 10;
`
}
return client.name === 'facr' ? client.styles.homePageHeader : css`
background: linear-gradient(
187deg,
${color} -4.49%,
#000000 68.29%),
#000000;
z-index: 10;
`
}
type HeaderProps = {
color?: string,
headerImage?: string | null,
height?: number,
}
export const HeaderStyled = styled.header<HeaderProps>`
position: relative;
display: flex; display: flex;
flex-direction: column; align-items: center;
justify-content: center; justify-content: space-between;
height: ${({ height = 8.5 }) => height}rem; padding: 12px 18px;
${isMobileDevice
? css`
height: 124px
`
: ''};
${({ color, headerImage }) => defaultHeaderStyles(color, headerImage)}
${isMobileDevice
? css`
padding: 8px;
`
: ''}
` `
type Props = { export const HeaderMobileMidle = styled.div`
height?: number, width: 100%;
marginTop?: number,
}
export const HeaderGroup = styled.div<Props>`
display: flex; display: flex;
flex-direction: row;
align-items: center; align-items: center;
justify-content: center;
${({ height }) => (height ? `height: ${height}rem` : '')}; padding: 12px 0;
${({ marginTop }) => (marginTop ? `margin-top: ${marginTop}rem` : '')}; margin-top: 6px;
${isMobileDevice
? css`
position: relative;
justify-content: space-between;
width: 100%;
:only-child {
flex-basis: 100px;
}
`
: ''};
`
export const HeaderLogo = styled(Logo)`
${({ isMatchPage }) => (isMatchPage ? css`
width: ${client.styles.matchLogoWidth}rem;
height: ${client.styles.matchLogoHeight}rem;
` : '')}
${isMobileDevice
? css`
width: 65px;
height: 15px;
`
: ''}
`
type PositionProps = {
isMatchPage?: boolean,
left?: number,
right?: number,
top?: number,
}
export const Position = styled.div<PositionProps>`
position: absolute;
top: ${({ isMatchPage, top = 1.14 }) => (
isMatchPage
? client.styles.matchLogoTopMargin ?? top
: top
)}rem;
${({ left }) => (isUndefined(left) ? '' : `left: ${left}rem`)};
${({ right }) => (isUndefined(right) ? '' : `right: ${right}rem`)};
` `
export const ScSportsWrapper = styled.div` export const HeaderIconsWrapper = styled.div`
height: 80px;
display: flex; display: flex;
flex-direction: row;
align-items: center; align-items: center;
position: absolute; justify-content: space-around;
min-width: 100px;
${isMobileDevice @media ${devices.tablet} {
? css` min-width: auto;
top: 110px;
padding: 10px;
justify-content: space-between;
width: 100%;
/* right: -10px;
width: 95vw;
bottom: -90px; */
`
: ''};
`
export const ScModal = styled(BaseModal)`
background-color: rgba(0, 0, 0, 0.7);
${ModalWindow} {
min-width: 280px;
max-height: 250px;
background-color: #333333;
border-radius: 0px;
padding: 0;
${customScrollbar}
overflow-y: auto;
${isMobileDevice
? css`
height: auto;
top: -15vh;
`
: ''};
} }
` `
export const ScHeaderTitle = styled.span`
font-weight: 700;
font-size: 10px;
line-height: 24px;
color: #FFFFFF;
${isMobileDevice
? css`
font-size: 10px;
line-height: 20px;
@media (orientation: landscape) { export const IconFavWrapper = styled.div`
font-size: 10px; width: 24px;
} height: 20px;
` background-image: url(/images/star-white.svg);
: ''}; background-repeat: no-repeat;
`
export const ScHeaderGroup = styled.div` @media ${devices.tablet} {
display: flex; display: none;
flex-direction: row; }
justify-content: center;
padding: 10px;
border-bottom: 1px solid #505050;
${isMobileDevice
? css`
font-size: 10px;
line-height: 20px;
@media (orientation: landscape) {
font-size: 10px;
}
`
: ''};
`
export const ScBody = styled.div`
display: flex;
flex-direction: column;
padding: 0 15px 15px 15px;
`
type SportProps = {
active: boolean,
}
export const ScSport = styled.div<SportProps>`
display: flex;
justify-content: center;
text-transform: uppercase;
font-size: 10px;
font-weight: 700;
opacity: ${({ active }) => (active ? 1 : 0.5)};
margin-top: 18px;
cursor: pointer;
` `

@ -31,7 +31,5 @@ export const useHomePage = () => {
}), }),
[selectedDate], [selectedDate],
) )
return { return { fetchMatches }
fetchMatches,
}
} }

@ -1,5 +1,4 @@
import { PAGES } from 'config' import { PAGES } from 'config'
import { isMobileDevice } from 'config/userAgent'
import { usePageLogger } from 'hooks/usePageLogger' import { usePageLogger } from 'hooks/usePageLogger'
@ -17,14 +16,13 @@ import { UserFavorites } from 'features/UserFavorites'
import { useHomePage } from './hooks' import { useHomePage } from './hooks'
import { Header } from './components/Header' import { Header } from './components/Header'
import { HeaderMobile } from '../HeaderMobile'
const Home = () => { const Home = () => {
usePageLogger(PAGES.home) usePageLogger(PAGES.home)
const { fetchMatches } = useHomePage() const { fetchMatches } = useHomePage()
return ( return (
<PageWrapper> <PageWrapper>
{isMobileDevice ? <HeaderMobile /> : <Header />} <Header />
<Main> <Main>
<UserFavorites /> <UserFavorites />
<Content> <Content>

@ -1,38 +0,0 @@
import React from 'react'
import * as icons from '../../libs/index'
export type IconProps = {
className?: string,
color?: string,
direction?: number,
onClick?: () => void,
refIcon: any,
size?: number,
}
export const Icon: React.FC<IconProps> = ({
className,
color,
direction,
onClick,
refIcon,
size,
}) => (
<div
className={className || 'icon-container'}
onClick={onClick}
onKeyDown={onClick}
style={{
fill: color,
height: size,
transform: `rotate(${direction}deg)`,
width: size,
}}
aria-hidden='true'
>
{
// @ts-ignore
React.createElement(icons[refIcon], {})
}
</div>
)

@ -0,0 +1,5 @@
export const Date = () => (
<svg width='100%' height='100%' viewBox='0 0 27 26' fill='none' xmlns='http://www.w3.org/2000/svg'>
<path fillRule='evenodd' clipRule='evenodd' d='M25.2659 3.62109C25.9389 4.26715 26.317 5.14339 26.317 6.05706V22.1336C26.317 23.0473 25.9389 23.9235 25.2659 24.5696C24.5929 25.2156 23.6801 25.5786 22.7283 25.5786H3.58868C2.6369 25.5786 1.72411 25.2156 1.0511 24.5696C0.378092 23.9235 0 23.0473 0 22.1336V6.05706C0 5.14339 0.378092 4.26715 1.0511 3.62109C1.72411 2.97503 2.6369 2.61208 3.58868 2.61208H6.57924V1.46376C6.57924 1.1592 6.70528 0.867119 6.92961 0.651766C7.15395 0.436414 7.45821 0.31543 7.77547 0.31543C8.09273 0.31543 8.39699 0.436414 8.62133 0.651766C8.84567 0.867119 8.9717 1.1592 8.9717 1.46376V2.61208H17.3453V1.46376C17.3453 1.1592 17.4713 0.867119 17.6957 0.651766C17.92 0.436414 18.2242 0.31543 18.5415 0.31543C18.8588 0.31543 19.163 0.436414 19.3874 0.651766C19.6117 0.867119 19.7377 1.1592 19.7377 1.46376V2.61208H22.7283C23.6801 2.61208 24.5929 2.97503 25.2659 3.62109ZM6.57924 4.90873H4.18679C3.7109 4.90873 3.25451 5.09021 2.918 5.41324C2.5815 5.73627 2.39245 6.17439 2.39245 6.63122V9.50203H23.9245V6.63122C23.9245 6.17439 23.7355 5.73627 23.399 5.41324C23.0625 5.09021 22.6061 4.90873 22.1302 4.90873H19.7377V6.05706C19.7377 6.36161 19.6117 6.65369 19.3874 6.86905C19.163 7.0844 18.8588 7.20538 18.5415 7.20538C18.2242 7.20538 17.92 7.0844 17.6957 6.86905C17.4713 6.65369 17.3453 6.36161 17.3453 6.05706V4.90873H8.9717V6.05706C8.9717 6.36161 8.84567 6.65369 8.62133 6.86905C8.39699 7.0844 8.09273 7.20538 7.77547 7.20538C7.45821 7.20538 7.15395 7.0844 6.92961 6.86905C6.70528 6.65369 6.57924 6.36161 6.57924 6.05706V4.90873ZM4.52477 15.3158C5.66029 15.3158 6.58082 14.4321 6.58082 13.3421C6.58082 12.2521 5.66029 11.3684 4.52477 11.3684C3.38924 11.3684 2.46872 12.2521 2.46872 13.3421C2.46872 14.4321 3.38924 15.3158 4.52477 15.3158Z' fill='currentColor' />
</svg>
)

@ -7,7 +7,7 @@ import { SportTypes, ProfileTypes } from 'config'
import { Gender } from 'requests' import { Gender } from 'requests'
import type { ObjectWithName } from 'features/Name' import type { ObjectWithName } from 'features/Name'
import { SportIcon } from 'components/SportIcon/SportIcon' import { SportIcon } from 'features/SportIcon'
import { import {
Item, Item,

@ -6,6 +6,7 @@ import getUnixTime from 'date-fns/getUnixTime'
import { ProfileTypes, PAGES } from 'config' import { ProfileTypes, PAGES } from 'config'
import type { Match } from 'features/Matches' import type { Match } from 'features/Matches'
import { SportIcon } from 'features/SportIcon'
import { useMatchSwitchesStore } from 'features/MatchSwitches' import { useMatchSwitchesStore } from 'features/MatchSwitches'
import { useName } from 'features/Name' import { useName } from 'features/Name'
import { T9n } from 'features/T9n' import { T9n } from 'features/T9n'
@ -27,14 +28,15 @@ import {
TeamName, TeamName,
Teams, Teams,
Time, Time,
TournamentName,
TeamLogos, TeamLogos,
TeamLogo, TeamLogo,
BuyMatchBadge, BuyMatchBadge,
CountryFlag,
SecondaryInfo, SecondaryInfo,
FavoriteSign, FavoriteSign,
NameSignWrapper, NameSignWrapper,
HoverFrame, HoverFrame,
ScDollar,
} from '../styled' } from '../styled'
import { useCardPreview } from './hooks' import { useCardPreview } from './hooks'
@ -67,7 +69,11 @@ export const CardFrontside = ({
const { isInFavorites } = useUserFavoritesStore() const { isInFavorites } = useUserFavoritesStore()
const { isScoreHidden } = useMatchSwitchesStore() const { isScoreHidden } = useMatchSwitchesStore()
const isInFuture = getUnixTime(date) > getUnixTime(new Date()) const isInFuture = getUnixTime(date) > getUnixTime(new Date())
const showScore = !(isInFuture || isScoreHidden) || (live && !isScoreHidden) const showScore = !(
isInFuture
|| isScoreHidden
) || (live && !isScoreHidden)
const tournamentInFavorites = isInFavorites(ProfileTypes.TOURNAMENTS, tournament.id)
const team1InFavorites = isInFavorites(ProfileTypes.TEAMS, team1.id) const team1InFavorites = isInFavorites(ProfileTypes.TEAMS, team1.id)
const team2InFavorites = isInFavorites(ProfileTypes.TEAMS, team2.id) const team2InFavorites = isInFavorites(ProfileTypes.TEAMS, team2.id)
@ -77,42 +83,50 @@ export const CardFrontside = ({
}) })
return ( return (
<CardWrapperOuter onClick={onClick} onKeyPress={onKeyPress}> <CardWrapperOuter
onClick={onClick}
onKeyPress={onKeyPress}
>
<CardWrapper> <CardWrapper>
<HoverFrame /> <HoverFrame />
<PreviewWrapper> <PreviewWrapper>
{previewImage && ( {previewImage && (
<Preview title={tournamentName} src={previewImage} /> <Preview
)} title={tournamentName}
{access === MatchAccess.NoCountryAccess ? ( src={previewImage}
<NoAccessMessage /> />
) : (
<TeamLogos>
<TeamLogo
id={team1.id}
nameAsTitle
altNameObj={team1}
sportType={sportType}
profileType={ProfileTypes.TEAMS}
/>
<TeamLogo
id={team2.id}
nameAsTitle
altNameObj={team2}
sportType={sportType}
profileType={ProfileTypes.TEAMS}
/>
</TeamLogos>
)} )}
{access === MatchAccess.NoCountryAccess
? <NoAccessMessage />
: (
<TeamLogos>
<TeamLogo
id={team1.id}
nameAsTitle
altNameObj={team1}
sportType={sportType}
profileType={ProfileTypes.TEAMS}
/>
<TeamLogo
id={team2.id}
nameAsTitle
altNameObj={team2}
sportType={sportType}
profileType={ProfileTypes.TEAMS}
/>
</TeamLogos>
)}
{access === MatchAccess.CanBuyMatch && <BuyMatchBadge />}
<MatchTimeInfo> <MatchTimeInfo>
<MatchDate isHomePage={isHomePage}> <MatchDate isHomePage={isHomePage}>
{isHomePage ? null : formattedDate} {isHomePage ? null : formattedDate}
{live && ( <Time>{time}</Time>
<LiveSign>
<T9n t='live' />
</LiveSign>
)}
</MatchDate> </MatchDate>
{live && (
<LiveSign>
<T9n t='live' />
</LiveSign>
)}
</MatchTimeInfo> </MatchTimeInfo>
</PreviewWrapper> </PreviewWrapper>
<Info> <Info>
@ -133,11 +147,15 @@ export const CardFrontside = ({
</Team> </Team>
</Teams> </Teams>
<SecondaryInfo> <SecondaryInfo>
<Time>{time}</Time> <SportIcon sport={sportType} />
{access === MatchAccess.CanBuyMatch && ( <CountryFlag src={`https://instatscout.com/images/flags/48/${match.countryId}.png`} />
<BuyMatchBadge> {tournament && (
<ScDollar refIcon='Dollar' size={5} /> <NameSignWrapper>
</BuyMatchBadge> <TournamentName title={tournamentName}>
{tournamentName}
</TournamentName>
{tournamentInFavorites && <FavoriteSign marginLeft={12} />}
</NameSignWrapper>
)} )}
</SecondaryInfo> </SecondaryInfo>
</Info> </Info>

@ -4,7 +4,6 @@ import { devices } from 'config/devices'
import { isMobileDevice } from 'config/userAgent' import { isMobileDevice } from 'config/userAgent'
import { Name } from 'features/Name' import { Name } from 'features/Name'
import { Icon } from 'features/Icon'
import { ProfileLogo } from 'features/ProfileLogo' import { ProfileLogo } from 'features/ProfileLogo'
export const CardWrapperOuter = styled.li.attrs({ export const CardWrapperOuter = styled.li.attrs({
@ -14,17 +13,18 @@ export const CardWrapperOuter = styled.li.attrs({
position: relative; position: relative;
${isMobileDevice ${isMobileDevice
? css` ? css`
width: 100%; width: 100%;
padding-top: 0; padding-top: 0;
margin-top: 6px; height: 90px;
margin-bottom: 10px;
@media screen and (orientation: landscape) {
width: 100%; @media screen and (orientation: landscape){
:nth-child(odd) { width: 49%;
margin-right: 10px; :nth-child(odd){
} margin-right: 10px;
} }
` }
`
: ''}; : ''};
` `
@ -41,12 +41,10 @@ export const CardWrapper = styled.div`
cursor: pointer; cursor: pointer;
${isMobileDevice ${isMobileDevice
? css` ? css`
position: static; width: 100%;
display: flex; height: 90px;
width: 100%; padding-bottom: 0;
height: 75px; `
padding-bottom: 0;
`
: ''}; : ''};
` `
@ -71,9 +69,9 @@ export const PreviewWrapper = styled.div`
height: 60%; height: 60%;
${isMobileDevice ${isMobileDevice
? css` ? css`
width: 40%; width: 50%;
height: 100%; height: 100%;
` `
: ''}; : ''};
` `
@ -83,12 +81,6 @@ export const Preview = styled.img`
height: 100%; height: 100%;
object-fit: cover; object-fit: cover;
opacity: 0.4; opacity: 0.4;
${isMobileDevice
? css`
opacity: 0.2;
`
: ''};
` `
export const MatchTimeInfo = styled.div` export const MatchTimeInfo = styled.div`
@ -126,38 +118,19 @@ export const MatchDate = styled.div<MatchDateProps>`
} }
${isMobileDevice ${isMobileDevice
? css` ? css`
background-color: transparent; height: 15px;
margin-left: 4px; font-size: 8px;
height: 15px; `
width: 22px;
font-size: 7px;
`
: ''}; : ''};
` `
type LiveType = { export const LiveSign = styled(MatchDate)`
color?: string, background-color: #CC0000;
}
export const LiveSign = styled(MatchDate)<LiveType>`
background-color: ${({ color }) => color ?? '#CC0000'};
margin-left: auto; margin-left: auto;
${isMobileDevice
? css`
font-size: 7px;
padding: 3px;
`
: ''};
` `
export const Time = styled.span` export const Time = styled.span`
margin: 0 0.2rem; margin: 0 0.2rem;
${isMobileDevice
? css`
font-size: 10px;
`
: ''};
` `
export const Info = styled.div` export const Info = styled.div`
@ -170,25 +143,19 @@ export const Info = styled.div`
white-space: nowrap; white-space: nowrap;
${isMobileDevice ${isMobileDevice
? css` ? css`
/* position: absolute; position: absolute;
top: 0; top: 0;
left: 45%; */ left: 50%;
width: 60%; width: 50%;
height: 100%; height: 100%;
padding: 9px; padding: 13px 12px 13px 10px;
` `
: ''}; : ''};
` `
export const SecondaryInfo = styled.div` export const SecondaryInfo = styled.div`
display: flex; display: flex;
align-items: center; align-items: center;
${isMobileDevice
? css`
justify-content: space-between;
`
: ''};
` `
export const CountryFlag = styled.img` export const CountryFlag = styled.img`
@ -196,34 +163,32 @@ export const CountryFlag = styled.img`
height: 0.75rem; height: 0.75rem;
margin-left: 0.567rem; margin-left: 0.567rem;
object-fit: contain; object-fit: contain;
object-position: bottom;
${isMobileDevice ${isMobileDevice
? css` ? css`
object-fit: cover; width: 12px;
width: 12px; height: 8px;
height: 100%; margin-left: 3.5px;
margin-left: 8px; `
`
: ''}; : ''};
` `
type FavoriteSignProps = { type FavoriteSignProps = {
color?: string,
marginLeft?: number, marginLeft?: number,
} }
export const FavoriteSign = styled.span<FavoriteSignProps>` export const FavoriteSign = styled.span<FavoriteSignProps>`
display: inline-block; display: inline-block;
width: 0.472rem;
height: 0.472rem;
margin-top: 0.08rem; margin-top: 0.08rem;
margin-left: ${({ marginLeft = 9 }) => marginLeft}px; margin-left: ${({ marginLeft = 9 }) => marginLeft}px;
color: ${({ color }) => color}; background: url('/images/sportFavStar.png') no-repeat center / 100% 100%;
${isMobileDevice ${isMobileDevice
? css` ? css`
display: flex; width: 10px;
justify-content: center; height: 10px;
align-items: center; `
width: 8px;
height: 8px;
`
: ''}; : ''};
` `
@ -241,10 +206,10 @@ export const TournamentName = styled.span`
margin-left: 0.567rem; margin-left: 0.567rem;
${isMobileDevice ${isMobileDevice
? css` ? css`
font-size: 10px; font-size: 10px;
line-height: 100%; line-height: 100%;
max-width: 100%; max-width: 100%;
` `
: ''}; : ''};
${nameStyles} ${nameStyles}
@ -252,6 +217,11 @@ export const TournamentName = styled.span`
export const Teams = styled.div` export const Teams = styled.div`
margin-bottom: 0.567rem; margin-bottom: 0.567rem;
${isMobileDevice
? css`
margin-bottom: 15px;
`
: ''};
` `
export const Team = styled.span` export const Team = styled.span`
@ -264,9 +234,9 @@ export const Team = styled.span`
color: #fff; color: #fff;
${isMobileDevice ${isMobileDevice
? css` ? css`
font-size: 14px; font-size: 14px;
line-height: 20px; line-height: 20px;
` `
: ''}; : ''};
` `
@ -280,17 +250,7 @@ export const TeamName = styled(Name)`
${nameStyles} ${nameStyles}
` `
export const Score = styled.div` export const Score = styled.div``
${isMobileDevice
? css`
display: flex;
justify-content: center;
width: 15px;
`
: ''};
`
export const TeamLogos = styled.div` export const TeamLogos = styled.div`
display: flex; display: flex;
@ -306,11 +266,12 @@ export const TeamLogo = styled(ProfileLogo)`
:last-child { :last-child {
margin-left: 0.8rem; margin-left: 0.8rem;
} }
${isMobileDevice ${isMobileDevice
? css` ? css`
width: 30%; width: 30%;
` `
: ''}; : ''};
` `
@ -322,30 +283,20 @@ export const BuyMatchBadge = styled.span`
height: 1.18rem; height: 1.18rem;
cursor: pointer; cursor: pointer;
/* background-image: url(/images/dollar-sign.svg); */ background-image: url(/images/dollar-sign.svg);
color: rgba(255, 255, 255, 0.7);
background-position: center; background-position: center;
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: 0.472rem 0.71rem; background-size: 0.472rem 0.71rem;
background-color: rgba(255, 255, 255, 0.19); background-color: #fff;
border-radius: 50%; border-radius: 50%;
border: 0.5px solid rgba(0, 0, 0, 0.2);
box-shadow: 0px 0.08rem 0.283rem rgba(0, 0, 0, 0.5); box-shadow: 0px 0.08rem 0.283rem rgba(0, 0, 0, 0.5);
${isMobileDevice ${isMobileDevice
? css` ? css`
position: static; width: 19px;
display: flex; height: 17px;
align-items: center; background-size: 40%;
justify-content: center; `
width: 15px;
height: 15px;
/* background-size: 40%; */
`
: ''}; : ''};
` `
export const ScDollar = styled(Icon)`
display: flex;
justify-content: center;
align-items: center;
`

@ -3,7 +3,7 @@ import { format } from 'date-fns'
import type { MatchInfo } from 'requests/getMatchInfo' import type { MatchInfo } from 'requests/getMatchInfo'
import { Name } from 'features/Name' import { Name } from 'features/Name'
import { SportIcon } from 'components/SportIcon/SportIcon' import { SportIcon } from 'features/SportIcon'
import { T9n } from 'features/T9n' import { T9n } from 'features/T9n'
import { parseDate } from 'helpers/parseDate' import { parseDate } from 'helpers/parseDate'

@ -18,7 +18,7 @@ export const Wrapper = styled.div`
${isMobileDevice ${isMobileDevice
? css` ? css`
@media (max-width: 750px) { @media (max-width: 750px) {
/* padding-top: 50px; */ padding-top: 50px;
} }
@media screen and (orientation: landscape) { @media screen and (orientation: landscape) {
padding-top: 55px; padding-top: 55px;

@ -28,7 +28,7 @@ export const LiveMatchPlaylist = () => {
<Item> <Item>
<SimplePlaylistButton <SimplePlaylistButton
to={`/${sport}${PAGES.match}/${match.id}`} to={`/${sport}${PAGES.match}/${match.id}`}
title='watch' title='watch_live_stream'
/> />
</Item> </Item>
<Item> <Item>

@ -20,7 +20,8 @@ export const Item = styled.li`
${isMobileDevice ${isMobileDevice
? css` ? css`
height: 48px; height: 36px;
min-height: 36px;
margin-bottom: 12px; margin-bottom: 12px;
` `
: ''}; : ''};

@ -15,7 +15,7 @@ export const Content = styled.div`
margin-top: 30%; margin-top: 30%;
background: #333; background: #333;
border-radius: 4px; border-radius: 4px;
padding: 20px 0 30px 0; padding: 30px 0;
@media (orientation: landscape){ @media (orientation: landscape){
margin: 0 auto; margin: 0 auto;
@ -60,12 +60,10 @@ export const HeaderTitle = styled.h2`
line-height: 1.982rem; line-height: 1.982rem;
color: #FFFFFF; color: #FFFFFF;
text-align: center; text-align: center;
text-transform: uppercase;
${isMobileDevice ${isMobileDevice
? css` ? css`
font-size: 10px; font-size: 14px;
font-weight: 700; line-height: 18px;
line-height: 12px;
margin-bottom: 20px; margin-bottom: 20px;
` `
: ''}; : ''};

@ -37,7 +37,7 @@ export const SimplePlaylistButton = ({
</Title> </Title>
{duration && <Duration>{secondsToHms(duration)}</Duration>} {duration && <Duration>{secondsToHms(duration)}</Duration>}
{ {
title === 'watch' title === 'watch_live_stream'
&& ( && (
<LiveSign> <LiveSign>
<T9n t='live' /> <T9n t='live' />

@ -12,7 +12,7 @@ export const StyledLink = styled(Link)`
border: none; border: none;
cursor: pointer; cursor: pointer;
display: flex; display: flex;
flex-direction: row; flex-direction: column;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
width: 100%; width: 100%;
@ -25,6 +25,7 @@ export const StyledLink = styled(Link)`
), ),
#3F3F3F; #3F3F3F;
box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.3); box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.3);
border-radius: 2px;
:hover { :hover {
background-color: #555555; background-color: #555555;
@ -32,20 +33,20 @@ export const StyledLink = styled(Link)`
@media ${devices.mobile} { @media ${devices.mobile} {
justify-content: center; justify-content: center;
border-radius: 5px;
} }
` `
export const Title = styled.span` export const Title = styled.span`
font-weight: 700; font-weight: 500;
font-size: 0.95rem; font-size: 0.95rem;
line-height: 2.36rem; line-height: 2.36rem;
letter-spacing: 0.03em; letter-spacing: 0.03em;
color: #ffffff; color: #ffffff;
text-transform: uppercase;
${isMobileDevice ${isMobileDevice
? css` ? css`
font-size: 10px; font-size: 14px;
line-height: 12px; line-height: 36px;
` `
: ''}; : ''};
` `
@ -66,17 +67,21 @@ export const LiveSign = styled(MatchDate)`
width: 1.511rem; width: 1.511rem;
height: 0.71rem; height: 0.71rem;
background-color: #CC0000; background-color: #CC0000;
position: absolute;
right: 0.8rem;
top: 50%;
font-size: 0.32rem; font-size: 0.32rem;
transform: translateY(-38%);
display: flex; display: flex;
align-items: center; align-items: center;
${isMobileDevice ${isMobileDevice
? css` ? css`
position: static; width: 26px;
width: 32px; height: 12px;
height: 22px; font-size: 8px;
font-size: 10px; right: 12px;
/* transform: translateY(-50%); */ transform: translateY(-50%);
` `
: ''}; : ''};
` `

@ -16,12 +16,12 @@ export const ScoreSwitch = () => {
<Switch <Switch
role='switch' role='switch'
onClick={toggleScore} onClick={toggleScore}
aria-checked={!isScoreHidden} aria-checked={isScoreHidden}
> >
<Title t='scores' /> <Title t='hide_score' />
<Icon <Icon
iconName={isMobileDevice ? 'score-switch-mobile' : 'score-switch'} iconName={isMobileDevice ? 'score-switch-mobile' : 'score-switch'}
isOn={!isScoreHidden} isOn={isScoreHidden}
/> />
</Switch> </Switch>
</Wrapper> </Wrapper>

@ -10,10 +10,8 @@ export const Switch = styled.div`
cursor: pointer; cursor: pointer;
${isMobileDevice ${isMobileDevice
? css` ? css`
justify-content: flex-end; justify-content: space-between;
width: 100%; width: 100%;
height: 100%;
text-transform: uppercase;
` `
: ''}; : ''};
` `
@ -27,11 +25,11 @@ export const Title = styled(T9n)`
color: ${({ theme }) => theme.colors.text100}; color: ${({ theme }) => theme.colors.text100};
${isMobileDevice ${isMobileDevice
? css` ? css`
font-size: 10px; font-size: 14px;
line-height: 22px; line-height: 22px;
letter-spacing: -0.408px; letter-spacing: -0.408px;
text-transform: uppercase; text-transform: none;
font-weight: 700; font-weight: 400;
` `
: ''}; : ''};
` `
@ -63,33 +61,27 @@ export const Icon = styled.div<IconProps>`
${isMobileDevice ${isMobileDevice
? css` ? css`
width: 36px; width: 51px;
height: 18px; height: 31px;
margin-left: 1.5rem;
` `
: ''} : ''}
` `
export const Wrapper = styled.div` export const Wrapper = styled.div`
margin-right: 2.45rem; margin-right: 2.45rem;
height: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
${isMobileDevice ${isMobileDevice
? css` ? css`
@media screen and (orientation: portrait) { position: absolute;
/* width: 30%; */ bottom: -130px;
height: 50px; right: -10px;
/* top: 130px; */
/* position: absolute; */
/* right: -10px;
width: 95vw; width: 95vw;
bottom: -90px; */ @media (max-width: 450px){
} bottom: -137px;
@media screen and (orientation: landscape) { }
display: none
}
` `
: ''}; : ''};
` `

@ -30,14 +30,8 @@ export const MatchesList = ({
<Fragment> <Fragment>
{!isEmpty(matches) && ( {!isEmpty(matches) && (
<Section> <Section>
{title && ( {title && <Title><T9n t={title} /></Title>}
<Title> <Component matches={matches} />
<T9n t={title} />
</Title>
)}
<Component
matches={matches}
/>
</Section> </Section>
)} )}
</Fragment> </Fragment>

@ -1,12 +1,7 @@
import { memo } from 'react' import map from 'lodash/map'
import { useRouteMatch } from 'react-router-dom'
import { PAGES } from 'config/pages'
import { isMobileDevice } from 'config/userAgent'
import { MatchCard } from 'features/MatchCard'
import { TournamentList } from 'features/TournamentList'
import type { Match } from 'features/Matches' import type { Match } from 'features/Matches'
import { MatchCard } from 'features/MatchCard'
import { Wrapper } from './styled' import { Wrapper } from './styled'
@ -14,16 +9,8 @@ type MatchesGridProps = {
matches: Array<Match>, matches: Array<Match>,
} }
export const MatchesGrid = memo(({ matches }: MatchesGridProps) => { export const MatchesGrid = ({ matches }: MatchesGridProps) => (
const isHomePage = useRouteMatch(PAGES.home)?.isExact <Wrapper>
{map(matches, (match) => <MatchCard key={match.id} match={match} />)}
return ( </Wrapper>
<Wrapper> )
{isHomePage && isMobileDevice
? <TournamentList matches={matches} />
: (matches.map((match) => (
<MatchCard key={match.id} match={match} />
)))}
</Wrapper>
)
})

@ -7,9 +7,10 @@ export const MenuList = styled.ul`
display: flex; display: flex;
${isMobileDevice ${isMobileDevice
? css` ? css`
align-items: center; margin-top: 8px;
@media screen and (orientation: landscape){ @media screen and (orientation: landscape){
margin-right: 5px; margin-right: 5px;
margin-top: 0;
} }
` `
: ''}; : ''};
@ -25,14 +26,6 @@ export const MenuItem = styled.li`
:hover ${TooltipWrapper} { :hover ${TooltipWrapper} {
display: block; display: block;
} }
${isMobileDevice
? css`
height: 100%;
padding: 5px;
`
: ''};
` `
type IconProps = { type IconProps = {
@ -50,8 +43,8 @@ export const Icon = styled.div<IconProps>`
opacity: 0.8; opacity: 0.8;
${isMobileDevice ${isMobileDevice
? css` ? css`
width: 13px; width: 16px;
height: 13px; height: 16px;
background-size: contain; background-size: contain;
/* margin: 0 4px; */ /* margin: 0 4px; */
:only-child { :only-child {

@ -3,7 +3,7 @@ import { useMemo } from 'react'
import ReactDOM from 'react-dom' import ReactDOM from 'react-dom'
import { OutsideClick } from 'features/OutsideClick' import { OutsideClick } from 'features/OutsideClick'
import { Close } from '../../libs/objects/Close' import { Close } from 'features/Icons/Close'
import { import {
ModalContainer, ModalContainer,
@ -40,7 +40,7 @@ export const Modal = ({
<ModalWindow> <ModalWindow>
{withCloseButton && ( {withCloseButton && (
<ModalCloseButton onClick={close}> <ModalCloseButton onClick={close}>
<Close size={8} /> <Close />
</ModalCloseButton> </ModalCloseButton>
)} )}
{children} {children}

@ -46,6 +46,6 @@ export const ModalCloseButton = styled.button.attrs({
outline: none; outline: none;
padding: 16px 19px; padding: 16px 19px;
cursor: pointer; cursor: pointer;
color: rgba(255, 255, 255, 1); color: rgba(255, 255, 255, 0.5);
background-color: transparent; background-color: transparent;
` `

@ -20,10 +20,10 @@ export const BaseButton = styled.button<Props>`
height: ${({ height = 1.6 }) => height}rem; height: ${({ height = 1.6 }) => height}rem;
padding: ${({ padding = 0 }) => padding}px; padding: ${({ padding = 0 }) => padding}px;
color: white; color: white;
/* background-color: rgba(255, 255, 255, 0.12); background-color: rgba(255, 255, 255, 0.12);
background-position: center; background-position: center;
background-repeat: no-repeat; background-repeat: no-repeat;
border-radius: 50%; */ border-radius: 50%;
:hover { :hover {
background-color: rgba(255, 255, 255, 0.22); background-color: rgba(255, 255, 255, 0.22);
@ -35,7 +35,7 @@ export const BaseButton = styled.button<Props>`
height: 18px; height: 18px;
padding: 4px; padding: 4px;
position: absolute; position: absolute;
top: -10px; top: -30px;
right: -30px; right: -30px;
@media screen and (orientation: landscape){ @media screen and (orientation: landscape){
width: 24px; width: 24px;

@ -1,6 +1,6 @@
import type { MouseEvent } from 'react' import type { MouseEvent } from 'react'
import { Close } from '../../../libs/objects/Close' import { Close } from 'features/Icons/Close'
import { BaseButton } from '../BaseButton' import { BaseButton } from '../BaseButton'

@ -10,7 +10,7 @@ import {
Flag, Flag,
TeamOrCountry, TeamOrCountry,
} from 'features/ItemsList/styled' } from 'features/ItemsList/styled'
import { SportIcon } from 'components/SportIcon/SportIcon' import { SportIcon } from 'features/SportIcon'
const Wrapper = styled.div` const Wrapper = styled.div`
width: 100%; width: 100%;

@ -9,7 +9,6 @@ import {
} from 'config' } from 'config'
import { client } from 'config/clients' import { client } from 'config/clients'
import { isMobileDevice } from 'config/userAgent'
import { Menu } from 'features/Menu' import { Menu } from 'features/Menu'
import { Search } from 'features/Search' import { Search } from 'features/Search'
@ -77,12 +76,11 @@ export const ProfileHeader = ({
<Position right={0.71}> <Position right={0.71}>
<HeaderGroup> <HeaderGroup>
{!isMobileDevice ? <ScoreSwitch /> : null} <ScoreSwitch />
<Menu /> <Menu />
</HeaderGroup> </HeaderGroup>
</Position> </Position>
</HeaderStyled> </HeaderStyled>
{isMobileDevice ? <ScoreSwitch /> : null}
</Fragment> </Fragment>
) )
} }

@ -6,7 +6,6 @@ import { client } from 'config/clients'
import { isMobileDevice } from 'config/userAgent' import { isMobileDevice } from 'config/userAgent'
import { Logo } from 'features/Logo' import { Logo } from 'features/Logo'
import { ScoreSwitch } from 'features/MatchSwitches'
export const DEFAULT_HEADER_COLOR = 'rgba(53, 96, 225, 0.56)' export const DEFAULT_HEADER_COLOR = 'rgba(53, 96, 225, 0.56)'
@ -122,8 +121,3 @@ export const Position = styled.div<PositionProps>`
${({ left }) => (isUndefined(left) ? '' : `left: ${left}rem`)}; ${({ left }) => (isUndefined(left) ? '' : `left: ${left}rem`)};
${({ right }) => (isUndefined(right) ? '' : `right: ${right}rem`)}; ${({ right }) => (isUndefined(right) ? '' : `right: ${right}rem`)};
` `
export const ScSwitch = styled(ScoreSwitch)`
position: absolute;
top: 400px;
`

@ -84,7 +84,7 @@ export const Form = styled.form<FormProps>`
` `
: ''}; : ''};
${InputWrapper} { ${InputWrapper} {
width: 70px; width: 0;
height: 1.7rem; height: 1.7rem;
margin: 0; margin: 0;
padding-left: 0.567rem; padding-left: 0.567rem;
@ -132,9 +132,8 @@ export const Form = styled.form<FormProps>`
cursor: pointer; cursor: pointer;
${isMobileDevice ${isMobileDevice
? css` ? css`
display: flex; width: 19px;
align-items: center; top: 1px;
width: 13px;
` `
: ''}; : ''};
} }

@ -0,0 +1,27 @@
import styled from 'styled-components/macro'
import { SportTypes } from 'config'
import { getSportLexic } from 'helpers'
type IconProps = {
src: string,
}
const Icon = styled.span<IconProps>`
display: inline-block;
height: 10px;
min-width: 10px;
background-image: url(/images/${({ src }) => `${src}-icon`}.svg);
background-repeat: no-repeat;
background-position: center;
background-size: 100% 100%;
`
type Props = {
sport: SportTypes,
}
export const SportIcon = ({ sport }: Props) => (
<Icon src={getSportLexic(sport)} />
)

@ -1,20 +0,0 @@
import { T9n } from 'features/T9n'
import { ScSportsFilter, ScArrow } from './styled'
type SportsFilterProps = {
onModalOpen: () => void,
open: boolean,
sport: string,
}
export const SportsFilter = ({
onModalOpen,
open,
sport,
}: SportsFilterProps) => (
<ScSportsFilter onClick={onModalOpen}>
<T9n t={sport} />
<ScArrow refIcon='Arrow' color='#ffffff' direction={open ? 180 : 0} />
</ScSportsFilter>
)

@ -1,25 +0,0 @@
import styled, { css } from 'styled-components/macro'
import { isMobileDevice } from 'config/userAgent'
import { Icon } from 'features/Icon'
export const ScSportsFilter = styled.div`
display: flex;
color: white;
font-size: 14px;
width: 30%;
text-transform: uppercase;
font-weight: 700;
height: 100%;
align-items: center;
${isMobileDevice
? css`
font-size: 10px;
`
: ''};
`
export const ScArrow = styled(Icon)`
margin-left: 14px;
`

@ -1,89 +0,0 @@
import { useState } from 'react'
import { ProfileTypes } from 'config'
import { SportIcon } from 'components/SportIcon/SportIcon'
import { T9n } from 'features/T9n'
import { Icon } from 'features/Icon'
import type { Match } from 'features/Matches'
import { MatchCard } from 'features/MatchCard'
import {
CountryFlag,
FavoriteSign,
LiveSign,
} from 'features/MatchCard/styled'
import { useUserFavoritesStore } from 'features/UserFavorites/store'
import type { TournamentType } from 'requests/getMatches/types'
import {
CardWrapperOuter,
CardWrapper,
CountMatches,
TournamentName,
ScFirstInfo,
ScMatchesWrapper,
ScSecondInfo,
} from './styled'
export type TournamentProps = {
tournament: TournamentType & {
countryId: number,
live: boolean,
sportType: number,
},
tournamentMatches: Array<Match>,
}
export const Tournament = ({
tournament,
tournamentMatches,
}: TournamentProps) => {
const [open, setOpen] = useState(false)
const {
countryId,
live,
sportType,
} = tournament
const { isInFavorites } = useUserFavoritesStore()
const currentColor = open ? '#ffffff' : 'rgba(255, 255, 255, 0.5)'
const tournamentInFavorites = isInFavorites(
ProfileTypes.TOURNAMENTS,
tournament.id,
)
return (
<CardWrapperOuter>
<CardWrapper open={open} onClick={() => setOpen(!open)}>
<ScFirstInfo>
<SportIcon fill={open ? '#ffffff' : ''} sport={sportType} />
<CountryFlag
src={`https://instatscout.com/images/flags/48/${countryId}.png`}
/>
<TournamentName nameObj={tournament} />
{tournamentInFavorites && (
<FavoriteSign marginLeft={12} color={currentColor}>
<Icon refIcon='Star' />
</FavoriteSign>
)}
</ScFirstInfo>
<ScSecondInfo>
{live && (
<LiveSign color={open ? '#294FC3' : '#CC0000'}>
<T9n t='live' />
</LiveSign>
)}
<CountMatches color={currentColor}>{tournamentMatches.length}</CountMatches>
<Icon refIcon='Arrow' direction={open ? 180 : 0} color={currentColor} />
</ScSecondInfo>
</CardWrapper>
<ScMatchesWrapper>
{open
&& tournamentMatches?.map((match: Match) => (
<MatchCard key={match.id} match={match} />
))}
</ScMatchesWrapper>
</CardWrapperOuter>
)
}

@ -1,86 +0,0 @@
import styled, { css } from 'styled-components/macro'
import { Name } from 'features/Name'
import { Icon } from 'features/Icon'
import { isMobileDevice } from 'config/userAgent'
export const CardWrapperOuter = styled.li.attrs({
tabIndex: 0,
})`
display: flex;
flex-direction: column;
justify-content: center;
position: relative;
${isMobileDevice
? css`
width: 100%;
padding-top: 0;
margin-bottom: 5px;
}
`
: ''};
`
export const CardWrapper = styled.div<{ open: boolean }>`
display: flex;
align-items: center;
border-radius: 2px;
background-color: ${({ open }) => (open ? '#294FC3' : '#3f3f3f')};
cursor: pointer;
${isMobileDevice
? css`
padding: 10px;
width: 100%;
height: 50px;
`
: ''};
`
export const TournamentName = styled(Name)`
font-weight: 700;
font-size: 13px;
line-height: 16px;
color: #ffffff;
overflow: hidden;
text-overflow: ellipsis;
margin-left: 7px;
white-space: nowrap;
`
export const CountMatches = styled.span<{ color?: string }>`
font-weight: 700;
font-size: 12px;
line-height: 16px;
color: ${({ color }) => color};
width: 20px;
text-align: center;
margin-left: 20px;
`
export const ScFirstInfo = styled.div`
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
width: 80%;
`
export const ScSecondInfo = styled.div`
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-end;
width: 100%;
`
export const ScMatchesWrapper = styled.ul`
display: flex;
flex-direction: column;
`
export const ScStar = styled(Icon)`
display: flex;
justify-content: center;
align-items: center;
`

@ -1,55 +0,0 @@
import { getSportLexic } from 'helpers/getSportLexic'
import { TournamentListProps } from 'features/TournamentList'
import type { Match } from 'features/Matches'
import { useHeaderFiltersStore } from 'features/HeaderFilters'
export const useTournaments = (matches: Array<Match>) => {
const { selectedSport } = useHeaderFiltersStore()
const compareSport = (match: Match, sportName: string) => {
if (sportName === 'all_sports') {
return true
}
const sport = getSportLexic(match.sportType)
if (sportName.indexOf('_popup') !== -1) {
return sport === sportName.replace('_popup', '')
}
return sport === sportName
}
const tournaments = matches.reduce((acc: Array<TournamentListProps> | [], match: Match) => {
if (matches.length === 0) return []
if (!acc[match.tournament.id] && compareSport(match, selectedSport)) {
const tournament = {
...match.tournament,
countryId: match.countryId,
live: match.live,
matches: [match],
sportType: match.sportType,
}
acc[match.tournament.id] = {
tournament: {
...tournament,
},
tournamentMatches: [match],
}
} else if (compareSport(match, selectedSport)) {
acc[match.tournament.id] = {
...acc[match.tournament.id],
tournament: {
...acc[match.tournament.id].tournament,
live: acc[match.tournament.id]?.tournament.live
? acc[match.tournament.id]?.tournament.live
: match.live,
},
tournamentMatches: [...acc[match.tournament.id].tournamentMatches, match],
}
}
return acc
}, [])
return {
tournaments,
}
}

@ -1,35 +0,0 @@
import type { Match } from 'features/Matches'
import type { TournamentType } from 'requests/getMatches/types'
import { Tournament } from './components/Tournament'
import { useTournaments } from './hooks'
type TournamentTypeProps = {
matches: Array<Match>,
}
export type TournamentListProps = {
tournament: TournamentType & {
countryId: number,
live: boolean,
sportType: number,
},
tournamentMatches: Array<Match>,
}
export const TournamentList = ({ matches }: TournamentTypeProps) => {
const { tournaments } = useTournaments(matches)
return (
<>
{tournaments?.map(({ tournament, tournamentMatches }: TournamentListProps) => (
<Tournament
key={tournament.id}
tournament={tournament}
tournamentMatches={tournamentMatches}
/>
))}
</>
)
}

@ -7,7 +7,7 @@ import { FavoritesActions } from 'requests'
import { Modal } from 'features/Modal' import { Modal } from 'features/Modal'
import { ProfileLink } from 'features/ProfileLink' import { ProfileLink } from 'features/ProfileLink'
import { Close } from '../../libs/objects/Close' import { Close } from 'features/Icons/Close'
import { TooltipBlock } from './TooltipBlock' import { TooltipBlock } from './TooltipBlock'
import { useUserFavoritesStore } from './store' import { useUserFavoritesStore } from './store'

@ -1,3 +0,0 @@
import * as icons from './index'
export type iconTypes = keyof typeof icons

@ -1,11 +0,0 @@
export { Arrow } from './objects/Arrow'
export { Date } from './objects/Date'
export { Calendar } from './objects/Calendar'
export { Basketball } from './objects/Basketball'
export { Football } from './objects/Football'
export { Hockey } from './objects/Hockey'
export { Handball } from './objects/Handball'
export { Volleyball } from './objects/Volleyball'
export { Star } from './objects/Star'
export { Dollar } from './objects/Dollar'
export { Close } from './objects/Close'

@ -1,15 +0,0 @@
export const Arrow = (): JSX.Element => (
<svg
xmlns='http://www.w3.org/2000/svg'
width='12'
height='8'
fill='true'
viewBox='0 0 12 8'
>
<path
fillRule='evenodd'
d='M10.6.6L6 5.2 1.4.6 0 2l6 6 6-6L10.6.6z'
clipRule='evenodd'
/>
</svg>
)

@ -1,22 +0,0 @@
export const Basketball = () => (
<svg
xmlns='http://www.w3.org/2000/svg'
width='10'
height='10'
fill='true'
viewBox='0 0 40 40'
>
<path
d='M20.298.006h-.15A19.268 19.268 0 0025.264 13.7l8.348-8.347A20.011 20.011 0 0020.298 0z'
/>
<path
d='M18.666.064a20.011 20.011 0 00-12.261 5.3l13.6 13.6 4.21-4.21A20.753 20.753 0 0118.666.064zM5.35 6.407A20.011 20.011 0 00.065 18.674a20.746 20.746 0 0114.685 5.544l4.2-4.2zM34.65 6.416l-8.34 8.344A19.261 19.261 0 0040 19.875a20.011 20.011 0 00-5.35-13.459z'
/>
<path
d='M25.264 15.804l-4.21 4.209L34.662 33.62a20.011 20.011 0 005.283-12.266 20.763 20.763 0 01-14.681-5.55zM.693 20.135c-.226 0-.453.015-.68.021A20.011 20.011 0 005.36 33.612l8.348-8.343A19.265 19.265 0 00.693 20.136zM20.007 21.063l-4.2 4.2a20.755 20.755 0 015.553 14.7 20.011 20.011 0 0012.249-5.3z'
/>
<path
d='M14.757 26.312L6.399 34.67a20.011 20.011 0 0013.471 5.347 19.26 19.26 0 00-5.113-13.705z'
/>
</svg>
)

@ -1,24 +0,0 @@
export const Calendar = (): JSX.Element => (
<svg
xmlns='http://www.w3.org/2000/svg'
width='9'
height='9'
fill='true'
viewBox='0 0 9 9'
>
<path
fillOpacity='0.5'
fillRule='evenodd'
d='M8.64 1.178c.23.23.36.542.36.867v5.728A1.227 1.227 0 017.773 9H1.227A1.227 1.227 0 010 7.773V2.045A1.227 1.227 0 011.227.818H2.25V.41a.41.41 0 11.818 0v.41h2.864v-.41a.41.41 0 11.818 0v.41h1.023c.325 0 .637.128.868.359zm-6.39.458h-.818a.614.614 0 00-.614.614v1.023h7.364V2.25a.614.614 0 00-.614-.614H6.75v.41a.41.41 0 11-.818 0v-.41H3.068v.41a.41.41 0 11-.818 0v-.41zm5.85 2.47H.81v3.107a1 1 0 001 1H7.1a1 1 0 001-1V4.106z'
clipRule='evenodd'
/>
<ellipse
cx='2.323'
cy='5.631'
fill='#fff'
fillOpacity='0.5'
rx='0.703'
ry='0.703'
/>
</svg>
)

@ -1,15 +0,0 @@
export const Date = () => (
<svg
width='100%'
height='100%'
viewBox='0 0 27 26'
fill='true'
xmlns='http://www.w3.org/2000/svg'
>
<path
clipRule='evenodd'
d='M25.2659 3.62109C25.9389 4.26715 26.317 5.14339 26.317 6.05706V22.1336C26.317 23.0473 25.9389 23.9235 25.2659 24.5696C24.5929 25.2156 23.6801 25.5786 22.7283 25.5786H3.58868C2.6369 25.5786 1.72411 25.2156 1.0511 24.5696C0.378092 23.9235 0 23.0473 0 22.1336V6.05706C0 5.14339 0.378092 4.26715 1.0511 3.62109C1.72411 2.97503 2.6369 2.61208 3.58868 2.61208H6.57924V1.46376C6.57924 1.1592 6.70528 0.867119 6.92961 0.651766C7.15395 0.436414 7.45821 0.31543 7.77547 0.31543C8.09273 0.31543 8.39699 0.436414 8.62133 0.651766C8.84567 0.867119 8.9717 1.1592 8.9717 1.46376V2.61208H17.3453V1.46376C17.3453 1.1592 17.4713 0.867119 17.6957 0.651766C17.92 0.436414 18.2242 0.31543 18.5415 0.31543C18.8588 0.31543 19.163 0.436414 19.3874 0.651766C19.6117 0.867119 19.7377 1.1592 19.7377 1.46376V2.61208H22.7283C23.6801 2.61208 24.5929 2.97503 25.2659 3.62109ZM6.57924 4.90873H4.18679C3.7109 4.90873 3.25451 5.09021 2.918 5.41324C2.5815 5.73627 2.39245 6.17439 2.39245 6.63122V9.50203H23.9245V6.63122C23.9245 6.17439 23.7355 5.73627 23.399 5.41324C23.0625 5.09021 22.6061 4.90873 22.1302 4.90873H19.7377V6.05706C19.7377 6.36161 19.6117 6.65369 19.3874 6.86905C19.163 7.0844 18.8588 7.20538 18.5415 7.20538C18.2242 7.20538 17.92 7.0844 17.6957 6.86905C17.4713 6.65369 17.3453 6.36161 17.3453 6.05706V4.90873H8.9717V6.05706C8.9717 6.36161 8.84567 6.65369 8.62133 6.86905C8.39699 7.0844 8.09273 7.20538 7.77547 7.20538C7.45821 7.20538 7.15395 7.0844 6.92961 6.86905C6.70528 6.65369 6.57924 6.36161 6.57924 6.05706V4.90873ZM4.52477 15.3158C5.66029 15.3158 6.58082 14.4321 6.58082 13.3421C6.58082 12.2521 5.66029 11.3684 4.52477 11.3684C3.38924 11.3684 2.46872 12.2521 2.46872 13.3421C2.46872 14.4321 3.38924 15.3158 4.52477 15.3158Z'
fill='currentColor'
/>
</svg>
)

@ -1,12 +0,0 @@
export const Dollar = () => (
<svg
xmlns='http://www.w3.org/2000/svg'
fill='true'
viewBox='0 0 12 23'
>
<path
fill='currentColor'
d='M8.812 15.581c0-.664-.21-1.21-.633-1.64-.422-.438-1.125-.829-2.11-1.172-.984-.352-1.75-.676-2.296-.973-1.82-.976-2.73-2.422-2.73-4.336 0-1.297.394-2.363 1.183-3.199.79-.836 1.86-1.332 3.211-1.488V.218h1.875v2.578c1.36.195 2.41.774 3.152 1.735.742.953 1.114 2.195 1.114 3.726H8.742c0-.984-.223-1.758-.668-2.32-.438-.57-1.035-.856-1.793-.856-.75 0-1.336.203-1.758.61-.422.406-.633.988-.633 1.746 0 .68.207 1.226.621 1.64.422.407 1.133.793 2.133 1.16 1 .368 1.785.708 2.356 1.02.57.313 1.05.672 1.44 1.078.392.399.692.86.903 1.383.211.524.317 1.137.317 1.84 0 1.32-.407 2.39-1.22 3.21-.804.821-1.929 1.305-3.374 1.454v2.285H5.203v-2.273c-1.547-.172-2.739-.727-3.575-1.664C.8 17.632.386 16.39.386 14.843h2.848c0 .984.246 1.746.738 2.285.5.54 1.203.809 2.11.809.89 0 1.566-.215 2.027-.645.469-.43.703-1 .703-1.71z'
/>
</svg>
)

@ -1,13 +0,0 @@
export const Football = () => (
<svg
xmlns='http://www.w3.org/2000/svg'
width='10'
height='11'
fill='true'
viewBox='0 0 10 11'
>
<path
d='M3.17 1.074a4.898 4.898 0 00-1.633 1.109 5.026 5.026 0 00-1.083 1.67A5.131 5.131 0 00.092 5.75c0 .656.122 1.295.362 1.9A5.025 5.025 0 001.537 9.32c.471.481 1.02.854 1.633 1.108.59.246 1.216.37 1.856.37.641 0 1.266-.125 1.857-.37A5.018 5.018 0 009.599 7.65c.24-.604.361-1.243.361-1.899 0-.655-.121-1.294-.361-1.899a5.026 5.026 0 00-1.084-1.67 4.893 4.893 0 00-1.632-1.108A4.824 4.824 0 005.026.705c-.64 0-1.265.124-1.856.37zM1.325 7.876a3.402 3.402 0 01-.65-.535 4.86 4.86 0 01-.15-2.651c.092-.187.197-.365.316-.537.037-.053.07-.108.11-.159l1.113.674v.028c-.003.613.058 1.221.18 1.82v.007l-.863 1.385a.68.68 0 01-.056-.032zm3.311 2.34c.192.101.39.186.593.255a4.545 4.545 0 01-2.504-.62l1.867.34.044.026zm-.007-.344l-2.202-.401a7.042 7.042 0 01-.69-1.02c-.05-.093-.106-.182-.15-.278l.863-1.384.065.017c.54.148 1.089.253 1.642.335.032.004.059.009.082.011l1.034 1.829c-.18.258-.36.514-.546.768-.031.042-.064.083-.098.123zm3.665-.779c-.176.18-.362.342-.557.486a4.41 4.41 0 00-.166-.776l1.103-2.105c.304-.142.597-.302.87-.501a.393.393 0 00.087-.087 4.75 4.75 0 01-1.337 2.983zm-.05-2.73c.042.08.082.16.123.243L7.3 8.639l-.018.004a9.511 9.511 0 01-1.742.171l-1.064-1.88a118.854 118.854 0 00.82-1.592l2.2-.23c.27.404.526.817.748 1.251zm-.446-2.412c-.104.282-.216.562-.327.841l-2.144.226a1.786 1.786 0 00-.08-.102l-.763-.877.007-.007-.308-.315.597-1.839a.82.82 0 01.124-.025c.325-.033.65-.072.975-.09.199-.012.4-.019.602-.004L7.958 3.46c-.051.165-.1.33-.16.49zm.496-1.542c.407.417.723.893.946 1.402a4.657 4.657 0 00-1.03-.54L6.757 1.593c.01-.072.015-.145.017-.218.553.23 1.072.575 1.52 1.033zM3.547 1.29l.011.008c.333.118.635.29.92.496L3.92 3.51a.059.059 0 00-.008.003c-.114.049-.23.092-.343.144a9.763 9.763 0 00-1.34.74l-1.1-.667a.347.347 0 01.02-.102c.073-.202.146-.404.23-.601.064-.152.137-.3.217-.443a4.578 4.578 0 011.96-1.313.327.327 0 00-.01.017z'
/>
</svg>
)

@ -1,13 +0,0 @@
export const Handball = () => (
<svg
xmlns='http://www.w3.org/2000/svg'
width='11'
height='11'
fill='true'
viewBox='0 0 11 11'
>
<path
d='M3.7.846a4.898 4.898 0 00-1.632 1.108 5.026 5.026 0 00-1.083 1.67 5.131 5.131 0 00-.362 1.899c0 .655.122 1.294.362 1.899a5.025 5.025 0 001.083 1.67c.471.48 1.02.854 1.633 1.108.59.245 1.216.37 1.856.37.641 0 1.266-.125 1.857-.37a5.019 5.019 0 002.716-2.778c.24-.605.361-1.244.361-1.899s-.121-1.294-.361-1.9a5.027 5.027 0 00-1.084-1.669A4.893 4.893 0 007.414.846a4.824 4.824 0 00-1.857-.37c-.64 0-1.265.125-1.856.37zM1.857 7.647a3.402 3.402 0 01-.65-.535 4.86 4.86 0 01-.15-2.651c.092-.186.197-.365.316-.536.037-.053.07-.108.11-.16l1.113.674v.029c-.003.612.058 1.22.18 1.82v.007l-.863 1.384a.677.677 0 01-.056-.032zm3.311 2.341c.192.1.39.185.593.254a4.545 4.545 0 01-2.504-.62l1.867.34a.52.52 0 00.044.026zm-.007-.344l-2.202-.402a7.042 7.042 0 01-.69-1.02c-.05-.092-.106-.182-.15-.278l.863-1.383.065.016c.54.148 1.089.253 1.642.335l.082.012 1.034 1.828c-.18.258-.36.515-.546.769-.031.042-.064.082-.098.123zm3.665-.78c-.176.18-.362.342-.557.486a4.41 4.41 0 00-.166-.776L9.205 6.47c.304-.141.597-.302.87-.5a.393.393 0 00.087-.087 4.75 4.75 0 01-1.337 2.983zm-.05-2.73c.042.08.082.161.123.243L7.832 8.411l-.018.003a9.511 9.511 0 01-1.742.172L5.008 6.705a119.343 119.343 0 00.82-1.591l2.2-.231c.27.404.526.817.748 1.251zM8.33 3.723c-.104.282-.216.561-.327.84l-2.144.226a1.781 1.781 0 00-.08-.101l-.763-.877.007-.008-.308-.315.597-1.838a.821.821 0 01.124-.025c.325-.034.65-.072.975-.091.199-.012.4-.018.602-.004l1.477 1.703c-.051.164-.1.329-.16.49zm.496-1.542c.407.417.723.893.946 1.401a4.657 4.657 0 00-1.03-.54L7.288 1.366a2.01 2.01 0 00.017-.218c.553.23 1.072.575 1.52 1.033zM4.078 1.06c.005.004.008.008.011.009.333.117.635.29.92.495L4.45 3.282a.06.06 0 00-.008.003c-.114.048-.23.091-.343.144a9.762 9.762 0 00-1.34.739l-1.1-.666a.347.347 0 01.02-.103c.073-.201.146-.404.23-.6a4.55 4.55 0 01.217-.443 4.578 4.578 0 011.96-1.313.338.338 0 00-.01.017z'
/>
</svg>
)

@ -1,11 +0,0 @@
export const Hockey = () => (
<svg
xmlns='http://www.w3.org/2000/svg'
fill='true'
viewBox='0 0 40 40'
>
<path
d='M39.349 1.675L34.761.078a.728.728 0 00-1 .4l-9.573 24.751c-.2.4-.4.6-.8.6H4.44c-.4 0-.6.2-.8.6L.052 39c-.2.4.2 1 .8 1h24.533c.4 0 .6-.2.8-.6L39.947 2.673a.763.763 0 00-.598-.998zM12.02 36.008H5.039l1.8-5.988h7.181z'
/>
</svg>
)

@ -1,14 +0,0 @@
export const Star = () => (
<svg
xmlns='http://www.w3.org/2000/svg'
width='8'
height='8'
fill='none'
viewBox='0 0 8 8'
>
<path
fill='currentColor'
d='M4 0l1.147 2.42 2.657.344-1.948 1.84.495 2.632L4 5.952 1.649 7.236l.495-2.633-1.948-1.84 2.657-.342L4 0z'
/>
</svg>
)

@ -1,19 +0,0 @@
export const Volleyball = () => (
<svg
xmlns='http://www.w3.org/2000/svg'
width='11'
height='11'
fill='true'
viewBox='0 0 11 11'
>
<g clipPath='url(#clip0_25420_222728)'>
<path d='M5.697 3.62c-.11.63-.305 1.22-.63 1.763a.153.153 0 01-.11.063c-1.76-.007-3.243.648-4.486 1.876-.025.025-.046.052-.081.093-.021-.05-.035-.083-.046-.117a4.886 4.886 0 01-.19-2.314.282.282 0 01.082-.148c.727-.689 1.591-1.118 2.56-1.341.863-.2 1.727-.209 2.588.019.077.02.152.045.23.07l.083.036zM6.116.847c.181.05.348.091.511.143.62.198 1.195.518 1.69.941.04.035.07.083.083.136.366 1.951-.117 3.658-1.479 5.11-.054.057-.118.106-.18.163a.681.681 0 01-.063-.042A5.225 5.225 0 015.53 5.945c-.04-.067-.043-.117 0-.188a5.844 5.844 0 00.796-2.38A6.212 6.212 0 006.124.91C6.12.9 6.12.89 6.116.847zM8.85 9.065c-.2.187-.375.365-.565.526a4.814 4.814 0 01-1.501.86.236.236 0 01-.148.008c-1.837-.675-3.055-1.94-3.618-3.825-.02-.07-.03-.143-.045-.214 0-.013 0-.025.002-.037a4.476 4.476 0 011.01-.275c.28-.038.566-.048.849-.07.052-.005.085.01.115.062.848 1.493 2.118 2.444 3.755 2.923.036.012.073.021.146.042z' />
<path d='M.465 3.881c.163-.433.392-.839.68-1.202.84-1.062 1.931-1.696 3.27-1.888.318-.045.644-.028.966-.04.055-.002.087.018.105.076.22.668.317 1.37.286 2.074-.002.034-.009.068-.014.107a5.964 5.964 0 00-2.746-.16A6.332 6.332 0 00.465 3.88zM2.406 6.643c.49 1.838 1.597 3.171 3.262 4.087-.267.007-.534.03-.8.017a4.928 4.928 0 01-2.736-.971A4.903 4.903 0 01.68 8.082c-.016-.031-.019-.093 0-.116a5.547 5.547 0 011.702-1.319.098.098 0 01.025-.004zM7.237 7.705C8.592 6.345 9.19 4.7 9.11 2.778c.025.033.045.057.062.083.533.76.84 1.6.908 2.526.08 1.109-.191 2.127-.78 3.066-.044.071-.083.096-.173.075a5.799 5.799 0 01-1.882-.811.027.027 0 01-.007-.012z' />
</g>
<defs>
<clipPath id='clip0_25420_222728'>
<path fill='#fff' d='M0 0H10V10H0z' transform='translate(.093 .751)' />
</clipPath>
</defs>
</svg>
)

@ -1,6 +1,6 @@
import { SportTypes } from 'config' import { SportTypes } from 'config'
export type TournamentType = { type Tournament = {
id: number, id: number,
name_eng: string, name_eng: string,
name_rus: string, name_rus: string,
@ -31,7 +31,7 @@ export type Match = {
sub: boolean, sub: boolean,
team1: Team, team1: Team,
team2: Team, team2: Team,
tournament: TournamentType, tournament: Tournament,
} }
export type Matches = Array<Match> export type Matches = Array<Match>

Loading…
Cancel
Save