Skip to content

Commit

Permalink
Code clean up and adding comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Femi236 committed Feb 8, 2021
1 parent d853a66 commit 30e1fef
Show file tree
Hide file tree
Showing 10 changed files with 60 additions and 372 deletions.
24 changes: 1 addition & 23 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,29 +25,7 @@
crossorigin="anonymous"
/>

<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
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>
</head>
<body id="root" class="d-flex h-100 text-center text-white mybg">
<noscript>You need to enable JavaScript to run this app.</noscript>

<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
<body id="root" class="d-flex h-100 text-center text-white mybg"></body>
</html>
14 changes: 7 additions & 7 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import React, { Component } from "react";
//import "./App.css";

import "./cover.css";
import "weather-icons/css/weather-icons.css";

import LoadPage from "./components/loadPage";
import Clock from "./components/clock";
import "weather-icons/css/weather-icons.css";
import Weather from "./components/weather";
import Spotify from "./components/spotify";
import ImageSlideshow from "./components/imagelideshow";
Expand All @@ -13,15 +14,16 @@ class App extends Component {
constructor() {
super();
this.state = {
render: false, //Set render state to false
// Initially set render state to false to allow loadPage component to show
render: false,
};
}

componentDidMount() {
setTimeout(
function () {
//Start the timer
this.setState({ render: true }); //After 3 seconds, set render to true
//Start the timer, After 3 seconds, set render to true
this.setState({ render: true });
}.bind(this),
3000
);
Expand Down Expand Up @@ -63,8 +65,6 @@ class App extends Component {
<Quote />
</div>
</div>

{/* <div className="row container-fluid h1"></div> */}
</React.Fragment>
);
}
Expand Down
5 changes: 3 additions & 2 deletions src/components/clock.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,15 @@ class Clock extends Component {
};

componentDidMount() {
this.tmerId = setInterval(() => this.tick(), 1000);
this.timerId = setInterval(() => this.tick(), 1000);
}

componentWillUnmount() {
clearInterval(this.tmerId);
clearInterval(this.timerId);
}

returnedTime = (props) => {
// Return different parts of the time depending on the type of component called
if (this.props.type === 1) {
return this.state.date.toLocaleTimeString();
} else if (this.props.type === 2) {
Expand Down
293 changes: 0 additions & 293 deletions src/components/exampleSpotifyObject

This file was deleted.

Loading

0 comments on commit 30e1fef

Please sign in to comment.