style: code cleanup

This commit is contained in:
David Ralph
2021-03-19 15:56:48 +00:00
parent 77a0bbe7ee
commit 9ea6c18cd2
15 changed files with 140 additions and 114 deletions

View File

@@ -194,6 +194,6 @@ export default class Background extends React.PureComponent {
}
render() {
return <div id='backgroundImage'></div>;
return <div id='backgroundImage'/>;
}
}

View File

@@ -15,13 +15,13 @@ export default function PhotoInformation(props) {
<h1>{props.language.information}</h1>
<hr/>
<Location/>
<span id='location'></span>
<span id='location'/>
<Camera/>
<span id='camera'></span>
<span id='camera'/>
<Resolution/>
<span id='resolution'></span>
<span id='resolution'/>
<Photographer/>
<span id='photographerCard'></span>
<span id='photographerCard'/>
</div>
<span id='credit' style={{ 'display': 'none' }}></span>
</div>

View File

@@ -72,7 +72,7 @@ export default class Greeting extends React.PureComponent {
// Birthday
const birth = new Date(localStorage.getItem('birthday'));
if (localStorage.getItem('birthdayenabled') === 'true' && birth.getDate() === now.getDate() && birth.getMonth() === now.getMonth()) {
message = 'Happy Birthday';
message = this.props.language.birthday;
}
// Set the state to the greeting string

View File

@@ -14,53 +14,33 @@ import './scss/index.scss';
const Notes = React.lazy(() => import('./Notes'));
const renderLoader = () => <div></div>;
export default class Navbar extends React.PureComponent {
render() {
// toggle refresh button
let refreshHTML = (
<Tooltip title={this.props.language.widgets.navbar.tooltips.refresh}>
<RefreshIcon className='refreshicon topicons' onClick={() => window.location.reload()} />
</Tooltip>
);
export default function Navbar(props) {
return (
<div className='navbar-container'>
{(localStorage.getItem('notesEnabled') === 'true') ?
<div className='notes'>
<NotesIcon className='topicons'/>
<React.Suspense fallback={renderLoader()}>
<Notes language={props.language.widgets.navbar.notes}/>
</React.Suspense>
</div>
:null}
if (localStorage.getItem('refresh') === 'false') {
refreshHTML = null;
}
// toggle feedback button
let feedbackHTML = (
<Tooltip title='Feedback' placement='top'>
<Report className='topicons' onClick={() => this.props.openModal('feedbackModal')} />
</Tooltip>
);
if (Constants.BETA_VERSION === false) {
feedbackHTML = null;
}
// toggle notes
let notesHTML = (
<div className='notes'>
<NotesIcon className='topicons'/>
<React.Suspense fallback={renderLoader()}>
<Notes language={this.props.language.widgets.navbar.notes} />
</React.Suspense>
</div>
);
if (localStorage.getItem('notesEnabled') === 'false') {
notesHTML = null;
}
return (
<div className='navbar-container'>
{notesHTML}
{feedbackHTML}
{refreshHTML}
<Tooltip title={this.props.language.modals.main.navbar.settings} placement='top'>
<Gear className='settings-icon topicons' onClick={() => this.props.openModal('mainModal')} />
{(Constants.BETA_VERSION === true) ?
<Tooltip title='Feedback' placement='top'>
<Report className='topicons' onClick={() => props.openModal('feedbackModal')}/>
</Tooltip>
</div>
);
}
:null}
{(localStorage.getItem('refresh') === 'true') ?
<Tooltip title={props.language.widgets.navbar.tooltips.refresh}>
<RefreshIcon className='refreshicon topicons' onClick={() => window.location.reload()}/>
</Tooltip>
:null}
<Tooltip title={props.language.modals.main.navbar.settings} placement='top'>
<Gear className='settings-icon topicons' onClick={() => props.openModal('mainModal')}/>
</Tooltip>
</div>
);
}

View File

@@ -153,7 +153,8 @@ export default class Quote extends React.PureComponent {
<div className='quotediv'>
<h1 className='quote'>{`${this.state.quote}`}</h1>
<h1 className='quoteauthor'>
<a href={this.state.authorlink} className='quoteauthorlink' target='_blank' rel='noopener noreferrer'>{this.state.author}</a> {this.state.copy} {this.state.tweet} {this.state.favourited}
<a href={this.state.authorlink} className='quoteauthorlink' target='_blank' rel='noopener noreferrer'>{this.state.author}</a>
{this.state.copy} {this.state.tweet} {this.state.favourited}
</h1>
</div>
);