From be4a7db4a03cdd63f34ed01d7c154592760ce75a Mon Sep 17 00:00:00 2001 From: lukas Date: Sun, 26 Sep 2021 22:41:48 +0200 Subject: [PATCH] correct redirect to search page, avoid duplicate keys on moviesettingspage --- src/pages/HomePage/HomePage.tsx | 205 ++++++++++++----------- src/pages/SettingsPage/MovieSettings.tsx | 4 +- 2 files changed, 108 insertions(+), 101 deletions(-) diff --git a/src/pages/HomePage/HomePage.tsx b/src/pages/HomePage/HomePage.tsx index 4a8be75..bb568f4 100644 --- a/src/pages/HomePage/HomePage.tsx +++ b/src/pages/HomePage/HomePage.tsx @@ -67,6 +67,17 @@ export class HomePage extends React.Component { this.fetchStartData(); } + render(): JSX.Element { + return ( + + + + + {this.homepageContent()} + + ); + } + /** * fetch available videos for specified tag * this function clears all preview elements an reloads gravity with tag @@ -95,109 +106,105 @@ export class HomePage extends React.Component { }); } - render(): JSX.Element { + /** + * main content of homepage + */ + homepageContent(): JSX.Element { return ( <> - - - - - - -
{ - e.preventDefault(); - this.props.history.push('/search/' + this.keyword); - }}> - { - this.keyword = e.target.value; - }} - /> - -
-
- - Infos: - - - {this.state.sideinfo.VideoNr} Videos Total! - - - {this.state.sideinfo.FullHdNr} FULL-HD Videos! - - - {this.state.sideinfo.HDNr} HD Videos! - - - {this.state.sideinfo.SDNr} SD Videos! - - - {this.state.sideinfo.DifferentTags} different Tags! - - - Default Tags: - { - this.tagState = DefaultTags.all; - this.fetchVideoData(); - this.setState({subtitle: 'All Videos'}); - }} - /> - { - this.tagState = DefaultTags.fullhd; - this.fetchVideoData(); - this.setState({subtitle: 'Full Hd Videos'}); - }} - /> - { - this.tagState = DefaultTags.lowq; - this.fetchVideoData(); - this.setState({subtitle: 'Low Quality Videos'}); - }} - /> - { - this.tagState = DefaultTags.hd; - this.fetchVideoData(); - this.setState({subtitle: 'HD Videos'}); - }} - /> - -
- Sort By: -
- - {this.state.sortby} - - -
- this.onDropDownItemClick(SortBy.date, 'Date Added')}>Date Added - this.onDropDownItemClick(SortBy.likes, 'Most likes')}>Most likes - this.onDropDownItemClick(SortBy.random, 'Random')}>Random - this.onDropDownItemClick(SortBy.name, 'Name')}>Name - this.onDropDownItemClick(SortBy.length, 'Length')}>Length -
-
+ +
{ + e.preventDefault(); + this.props.history.push('/media/search/' + this.keyword); + }}> + { + this.keyword = e.target.value; + }} + /> + +
+
+ + Infos: + + + {this.state.sideinfo.VideoNr} Videos Total! + + + {this.state.sideinfo.FullHdNr} FULL-HD Videos! + + + {this.state.sideinfo.HDNr} HD Videos! + + + {this.state.sideinfo.SDNr} SD Videos! + + + {this.state.sideinfo.DifferentTags} different Tags! + + + Default Tags: + { + this.tagState = DefaultTags.all; + this.fetchVideoData(); + this.setState({subtitle: 'All Videos'}); + }} + /> + { + this.tagState = DefaultTags.fullhd; + this.fetchVideoData(); + this.setState({subtitle: 'Full Hd Videos'}); + }} + /> + { + this.tagState = DefaultTags.lowq; + this.fetchVideoData(); + this.setState({subtitle: 'Low Quality Videos'}); + }} + /> + { + this.tagState = DefaultTags.hd; + this.fetchVideoData(); + this.setState({subtitle: 'HD Videos'}); + }} + /> + +
+ Sort By: +
+ + {this.state.sortby} + + +
+ this.onDropDownItemClick(SortBy.date, 'Date Added')}>Date Added + this.onDropDownItemClick(SortBy.likes, 'Most likes')}>Most likes + this.onDropDownItemClick(SortBy.random, 'Random')}>Random + this.onDropDownItemClick(SortBy.name, 'Name')}>Name + this.onDropDownItemClick(SortBy.length, 'Length')}>Length
+
+
- -
- - + +
); } diff --git a/src/pages/SettingsPage/MovieSettings.tsx b/src/pages/SettingsPage/MovieSettings.tsx index 451a2d1..52262e6 100644 --- a/src/pages/SettingsPage/MovieSettings.tsx +++ b/src/pages/SettingsPage/MovieSettings.tsx @@ -117,8 +117,8 @@ class MovieSettings extends React.Component { TVShow Reindex
- {this.state.text.map((m) => ( -
+ {this.state.text.map((m, i) => ( +
{m}
))}