mirror of
https://github.com/10h30/fullstackopen.git
synced 2026-06-05 15:08:33 +09:00
Merge branch 'main' of https://github.com/10h30/fullstackopen into main
This commit is contained in:
@@ -1,2 +1,2 @@
|
||||
# fullstackopen
|
||||
My repository for submit excersises for Full Stack Web Developemnt Course at Fullstackopen.com
|
||||
My repository for submit exercises for Full Stack Web Developemnt Course at Fullstackopen.com
|
||||
|
||||
+25
-16
@@ -1,35 +1,45 @@
|
||||
import React from 'react'
|
||||
|
||||
const App = () => {
|
||||
const course = 'Half Stack application development'
|
||||
const part1 = 'Fundamentals of React'
|
||||
const exercises1 = 10
|
||||
const part2 = 'Using props to pass data'
|
||||
const exercises2 = 7
|
||||
const part3 = 'State of a component'
|
||||
const exercises3 = 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={[part1,part2,part3]} exercises={[exercises1, exercises2, exercises3]} />
|
||||
<Total exercises={[exercises1, exercises2, exercises3]} />
|
||||
<Content part={course.parts} />
|
||||
<Total part={course.parts} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
const Header = (props) => {
|
||||
return (
|
||||
<h1>{props.course}</h1>
|
||||
<h1>{props.course.name}</h1>
|
||||
)
|
||||
}
|
||||
|
||||
const Content = (props) => {
|
||||
return (
|
||||
<div>
|
||||
<Part part={props.part[0]} exercises={props.exercises[0]} />
|
||||
<Part part={props.part[2]} exercises={props.exercises[1]} />
|
||||
<Part part={props.part[2]} exercises={props.exercises[2]} />
|
||||
<Part part={props.part[0]} />
|
||||
<Part part={props.part[1]} />
|
||||
<Part part={props.part[2]} />
|
||||
</div>
|
||||
|
||||
)
|
||||
@@ -37,14 +47,13 @@ const Content = (props) => {
|
||||
|
||||
const Part = (props) => {
|
||||
return (
|
||||
<p>{props.part} {props.exercises}</p>
|
||||
<p>{props.part.name} {props.part.exercises}</p>
|
||||
)
|
||||
}
|
||||
|
||||
const Total = (props) => {
|
||||
return (
|
||||
<p>Number of exercises {props.exercises[0] + props.exercises[1] + props.exercises[2]}</p>
|
||||
//<p>1</p>
|
||||
<p>Number of exercises {props.part[0].exercises + props.part[1].exercises + props.part[2].exercises}</p>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user