Commit 27209ea8 authored by David Haynes's avatar David Haynes 🙆

Merge branch 'gothree-frontend' of git.gmu.edu:srct/go into gothree-frontend

parents 04796779 f4608639
Pipeline #3255 passed with stage
in 53 seconds
import React from 'react';
import ReactDOM from 'react-dom';
import { HashRouter, Route, Link } from 'react-router-dom';
// Apply Global Masonstrap styling
import "masonstrap/build/css/masonstrap.min.css";
import "masonstrap/build/js/masonstrap.min.js";
import { Routes } from 'Utils';
// const App = () => (
// <PageTemplate>
// <Routes />
// </PageTemplate>
// );
ReactDOM.render(
<HashRouter>
<Routes />
</HashRouter>,
document.getElementById('root')
);
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 } from 'Components';
export default class HomePage extends React.Component {
render() {
return (
<PageTemplate page={'home'}>
<p>Hello World! 1</p>
</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';
export {
//Tempaltes
PageTemplate,
//Pages
HomePage,
AboutPage,
DhaynesPage,
//Organisms
NavBar,
};
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 };
...@@ -2,3 +2,4 @@ from django.shortcuts import render ...@@ -2,3 +2,4 @@ from django.shortcuts import render
def index(request): def index(request):
return render(request, 'index.html') return render(request, 'index.html')
...@@ -2,24 +2,32 @@ ...@@ -2,24 +2,32 @@
"name": "go", "name": "go",
"version": "3.0", "version": "3.0",
"description": "University-branded URL shortening", "description": "University-branded URL shortening",
"main": "index.js", "main": "App.js",
"repository": "git@git.gmu.edu:srct/go.git", "repository": "git@git.gmu.edu:srct/go.git",
"author": "Mason SRCT", "author": "Mason SRCT",
"license": "Apache-2.0", "license": "Apache-2.0",
"private": false, "private": false,
"scripts": { "scripts": {
"dev": "webpack --mode development ./go/go_ahead/src/index.jsx --output ./go/static/main.js --watch", "start": "yarn dev",
"build": "webpack --mode production ./project/frontend/src/index.js --output ./go/static/main.js" "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": { "babel": {
"presets": [ "presets": [
"es2015", "@babel/preset-env",
"react" "@babel/preset-react"
],
"plugins": [
"@babel/plugin-proposal-class-properties"
] ]
}, },
"dependencies": { "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-core": "^6.26.3",
"babel-loader": "^7.1.5", "babel-loader": "^8.0.4",
"babel-plugin-transform-class-properties": "^6.24.1", "babel-plugin-transform-class-properties": "^6.24.1",
"babel-preset-env": "^1.7.0", "babel-preset-env": "^1.7.0",
"babel-preset-es2015": "^6.24.1", "babel-preset-es2015": "^6.24.1",
...@@ -29,8 +37,9 @@ ...@@ -29,8 +37,9 @@
"masonstrap": "https://git.gmu.edu/srct/masonstrap.git", "masonstrap": "https://git.gmu.edu/srct/masonstrap.git",
"react": "^16.4.2", "react": "^16.4.2",
"react-dom": "^16.4.2", "react-dom": "^16.4.2",
"reactstrap": "^6.4.0", "react-router-dom": "^4.3.1",
"style-loader": "^0.23.0", "reactstrap": "^6.5.0",
"style-loader": "^0.23.1",
"webpack": "^4.16.4", "webpack": "^4.16.4",
"webpack-cli": "^3.1.0" "webpack-cli": "^3.1.0"
} }
......
const path = require("path");
module.exports = { module.exports = {
module: { module: {
rules: [ rules: [
{ {
test: /\.jsx$/, test: /\.(js|jsx)$/,
exclude: /node_modules/, exclude: /node_modules/,
use: { use: ["babel-loader"]
loader: "babel-loader"
}
}, },
{ {
test: /\.css$/, test: /\.css$/,
...@@ -20,5 +20,12 @@ module.exports = { ...@@ -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