-
Notifications
You must be signed in to change notification settings - Fork 1
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
Conversation
@@ -0,0 +1,38 @@ | |||
@media screen and (max-width: 500px) { |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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. 😀
There was a problem hiding this comment.
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"> |
There was a problem hiding this comment.
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.
There was a problem hiding this 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
client/public/index.html
Outdated
@@ -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"> |
There was a problem hiding this comment.
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">
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
client/src/components/Card/index.js
Outdated
<div> | ||
<div className="title-style">{cardTitle}</div> | ||
{info.map(item => ( | ||
<LabelImg |
There was a problem hiding this comment.
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={[ |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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.
client/src/components/Card/index.js
Outdated
return ( | ||
<div> | ||
<div className="title-style">{cardTitle}</div> | ||
{info.map((item, i) => ( |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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"]
}
client/src/components/input/index.js
Outdated
}) => ( | ||
<div className="container-input"> | ||
<label className="label-style">{labelText}</label> | ||
<label className={labelClassName}>{labelText}</label> |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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({ |
There was a problem hiding this comment.
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}> |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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!
There was a problem hiding this 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.
#30 add all components for customer with style and react events