mirror of
https://github.com/Noratrieb/hugos-lieblingsflugzeuge.git
synced 2026-01-16 20:55:05 +01:00
hugo
This commit is contained in:
parent
9443cbd1b3
commit
5d87d4a1d3
6 changed files with 222 additions and 178 deletions
43
src/content.js
Normal file
43
src/content.js
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
import React from 'react';
|
||||
import f22 from './img/raptor-1040097_1920.png'
|
||||
import harrier from './img/av-8b-harrier-1986422_1920.jpg'
|
||||
|
||||
class Content extends React.Component {
|
||||
render() {
|
||||
const items = Array(100).fill(1).map((x, y) => x + y)
|
||||
.map(x => <ModelImage img={f22} name={'F' + (20 + x) + ' Raptor'}/>);
|
||||
|
||||
return (
|
||||
<div>
|
||||
{items}
|
||||
<ModelImage img={harrier} name="AV-8B Harrier"/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export default Content;
|
||||
|
||||
|
||||
class ModelImage extends React.Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
img: '',
|
||||
name: '',
|
||||
}
|
||||
}
|
||||
|
||||
static getDerivedStateFromProps(props) {
|
||||
return {img: props.img, name: props.name};
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div className="model">
|
||||
<img src={this.state.img} alt={this.state.name}/>
|
||||
<div>{this.state.name}</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue