import React, { useEffect, useState } from 'react'; import axios from 'axios'; import { makeStyles } from '@material-ui/styles'; import { ToastContainer, toast } from 'react-toastify'; import 'react-toastify/dist/ReactToastify.css'; const useStyles = makeStyles(theme => ({ show: { display: 'block', }, hide: { display: 'none', }, })); export default function ModalSettingNotify({show, meetingId}){ const classes = useStyles(); const [unapprovel, setUnapprovel ] = useState(null); const [approvel, setApprovel ] = useState(null); const [isApprovel, setIsApprovel ] = useState(false); useEffect(() => { axios.get(`/api/children/listOfMeetingNotifyApprovel/${meetingId}`, {params: { meeting_id: meetingId }}).then((response) => { if(response.data.status_code==200){ console.log(response.data.params); setApprovel(response.data.params); } else if(response.data.status_code==400){ //TODO } }); }, []); useEffect(() => { axios.get(`/api/children/listOfMeetingNotifyUnapprovel/${meetingId}`, {params: { meeting_id: meetingId }}).then((response) => { if(response.data.status_code==200){ console.log(response.data.params); setUnapprovel(response.data.params); } else if(response.data.status_code==400){ //TODO } }); }, []); async function settingNotify(meetingId) { // const formdata = new FormData(); // formdata.append('meeting_id', meetingId); // axios.post('/api/meetings/registerFavorite', formdata).then((response) => {}) console.log(meetingId); toast.success("SMSの送信に成功しました!", { position: "top-center", autoClose: 5000, className:"bg-success", hideProgressBar: true, closeOnClick: true, pauseOnHover: true, draggable: false, progress: undefined, style:{ color: '#ffffff', opacity: 0.95} }); }; return (
{setIsApprovel(false); }} className={`modal-tab-label ${isApprovel ? "" : "is-active"}`}>未承知
{setIsApprovel(true); }} className={`modal-tab-label ${!isApprovel ? "" : "is-active"}`}>承知済み
) }