X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=resources%2Fjs%2Fcomponents%2Fresults%2FList.js;h=911b6a53ba5526a70cb9073963190e6d0883949e;hb=4c5a82cb876e96c72c50e8bc12bd8a43a9afe847;hp=fb26fa56f264d94c2c393a6dc70af0e23dea91f3;hpb=1e725fef6dc440aaeea8c30e1e0598dc5d24ad86;p=alttp.git diff --git a/resources/js/components/results/List.js b/resources/js/components/results/List.js index fb26fa5..911b6a5 100644 --- a/resources/js/components/results/List.js +++ b/resources/js/components/results/List.js @@ -6,9 +6,11 @@ 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'; +import { useUser } from '../../hooks/user'; + +const List = ({ round, tournament }) => { + const { user } = useUser(); -const List = ({ round, tournament, user }) => { if (tournament.type === 'open-async') { const results = maySeeResults(user, tournament, round) ? (round.results || []).sort(compareResult) @@ -51,8 +53,6 @@ List.propTypes = { users: PropTypes.arrayOf(PropTypes.shape({ })), }), - user: PropTypes.shape({ - }), }; -export default withUser(List); +export default List;