From 682db6f8322a80d5628fe941734bf5c9095f5f22 Mon Sep 17 00:00:00 2001 From: Felix Hamme Date: Mon, 17 Jun 2019 22:26:58 +0200 Subject: [PATCH] Cleanup: Use reactstrap components instead of buggy "self-coded" stuff --- js/components/WarningPopup.js | 17 +++++------- pages/create.js | 50 ++++++++++++++++++++--------------- 2 files changed, 34 insertions(+), 33 deletions(-) diff --git a/js/components/WarningPopup.js b/js/components/WarningPopup.js index 77729dc..0c0152a 100644 --- a/js/components/WarningPopup.js +++ b/js/components/WarningPopup.js @@ -1,19 +1,14 @@ import React from 'react'; import PropTypes from 'prop-types'; -import {Alert} from 'reactstrap'; +import {Alert, Collapse} from 'reactstrap'; export class WarningPopup extends React.Component { render() { - if (this.props.shown) { - return (
- {this.props.children} - - {this.props.text} - -
); - } else { - return this.props.children; - } + return ( + + {this.props.text} + + ); } } diff --git a/pages/create.js b/pages/create.js index 1e8f678..1d654f6 100644 --- a/pages/create.js +++ b/pages/create.js @@ -2,8 +2,20 @@ import Head from 'next/head'; import React from 'react'; import {notify} from 'react-notify-toast'; import {connect} from 'react-redux'; -import posed from 'react-pose'; -import {Button, Card, CardBody, Col, Container, CustomInput, Form, FormGroup, Input, Label} from 'reactstrap'; +import { + Button, + Card, + CardBody, + Col, + Collapse, + Container, + CustomInput, + Form, + FormGroup, + Input, + Label, + Row +} from 'reactstrap'; import {TurniereNavigation} from '../js/components/Navigation'; import {Footer} from '../js/components/Footer'; import EditableStringList from '../js/components/EditableStringList'; @@ -49,14 +61,6 @@ function CreateTournamentCard() { ); } -const GroupphaseFader = posed.div({ - visible: { - opacity: 1, height: 200 - }, hidden: { - opacity: 0, height: 0 - } -}); - class CreateTournamentForm extends React.Component { constructor(props) { super(props); @@ -106,29 +110,31 @@ class CreateTournamentForm extends React.Component { checked={this.state.groupPhaseEnabled} onChange={this.handleGroupPhaseEnabledInput}/> - + - - - + + + + + - - + + - + + - +

Teams