Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
import React from 'react';
import './App.scss';
import { Sum } from './components/Sum/Sum';

export const App = () => (
<>
<p>Sum of 2 and 3 is 5</p>
<p>Sum of -5 and 5 is 0</p>
<p>Sum of 10 and 0 is 10</p>
<p>Sum of 0 and 5 is 5</p>
<p>Sum of 0 and 0 is 0</p>
{/* Replace paragraphs with Sum componets */}
{/* And remove commented lines :) */}
<Sum
a={2}
b={3}
/>
Comment on lines +7 to +10

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This violates checklist item #1: If you have < 3 attribues on a tag and the values are short write the tag in one line (to make it easier to write and read). Here Sum has two short attributes, so it should be written like <Sum a={2} b={3} /> on a single line instead of being split across multiple lines.

<Sum
a={-5}
b={5}
/>
Comment on lines +11 to +14

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also violates checklist item #1: If you have < 3 attribues on a tag and the values are short write the tag in one line. Sum here has two short attributes and should be in one line, e.g. <Sum a={-5} b={5} />.

<Sum
a={10}
/>
Comment on lines +15 to +17

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This Sum has only one short attribute, so according to checklist item #1 (If you have < 3 attribues on a tag and the values are short write the tag in one line), it should be formatted on a single line: <Sum a={10} />.

<Sum
b={5}
/>
Comment on lines +18 to +20

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same checklist item #1 applies here: with only one short attribute, the Sum tag should be on a single line, e.g. <Sum b={5} />, rather than split across multiple lines.

<Sum />
</>
);
4 changes: 3 additions & 1 deletion src/components/Sum/Sum.jsx
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
// export const Sum = () => ();
export const Sum = ({ a = 0, b = 0 }) => {
return <p>{`Sum of ${a} and ${b} is ${a + b}`}</p>;
};
Loading