make codacy happy

This commit is contained in:
David Ralph
2019-09-26 10:45:54 +01:00
parent 4dc7b4564d
commit 69ebcd7b8b
7 changed files with 15 additions and 18 deletions

View File

@@ -3,7 +3,7 @@ import React from 'react';
const checkTime = (i) => {
if (i < 10) i = '0' + i;
return i;
}
};
export default class Clock extends React.Component {
constructor(...args) {
@@ -16,9 +16,9 @@ export default class Clock extends React.Component {
startTime() {
const today = new Date();
let h = today.getHours();
let ampm = h >= 12 ? 'PM' : 'AM';
const m = checkTime(today.getMinutes());
let h = today.getHours();
const ampm = h >= 12 ? 'PM' : 'AM';
const m = checkTime(today.getMinutes());
// const s = checkTime(today.getSeconds());
if (h > 12) h = h - 12;

View File

@@ -10,7 +10,6 @@ export default class Search extends React.Component {
<h1 id='photographer'></h1>
<div id='backgroundCredits' class='tooltip'><RoomIcon classname='locationicon'/>
<span class='tooltiptext' id='location'></span>
</div>
</div>
);

View File

@@ -9,9 +9,9 @@ export default class Greeting extends React.Component {
}
getGreeting() {
const h = new Date().getHours();
let t = 'Good evening'; // Set the default time string to "Good evening"
if (h < 12) t = 'Good morning'; // If it's before 12am, set the time string to "Good morning"
const h = new Date().getHours();
let t = 'Good evening'; // Set the default time string to "Good evening"
if (h < 12) t = 'Good morning'; // If it's before 12am, set the time string to "Good morning"
else if (h < 18) t = 'Good afternoon'; // If it's before 6pm, set the time string to "Good afternoon"
this.setState({ greeting: t }); // Set the state to the time string
}

View File

@@ -18,8 +18,8 @@ export default class Quote extends React.Component {
this.setState({ quote: data.quote, author: data.author });
} catch (e) {
const randomInt = (min, max) => { return Math.floor(Math.random() * (max - min + 1)) + min; };
const num = randomInt(1, 20);
this.setState({ quote: quotes[num].quote, author: quotes[num].author })
const num = randomInt(1, 20);
this.setState({ quote: quotes[num].quote, author: quotes[num].author });
}
}

View File

@@ -6,7 +6,7 @@ export default class Search extends React.Component {
<div id='searchBar' className='search-bar'>
<form id='searchBar' className='searchbarform' action='https://duckduckgo.com/' onSubmit={('search()')}>
<input type='text' placeholder='Search' name='q' id='searchText'className='searchText' />
<div class="blursearcbBG" />
<div class='blursearcbBG' />
</form>
</div>
);