|
|
|
|
@ -4,6 +4,8 @@ import map from 'lodash/map' |
|
|
|
|
|
|
|
|
|
import { isMobileDevice } from 'config/userAgent' |
|
|
|
|
import type { MatchPlaylistOptions, PlaylistOption } from 'features/MatchPage/types' |
|
|
|
|
import type { MatchInfo } from 'requests' |
|
|
|
|
import { FULL_GAME_KEY } from 'features/MatchPage/helpers/buildPlaylists' |
|
|
|
|
|
|
|
|
|
import { T9n } from 'features/T9n' |
|
|
|
|
import { isEqual } from 'features/MatchSidePlaylists/helpers' |
|
|
|
|
@ -13,6 +15,7 @@ import { PlayButton } from '../PlayButton' |
|
|
|
|
type Props = { |
|
|
|
|
onSelect?: (selectedMathPlaylist: PlaylistOption) => void, |
|
|
|
|
playlists: MatchPlaylistOptions, |
|
|
|
|
profile: MatchInfo, |
|
|
|
|
selectedMathPlaylist?: PlaylistOption, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -33,6 +36,7 @@ const Item = styled.li` |
|
|
|
|
export const MatchPlaylists = ({ |
|
|
|
|
onSelect, |
|
|
|
|
playlists, |
|
|
|
|
profile, |
|
|
|
|
selectedMathPlaylist, |
|
|
|
|
}: Props) => ( |
|
|
|
|
<List> |
|
|
|
|
@ -42,6 +46,7 @@ export const MatchPlaylists = ({ |
|
|
|
|
<PlayButton |
|
|
|
|
duration={playlist.duration} |
|
|
|
|
active={isEqual(playlist, selectedMathPlaylist)} |
|
|
|
|
disabled={playlist.id !== FULL_GAME_KEY && !profile?.calc} |
|
|
|
|
onClick={() => onSelect?.(playlist)} |
|
|
|
|
> |
|
|
|
|
<T9n t={playlist.lexic} /> |
|
|
|
|
|