mirror of
https://github.com/Noratrieb/hugos-lieblingsflugzeuge.git
synced 2026-01-16 20:55:05 +01:00
plane hugo
This commit is contained in:
parent
ec7929a9ba
commit
ea8fe969a4
7 changed files with 190 additions and 131 deletions
30
src/Plane.js
Normal file
30
src/Plane.js
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
import React, {Component} from "react";
|
||||
import './Plane.css'
|
||||
|
||||
|
||||
class ModelImage extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
img: '',
|
||||
name: '',
|
||||
}
|
||||
}
|
||||
|
||||
static getDerivedStateFromProps(props) {
|
||||
return {img: props.img, name: props.name};
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<a href="" className="model">
|
||||
<img src={this.state.img} alt={this.state.name}/>
|
||||
<div className="model-info">
|
||||
<span className="model-info-text">{this.state.name}</span>
|
||||
</div>
|
||||
</a>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default ModelImage;
|
||||
Loading…
Add table
Add a link
Reference in a new issue