* fix(#1574): disable input email (#474)

* feat(ott-1593): add additional events (#475)

Co-authored-by: boyvanov <boyvanov.sergey@gmail.com>

* feat(ott-1614): add live indicator (#476)

Co-authored-by: Andrei Dekterev <57942757+dekterev@users.noreply.github.com>
Co-authored-by: boyvanov <50294488+boyvanov@users.noreply.github.com>
Co-authored-by: boyvanov <boyvanov.sergey@gmail.com>
Co-authored-by: PolyakovaM <55061222+PolyakovaM@users.noreply.github.com>
keep-around/af30b88d367751c9e05a735e4a0467a96238ef47
Mirlan 4 years ago committed by GitHub
parent d7416486a2
commit b9ea06225b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      src/features/Common/Input/index.tsx
  2. 1
      src/features/JoinMatchPage/hooks.tsx
  3. 15
      src/features/JoinMatchPage/index.tsx
  4. 13
      src/features/MatchSidePlaylists/components/EventsList/index.tsx
  5. 61
      src/features/MatchSidePlaylists/components/TabEvents/index.tsx
  6. 2
      src/features/UserAccount/components/PersonalInfoForm/index.tsx
  7. 1
      src/requests/getUnauthenticatedMatch.tsx

@ -20,6 +20,7 @@ type Props = {
autoComplete?: string, autoComplete?: string,
className?: string, className?: string,
defaultValue?: string, defaultValue?: string,
disabled?: boolean,
editIcon?: boolean, editIcon?: boolean,
inputWidth?: number, inputWidth?: number,
label?: string, label?: string,
@ -41,6 +42,7 @@ export const Input = ({
autoComplete = '', autoComplete = '',
className, className,
defaultValue, defaultValue,
disabled,
editIcon = false, editIcon = false,
error, error,
inputWidth, inputWidth,
@ -79,6 +81,7 @@ export const Input = ({
required={required} required={required}
value={value} value={value}
defaultValue={defaultValue} defaultValue={defaultValue}
disabled={disabled}
onChange={onChange} onChange={onChange}
onBlur={onBlur} onBlur={onBlur}
onFocus={onFocus} onFocus={onFocus}

@ -41,6 +41,7 @@ export const useUnauthenticatedMatch = () => {
return { return {
handleSubmit, handleSubmit,
live: matchInfo?.live,
matchDate, matchDate,
teamName1, teamName1,
teamName2, teamName2,

@ -38,6 +38,7 @@ export const JoinMatchPage = () => {
const { sportType } = usePageParams() const { sportType } = usePageParams()
const { const {
handleSubmit, handleSubmit,
live,
matchDate, matchDate,
teamName1, teamName1,
teamName2, teamName2,
@ -55,12 +56,14 @@ export const JoinMatchPage = () => {
<MatchInfo> <MatchInfo>
<DateInfoWrapper> <DateInfoWrapper>
<DateInfo>{matchDate}</DateInfo> <DateInfo>{matchDate}</DateInfo>
<WatchLive> {live && (
<WatchLiveCircle /> <WatchLive>
<WatchLiveText> <WatchLiveCircle />
<T9n t='watch_live' /> <WatchLiveText>
</WatchLiveText> <T9n t='watch_live' />
</WatchLive> </WatchLiveText>
</WatchLive>
)}
</DateInfoWrapper> </DateInfoWrapper>
<TeamsNameWrapper> <TeamsNameWrapper>
<EmptySpan>{teamName1}</EmptySpan> <EmptySpan>{teamName1}</EmptySpan>

@ -3,7 +3,11 @@ import map from 'lodash/map'
import type { Events, MatchInfo } from 'requests' import type { Events, MatchInfo } from 'requests'
import type { PlaylistOption, Playlists } from 'features/MatchPage/types' import type {
EventPlaylistOption,
PlaylistOption,
Playlists,
} from 'features/MatchPage/types'
import { PlaylistTypes } from 'features/MatchPage/types' import { PlaylistTypes } from 'features/MatchPage/types'
import { isEqual } from '../../helpers' import { isEqual } from '../../helpers'
@ -27,15 +31,18 @@ export const EventsList = ({
}: Props) => ( }: Props) => (
<List> <List>
{map(events, (event) => { {map(events, (event) => {
const repeatedEpisodes = event.rep || []
const eventPlaylist = { const eventPlaylist = {
data: [{ data: [{
e: event.e, e: event.e,
h: event.h, h: event.h,
s: event.s, s: event.s,
}], },
...repeatedEpisodes,
],
id: event.n, id: event.n,
type: PlaylistTypes.EVENT, type: PlaylistTypes.EVENT,
} as PlaylistOption } as EventPlaylistOption
const isHomeTeam = event.t === profile?.team1.id const isHomeTeam = event.t === profile?.team1.id
const team = isHomeTeam const team = isHomeTeam

@ -51,6 +51,12 @@ export const TabEvents = ({
), ),
), [areEventsReversed, events]) ), [areEventsReversed, events])
const reversedGroupEvents = useMemo(() => (
areEventsReversed
? reverse(groupedEvents)
: groupedEvents
), [areEventsReversed, groupedEvents])
if (!profile) return null if (!profile) return null
return ( return (
@ -79,37 +85,32 @@ export const TabEvents = ({
</Tabs> </Tabs>
<HalfList> <HalfList>
{ {
map( map(reversedGroupEvents, (halfEvents, idx) => {
areEventsReversed const firstEvent = halfEvents[0]
? reverse(groupedEvents) const isFirstBlock = idx === 0
: groupedEvents,
(halfEvents, idx) => {
const firstEvent = halfEvents[0]
const isFirstBlock = idx === 0
return ( return (
<HalfEvents key={firstEvent.h}> <HalfEvents key={firstEvent.h}>
{ {
!isFirstBlock && ( !isFirstBlock && (
<BlockTitle> <BlockTitle>
<T9n t='half_time' /> <T9n t='half_time' />
</BlockTitle> </BlockTitle>
) )
} }
<BlockTitle> <BlockTitle>
<T9n t={firstEvent.l} /> <T9n t={firstEvent.l} />
</BlockTitle> </BlockTitle>
<EventsList <EventsList
events={halfEvents} events={halfEvents}
onSelect={onSelect} onSelect={onSelect}
playlists={playlists} playlists={playlists}
profile={profile} profile={profile}
selectedPlaylist={selectedPlaylist} selectedPlaylist={selectedPlaylist}
/> />
</HalfEvents> </HalfEvents>
) )
}, })
)
} }
</HalfList> </HalfList>
</Fragment> </Fragment>

@ -90,9 +90,9 @@ export const PersonalInfoForm = (props: Props) => {
labelLexic='form_email' labelLexic='form_email'
labelWidth={labelWidth} labelWidth={labelWidth}
onChange={updateFormValue(email)} onChange={updateFormValue(email)}
editIcon
maxLength={500} maxLength={500}
withError={false} withError={false}
disabled
/> />
<Combobox <Combobox
value={selectedCountry?.name ?? readFormValue(country)} value={selectedCountry?.name ?? readFormValue(country)}

@ -15,6 +15,7 @@ type Team = {
export type UnauthenticatedMatch = { export type UnauthenticatedMatch = {
date: string, date: string,
live: boolean,
team1: Team, team1: Team,
team2: Team, team2: Team,
tournament: { tournament: {

Loading…
Cancel
Save