mirror of
https://github.com/openmhz/trunk-server.git
synced 2026-11-14 17:58:02 -05:00
Update GroupModal.js
This commit is contained in:
@@ -8,32 +8,21 @@ import {
|
|||||||
import "./FilterModal.css";
|
import "./FilterModal.css";
|
||||||
|
|
||||||
|
|
||||||
class GroupModal extends Component {
|
function GroupModal(props) {
|
||||||
constructor(props) {
|
|
||||||
super(props)
|
|
||||||
this.handleInputChange = this.handleInputChange.bind(this);
|
|
||||||
this.handleDone = this.handleDone.bind(this);
|
|
||||||
this.handleClose = this.handleClose.bind(this);
|
|
||||||
|
|
||||||
this.state = {
|
const [open, setOpen] = useState(false);
|
||||||
open: false,
|
const [selectedGroup, setSelectedGroup] = useState(false);
|
||||||
selectedGroup: false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
const handleInputChange = (e, { name, value }) => this.setState({ [name]: value });
|
||||||
|
const handleClose = () => this.props.onClose(false);
|
||||||
|
|
||||||
handleInputChange = (e, { name, value }) => this.setState({ [name]: value });
|
const handleDone = () => {
|
||||||
handleClose = () => this.props.onClose(false);
|
|
||||||
|
|
||||||
handleDone(event) {
|
|
||||||
|
|
||||||
if (this.state.selectedGroup) {
|
if (this.state.selectedGroup) {
|
||||||
this.props.callActions.setGroupFilter(this.state.selectedGroup);
|
this.props.callActions.setGroupFilter(this.state.selectedGroup);
|
||||||
this.props.onClose(true);
|
this.props.onClose(true);
|
||||||
} else {
|
} else {
|
||||||
this.props.onClose(false);
|
this.props.onClose(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
componentDidUpdate(prevProps) {
|
componentDidUpdate(prevProps) {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user