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