X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=resources%2Fjs%2Fcomponents%2Fresults%2FList.js;h=fb26fa56f264d94c2c393a6dc70af0e23dea91f3;hb=d2d1231d5cea49224df581aed9d9e77f9deb832b;hp=14c70968cd5324823c558732df049e3a2fd715ea;hpb=855decfd62b51ed500c8a5903f4b263c4c9afb5c;p=alttp.git diff --git a/resources/js/components/results/List.js b/resources/js/components/results/List.js index 14c7096..fb26fa5 100644 --- a/resources/js/components/results/List.js +++ b/resources/js/components/results/List.js @@ -5,9 +5,25 @@ import Item from './Item'; import { sortByFinished, sortByResult } from '../../helpers/Participant'; import { maySeeResults } from '../../helpers/permissions'; import { getRunners } from '../../helpers/Tournament'; +import { compareResult } from '../../helpers/Result'; import { withUser } from '../../helpers/UserContext'; const List = ({ round, tournament, user }) => { + if (tournament.type === 'open-async') { + const results = maySeeResults(user, tournament, round) + ? (round.results || []).sort(compareResult) + : round.results || []; + return
+ {results.map(result => + + )} +
; + } const runners = maySeeResults(user, tournament, round) ? sortByResult(getRunners(tournament), round) : sortByFinished(getRunners(tournament), round); @@ -15,9 +31,9 @@ const List = ({ round, tournament, user }) => { {runners.map(participant => )} ; @@ -25,10 +41,15 @@ const List = ({ round, tournament, user }) => { List.propTypes = { round: PropTypes.shape({ + results: PropTypes.arrayOf(PropTypes.shape({ + })), }), tournament: PropTypes.shape({ participants: PropTypes.arrayOf(PropTypes.shape({ })), + type: PropTypes.string, + users: PropTypes.arrayOf(PropTypes.shape({ + })), }), user: PropTypes.shape({ }),