mirror of
https://github.com/10h30/fullstackopen.git
synced 2026-06-05 15:08:33 +09:00
Completed 2.4
This commit is contained in:
@@ -1,9 +1,10 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
const App = () => {
|
const App = () => {
|
||||||
const course = {
|
const courses = [
|
||||||
id: 1,
|
{
|
||||||
name: 'Half Stack application development',
|
name: 'Half Stack application development',
|
||||||
|
id: 1,
|
||||||
parts: [
|
parts: [
|
||||||
{
|
{
|
||||||
name: 'Fundamentals of React',
|
name: 'Fundamentals of React',
|
||||||
@@ -26,9 +27,30 @@ const App = () => {
|
|||||||
id: 4
|
id: 4
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Node.js',
|
||||||
|
id: 2,
|
||||||
|
parts: [
|
||||||
|
{
|
||||||
|
name: 'Routing',
|
||||||
|
exercises: 3,
|
||||||
|
id: 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Middlewares',
|
||||||
|
exercises: 7,
|
||||||
|
id: 2
|
||||||
}
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
return <Course course={course} />
|
return (
|
||||||
|
<div><h1>Web Development Curriculum</h1>
|
||||||
|
{courses.map(course => <Course key={course.id} course={course} />)}
|
||||||
|
</div>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
const Course = ({course}) => {
|
const Course = ({course}) => {
|
||||||
@@ -43,7 +65,7 @@ const Course = ({course}) => {
|
|||||||
|
|
||||||
const Header = (props) => {
|
const Header = (props) => {
|
||||||
return (
|
return (
|
||||||
<h1>{props.course.name}</h1>
|
<h2>{props.course.name}</h2>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user