mirror of
https://github.com/Noratrieb/hugos-lieblingsflugzeuge.git
synced 2026-01-17 05:05:05 +01:00
plane hugo
This commit is contained in:
parent
ec7929a9ba
commit
ea8fe969a4
7 changed files with 190 additions and 131 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import React from 'react';
|
||||
import ModelImage from './Plane'
|
||||
import f22 from './img/raptor-1040097_1920.png'
|
||||
import harrier from './img/av-8b-harrier-1986422_1920.jpg'
|
||||
|
||||
|
|
@ -16,27 +17,4 @@ class Modern extends React.Component {
|
|||
}
|
||||
}
|
||||
|
||||
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>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Modern;
|
||||
Loading…
Add table
Add a link
Reference in a new issue