Code Review!#19
Open
matiasgarcia91 wants to merge 59 commits into
Open
Conversation
…server Events & teams fetch and map from server
Feat login status nav
Feat create event
Feat events overview
Feat rsvp
Feat editevent
Alert messagebox with proper props
skeleton card for loading appState
Feat event cards v2
event info with icons and event headers
navbar without tabs
refactoring before deploy
Release: version 0.1
set some messages to showMessageWithTimeout
Merge pull request #13 from mir4cles/development
Release: version 0.1.1
matiasgarcia91
commented
Jul 2, 2020
Collaborator
Author
matiasgarcia91
left a comment
There was a problem hiding this comment.
Again, clean and concise code and components, well structured also. Nice work Juri!
|
|
||
| import { useDispatch, useSelector } from "react-redux"; | ||
| import { selectAppLoading } from "./store/appState/selectors"; | ||
| import { useDispatch } from "react-redux"; |
Collaborator
Author
There was a problem hiding this comment.
as a style guide, i normally order my imports like:
- Libraries (react, react-redux, express, etc)
- My other files (actions/selectors in the FE, routers + middlewares in the backend)
- Components
- Css
|
|
||
| return ( | ||
| <Navbar bg="light" expand="lg"> | ||
| <Navbar.Brand as={NavLink} to="/"> |
Collaborator
Author
There was a problem hiding this comment.
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); |
Collaborator
Author
There was a problem hiding this comment.
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> | ||
| ); |
| > | ||
| <AddIcon /> | ||
| </Fab> | ||
| ) : null} |
Collaborator
Author
There was a problem hiding this comment.
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)], |
| const teamsCount = getState().teams.length; | ||
| // const response = await axios.get( | ||
| // `http://localhost:4000/events?limit=${DEFAULT_PAGINATION_LIMIT}` | ||
| // ); |
Collaborator
Author
There was a problem hiding this comment.
remove old code
instructions on landing page
Release: version 0.2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.