diff options
Diffstat (limited to 'diplomacy/web/src/gui/forms/select_location_form.jsx')
-rw-r--r-- | diplomacy/web/src/gui/forms/select_location_form.jsx | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/diplomacy/web/src/gui/forms/select_location_form.jsx b/diplomacy/web/src/gui/forms/select_location_form.jsx index ca7be09..1725c9b 100644 --- a/diplomacy/web/src/gui/forms/select_location_form.jsx +++ b/diplomacy/web/src/gui/forms/select_location_form.jsx @@ -17,20 +17,27 @@ import React from "react"; import PropTypes from "prop-types"; import {Button} from "../components/button"; +import {FancyBox} from "../components/fancyBox"; export class SelectLocationForm extends React.Component { render() { + const title = `Select location to continue building order: ${this.props.path.join(' ')}`; return ( - <div> - {this.props.locations.map((location, index) => ( - <Button key={index} title={location} large={true} onClick={() => this.props.onSelect(location)}/> - ))} - </div> + <FancyBox title={title} onClose={this.props.onClose}> + <div> + {this.props.locations.map((location, index) => ( + <Button key={index} title={location} large={true} + onClick={() => this.props.onSelect(location)}/> + ))} + </div> + </FancyBox> ); } } SelectLocationForm.propTypes = { locations: PropTypes.arrayOf(PropTypes.string).isRequired, - onSelect: PropTypes.func.isRequired // onSelect(location) + onSelect: PropTypes.func.isRequired, // onSelect(location) + onClose: PropTypes.func.isRequired, + path: PropTypes.array.isRequired }; |