import React from 'react'; import PopupBase from '../PopupBase'; import style from './NewActorPopup.module.css'; import {callAPI} from '../../../utils/Api'; /** * creates modal overlay to define a new Tag */ class NewActorPopup extends React.Component { render() { return ( ); } } export class NewActorPopupContent extends React.Component { constructor(props, context) { super(props, context); this.props = props; } render() { return ( <>
{ this.value = v.target.value; }}/>
); } /** * store the filled in form to the backend */ storeselection() { // check if user typed in name if (this.value === '' || this.value === undefined) return; callAPI('actor.php', {action: 'createActor', actorname: this.value}, (result) => { if (result.result !== 'success') { console.log('error occured while writing to db -- todo error handling'); console.log(result.result); } this.props.onHide(); }); } } export default NewActorPopup;