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

Code Review #1

Open
a-n-g-i-e-r-i opened this issue Jul 12, 2021 · 2 comments
Open

Code Review #1

a-n-g-i-e-r-i opened this issue Jul 12, 2021 · 2 comments

Comments

@a-n-g-i-e-r-i
Copy link

Please review all comments associated with this issue and refactor your code accordingly. Thanks!

@a-n-g-i-e-r-i
Copy link
Author

a-n-g-i-e-r-i commented Jul 12, 2021

return (
<>
<CssBaseline />
<Container maxWidth='sm'>
<form
style={{ backgroundColor: 'white', borderRadius: 20 }}
>
<TextField
id='transactionId'
label='Transaction ID'
style={{ margin: 0, padding: 10 }}
value={transaction.transactionId}
InputLabelProps={{shrink: true}}
variant='outlined'
fullWidth
disabled
/>
<TextField
type='number'
id='ammount'
label='Ammount'
style={{ margin: 0, padding: 10 }}
value={transaction.amount}
InputLabelProps={{shrink: true}}
variant='outlined'
fullWidth
disabled
/>
<TextField
id='from'
label='From'
style={{ margin: 0, padding: 10 }}
value={transaction.from}
margin='normal'
InputLabelProps={{shrink: true}}
variant='outlined'
fullWidth
disabled
/>
<TextField
id='flag'
label='Flag'
style={{ margin: 0, padding: 10 }}
value={transaction.flag}
InputLabelProps={{shrink: true}}
variant='outlined'
fullWidth
disabled
/>
<TextField
id='date'
label='Date'
style={{ margin: 0, padding: 10 }}
value={transaction.date}
InputLabelProps={{shrink: true}}
variant='outlined'
fullWidth
disabled
/>
<div className={classes.divEdit}>
<Button
onClick={()=>{history.push(`/transactions/${id}/edit`)}}
variant='outlined' color='primary'
className={classes.buttonEdit}
type='Link'
>
Edit
</Button>
<Button
className={classes.buttonEdit}
onClick={handleDelete}
variant='outlined'
color='primary'
type='Link'
>
Delete
</Button>
</div>
<div style={{ margin: 0, padding: 14 }}>
<Button
onClick={()=>history.push("/transactions")}
variant='outlined'
color='primary'
type='Link'
fullWidth
>
Back
</Button>
</div>
</form>
</Container>
</>

Make sure you have a code linter like Prettier installed in vs code to clean up your component formatting. Some of these indentations and angle brackets look off.

@a-n-g-i-e-r-i
Copy link
Author

? "http://localhost:3001"
: "https://budget-horizon.herokuapp.com"

Consider building these two urls dynamically using environment variables

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

No branches or pull requests

1 participant