mirror of
https://github.com/10h30/fullstackopen.git
synced 2026-06-05 15:08:33 +09:00
Completed 1.5
This commit is contained in:
+20
-18
@@ -1,34 +1,36 @@
|
||||
import React from 'react'
|
||||
|
||||
const App = () => {
|
||||
const course = 'Half Stack application development'
|
||||
const parts = [
|
||||
{
|
||||
name: 'Fundamentals of React',
|
||||
exercises: 10
|
||||
},
|
||||
{
|
||||
name: 'Using props to pass data',
|
||||
exercises: 7
|
||||
},
|
||||
{
|
||||
name: 'State of a component',
|
||||
exercises: 14
|
||||
}
|
||||
]
|
||||
const course = {
|
||||
name: 'Half Stack application development',
|
||||
parts: [
|
||||
{
|
||||
name: 'Fundamentals of React',
|
||||
exercises: 10
|
||||
},
|
||||
{
|
||||
name: 'Using props to pass data',
|
||||
exercises: 7
|
||||
},
|
||||
{
|
||||
name: 'State of a component',
|
||||
exercises: 14
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Header course={course} />
|
||||
<Content part={parts} />
|
||||
<Total part={parts} />
|
||||
<Content part={course.parts} />
|
||||
<Total part={course.parts} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
const Header = (props) => {
|
||||
return (
|
||||
<h1>{props.course}</h1>
|
||||
<h1>{props.course.name}</h1>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user