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

FariHara as it currently is #1

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

FariHara as it currently is #1

wants to merge 11 commits into from

Conversation

Ripplz
Copy link
Collaborator

@Ripplz Ripplz commented Jun 5, 2018

No description provided.

@Ripplz Ripplz requested a review from lumiscript June 5, 2018 14:35
@@ -0,0 +1,18 @@
import InputEntry from './InputEntry';

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') {

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

Copy link
Collaborator Author

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.

<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}

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.

import React from 'react';

const PreferenceButton = ( {label, buttonClicked, selectState} ) =>
<button type="button" className={`col-3 ${selectState&&selectState}`} onClick={buttonClicked}>{label}</button>

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">

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 = {

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

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.

2 participants