abstract dynamic video tile load within new dynamicloader class to allow to load other elements dynamically.
This commit is contained in:
		@@ -1,6 +1,5 @@
 | 
			
		||||
import {TagType} from '../../types/VideoTypes';
 | 
			
		||||
import React from 'react';
 | 
			
		||||
import videocontainerstyle from '../../elements/VideoContainer/VideoContainer.module.css';
 | 
			
		||||
import {Link} from 'react-router-dom';
 | 
			
		||||
import {TagPreview} from '../../elements/Preview/Preview';
 | 
			
		||||
import {APINode, callAPI} from '../../utils/Api';
 | 
			
		||||
@@ -9,6 +8,7 @@ import SideBar, {SideBarTitle} from '../../elements/SideBar/SideBar';
 | 
			
		||||
import Tag from '../../elements/Tag/Tag';
 | 
			
		||||
import {DefaultTags} from '../../types/GeneralTypes';
 | 
			
		||||
import NewTagPopup from '../../elements/Popups/NewTagPopup/NewTagPopup';
 | 
			
		||||
import DynamicContentContainer from '../../elements/DynamicContentContainer/DynamicContentContainer';
 | 
			
		||||
 | 
			
		||||
interface TagViewState {
 | 
			
		||||
    loadedtags: TagType[];
 | 
			
		||||
@@ -53,15 +53,19 @@ class TagView extends React.Component<Props, TagViewState> {
 | 
			
		||||
                        Add a new Tag!
 | 
			
		||||
                    </button>
 | 
			
		||||
                </SideBar>
 | 
			
		||||
                <div className={videocontainerstyle.maincontent}>
 | 
			
		||||
                    {this.state.loadedtags
 | 
			
		||||
                        ? this.state.loadedtags.map((m) => (
 | 
			
		||||
                              <Link to={'/categories/' + m.TagId} key={m.TagId}>
 | 
			
		||||
                                  <TagPreview name={m.TagName} />
 | 
			
		||||
                              </Link>
 | 
			
		||||
                          ))
 | 
			
		||||
                        : 'loading'}
 | 
			
		||||
                </div>
 | 
			
		||||
                {this.state.loadedtags.length !== 0 ? (
 | 
			
		||||
                    <DynamicContentContainer
 | 
			
		||||
                        data={this.state.loadedtags}
 | 
			
		||||
                        renderElement={(m): JSX.Element => (
 | 
			
		||||
                            <Link to={'/categories/' + m.TagId} key={m.TagId}>
 | 
			
		||||
                                <TagPreview name={m.TagName} />
 | 
			
		||||
                            </Link>
 | 
			
		||||
                        )}
 | 
			
		||||
                        initialLoadNr={20}
 | 
			
		||||
                    />
 | 
			
		||||
                ) : (
 | 
			
		||||
                    'loading'
 | 
			
		||||
                )}
 | 
			
		||||
                {this.handlePopups()}
 | 
			
		||||
            </>
 | 
			
		||||
        );
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@ import React from 'react';
 | 
			
		||||
 | 
			
		||||
class TVShowPage extends React.Component {
 | 
			
		||||
    render(): JSX.Element {
 | 
			
		||||
        return <></>;
 | 
			
		||||
        return <>TvShowPage</>;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user