Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

edit some components to make it more generic, add eslint configeraions, and react-router-dom #23

Merged
merged 11 commits into from
Jul 31, 2018

Conversation

amusameh
Copy link
Collaborator

related to issue #21

@amusameh amusameh requested a review from NouraldinS July 30, 2018 07:45
const Router = () => (
<BrowserRouter>
<Switch>
<Route exact path="/" render={() => <Login />} />

Choose a reason for hiding this comment

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

What do you think about using the "/" path for the customer homepage, and putting all of the admin-related pages under "/admin/"? So then admin login is at the path /admin/, AddFlight is /admin/addflight, and so on.

I imagine that most of the visitors to the site would be customers, so this might make the site easier to use (and remember) for them.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done. We were worried about getting react-router-dom working that we didn't think about his 😄

Choose a reason for hiding this comment

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

👍haha

const Router = () => (
<BrowserRouter>
<Switch>
<Route exact path="/" render={() => <Login />} />

Choose a reason for hiding this comment

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

Having the login route use a render function prop is good, because that's where you can check whether they already have a logged-in token, and can redirect them right into /flights or whereever they should go 😀

<button className={className} onClick={onClick}>
{children}
</button>
);

Choose a reason for hiding this comment

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

👍


class Select extends Component {
selectValue = e => {

Choose a reason for hiding this comment

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

You might need to add the class properties babel plugin for this class property syntax to work (to get transformed properly in the build step).

It's really easy - you can take a look here: https://www.npmjs.com/package/babel-plugin-transform-class-properties
It's just an npm package, and then one line added to your .babelrc
We use class properties a lot at my work! We love them.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I was trying to find something to get rid of that annoying red alarm. thanks for pointing this out :)

Choose a reason for hiding this comment

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

np!

<a href="#">Update flight status</a>
</li>)
}
{thirdTap && (

Choose a reason for hiding this comment

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

What does thirdTap mean?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We have a third tap on the side navigation bar(Update flight status) which appears only when you click on a flight from the flights' table. I'll change the name to be more readable.

Choose a reason for hiding this comment

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

Ah, got it now

Copy link
Contributor

@NouraldinS NouraldinS left a comment

Choose a reason for hiding this comment

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

I think this is very good so far, just solve the comments @tomduggan85 had pointed out and everything will be merged tomorrow.
@amusameh

@amusameh amusameh requested a review from NouraldinS July 30, 2018 21:50
@NouraldinS NouraldinS merged commit 6d6751e into master Jul 31, 2018
@NouraldinS NouraldinS deleted the route branch July 31, 2018 09:27
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.

4 participants