Ott 2067 events list rendering

keep-around/d927435c21e499d816630bee4960a748b6d256e3
Макситалиев Мирлан 4 years ago
parent 91f846f4b9
commit d927435c21
  1. 2
      src/features/MatchPage/styled.tsx
  2. 21
      src/features/MatchSidePlaylists/components/EventsList/index.tsx
  3. 10
      src/features/MatchSidePlaylists/components/TabEvents/index.tsx
  4. 23
      src/features/MatchSidePlaylists/components/TabEvents/styled.tsx

@ -32,7 +32,7 @@ export const Wrapper = styled.div`
` `
export const Container = styled.div` export const Container = styled.div`
width: calc(100% - 375px); width: 100%;
max-width: 2090px; max-width: 2090px;
max-height: 896px; max-height: 896px;
display: flex; display: flex;

@ -2,21 +2,25 @@ import map from 'lodash/map'
import type { Events, MatchInfo } from 'requests' import type { Events, MatchInfo } from 'requests'
import { T9n } from 'features/T9n'
import type { import type {
EventPlaylistOption, EventPlaylistOption,
PlaylistOption, PlaylistOption,
Playlists,
} from 'features/MatchPage/types' } from 'features/MatchPage/types'
import { PlaylistTypes } from 'features/MatchPage/types' import { PlaylistTypes } from 'features/MatchPage/types'
import { isEqual } from '../../helpers' import { isEqual } from '../../helpers'
import { EventButton } from '../EventButton' import { EventButton } from '../EventButton'
import { Event, List } from '../TabEvents/styled' import {
BlockTitle,
Event,
TextEvent,
List,
} from '../TabEvents/styled'
type Props = { type Props = {
events: Events, events: Events,
onSelect: (option: PlaylistOption) => void, onSelect: (option: PlaylistOption) => void,
playlists: Playlists,
profile: MatchInfo, profile: MatchInfo,
selectedPlaylist?: PlaylistOption, selectedPlaylist?: PlaylistOption,
} }
@ -24,12 +28,21 @@ type Props = {
export const EventsList = ({ export const EventsList = ({
events, events,
onSelect, onSelect,
playlists,
profile, profile,
selectedPlaylist, selectedPlaylist,
}: Props) => ( }: Props) => (
<List> <List>
{map(events, (event) => { {map(events, (event) => {
if (!event.t && !event.pl) {
return (
<TextEvent key={event.n}>
<BlockTitle>
<T9n t={event.l} />
</BlockTitle>
</TextEvent>
)
}
const repeatedEpisodes = event.rep || [] const repeatedEpisodes = event.rep || []
const eventPlaylist = { const eventPlaylist = {
data: [{ data: [{

@ -10,7 +10,7 @@ import type { Events, MatchInfo } from 'requests'
import { useToggle } from 'hooks' import { useToggle } from 'hooks'
import type { PlaylistOption, Playlists } from 'features/MatchPage/types' import type { PlaylistOption } from 'features/MatchPage/types'
import { T9n } from 'features/T9n' import { T9n } from 'features/T9n'
import { EventsList } from '../EventsList' import { EventsList } from '../EventsList'
@ -26,7 +26,6 @@ import {
type Props = { type Props = {
events: Events, events: Events,
onSelect: (option: PlaylistOption) => void, onSelect: (option: PlaylistOption) => void,
playlists: Playlists,
profile: MatchInfo, profile: MatchInfo,
selectedPlaylist?: PlaylistOption, selectedPlaylist?: PlaylistOption,
} }
@ -34,7 +33,6 @@ type Props = {
export const TabEvents = ({ export const TabEvents = ({
events, events,
onSelect, onSelect,
playlists,
profile, profile,
selectedPlaylist, selectedPlaylist,
}: Props) => { }: Props) => {
@ -52,7 +50,7 @@ export const TabEvents = ({
reverseStatus reverseStatus
? reverse([...events]) ? reverse([...events])
: events, : events,
'h', ({ h }) => h,
), ),
) )
return reverseStatus return reverseStatus
@ -101,13 +99,9 @@ export const TabEvents = ({
</BlockTitle> </BlockTitle>
) )
} }
<BlockTitle>
<T9n t={firstEvent.l} />
</BlockTitle>
<EventsList <EventsList
events={halfEvents} events={halfEvents}
onSelect={onSelect} onSelect={onSelect}
playlists={playlists}
profile={profile} profile={profile}
selectedPlaylist={selectedPlaylist} selectedPlaylist={selectedPlaylist}
/> />

@ -20,23 +20,30 @@ export const HalfList = styled.ul`
width: 100%; width: 100%;
` `
export const HalfEvents = styled.li` export const HalfEvents = styled.li``
:not(:last-child) {
margin-bottom: 12px;
}
`
export const List = styled.ul` export const List = styled.ul``
margin-top: 12px;
`
export const Event = styled.li` export const Event = styled.li`
width: 100%; width: 100%;
height: 48px; height: 48px;
margin-bottom: 12px;
:first-child {
margin-top: 12px;
}
`
export const TextEvent = styled.li`
width: 100%;
:not(:last-child) { :not(:last-child) {
margin-bottom: 12px; margin-bottom: 12px;
} }
:last-child {
margin-bottom: 0px;
}
` `
type AvatarProps = { type AvatarProps = {

Loading…
Cancel
Save