]> git.localhorst.tv Git - alttp.git/blobdiff - resources/js/components/results/Item.js
open tournament type
[alttp.git] / resources / js / components / results / Item.js
index a2ee8e392b82a392b76236b8bab92e4e7806d6f7..4b243b34bc4a9a673a55c233d4c4c62481745851 100644 (file)
@@ -5,8 +5,8 @@ import { Button } from 'react-bootstrap';
 import DetailDialog from './DetailDialog';
 import Box from '../users/Box';
 import { getIcon, getTime } from '../../helpers/Result';
-import { findResult } from '../../helpers/Participant';
 import { maySeeResults } from '../../helpers/permissions';
+import { findResult } from '../../helpers/User';
 import { withUser } from '../../helpers/UserContext';
 
 const getClassName = result => {
@@ -23,16 +23,16 @@ const getClassName = result => {
 };
 
 const Item = ({
-       participant,
+       authUser,
        round,
        tournament,
        user,
 }) => {
        const [showDialog, setShowDialog] = useState(false);
-       const result = findResult(participant, round);
-       const maySee = maySeeResults(user, tournament, round);
+       const result = findResult(user, round);
+       const maySee = maySeeResults(authUser, tournament, round);
        return <div className="result">
-               <Box user={participant.user} />
+               <Box user={user} />
                <Button
                        className={getClassName(result)}
                        onClick={() => setShowDialog(true)}
@@ -45,18 +45,16 @@ const Item = ({
                </Button>
                <DetailDialog
                        onHide={() => setShowDialog(false)}
-                       participant={participant}
                        round={round}
                        show={showDialog}
                        tournament={tournament}
+                       user={user}
                />
        </div>;
 };
 
 Item.propTypes = {
-       participant: PropTypes.shape({
-               user: PropTypes.shape({
-               }),
+       authUser: PropTypes.shape({
        }),
        round: PropTypes.shape({
        }),
@@ -66,4 +64,4 @@ Item.propTypes = {
        }),
 };
 
-export default withUser(Item);
+export default withUser(Item, 'authUser');