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
|
# 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'
|
import React from 'react'
|
||||||
|
|
||||||
const App = () => {
|
const App = () => {
|
||||||
const course = 'Half Stack application development'
|
const course = {
|
||||||
const part1 = 'Fundamentals of React'
|
name: 'Half Stack application development',
|
||||||
const exercises1 = 10
|
parts: [
|
||||||
const part2 = 'Using props to pass data'
|
{
|
||||||
const exercises2 = 7
|
name: 'Fundamentals of React',
|
||||||
const part3 = 'State of a component'
|
exercises: 10
|
||||||
const exercises3 = 14
|
},
|
||||||
|
{
|
||||||
|
name: 'Using props to pass data',
|
||||||
|
exercises: 7
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'State of a component',
|
||||||
|
exercises: 14
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Header course={course} />
|
<Header course={course} />
|
||||||
<Content part={[part1,part2,part3]} exercises={[exercises1, exercises2, exercises3]} />
|
<Content part={course.parts} />
|
||||||
<Total exercises={[exercises1, exercises2, exercises3]} />
|
<Total part={course.parts} />
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
const Header = (props) => {
|
const Header = (props) => {
|
||||||
return (
|
return (
|
||||||
<h1>{props.course}</h1>
|
<h1>{props.course.name}</h1>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
const Content = (props) => {
|
const Content = (props) => {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Part part={props.part[0]} exercises={props.exercises[0]} />
|
<Part part={props.part[0]} />
|
||||||
<Part part={props.part[2]} exercises={props.exercises[1]} />
|
<Part part={props.part[1]} />
|
||||||
<Part part={props.part[2]} exercises={props.exercises[2]} />
|
<Part part={props.part[2]} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
)
|
)
|
||||||
@@ -37,14 +47,13 @@ const Content = (props) => {
|
|||||||
|
|
||||||
const Part = (props) => {
|
const Part = (props) => {
|
||||||
return (
|
return (
|
||||||
<p>{props.part} {props.exercises}</p>
|
<p>{props.part.name} {props.part.exercises}</p>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
const Total = (props) => {
|
const Total = (props) => {
|
||||||
return (
|
return (
|
||||||
<p>Number of exercises {props.exercises[0] + props.exercises[1] + props.exercises[2]}</p>
|
<p>Number of exercises {props.part[0].exercises + props.part[1].exercises + props.part[2].exercises}</p>
|
||||||
//<p>1</p>
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user