Pārlūkot izejas kodu

Removed some div nesting where possible.

KrisVos130 7 gadi atpakaļ
vecāks
revīzija
8947776bb3

+ 58 - 47
frontend/app/index.tpl.html

@@ -1,55 +1,66 @@
 <!doctype html>
 <!doctype html>
 <html>
 <html>
-  <head>
-    <title>Musare</title>
+<head>
+	<title>Musare</title>
 
 
-		<meta charset="UTF-8">
-		<meta http-equiv="X-UA-Compatible" content="IE=edge">
-		<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
-		<meta name="keywords" content="music, musare, listen, station, station, radio, edm, chill, community, official, rooms, room, party, good, mus, pop">
-		<meta name="description" content="On Musare you can listen to lots of different songs, playing 24/7 in our official stations and in user-made community stations!">
-		<meta name="copyright" content="© Copyright Musare 2015-2017 All Right Reserved">
+	<meta charset="UTF-8">
+	<meta http-equiv="X-UA-Compatible" content="IE=edge">
+	<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
+	<meta name="keywords"
+		  content="music, musare, listen, station, station, radio, edm, chill, community, official, rooms, room, party, good, mus, pop">
+	<meta name="description"
+		  content="On Musare you can listen to lots of different songs, playing 24/7 in our official stations and in user-made community stations!">
+	<meta name="copyright" content="© Copyright Musare 2015-2017 All Right Reserved">
 
 
-		<link rel="apple-touch-icon" sizes="57x57" href="/assets/images/apple-touch-icon-57x57.png?v=06042016">
-		<link rel="apple-touch-icon" sizes="60x60" href="/assets/images/apple-touch-icon-60x60.png?v=06042016">
-		<link rel="apple-touch-icon" sizes="72x72" href="/assets/images/apple-touch-icon-72x72.png?v=06042016">
-		<link rel="apple-touch-icon" sizes="76x76" href="/assets/images/apple-touch-icon-76x76.png?v=06042016">
-		<link rel="apple-touch-icon" sizes="114x114" href="/assets/images/apple-touch-icon-114x114.png?v=06042016">
-		<link rel="apple-touch-icon" sizes="120x120" href="/assets/images/apple-touch-icon-120x120.png?v=06042016">
-		<link rel="apple-touch-icon" sizes="144x144" href="/assets/images/apple-touch-icon-144x144.png?v=06042016">
-		<link rel="apple-touch-icon" sizes="152x152" href="/assets/images/apple-touch-icon-152x152.png?v=06042016">
-		<link rel="apple-touch-icon" sizes="180x180" href="/assets/images/apple-touch-icon-180x180.png?v=06042016">
-		<link rel="icon" type="image/png" href="/assets/images/favicon-32x32.png?v=06042016" sizes="32x32">
-		<link rel="icon" type="image/png" href="/assets/images/favicon-194x194.png?v=06042016" sizes="194x194">
-		<link rel="icon" type="image/png" href="/assets/images/favicon-96x96.png?v=06042016" sizes="96x96">
-		<link rel="icon" type="image/png" href="/assets/images/android-chrome-192x192.png?v=06042016" sizes="192x192">
-		<link rel="icon" type="image/png" href="/assets/images/favicon-16x16.png?v=06042016" sizes="16x16">
-		<link rel="manifest" href="/assets/manifest.json?v=06042016">
-		<link rel="mask-icon" href="/assets/images/safari-pinned-tab.svg?v=06042016" color="#03a9f4">
-		<link rel="shortcut icon" href="/assets/images/favicon.ico?v=06042016">
-		<meta name="msapplication-TileColor" content="#03a9f4">
-		<meta name="msapplication-TileImage" content="/assets/images/mstile-144x144.png?v=06042016">
-		<meta name="theme-color" content="#03a9f4">
-		<meta name="google" content="nositelinkssearchbox" />
+	<link rel="apple-touch-icon" sizes="57x57" href="/assets/images/apple-touch-icon-57x57.png?v=06042016">
+	<link rel="apple-touch-icon" sizes="60x60" href="/assets/images/apple-touch-icon-60x60.png?v=06042016">
+	<link rel="apple-touch-icon" sizes="72x72" href="/assets/images/apple-touch-icon-72x72.png?v=06042016">
+	<link rel="apple-touch-icon" sizes="76x76" href="/assets/images/apple-touch-icon-76x76.png?v=06042016">
+	<link rel="apple-touch-icon" sizes="114x114" href="/assets/images/apple-touch-icon-114x114.png?v=06042016">
+	<link rel="apple-touch-icon" sizes="120x120" href="/assets/images/apple-touch-icon-120x120.png?v=06042016">
+	<link rel="apple-touch-icon" sizes="144x144" href="/assets/images/apple-touch-icon-144x144.png?v=06042016">
+	<link rel="apple-touch-icon" sizes="152x152" href="/assets/images/apple-touch-icon-152x152.png?v=06042016">
+	<link rel="apple-touch-icon" sizes="180x180" href="/assets/images/apple-touch-icon-180x180.png?v=06042016">
+	<link rel="icon" type="image/png" href="/assets/images/favicon-32x32.png?v=06042016" sizes="32x32">
+	<link rel="icon" type="image/png" href="/assets/images/favicon-194x194.png?v=06042016" sizes="194x194">
+	<link rel="icon" type="image/png" href="/assets/images/favicon-96x96.png?v=06042016" sizes="96x96">
+	<link rel="icon" type="image/png" href="/assets/images/android-chrome-192x192.png?v=06042016" sizes="192x192">
+	<link rel="icon" type="image/png" href="/assets/images/favicon-16x16.png?v=06042016" sizes="16x16">
+	<link rel="manifest" href="/assets/manifest.json?v=06042016">
+	<link rel="mask-icon" href="/assets/images/safari-pinned-tab.svg?v=06042016" color="#03a9f4">
+	<link rel="shortcut icon" href="/assets/images/favicon.ico?v=06042016">
+	<meta name="msapplication-TileColor" content="#03a9f4">
+	<meta name="msapplication-TileImage" content="/assets/images/mstile-144x144.png?v=06042016">
+	<meta name="theme-color" content="#03a9f4">
+	<meta name="google" content="nositelinkssearchbox"/>
 
 
 
 
-		<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" type="text/css">
-		<link href="https://fonts.googleapis.com/css?family=Roboto:100,400" rel="stylesheet">
-		<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
-		<script src="https://www.youtube.com/iframe_api"></script>
-		<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.15.0/moment.min.js"></script>
-		<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.4.8/socket.io.min.js"></script>
-		<script>
-			(function(i,s,o,g,r,a,m){i["GoogleAnalyticsObject"]=r;i[r]=i[r]||function(){
-						(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
-					m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
-			})(window,document,"script","https://www.google-analytics.com/analytics.js","ga");
+	<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet"
+		  type="text/css">
+	<link href="https://fonts.googleapis.com/css?family=Roboto:100,400" rel="stylesheet">
+	<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
+	<script src="https://www.youtube.com/iframe_api"></script>
+	<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.15.0/moment.min.js"></script>
+	<script type="text/javascript"
+			src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.4.8/socket.io.min.js"></script>
+	<script async src="https://www.google.com/recaptcha/api.js"></script>
+	<script>
+		(function (i, s, o, g, r, a, m) {
+			i["GoogleAnalyticsObject"] = r;
+			i[r] = i[r] || function () {
+						(i[r].q = i[r].q || []).push(arguments)
+					}, i[r].l = 1 * new Date();
+			a = s.createElement(o),
+					m = s.getElementsByTagName(o)[0];
+			a.async = 1;
+			a.src = g;
+			m.parentNode.insertBefore(a, m)
+		})(window, document, "script", "https://www.google-analytics.com/analytics.js", "ga");
 
 
-			ga("create", "UA-93460758-1", "auto");
-		</script>
-  </head>
-  <body>
-    <div id="root"></div>
-		<script src="https://www.google.com/recaptcha/api.js"></script>
-  </body>
+		ga("create", "UA-93460758-1", "auto");
+	</script>
+</head>
+<body>
+	<div id="root"></div>
+</body>
 </html>
 </html>

+ 2 - 2
frontend/app/js/components/Global/Menu.jsx

@@ -22,13 +22,13 @@ export default class Menu extends Component {
 
 
 	render() {
 	render() {
 		return (
 		return (
-			<div className="Menu">
+			<header className="Menu">
 				{this.getLink("/", "Home")}
 				{this.getLink("/", "Home")}
 				{this.getLink("/login", "Login", !this.props.loggedIn)}
 				{this.getLink("/login", "Login", !this.props.loggedIn)}
 				{this.getLink("/register", "Register", !this.props.loggedIn)}
 				{this.getLink("/register", "Register", !this.props.loggedIn)}
 				{this.getLink("/settings", "Settings", this.props.loggedIn)}
 				{this.getLink("/settings", "Settings", this.props.loggedIn)}
 				{this.getLink("/logout", "Logout", this.props.loggedIn)}
 				{this.getLink("/logout", "Logout", this.props.loggedIn)}
-			</div>
+			</header>
 		);
 		);
 	}
 	}
 }
 }

+ 4 - 8
frontend/app/js/index.js

@@ -7,13 +7,12 @@ import thunk from "redux-thunk";
 import "babel-polyfill";
 import "babel-polyfill";
 
 
 import rootReducer from "reducers";
 import rootReducer from "reducers";
-import DevTools from "dev/redux-dev-tools";
 
 
 import App from "views/App";
 import App from "views/App";
 
 
 import "../styles/main.scss";
 import "../styles/main.scss";
 
 
-const isProduction = process.env.NODE_ENV === "production";
+// const isProduction = process.env.NODE_ENV === "production";
 let store = null;
 let store = null;
 
 
 const middleware = applyMiddleware(thunk);
 const middleware = applyMiddleware(thunk);
@@ -24,12 +23,9 @@ store = createStore(
 
 
 ReactDOM.render(
 ReactDOM.render(
 	<Provider store={ store }>
 	<Provider store={ store }>
-		<div>
-			<BrowserRouter>
-				<Route path="/" component={ App } />
-			</BrowserRouter>
-			{ !isProduction ? <DevTools /> : "" }
-		</div>
+		<BrowserRouter>
+			<App />
+		</BrowserRouter>
 	</Provider>,
 	</Provider>,
 	document.getElementById("root")
 	document.getElementById("root")
 );
 );

+ 66 - 78
frontend/app/js/views/App/index.jsx

@@ -37,14 +37,11 @@ const asyncComponent = getComponent => {
 class App extends Component { // eslint-disable-line react/no-multi-comp
 class App extends Component { // eslint-disable-line react/no-multi-comp
 	static propTypes = {
 	static propTypes = {
 		dispatch: PropTypes.func,
 		dispatch: PropTypes.func,
-		history: PropTypes.shape({
-			push: PropTypes.func.isRequired,
-		}).isRequired,
-	}
+	};
 
 
 	static defaultProps = {
 	static defaultProps = {
 		dispatch: () => {},
 		dispatch: () => {},
-	}
+	};
 
 
 	componentDidMount() {
 	componentDidMount() {
 		const { dispatch } = this.props;
 		const { dispatch } = this.props;
@@ -63,7 +60,7 @@ class App extends Component { // eslint-disable-line react/no-multi-comp
 		});
 		});
 
 
 		if (localStorage.getItem("github_redirect")) {
 		if (localStorage.getItem("github_redirect")) {
-			this.props.history.push(localStorage.getItem("github_redirect"));
+			// TODO
 			localStorage.removeItem("github_redirect");
 			localStorage.removeItem("github_redirect");
 		}
 		}
 	}
 	}
@@ -72,78 +69,69 @@ class App extends Component { // eslint-disable-line react/no-multi-comp
 		return (
 		return (
 			<div>
 			<div>
 				<Menu />
 				<Menu />
-				<div>
-					<Switch>
-						<AuthRoute
-							exact
-							path="/login"
-							component={ asyncComponent(() =>
-								System.import("views/Auth/Login").then(module => module.default)
-							) }
-							authRequired={ false }
-						/>
-						<AuthRoute
-							exact
-							path="/logout"
-							component={ asyncComponent(() =>
-								System.import("views/Auth/Logout").then(module => module.default)
-							) }
-							authRequired={ true }
-						/>
-						<AuthRoute
-							exact
-							path="/register"
-							component={ asyncComponent(() =>
-								System.import("views/Auth/Register").then(module => module.default)
-							) }
-							authRequired={ false }
-						/>
-						<AuthRoute
-							exact
-							path="/settings"
-							component={ asyncComponent(() =>
-								System.import("views/Auth/Settings").then(module => module.default)
-							) }
-							authRequired={ true }
-						/>
-						<AuthRoute
-							exact
-							path="/settings/setpassword"
-							component={ asyncComponent(() =>
-								System.import("views/Auth/SetPassword").then(module => module.default)
-							) }
-							authRequired={ true }
-						/>
-						<AuthRoute
-							exact
-							path="/reset_password"
-							component={ asyncComponent(() =>
-								System.import("views/Auth/ForgotPassword").then(module => module.default)
-							) }
-							authRequired={ false }
-						/>
-						<Route
-							exact
-							path="/template"
-							component={ asyncComponent(() =>
-								System.import("views/Template").then(module => module.default)
-							) }
-						/>
-						<Route
-							exact
-							path="/"
-							component={ asyncComponent(() =>
-								System.import("views/Home").then(module => module.default)
-							) }
-						/>
-						<Route
-							path="*"
-							component={ asyncComponent(() =>
-								System.import("views/NotFound").then(module => module.default)
-							) }
-						/>
-					</Switch>
-				</div>
+				<Switch>
+					<AuthRoute
+						exact
+						path="/login"
+						component={ asyncComponent(() =>
+							System.import("views/Auth/Login").then(module => module.default)
+						) }
+						authRequired={ false }
+					/>
+					<AuthRoute
+						exact
+						path="/logout"
+						component={ asyncComponent(() =>
+							System.import("views/Auth/Logout").then(module => module.default)
+						) }
+						authRequired={ true }
+					/>
+					<AuthRoute
+						exact
+						path="/register"
+						component={ asyncComponent(() =>
+							System.import("views/Auth/Register").then(module => module.default)
+						) }
+						authRequired={ false }
+					/>
+					<AuthRoute
+						exact
+						path="/settings"
+						component={ asyncComponent(() =>
+							System.import("views/Auth/Settings").then(module => module.default)
+						) }
+						authRequired={ true }
+					/>
+					<AuthRoute
+						exact
+						path="/settings/setpassword"
+						component={ asyncComponent(() =>
+							System.import("views/Auth/SetPassword").then(module => module.default)
+						) }
+						authRequired={ true }
+					/>
+					<AuthRoute
+						exact
+						path="/reset_password"
+						component={ asyncComponent(() =>
+							System.import("views/Auth/ForgotPassword").then(module => module.default)
+						) }
+						authRequired={ false }
+					/>
+					<Route
+						exact
+						path="/"
+						component={ asyncComponent(() =>
+							System.import("views/Home").then(module => module.default)
+						) }
+					/>
+					<Route
+						path="*"
+						component={ asyncComponent(() =>
+							System.import("views/NotFound").then(module => module.default)
+						) }
+					/>
+				</Switch>
 			</div>
 			</div>
 		);
 		);
 	}
 	}

+ 0 - 5
frontend/app/js/views/Home/index.jsx

@@ -1,9 +1,4 @@
 import React, { Component } from "react";
 import React, { Component } from "react";
-import { connect } from "react-redux";
-
-@connect(state => ({
-	counter: state.app.get("counter"),
-}))
 
 
 export default class Home extends Component {
 export default class Home extends Component {
 	render() {
 	render() {