Skip to content

Code Review!#19

Open
matiasgarcia91 wants to merge 59 commits into
reviewfrom
development
Open

Code Review!#19
matiasgarcia91 wants to merge 59 commits into
reviewfrom
development

Conversation

@matiasgarcia91
Copy link
Copy Markdown
Collaborator

No description provided.

mir4cles and others added 30 commits June 18, 2020 17:24
…server

Events & teams fetch and map from server
mir4cles and others added 25 commits June 25, 2020 12:06
Alert messagebox with proper props
skeleton card for loading appState
event info with icons and event headers
set some messages to showMessageWithTimeout
Merge pull request #13 from mir4cles/development
Copy link
Copy Markdown
Collaborator Author

@matiasgarcia91 matiasgarcia91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, clean and concise code and components, well structured also. Nice work Juri!

Comment thread src/App.js

import { useDispatch, useSelector } from "react-redux";
import { selectAppLoading } from "./store/appState/selectors";
import { useDispatch } from "react-redux";
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as a style guide, i normally order my imports like:

  1. Libraries (react, react-redux, express, etc)
  2. My other files (actions/selectors in the FE, routers + middlewares in the backend)
  3. Components
  4. Css


return (
<Navbar bg="light" expand="lg">
<Navbar.Brand as={NavLink} to="/">
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice work pulling out bootstrap from the template and rearranging it with material-ui 🚀

const [sportType, setSportType] = React.useState(event.sportType);
const [description, setDescription] = React.useState(event.description);
const [outdoor, setOutdoor] = React.useState(event.outdoor);
const [maxPlayers, setMaxPlayers] = React.useState(25);
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

desctructure useState so you dont repeat so much React.

Comment on lines +67 to +87
const attendButton = attendingIds.includes(user.id) ? (
<Button
variant="contained"
color="secondary"
className={classes.button}
startIcon={<EventBusyIcon />}
onClick={() => dispatch(cancelAttendEvent(id))}
>
Don't go
</Button>
) : (
<Button
variant="contained"
color="primary"
className={classes.button}
startIcon={<EventAvailableIcon />}
onClick={() => dispatch(attendEvent(id))}
>
Attend
</Button>
);
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice 👌

Comment thread src/pages/Events/index.js
>
<AddIcon />
</Fab>
) : null}
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

everytime you have a ternary and one of the returns in null you can solve it with an &&:

{token && (
          <Fab
            size="medium"
            color="secondary"
            className={classes.fab}
            aria-label="create event"
            component={Link}
            to="/create-event"
          >
            <AddIcon />
          </Fab>
        )}

case CANCEL_ATTEND_EVENT:
return {
...state,
attending: [...state.attending.filter((rsvp) => rsvp.id !== payload)],
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

const teamsCount = getState().teams.length;
// const response = await axios.get(
// `http://localhost:4000/events?limit=${DEFAULT_PAGINATION_LIMIT}`
// );
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove old code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants