aboutsummaryrefslogtreecommitdiff
path: root/diplomacy/web/src/gui/forms/select_location_form.jsx
diff options
context:
space:
mode:
authornotoraptor <stevenbocco@gmail.com>2019-07-25 10:59:36 -0400
committerPhilip Paquette <pcpaquette@gmail.com>2019-07-25 11:15:59 -0400
commit48ee1a065debde5027fc17e49144d348258dc5e4 (patch)
treeb85be5b31a61ad911a89789c2089eaf7852ad4d9 /diplomacy/web/src/gui/forms/select_location_form.jsx
parent09f9589bfa1a9e19805c2cc7dc58cad4da93f17f (diff)
[Web] Added game creation interface
- Replaced fancybox with react-confirm-alert + dialog box - Removed unused code - Default map can be selected with 1-click - Added ability to select map variants
Diffstat (limited to 'diplomacy/web/src/gui/forms/select_location_form.jsx')
-rw-r--r--diplomacy/web/src/gui/forms/select_location_form.jsx19
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
};