NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

InvoiceSummaryPage.jsx

lineNo: 14 — for complex ternary operators move each case to its own methods
for instance, instead of incoTerms ? (/**Ten lines of code*/) : (/**Ten Lines of code*/)
break it down to its own methods like incoTerms ? this.methodTrue : this.methodFalse.

lineNo: 18 — Change the variable name for ‘incoTerms’ can’t understand what it means.
lineNo: 23 — ‘CODE’ must be accessed through translation and not hardcoded.
lineNo: 25, 26, — destructure the ‘rowDetails’ object at the top

lineNo: 28 — Instead of
data ? (
<SecondaryCard>
<DocDetails>{data.replace('~', ' (')})</DocDetails>
</SecondaryCard>
) : (
<SecondaryCard>-</SecondaryCard>
)

we can change it to

<SecondaryCard>
data ? (<DocDetails>{data.replace('~', ' (')})</DocDetails>) : ‘-’
</SecondaryCard>

lineNo: 52 — same as previous comment, since <SecondaryCard> is used in both the true and false scenarios, move it outside the ternary operator.

lineNo: 47, 48 — Use translations and don’t hardcode data

lineNo: 82 — Do not hard code css in the jsx file, please declare the color in COLOR_NAMES and then use it.
lineNo : 82 — Do not use inline styling. Use StyledComponents.

lineNo: 96, 99 — From what I can understand, line no 96 and 99 are the truth and false scenarios of the ternary function in line no 14, so instead of using the same function with an unnecessary ternary operator, we an create two separate methods, for example this.getInvoiceWithIncoTerms for LN 96 and this.getInvoiceWithDocumentReference for LN 99
and avoid branches in our code.

lineNo: 111 — Please add comments for PropTypes.

     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.