fix(#2776): sort videotab in matchpage

keep-around/b214ac7012ef42593bee62c207888a2593bc5a38
Andrei Dekterev 3 years ago
parent 7f1855f77f
commit ab81156e5a
  1. 4
      src/features/MatchSidePlaylists/components/TabVideo/index.tsx
  2. 1
      src/features/MatchSidePlaylists/hooks.tsx

@ -6,6 +6,7 @@ import {
import { format } from 'date-fns' import { format } from 'date-fns'
import map from 'lodash/map' import map from 'lodash/map'
import sortBy from 'lodash/sortBy'
import { MatchCard } from 'features/MatchCard' import { MatchCard } from 'features/MatchCard'
import { TournamentData } from 'features/MatchPage/types' import { TournamentData } from 'features/MatchPage/types'
@ -60,7 +61,6 @@ export const TabVideo = ({
return !someProfileMatch return !someProfileMatch
}, [tournamentData, profileId, profileDate]) }, [tournamentData, profileId, profileDate])
return ( return (
<Fragment> <Fragment>
<VideoDate <VideoDate
@ -72,7 +72,7 @@ export const TabVideo = ({
/> />
<MatchesWrapper> <MatchesWrapper>
{ {
map(matches, (match) => ( map(sortBy(matches, ['!live', 'date']), (match) => (
<MatchCard <MatchCard
key={match.id} key={match.id}
match={match} match={match}

@ -17,7 +17,6 @@ export const useMatchSidePlaylists = () => {
tournamentData, tournamentData,
} = useMatchPageStore() } = useMatchPageStore()
const [selectedTab, setSelectedTab] = useState<Tabs>(Tabs.WATCH) const [selectedTab, setSelectedTab] = useState<Tabs>(Tabs.WATCH)
const isWatchTabVisible = useMemo(() => { const isWatchTabVisible = useMemo(() => {
const playListFilter = reduce( const playListFilter = reduce(
playlists.match, playlists.match,

Loading…
Cancel
Save