Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul404notfound committed Jun 26, 2019
1 parent dd19eb4 commit 53a6e79
Show file tree
Hide file tree
Showing 13 changed files with 1,014 additions and 27 deletions.
881 changes: 879 additions & 2 deletions package-lock.json

Large diffs are not rendered by default.

18 changes: 15 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@
"react-scripts": "3.0.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"build-css": "node-sass-chokidar --include-path ./src --include-path ./node_modules src/ -o ../css",
"watch-css": "npm run build-css && node-sass-chokidar --include-path ./src/styles --include-path ./node_modules src/ -o ./src/css --watch --recursive",
"start-js": "react-scripts start",
"start": "npm-run-all -p watch-css start-js",
"build-js": "react-scripts build",
"lint": "esw webpack.config.* src --ext .js,.jsx tools --color",
"build": "npm-run-all build-css build-js",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
},
"eslintConfig": {
Expand All @@ -27,5 +32,12 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"enzyme": "^3.5.0",
"enzyme-adapter-react-16": "^1.3.1",
"enzyme-to-json": "^3.3.4",
"node-sass-chokidar": "^1.3.3",
"npm-run-all": "^4.1.3"
}
}
Binary file added public/images/anu-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/header-back.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/hero.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 8 additions & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,14 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
<title>Crawford School of Public Policy</title>
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-M9MCPC4');</script>
<!-- End Google Tag Manager -->
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
58 changes: 37 additions & 21 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,42 @@
import React from 'react';
import logo from './logo.svg';
import React, { Component } from 'react';
import Header from './components/Header'
import './App.css';

function App() {
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>
Edit <code>src/App.js</code> and save to reload.
</p>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
</header>
</div>
);
// function App() {
// return (
// <div className="App">
// <header className="App-header">
// <img src={logo} className="App-logo" alt="logo" />
// <p>
// Edit <code>src/App.js</code> and save to reload.
// </p>
// <a
// className="App-link"
// href="https://reactjs.org"
// target="_blank"
// rel="noopener noreferrer"
// >
// Learn React
// </a>
// </header>
// </div>
// );
// }

class App extends Component{
render(){
return (
<div className="Container">
<Header />

</div>
);
}
}






export default App;
27 changes: 27 additions & 0 deletions src/components/Header.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import React, { Component } from 'react';
import ResponsiveImage from './ResponsiveImage';
import '../css/styles/sass/header.css';

class Header extends Component {
render(){
return (
<header className="anu-header">
<div className="wrapper">
<div className="top">
<div className="tagline">
Crawford School <br />of Public Policy
</div>
<ResponsiveImage imageName="anu-logo" class="anu-logo" />
</div>
<div className="bottom">
<div><p><strong>Scott Thomson</strong> is currently completing a Master of Environmental and Resource Economics</p></div>
<p><strong>Are you ready to apply your knowledge of economics to tackle broader issues such as climate change mitigation, poverty reduction, and international trade?</strong></p>
</div>
<ResponsiveImage imageName="hero"/>
</div>
</header>
)
}
}

export default Header;
42 changes: 42 additions & 0 deletions src/components/ResponsiveImage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';

const PATH = 'images/';

class Feature extends Component {
constructor(props) {
super(props);

this.state = {
small: PATH + props.imageName + '.' + props.fileType,
medium: PATH + props.imageName + '@2x.' + props.fileType,
}
}

render() {
return (
<img
src={this.state.small}
srcSet={`${this.state.small} 700w, ${this.state.medium} 1000w`}
alt={this.props.alt}
className={this.props.class}
/>
);
}
}

Feature.propTypes = {
alt: PropTypes.string,
class: PropTypes.string,
imageName: PropTypes.string,
fileType: PropTypes.string,
}

Feature.defaultProps = {
alt: '',
class: 'image',
imageName: 'flexible',
fileType: 'png',
}

export default Feature;
4 changes: 4 additions & 0 deletions src/css/styles/sass/header.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
header.anu-header {
position: relative;
background: url(../../../../public/images/header-back.png);
}
2 changes: 2 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ ReactDOM.render(<App />, document.getElementById('root'));
// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://bit.ly/CRA-PWA

//registerServiceWorker();
serviceWorker.unregister();

0 comments on commit 53a6e79

Please sign in to comment.