diff --git a/frontend/src/Call/CallPlayer.js b/frontend/src/Call/CallPlayer.js index c75a803..7f8c751 100644 --- a/frontend/src/Call/CallPlayer.js +++ b/frontend/src/Call/CallPlayer.js @@ -40,10 +40,8 @@ class CallPlayer extends React.Component { this.addCall = this.addCall.bind(this); this.handlePusherClick = this.handlePusherClick.bind(this); this.handleSidebarToggle = this.handleSidebarToggle.bind(this); - this.handleSupportToggle = this.handleSupportToggle.bind(this); this.handleFilterClose = this.handleFilterClose.bind(this); this.handleGroupClose = this.handleGroupClose.bind(this); - this.handleSupportClose = this.handleSupportClose.bind(this); this.handleCalendarToggle = this.handleCalendarToggle.bind(this); this.handleCalendarClose = this.handleCalendarClose.bind(this); this.handleLiveToggle = this.handleLiveToggle.bind(this); @@ -68,8 +66,7 @@ class CallPlayer extends React.Component { sidebarOpened: false, filterVisible: false, groupVisible: false, - calendarVisible: false, - supportVisible: false + calendarVisible: false } } @@ -91,10 +88,6 @@ class CallPlayer extends React.Component { filterVisible: !this.state.filterVisible }) - handleSupportToggle = () => this.setState({ - supportVisible: !this.state.supportVisible - }) - handleContextRef = contextRef => this.setState({ contextRef }) changeUrl = url => this.props.callActions.changeUrl(url) @@ -234,12 +227,6 @@ class CallPlayer extends React.Component { this.props.callActions.fetchCalls(); } - handleSupportClose() { - this.setState({ - supportVisible: !this.state.supportVisible - }); - } - handleFilterClose(didUpdate) { this.setState({ filterVisible: !this.state.filterVisible @@ -547,7 +534,7 @@ class CallPlayer extends React.Component { - + @@ -611,7 +598,7 @@ class CallPlayer extends React.Component { this.switchAutoPlay()}>Autoplay - Support OpenMHz + Download Link diff --git a/frontend/src/Call/SupportModal.js b/frontend/src/Call/SupportModal.js index 8723bdd..6226040 100644 --- a/frontend/src/Call/SupportModal.js +++ b/frontend/src/Call/SupportModal.js @@ -1,4 +1,4 @@ -import React, { Component } from "react"; +import {useState} from 'react'; import { Modal, Button, @@ -7,49 +7,35 @@ import { import "./FilterModal.css"; -class SupportModal extends Component { - constructor(props) { - super(props) - this.handleDone = this.handleDone.bind(this); - this.handleClose = this.handleClose.bind(this); +function SupportModal(props) { - this.state = { - open: false - } -} + const [open, setOpen] = useState(false); + const handleClose = () => props.onClose(); -handleClose = () => this.props.onClose(false); - -handleDone(event) { - this.props.onClose(); -} - - render() { - return ( - - - Support OpenMHz - - - - If OpenMHz brings you joy, think about becoming a supporter! It will cover hosting costs and help keep me focused on development. - No worries if not, I am not having problems keeping it going. - + return ( + setOpen(false)} onOpen={() => setOpen(true)} trigger={Support OpenMHz} size='tiny' > + Support OpenMHz + + + + If OpenMHz brings you joy, think about becoming a supporter! It will cover hosting costs and help keep me focused on development. + No worries if not, I am not having problems keeping it going. + Support - + - - - - Done - - - + + + setOpen(false)} > + Done + + + + + ) - ) - } } export default SupportModal;
If OpenMHz brings you joy, think about becoming a supporter! It will cover hosting costs and help keep me focused on development.
No worries if not, I am not having problems keeping it going.