Commit 36bba023 authored by David Haynes's avatar David Haynes 🙆

Merge branch 'gothree-frontend' into 'go-three'

Frontend Begins

See merge request !127
parents e2691fd0 20bd3bab
Pipeline #3459 passed with stage
in 54 seconds
import React from "react";
import ReactDOM from "react-dom";
import { HashRouter, Route, Link } from "react-router-dom";
import { Routes } from "Utils";
// Apply Global Masonstrap styling
import "masonstrap/build/css/masonstrap.min.css";
import "masonstrap/build/js/masonstrap.min.js";
ReactDOM.render(
<HashRouter>
<Routes />
</HashRouter>,
document.getElementById("root")
);
import AuthButton from "./AuthButton";
export { AuthButton };
import React from "react";
import { Navbar, NavbarBrand, Nav, NavItem, NavLink } from "reactstrap";
export default class NavBar extends React.Component {
render() {
return (
<div>
<Navbar color="dark" dark expand="md">
<NavbarBrand href="#">Go</NavbarBrand>
<Nav className="ml-auto" navbar>
<NavItem>
<NavLink href="#/dhaynes" active={this.props.page == "dhaynes"}>
Dhaynes
</NavLink>
</NavItem>
<NavItem>
<NavLink href="#/about" active={this.props.page == "about"}>
About
</NavLink>
</NavItem>
</Nav>
</Navbar>
</div>
);
}
}
import NavBar from "./NavBar";
export { NavBar };
import React from 'react';
import { PageTemplate } from 'Components';
export default class AboutPage extends React.Component {
state = {};
render() {
return (
<PageTemplate page={'about'}>
<p>About page</p>
</PageTemplate>
);
}
}
import React from 'react';
import { PageTemplate } from 'Components';
export default class DhaynesPage extends React.Component {
render() {
return (
<PageTemplate page={'dhaynes'}>
<h2>DAVID HAYNES</h2>
</PageTemplate>
);
}
}
import React from 'react';
import { PageTemplate, AuthButton } from 'Components';
export default class HomePage extends React.Component {
render() {
return (
<PageTemplate page={'home'}>
<p>Hello World! 1</p>
<AuthButton />
</PageTemplate>
);
}
}
import HomePage from './HomePage';
import AboutPage from './AboutPage';
import DhaynesPage from './DhaynesPage';
export { HomePage, AboutPage, DhaynesPage };
import React from 'react';
import { NavBar } from 'Components';
export default class PageTemplate extends React.Component {
render() {
return (
<div>
<NavBar page={this.props.page} />
<div>{this.props.children}</div>
</div>
);
}
}
import PageTemplate from './PageTemplate';
export { PageTemplate };
import { PageTemplate } from "./Templates";
import { HomePage, AboutPage, DhaynesPage } from "./Pages";
import { NavBar } from "./Organisms";
import { AuthButton } from "./Molecules";
export {
//Tempaltes
PageTemplate,
//Pages
HomePage,
AboutPage,
DhaynesPage,
//Organisms
NavBar,
//Molecules
AuthButton
};
import React from "react";
import { Route } from "react-router-dom";
import { HomePage, AboutPage, DhaynesPage } from "Components";
const Routes = () => (
<div>
<Route path="/" exact component={HomePage} />
<Route path="/dhaynes" component={DhaynesPage} />
<Route path="/about" component={AboutPage} />
</div>
);
export default Routes;
import Routes from './Routes';
export { Routes };
// Apply Global Masonstrap styling
import "masonstrap/build/css/masonstrap.min.css";
import "masonstrap/build/js/masonstrap.min.js";
import React from "react";
import ReactDOM from "react-dom";
import AuthButton from "./AuthButton.jsx";
ReactDOM.render(
<div>
<AuthButton />
</div>,
document.getElementById("root")
);
......@@ -2,3 +2,4 @@ from django.shortcuts import render
def index(request):
return render(request, 'index.html')
......@@ -2,24 +2,32 @@
"name": "go",
"version": "3.0",
"description": "University-branded URL shortening",
"main": "index.js",
"main": "App.js",
"repository": "git@git.gmu.edu:srct/go.git",
"author": "Mason SRCT",
"license": "Apache-2.0",
"private": false,
"scripts": {
"dev": "webpack --mode development ./go/go_ahead/src/index.jsx --output ./go/static/main.js --watch",
"build": "webpack --mode production ./project/frontend/src/index.js --output ./go/static/main.js"
"start": "yarn dev",
"dev": "webpack --mode development ./go/go_ahead/src/App.js --output ./go/static/main.js --watch",
"build": "webpack --mode production ./go/go_ahead/src/App.js --output ./go/static/main.js"
},
"babel": {
"presets": [
"es2015",
"react"
"@babel/preset-env",
"@babel/preset-react"
],
"plugins": [
"@babel/plugin-proposal-class-properties"
]
},
"dependencies": {
"@babel/core": "^7.1.2",
"@babel/plugin-proposal-class-properties": "^7.1.0",
"@babel/preset-env": "^7.1.0",
"@babel/preset-react": "^7.0.0",
"babel-core": "^6.26.3",
"babel-loader": "^7.1.5",
"babel-loader": "^8.0.4",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-preset-env": "^1.7.0",
"babel-preset-es2015": "^6.24.1",
......@@ -29,8 +37,9 @@
"masonstrap": "https://git.gmu.edu/srct/masonstrap.git",
"react": "^16.4.2",
"react-dom": "^16.4.2",
"reactstrap": "^6.4.0",
"style-loader": "^0.23.0",
"react-router-dom": "^4.3.1",
"reactstrap": "^6.5.0",
"style-loader": "^0.23.1",
"webpack": "^4.16.4",
"webpack-cli": "^3.1.0"
}
......
const path = require("path");
module.exports = {
module: {
rules: [
{
test: /\.jsx$/,
test: /\.(js|jsx)$/,
exclude: /node_modules/,
use: {
loader: "babel-loader"
}
use: ["babel-loader"]
},
{
test: /\.css$/,
......@@ -20,5 +20,12 @@ module.exports = {
]
}
]
},
resolve: {
extensions: ["*", ".js", ".jsx"],
alias: {
Components: path.resolve(__dirname, "./go/go_ahead/src/Components"),
Utils: path.resolve(__dirname, "./go/go_ahead/src/Utils")
}
}
};
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment