container insertion issues

This commit is contained in:
lukas 2020-06-07 23:27:31 +02:00
parent ed0df26a79
commit 21ccd165c2
4 changed files with 23 additions and 23 deletions

View File

@ -1,4 +0,0 @@
#categorycontent{
width: 70%;
float: left;
}

View File

@ -4,7 +4,7 @@ import Dropdown from "react-bootstrap/Dropdown";
import DropdownButton from "react-bootstrap/DropdownButton"; import DropdownButton from "react-bootstrap/DropdownButton";
class AddTagPopup extends React.Component { class AddTagPopup extends React.Component {
constructor(props: P, context: any) { constructor(props, context) {
super(props, context); super(props, context);
this.state = { this.state = {
@ -60,7 +60,6 @@ class AddTagPopup extends React.Component {
<Modal.Footer> <Modal.Footer>
<button className='btn btn-primary' onClick={() => { <button className='btn btn-primary' onClick={() => {
this.storeselection(); this.storeselection();
this.props.onHide();
}}>Add }}>Add
</button> </button>
</Modal.Footer> </Modal.Footer>
@ -82,6 +81,7 @@ class AddTagPopup extends React.Component {
console.log("error occured while writing to db -- todo error handling"); console.log("error occured while writing to db -- todo error handling");
console.log(result.result); console.log(result.result);
} }
this.props.onHide();
}); });
} }
} }

View File

@ -2,7 +2,6 @@ import React from "react";
import SideBar from "../elements/SideBar"; import SideBar from "../elements/SideBar";
import Tag from "../elements/Tag"; import Tag from "../elements/Tag";
import "../css/CategoryPage.css"
import {TagPreview} from "../elements/Preview"; import {TagPreview} from "../elements/Preview";
class CategoryPage extends React.Component { class CategoryPage extends React.Component {
@ -39,21 +38,23 @@ class CategoryPage extends React.Component {
<hr/> <hr/>
<button className='btn btn-success'>Add a new Tag!</button> <button className='btn btn-success'>Add a new Tag!</button>
</SideBar> </SideBar>
<div id='categorycontent'>
{!this.state.selected ?
(this.state.loadedtags ?
this.state.loadedtags.map((m) => (
<TagPreview
name={m.tag_name}
tag_id={m.tag_id}
viewbinding={this.props.viewbinding}
categorybinding={this.setPage}/>
)) :
"loading") :
this.selectionelements
}
</div> {!this.state.selected ?
(<div className='maincontent'>
{this.state.loadedtags ?
this.state.loadedtags.map((m) => (
<TagPreview
name={m.tag_name}
tag_id={m.tag_id}
viewbinding={this.props.viewbinding}
categorybinding={this.setPage}/>
)) :
"loading"}
</div>) :
this.selectionelements
}
</> </>
); );
} }

View File

@ -84,7 +84,10 @@ class Player extends React.Component {
</button> </button>
{this.state.popupvisible ? {this.state.popupvisible ?
<AddTagPopup show={this.state.popupvisible} <AddTagPopup show={this.state.popupvisible}
onHide={() => this.setState({popupvisible: false})} onHide={() => {
this.setState({popupvisible: false});
this.fetchMovieData();
}}
movie_id={this.state.movie_id}/> : movie_id={this.state.movie_id}/> :
null null
} }