-
Notifications
You must be signed in to change notification settings - Fork 0
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
FariHara as it currently is #1
base: master
Are you sure you want to change the base?
Conversation
src/BeforeEntry.js
Outdated
@@ -0,0 +1,18 @@ | |||
import InputEntry from './InputEntry'; |
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 u use vscode, install prettier to format your code so it reads well.
src/InfoTable.js
Outdated
@@ -31,14 +32,30 @@ class InfoTable extends React.Component { | |||
); | |||
} | |||
|
|||
downloadJsonData = () => { | |||
if (this.state.noDataText === 'No rows found') { |
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.
noDataText
can be a boolean .. since the 2 possible outcomes can either be rows found or rows not found.. you can represent this in your state as true
or false
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.
There's a third outcome..."Loading" so the user knows that the data is being retrieved from the server, in case of a spotty internet connection.
src/InputEntry.js
Outdated
<Field name={name} component="input" min={type==='number'&&1} value={value&&value} type={type} className={`form-control col-${type==="date" ? 4: type==="number" ? 2: 12}`} /> | ||
</div> | ||
const InputEntry = ( {type, name, value, placeholder, min, textChanged} ) => | ||
<Field name={name&&name} component="input" value={value&&value} type={type&&type} |
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.
<Field name={name&&name} component="input" value={value&&value} type={type&&type}
<label>{label}</label> placeholder={placeholder&&placeholder} min={min&&min} className="text_input" onChange={textChanged} />
You can refactor this block of code to use default props so you dont check if a value is available before passing it as a prop, within the prop.
src/PreferenceButton.js
Outdated
import React from 'react'; | ||
|
||
const PreferenceButton = ( {label, buttonClicked, selectState} ) => | ||
<button type="button" className={`col-3 ${selectState&&selectState}`} onClick={buttonClicked}>{label}</button> |
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.
template literal should be refactored too
src/ThankYou.js
Outdated
<div className="thankyou_header"> | ||
<img src={require('./images/logo.png')} alt="logo" /> | ||
</div> | ||
<div className="thankyou_main"> |
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.
stick to camelCase or snake_case
src/ThankYou.js
Outdated
<div><button type="button" className="btn thankyou_button" onClick={switchView}>Submit Another Entry</button></div> | ||
</div> | ||
</div> | ||
|
||
ThankYou.propTypes = { |
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.
Naming components is a hard feat, so i get it, lets try to make the name describe what the component is doing as opposed to describing how its doing it.. so instead of naming this ThankYou
I would name the component Confirmation
or ConfirmationView
No description provided.