mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-11-16 20:58:45 +00:00
lint pages
This commit is contained in:
@@ -17,7 +17,6 @@ import Nav from '@navbar/nav.jsx';
|
|||||||
import Navbar from '@navbar/navbar.jsx';
|
import Navbar from '@navbar/navbar.jsx';
|
||||||
import ErrorNavItem from '@navbar/error-navitem.jsx';
|
import ErrorNavItem from '@navbar/error-navitem.jsx';
|
||||||
import googleDriveIcon from '../../../googleDrive.svg';
|
import googleDriveIcon from '../../../googleDrive.svg';
|
||||||
import {Dropdown} from '../../../../components/dropdown/dropdown.jsx';
|
|
||||||
|
|
||||||
const AUTOSAVE_KEY = 'HB_editor_autoSaveOn';
|
const AUTOSAVE_KEY = 'HB_editor_autoSaveOn';
|
||||||
const BREWKEY = 'HB_newPage_content';
|
const BREWKEY = 'HB_newPage_content';
|
||||||
@@ -309,50 +308,51 @@ const EditorPage = (props)=>{
|
|||||||
const renderGoogleDriveIcon = ()=>{
|
const renderGoogleDriveIcon = ()=>{
|
||||||
const errorExists = alertNoGoogleToTransfer || alertOwnershipToTransfer || alertTrashedGoogleBrew || confirmGoogleTransfer;
|
const errorExists = alertNoGoogleToTransfer || alertOwnershipToTransfer || alertTrashedGoogleBrew || confirmGoogleTransfer;
|
||||||
return (<>
|
return (<>
|
||||||
<Nav.header>This brew is in {saveGoogle ? 'Google Drive' : 'The Homebrewery'}</Nav.header>
|
<Nav.header>This brew is in {saveGoogle ? 'Google Drive' : 'The Homebrewery'}</Nav.header>
|
||||||
<Nav.item className='googleDriveStorage' noDismiss='true' onClick={handleGoogleClick}>
|
<Nav.item className='googleDriveStorage' noDismiss='true' onClick={handleGoogleClick}>
|
||||||
{saveGoogle ? 'Transfer to Homebrewery' : 'Transfer to Drive'}
|
{saveGoogle ? 'Transfer to Homebrewery' : 'Transfer to Drive'}
|
||||||
{saveGoogle? '' : <img src={googleDriveIcon} alt='Google Drive icon' /> }
|
{saveGoogle? '' : <img src={googleDriveIcon} alt='Google Drive icon' /> }
|
||||||
</Nav.item>
|
</Nav.item>
|
||||||
{errorExists && <Nav.item className='errorContainer' >
|
{errorExists && <Nav.item className='errorContainer' >
|
||||||
{alertOwnershipToTransfer && (
|
{alertOwnershipToTransfer && (
|
||||||
<>
|
<>
|
||||||
You must be the Owner to transfer between the Homebrewery and Google Drive!
|
You must be the Owner to transfer between the Homebrewery and Google Drive!
|
||||||
The owner of this file is {currentBrew.authors[0]}.
|
The owner of this file is {currentBrew.authors[0]}.
|
||||||
<div className='confirm' onClick={closeAlerts}> Okay </div>
|
<div className='confirm' onClick={closeAlerts}> Okay </div>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{alertNoGoogleToTransfer && (
|
{alertNoGoogleToTransfer && (
|
||||||
<>
|
<>
|
||||||
You must be signed in to a Google account to transfer between the Homebrewery and Google Drive!
|
You must be signed in to a Google account to transfer between the Homebrewery and Google Drive!
|
||||||
<a target='_blank' rel='noopener noreferrer' href={`https://www.naturalcrit.com/login?redirect=${window.location.href}`}>
|
<a target='_blank' rel='noopener noreferrer' href={`https://www.naturalcrit.com/login?redirect=${window.location.href}`}>
|
||||||
<div className='confirm' onClick={closeAlerts}> Sign In </div>
|
<div className='confirm' onClick={closeAlerts}> Sign In </div>
|
||||||
</a>
|
</a>
|
||||||
<div className='deny' onClick={closeAlerts}> Not Now </div>
|
<div className='deny' onClick={closeAlerts}> Not Now </div>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{alertTrashedGoogleBrew && (
|
{alertTrashedGoogleBrew && (
|
||||||
<>
|
<>
|
||||||
This brew is currently in your Trash folder on Google Drive!<br />
|
This brew is currently in your Trash folder on Google Drive!<br />
|
||||||
If you want to keep it, make sure to move it before it is deleted permanently!<br />
|
If you want to keep it, make sure to move it before it is deleted permanently!<br />
|
||||||
<div className='confirm' onClick={toggleGoogleStorage}> Save my brew </div>
|
<div className='confirm' onClick={toggleGoogleStorage}> Save my brew </div>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{confirmGoogleTransfer && (
|
{confirmGoogleTransfer && (
|
||||||
<>
|
<>
|
||||||
{saveGoogle
|
{saveGoogle
|
||||||
? 'Would you like to transfer this brew from your Google Drive storage back to the Homebrewery?'
|
? 'Would you like to transfer this brew from your Google Drive storage back to the Homebrewery?'
|
||||||
: 'Would you like to transfer this brew from the Homebrewery to your personal Google Drive storage?'}
|
: 'Would you like to transfer this brew from the Homebrewery to your personal Google Drive storage?'}
|
||||||
<div className='confirm' onClick={toggleGoogleStorage}> Yes </div>
|
<div className='confirm' onClick={toggleGoogleStorage}> Yes </div>
|
||||||
<div className='deny' onClick={closeAlerts}> No </div>
|
<div className='deny' onClick={closeAlerts}> No </div>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</Nav.item>}
|
</Nav.item>}
|
||||||
</>
|
</>
|
||||||
)};
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
const renderAutoSaveButton = ()=>(
|
const renderAutoSaveButton = ()=>(
|
||||||
@@ -385,7 +385,7 @@ const EditorPage = (props)=>{
|
|||||||
save now
|
save now
|
||||||
</Nav.item>
|
</Nav.item>
|
||||||
{(pageName == 'editPage') && renderAutoSaveButton()}
|
{(pageName == 'editPage') && renderAutoSaveButton()}
|
||||||
{pageName === 'editPage' && <div className="nav-section">
|
{pageName === 'editPage' && <div className='nav-section'>
|
||||||
{renderGoogleDriveIcon()}
|
{renderGoogleDriveIcon()}
|
||||||
</div>}
|
</div>}
|
||||||
</Navbar.File>
|
</Navbar.File>
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ const BrewItem = ({
|
|||||||
const dateFormatString = 'YYYY-MM-DD HH:mm:ss';
|
const dateFormatString = 'YYYY-MM-DD HH:mm:ss';
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={`brewItem${detailsOpen ? ' detailsOpen' : ''}`} onClick={() => setDetailsOpen(!detailsOpen)} >
|
<div className={`brewItem${detailsOpen ? ' detailsOpen' : ''}`} onClick={()=>setDetailsOpen(!detailsOpen)} >
|
||||||
{brew.thumbnail && <div className='thumbnail' style={{ backgroundImage: `url(${brew.thumbnail})` }}></div>}
|
{brew.thumbnail && <div className='thumbnail' style={{ backgroundImage: `url(${brew.thumbnail})` }}></div>}
|
||||||
<div className='text'>
|
<div className='text'>
|
||||||
<h2 title={brew.title}>{brew.title}</h2>
|
<h2 title={brew.title}>{brew.title}</h2>
|
||||||
|
|||||||
@@ -299,8 +299,8 @@ const ListPage = ({ brewCollection = [{ title: '', class: '', brews: [] }], page
|
|||||||
<div className='radio-toggle layout-container'>
|
<div className='radio-toggle layout-container'>
|
||||||
<h6>View:</h6>
|
<h6>View:</h6>
|
||||||
<label className='option' title='grid'>
|
<label className='option' title='grid'>
|
||||||
<input name='layout-mode' type='radio' onChange={(e)=>handleLayoutChange(e, 'grid')} checked={layoutMode === 'grid'} />
|
<input name='layout-mode' type='radio' onChange={(e)=>handleLayoutChange(e, 'grid')} checked={layoutMode === 'grid'} />
|
||||||
<i className='fac compressed-grid'></i>
|
<i className='fac compressed-grid'></i>
|
||||||
</label>
|
</label>
|
||||||
<label className='option' title='list'>
|
<label className='option' title='list'>
|
||||||
<input name='layout-mode' type='radio' onChange={(e)=>handleLayoutChange(e, 'list')} checked={layoutMode === 'list'} />
|
<input name='layout-mode' type='radio' onChange={(e)=>handleLayoutChange(e, 'list')} checked={layoutMode === 'list'} />
|
||||||
@@ -321,24 +321,24 @@ const ListPage = ({ brewCollection = [{ title: '', class: '', brews: [] }], page
|
|||||||
};
|
};
|
||||||
const renderThemePicker = ()=>{
|
const renderThemePicker = ()=>{
|
||||||
return (
|
return (
|
||||||
<div className="radio-toggle theme-container">
|
<div className='radio-toggle theme-container'>
|
||||||
<h6>Theme:</h6>
|
<h6>Theme:</h6>
|
||||||
<label className="option">
|
<label className='option'>
|
||||||
<input type="radio" name="theme" onChange={(e)=>handleThemeChange(e, 'light')} checked={themeMode === 'light'}/>
|
<input type='radio' name='theme' onChange={(e)=>handleThemeChange(e, 'light')} checked={themeMode === 'light'}/>
|
||||||
<i className="fas fa-sun"/>
|
<i className='fas fa-sun'/>
|
||||||
</label>
|
</label>
|
||||||
<label className="option">
|
<label className='option'>
|
||||||
<input type="radio" name="theme" onChange={(e)=>handleThemeChange(e, 'dark')} checked={themeMode === 'dark'}/>
|
<input type='radio' name='theme' onChange={(e)=>handleThemeChange(e, 'dark')} checked={themeMode === 'dark'}/>
|
||||||
<i className="fas fa-moon"/>
|
<i className='fas fa-moon'/>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
)
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const renderNav = () =>{
|
const renderNav = ()=>{
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="listPageNav">
|
<div className='listPageNav'>
|
||||||
{renderLayoutModeOptions()}
|
{renderLayoutModeOptions()}
|
||||||
{renderThemePicker()}
|
{renderThemePicker()}
|
||||||
{renderSortOptions()}
|
{renderSortOptions()}
|
||||||
@@ -347,7 +347,7 @@ const ListPage = ({ brewCollection = [{ title: '', class: '', brews: [] }], page
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='sitePage listPage'>
|
<div className='sitePage listPage'>
|
||||||
@@ -355,7 +355,7 @@ const ListPage = ({ brewCollection = [{ title: '', class: '', brews: [] }], page
|
|||||||
|
|
||||||
{renderNav()}
|
{renderNav()}
|
||||||
|
|
||||||
<div className={`content V3 ${themeMode + 'Mode'}`}>
|
<div className={`content V3 ${`${themeMode}Mode`}`}>
|
||||||
<div className='brewCollection'>{renderBrewCollection(brewCollection)}</div>
|
<div className='brewCollection'>{renderBrewCollection(brewCollection)}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ const SharePage = (props)=>{
|
|||||||
document.removeEventListener('keydown', handleControlKeys);
|
document.removeEventListener('keydown', handleControlKeys);
|
||||||
};
|
};
|
||||||
}, []);
|
}, []);
|
||||||
console.log('brew: ',currentBrew);
|
console.log('brew: ', currentBrew);
|
||||||
return (
|
return (
|
||||||
<div className='sharePage sitePage'>
|
<div className='sharePage sitePage'>
|
||||||
<Meta name='robots' content='noindex, nofollow' />
|
<Meta name='robots' content='noindex, nofollow' />
|
||||||
|
|||||||
Reference in New Issue
Block a user