mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-09-20 16:42:58 +00:00
small inconsistencies
This commit is contained in:
@@ -70,7 +70,7 @@ const EditPage = (props)=>{
|
|||||||
const [unsavedChanges, setUnsavedChanges] = useState(false);
|
const [unsavedChanges, setUnsavedChanges] = useState(false);
|
||||||
const [alertTrashedGoogleBrew, setAlertTrashedGoogleBrew] = useState(props.brew.trashed);
|
const [alertTrashedGoogleBrew, setAlertTrashedGoogleBrew] = useState(props.brew.trashed);
|
||||||
const [alertNoGoogleToTransfer, setAlertNoGoogleToTransfer] = useState(false);
|
const [alertNoGoogleToTransfer, setAlertNoGoogleToTransfer] = useState(false);
|
||||||
const [alertOwnershipToTransfer, setalertOwnershipToTransfer] = useState(false);
|
const [alertOwnershipToTransfer, setAlertOwnershipToTransfer] = useState(false);
|
||||||
const [confirmGoogleTransfer, setConfirmGoogleTransfer] = useState(false);
|
const [confirmGoogleTransfer, setConfirmGoogleTransfer] = useState(false);
|
||||||
const [autoSaveEnabled, setAutoSaveEnabled] = useState(true);
|
const [autoSaveEnabled, setAutoSaveEnabled] = useState(true);
|
||||||
const [warnUnsavedChanges, setWarnUnsavedChanges] = useState(true);
|
const [warnUnsavedChanges, setWarnUnsavedChanges] = useState(true);
|
||||||
@@ -106,7 +106,7 @@ const EditPage = (props)=>{
|
|||||||
};
|
};
|
||||||
return ()=>{
|
return ()=>{
|
||||||
document.removeEventListener('keydown', handleControlKeys);
|
document.removeEventListener('keydown', handleControlKeys);
|
||||||
window.onBeforeUnload = null;
|
window.onbeforeunload = null;
|
||||||
};
|
};
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
@@ -184,7 +184,8 @@ const EditPage = (props)=>{
|
|||||||
setalertOwnershipToTransfer(false);
|
setalertOwnershipToTransfer(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
const toggleGoogleStorage = ()=>{
|
const toggleGoogleStorage = (e)=>{
|
||||||
|
closeAlerts(e);
|
||||||
const newSaveGoogle = !saveGoogle;
|
const newSaveGoogle = !saveGoogle;
|
||||||
setSaveGoogle((prev)=>!prev);
|
setSaveGoogle((prev)=>!prev);
|
||||||
setError(null);
|
setError(null);
|
||||||
@@ -269,25 +270,25 @@ const EditPage = (props)=>{
|
|||||||
|
|
||||||
|
|
||||||
{alertOwnershipToTransfer && (
|
{alertOwnershipToTransfer && (
|
||||||
<div className='errorContainer' onClick={closeAlerts}>
|
<div className='errorContainer'>
|
||||||
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'> Okay </div>
|
<div className='confirm' onClick={closeAlerts}> Okay </div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{alertNoGoogleToTransfer && (
|
{alertNoGoogleToTransfer && (
|
||||||
<div className='errorContainer' onClick={closeAlerts}>
|
<div className='errorContainer'>
|
||||||
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'> Sign In </div>
|
<div className='confirm' onClick={closeAlerts}> Sign In </div>
|
||||||
</a>
|
</a>
|
||||||
<div className='deny'> Not Now </div>
|
<div className='deny' onClick={closeAlerts}> Not Now </div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{alertTrashedGoogleBrew && (
|
{alertTrashedGoogleBrew && (
|
||||||
<div className='errorContainer' onClick={closeAlerts}>
|
<div className='errorContainer'>
|
||||||
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>
|
||||||
@@ -295,13 +296,13 @@ const EditPage = (props)=>{
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
{confirmGoogleTransfer && (
|
{confirmGoogleTransfer && (
|
||||||
<div className='errorContainer' onClick={closeAlerts}>
|
<div className='errorContainer'>
|
||||||
{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?'}
|
||||||
<br />
|
<br />
|
||||||
<div className='confirm' onClick={toggleGoogleStorage}> Yes </div>
|
<div className='confirm' onClick={toggleGoogleStorage}> Yes </div>
|
||||||
<div className='deny'> No </div>
|
<div className='deny' onClick={closeAlerts}> No </div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</Nav.item>
|
</Nav.item>
|
||||||
|
|||||||
Reference in New Issue
Block a user