import Head from 'next/head'; import React, {Component} from 'react'; import {Button, Container, Form, Input, InputGroup, InputGroupAddon, Table} from 'reactstrap'; import {TurniereNavigation} from '../js/components/Navigation'; import {BigImage} from '../js/components/BigImage'; import {Footer} from '../js/components/Footer'; import 'bootstrap/dist/css/bootstrap.min.css'; import '../static/css/everypage.css'; import '../static/css/profile.css'; import {connect} from 'react-redux'; import {changeMail} from '../js/api'; import {notify} from 'react-notify-toast'; function ContentContainer(props) { return (

E-Mail-Adresse ändern

); } export default class ProfilePage extends React.Component { render() { return (
Profil: turnie.re
); } } const Content = connect(state => { return {email: state.userinfo.uid, name: state.userinfo.username}; })(ContentContainer); function UserData(props) { return (
Name {props.name}
E-Mail-Adresse {props.email}
); } class NewMailAddressInput extends Component { constructor(props) { super(props); this.state = {email: ''}; this.submit = this.submit.bind(this); this.onChange = this.onChange.bind(this); this.onSubmitSuccess = this.onSubmitSuccess.bind(this); NewMailAddressInput.onSubmitError = NewMailAddressInput.onSubmitError.bind(this); } submit(event) { event.preventDefault(); changeMail(this.state.email, this.onSubmitSuccess, NewMailAddressInput.onSubmitError); } onSubmitSuccess() { this.setState({email: ''}); notify.show('E-Mail-Adresse geändert.', 'success', 2500); } static onSubmitError() { notify.show('Die E-Mail-Adresse konnte nicht geändert werden.', 'error', 3000); } onChange(input) { this.setState({email: input.target.value}); } render() { return (
); } }