saving udates, not missing much i guess
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
import React, { Component } from "react";
|
||||
import Facade from "../Datafacade/datafacade";
|
||||
import { NavLink } from 'react-router-dom';
|
||||
|
||||
class MapsSearch extends Component {
|
||||
state = {
|
||||
maps: []
|
||||
};
|
||||
|
||||
componentDidMount = async () => {
|
||||
const maps = await Facade.getMapsBySearchCache(this.props.keyword);
|
||||
this.setState({ maps });
|
||||
};
|
||||
|
||||
componentDidUpdate = async prevProps => {
|
||||
if (this.props.keyword !== prevProps.keyword) {
|
||||
const maps = await Facade.getMapsBySearchCache(this.props.keyword);
|
||||
this.setState({ maps });
|
||||
}
|
||||
}
|
||||
render() {
|
||||
return (
|
||||
<React.Fragment>
|
||||
<div className="container mm">
|
||||
<div className="row">
|
||||
{this.state.maps.map(e => (
|
||||
<div className="item" key={"mapdivs/" + e.mapname + "/" + e.mapstage}>
|
||||
<div className="box_grid">
|
||||
<NavLink to={'/map/' + e.mapname + "/" + e.mapstage}>
|
||||
<strong className="col-lg-1 col-centered" /> Map: {e.mapname}<br />
|
||||
<strong className="col-lg-1 col-centered" /> Stage: {e.mapstage}<br />
|
||||
<br />
|
||||
<br />
|
||||
</NavLink>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default MapsSearch;
|
||||
Reference in New Issue
Block a user