This commit is contained in:
Luke Berndt
2022-12-31 09:30:41 -05:00
parent 1b785f3e95
commit 931c8590db

View File

@@ -8,32 +8,42 @@ import {
import "./FilterModal.css"; import "./FilterModal.css";
function GroupModal(props) { class GroupModal extends Component {
constructor(props) {
super(props)
this.handleInputChange = this.handleInputChange.bind(this);
this.handleDone = this.handleDone.bind(this);
this.handleClose = this.handleClose.bind(this);
const [open, setOpen] = useState(false); this.state = {
const [selectedGroup, setSelectedGroup] = useState(false); open: false,
selectedGroup: false
}
}
const handleInputChange = (e, { name, value }) => this.setState({ [name]: value });
const handleClose = () => this.props.onClose(false);
const handleDone = () => { handleInputChange = (e, { name, value }) => this.setState({ [name]: value });
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) {
const filterChanged = (prevProps.selectedGroup !== this.props.selectedGroup); const filterChanged = (prevProps.selectedGroup !== this.props.selectedGroup);
if (filterChanged) { if (filterChanged) {
this.setState({ selectedGroup: this.props.selectedGroup}); this.setState({ selectedGroup: this.props.selectedGroup});
} }
}*/ }
//render() { render() {
var groupList = []; var groupList = [];
@@ -70,6 +80,6 @@ componentDidUpdate(prevProps) {
) )
} }
//} }
export default GroupModal; export default GroupModal;