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

Customr components #32

Closed
wants to merge 6 commits into from
Closed

Customr components #32

wants to merge 6 commits into from

Conversation

Balsam-Faysal
Copy link
Contributor

#30 add all components for customer with style and react events

@@ -0,0 +1,38 @@
@media screen and (max-width: 500px) {

Choose a reason for hiding this comment

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

Are there any styles for these components that have the @media selectors that you'd want to keep for all screen sizes? Since all of these styles are currently wrapped with the @media, this component will appear unstyled on desktop (or rather, for all screen widths above 500px, i.e. ipad).

Copy link
Collaborator

Choose a reason for hiding this comment

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

The main target for is is mobile but I agree it doesn't have to be mobile only :)
We will fix this.

</div>
);

export default NavBar;

Choose a reason for hiding this comment

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

I hate to have annoying name change suggestions, but if you find all of the different Nav components getting a little bit confusing, it might help to name them more specifically, like CustomerPageNavBar and so on. 😀

Copy link
Collaborator

Choose a reason for hiding this comment

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

Updated.

class MapTap extends Component {
render() {
return (
<div className="map-container">

Choose a reason for hiding this comment

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

If you're interested, this is another place where you could apply some of these ideas (#25) to put the common code between MapTap and FlightRoute Tap (basically the NavBar and Tabs) into a single file. It would probably require some adjustments to how the classes are currently passed into the Tabs component though.

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.

If you're doing the backend, DO NOT FORGET THE TESTS @amusameh

@@ -11,6 +11,7 @@
crossorigin="anonymous">

<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Volkhov">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Voces">
Copy link
Contributor

Choose a reason for hiding this comment

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

Put both imports on lines 13+14 in one line as in

<link href="https://fonts.googleapis.com/css?family=Voces|Volkhov" rel="stylesheet">

Copy link
Collaborator

Choose a reason for hiding this comment

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

Done

<div>
<div className="title-style">{cardTitle}</div>
{info.map(item => (
<LabelImg
Copy link
Contributor

Choose a reason for hiding this comment

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

Warning: Each child in an array or iterator should have a unique "key" prop

<div className="card-container">
<Card
cardTitle="Origin"
info={[
Copy link
Contributor

Choose a reason for hiding this comment

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

put this array in a variable/state/props and pass it to the component, do not stack js in your jsx.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah we should do this, but for now, we will finish the admin panel to and later we will start working on customer views, This is balsam work and she made this pull request the last minute before she leave. it wasn't supposed to be in a pull request.


class Home extends Component {
constructor(props) {
super(props);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are u calling super and passing props to it? You're not using props anywhere else, so you don't need to pass it to the Component constructor.

return (
<div>
<div className="title-style">{cardTitle}</div>
{info.map((item, i) => (
Copy link
Contributor

Choose a reason for hiding this comment

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

Add newline after { and before }, and rename your i variable to index.

Copy link
Collaborator

@amusameh amusameh Aug 8, 2018

Choose a reason for hiding this comment

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

The i is upated to index :)

If you mean a space before and space after. We are using prettier to format our code and it disagrees with this

{
  "extends": ["react-app", "plugin:prettier/recommended"]
}

}) => (
<div className="container-input">
<label className="label-style">{labelText}</label>
<label className={labelClassName}>{labelText}</label>

Choose a reason for hiding this comment

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

Here, you could do the same classnames type of fix that you did for the <Select component, or another idea is you could have 'label-style' be the default class and use labelClassName as an override - <label className={labelClassName || 'label-style'}

Either way, the idea is to save you the trouble of passing "label-style" every time you want to create an Input component.

@@ -0,0 +1,29 @@
@media screen and (max-width: 500px) {

Choose a reason for hiding this comment

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

Here's another spot where some of the styles probably apply to all browser widths, and some others just to max-width: 500px

@@ -0,0 +1,23 @@
@media screen and (max-width: 500px) {

Choose a reason for hiding this comment

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

Here's another spot where some of the styles probably apply to all browser widths, and some others just to max-width: 500px

@@ -0,0 +1,21 @@
@media screen and (max-width: 500px) {

Choose a reason for hiding this comment

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

Sorry to spam you with all these :) Here's another spot where some of the styles probably apply to all browser widths, and some others just to max-width: 500px

</SweetAlert>
);

this.setState({

Choose a reason for hiding this comment

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

Here, you can store a flag in this.state which says whether to show the SweetAlert component, and then in render(), read that flag and put the SweetAlert component right there in render(), if the flag is true. That way, this.state just has simple (and serializable) data types in it.

type="checkbox"
onTextInputChange={this.handlecheckboxChange}
/>
<Button className="cus-btn-style" onClick={this.popup}>

Choose a reason for hiding this comment

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

Should this use this.handleCheck instead of this.popup? I can't find this.popup.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we still need this function because we already have this. handleCheck on the whole form?

<Button className="cus-btn-style">

Is this ok?

Choose a reason for hiding this comment

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

Ah yep, you're right, you won't need any function at all there.
Your <Button className="cus-btn-style"> looks good to me!

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 cannot review 40+ files and figure out on my own which files belong to which feature, please commit less files.

@amusameh amusameh closed this Aug 9, 2018
@Balsam-Faysal Balsam-Faysal deleted the customrComponents branch August 9, 2018 18:22
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