refactored
This commit is contained in:
parent
1d48e78d7f
commit
3864c11b9b
4 changed files with 35 additions and 23 deletions
15
parts/2/courseExercise/src/components/Content.jsx
Normal file
15
parts/2/courseExercise/src/components/Content.jsx
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import Part from "./Part";
|
||||
|
||||
const Content = (props) => {
|
||||
return (
|
||||
<>
|
||||
{props.sections.map((section) => {
|
||||
return (
|
||||
<Part key={section.part} partName={section.part} exerciseCount={section.exerciseCount} />
|
||||
);
|
||||
})}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default Content;
|
||||
5
parts/2/courseExercise/src/components/Header.jsx
Normal file
5
parts/2/courseExercise/src/components/Header.jsx
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
const Header = (props) => {
|
||||
return <h1>{props.course}</h1>;
|
||||
};
|
||||
|
||||
export default Header;
|
||||
9
parts/2/courseExercise/src/components/Part.jsx
Normal file
9
parts/2/courseExercise/src/components/Part.jsx
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
const Part = (props) => {
|
||||
return (
|
||||
<p>
|
||||
{props.partName} {props.exerciseCount}
|
||||
</p>
|
||||
);
|
||||
};
|
||||
|
||||
export default Part;
|
||||
Loading…
Add table
Add a link
Reference in a new issue