structured project with folders

better min preview height
correct sort by creation date
This commit is contained in:
Lukas Heiligenbrunner 2020-06-07 11:37:50 +02:00
parent 75245a2cf6
commit 516949dc65
13 changed files with 42 additions and 24 deletions

View File

@ -8,7 +8,7 @@ if (isset($_POST['action'])) {
$action = $_POST['action']; $action = $_POST['action'];
switch ($action) { switch ($action) {
case "getMovies": case "getMovies":
$query = "SELECT movie_id,movie_name FROM videos ORDER BY likes DESC, create_date ASC, movie_name ASC"; $query = "SELECT movie_id,movie_name FROM videos ORDER BY likes DESC, create_date DESC, movie_name ASC";
if (isset($_POST['tag'])) { if (isset($_POST['tag'])) {
$tag = $_POST['tag']; $tag = $_POST['tag'];
if ($_POST['tag'] != "all") { if ($_POST['tag'] != "all") {

View File

@ -19,7 +19,7 @@
"test": "react-scripts test", "test": "react-scripts test",
"eject": "react-scripts eject" "eject": "react-scripts eject"
}, },
"proxy": "http://192.168.0.248", "proxy": "http://192.168.0.209",
"homepage": "/", "homepage": "/",
"eslintConfig": { "eslintConfig": {
"extends": "react-app" "extends": "react-app"

View File

@ -1,11 +1,12 @@
import React from 'react'; import React from 'react';
import "./css/App.css" import "./css/App.css"
import HomePage from "./HomePage"; import HomePage from "./pages/HomePage";
import RandomPage from "./RandomPage"; import RandomPage from "./pages/RandomPage";
// include bootstraps css // include bootstraps css
import 'bootstrap/dist/css/bootstrap.min.css'; import 'bootstrap/dist/css/bootstrap.min.css';
import SettingsPage from "./SettingsPage"; import SettingsPage from "./pages/SettingsPage";
import CategoryPage from "./pages/CategoryPage";
class App extends React.Component { class App extends React.Component {
constructor(props, context) { constructor(props, context) {
@ -30,6 +31,9 @@ class App extends React.Component {
} else if (this.state.page === "settings") { } else if (this.state.page === "settings") {
page = <SettingsPage/>; page = <SettingsPage/>;
this.mypage = page; this.mypage = page;
} else if (this.state.page === "categories") {
page = <CategoryPage/>;
this.mypage = page;
} else if (this.state.page === "video") { } else if (this.state.page === "video") {
// show videoelement if neccessary // show videoelement if neccessary
page = this.videoelement; page = this.videoelement;

View File

@ -13,6 +13,7 @@
} }
.previewimage { .previewimage {
min-height: 150px;
max-height: 400px; max-height: 400px;
min-width: 266px; min-width: 266px;
max-width: 410px; max-width: 410px;

View File

@ -1,6 +1,6 @@
import React from "react"; import React from "react";
import "./css/Preview.css"; import "../css/Preview.css";
import Player from "./Player"; import Player from "../pages/Player";
class Preview extends React.Component { class Preview extends React.Component {
constructor(props, context) { constructor(props, context) {

View File

@ -1,5 +1,5 @@
import React from "react"; import React from "react";
import "./css/SideBar.css" import "../css/SideBar.css"
class SideBar extends React.Component { class SideBar extends React.Component {
render() { render() {

View File

@ -1,6 +1,6 @@
import React from "react"; import React from "react";
import "./css/Tag.css" import "../css/Tag.css"
class Tag extends React.Component { class Tag extends React.Component {
@ -11,7 +11,7 @@ class Tag extends React.Component {
} }
render() { render() {
// todo onclick events correctly // todo onclick events correctlyy
return ( return (
<button className='tagbtn' onClick={this.props.onClick}>{this.props.children}</button> <button className='tagbtn' onClick={this.props.onClick}>{this.props.children}</button>
); );

13
src/pages/CategoryPage.js Normal file
View File

@ -0,0 +1,13 @@
import React from "react";
class CategoryPage extends React.Component{
render() {
return (
<>
</>
);
}
}
export default CategoryPage;

View File

@ -1,10 +1,10 @@
import React from "react"; import React from "react";
import Preview from "./Preview"; import Preview from "../elements/Preview";
import SideBar from "./SideBar"; import SideBar from "../elements/SideBar";
import Tag from "../elements/Tag";
import "./css/HomePage.css" import "../css/HomePage.css"
import "./css/DefaultPage.css" import "../css/DefaultPage.css"
import Tag from "./Tag";
class HomePage extends React.Component { class HomePage extends React.Component {
// stores all available movies // stores all available movies

View File

@ -1,9 +1,9 @@
import React from "react"; import React from "react";
import "./css/Player.css" import "../css/Player.css"
import {PlyrComponent} from 'plyr-react'; import {PlyrComponent} from 'plyr-react';
import SideBar from "./SideBar"; import SideBar from "../elements/SideBar";
import Tag from "./Tag"; import Tag from "../elements/Tag";
import AddTagPopup from "./AddTagPopup"; import AddTagPopup from "../elements/AddTagPopup";
class Player extends React.Component { class Player extends React.Component {

View File

@ -1,8 +1,8 @@
import React from "react"; import React from "react";
import Preview from "./Preview"; import Preview from "../elements/Preview";
import "./css/RandomPage.css" import "../css/RandomPage.css"
import SideBar from "./SideBar"; import SideBar from "../elements/SideBar";
import Tag from "./Tag"; import Tag from "../elements/Tag";
class RandomPage extends React.Component { class RandomPage extends React.Component {
constructor(props, context) { constructor(props, context) {

View File

@ -1,5 +1,5 @@
import React from "react"; import React from "react";
import "./css/DefaultPage.css" import "../css/DefaultPage.css"
class SettingsPage extends React.Component { class SettingsPage extends React.Component {