Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{
"terminal.integrated.fontSize": 60
}
}

//terminal size has been increased
8 changes: 8 additions & 0 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
//import the react npm that was installed
import React, { Component } from 'react';
//import the app css styling into this js file
import './App.css';
//import the header js information
import Header from './Header';
//import the section main js information
import SectionMain from './SectionMain';
//import the aside js information
import Aside from './Aside';
//import the footer js information
import Footer from './Footer';

//this creates a class which holds an object which ends up rendering information via react coding
class App extends Component {

render() {
Expand All @@ -19,4 +26,5 @@ class App extends Component {
}
}

//you can export this whole thing to be used in other pages of js now
export default App;
6 changes: 6 additions & 0 deletions src/App.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@

//import react & reactDOM npms into this file
import React from 'react';
import ReactDOM from 'react-dom';

//import app js file into this one
import App from './App';

//looks like this is jasmine testing framework to make sure that everything works I guess

it('renders without crashing', () => {
const div = document.createElement('div');
ReactDOM.render(<App />, div);
Expand Down
4 changes: 4 additions & 0 deletions src/Aside.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
//importing react npm and a component as well I think its in curly brackets because of a default state is required
import React, { Component } from 'react';
//importing aside css styling into this file
import './Aside.css';

//creating a class with the object inside which is rendering the aside page
class Aside extends Component {
render() {
return (
Expand All @@ -11,4 +14,5 @@ class Aside extends Component {
}
}

//exporting the aside file so that it can be used in other files if needed
export default Aside;
4 changes: 4 additions & 0 deletions src/Footer.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
//importing react npm and a component as well I think its in curly brackets because of a default state is required
import React, { Component } from 'react';
//import the footer styling into this file
import './Footer.css';

//creating the class footer with the object and rendering the footer via react
class Footer extends Component {
render() {
return (
Expand All @@ -11,4 +14,5 @@ class Footer extends Component {
}
}

//exporting this file so that it can be used and imported in other files
export default Footer;
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ import './index.css';
import App from './App';
import registerServiceWorker from './registerServiceWorker';


//renders the browser on this main file via react and gets the main root ID and also the registerServiceWorker runs as a function
ReactDOM.render(<App />, document.getElementById('root'));
registerServiceWorker();
5 changes: 4 additions & 1 deletion src/registerServiceWorker.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
// To learn more about the benefits of this model, read https://goo.gl/KwvDNy.
// This link also includes instructions on opting out of this behavior.

//this creates a variable about the local host and what to produce if it is being run locally
const isLocalhost = Boolean(
window.location.hostname === 'localhost' ||
// [::1] is the IPv6 localhost address.
Expand All @@ -18,6 +19,7 @@ const isLocalhost = Boolean(
)
);

//this exports the function register() and its in line with the app being ran in produce and serviceWorker modes
export default function register() {
if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
// The URL constructor is available in all browsers that support SW.
Expand All @@ -28,7 +30,8 @@ export default function register() {
// serve assets; see https://github.com/facebookincubator/create-react-app/issues/2374
return;
}


//there is an event listener and will load different files
window.addEventListener('load', () => {
const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;

Expand Down