mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-02 10:42:44 +00:00
tweak comments
This commit is contained in:
@@ -6,10 +6,8 @@ const NaturalCritIcon = require('naturalcrit/svg/naturalcrit.svg.jsx');
|
|||||||
let SAVEKEY = '';
|
let SAVEKEY = '';
|
||||||
|
|
||||||
const AccountPage = (props)=>{
|
const AccountPage = (props)=>{
|
||||||
// destructure props
|
// destructure props and set state for save location
|
||||||
const { accountDetails, brew } = props;
|
const { accountDetails, brew } = props;
|
||||||
|
|
||||||
// State for the save location
|
|
||||||
const [saveLocation, setSaveLocation] = React.useState('');
|
const [saveLocation, setSaveLocation] = React.useState('');
|
||||||
|
|
||||||
// initialize save location from local storage based on user id
|
// initialize save location from local storage based on user id
|
||||||
@@ -23,14 +21,12 @@ const AccountPage = (props)=>{
|
|||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
// function to set the active save location
|
|
||||||
const setActiveSaveLocation = (newSelection)=>{
|
const setActiveSaveLocation = (newSelection)=>{
|
||||||
if(saveLocation === newSelection) return;
|
if(saveLocation === newSelection) return;
|
||||||
window.localStorage.setItem(SAVEKEY, newSelection);
|
window.localStorage.setItem(SAVEKEY, newSelection);
|
||||||
setSaveLocation(newSelection);
|
setSaveLocation(newSelection);
|
||||||
};
|
};
|
||||||
|
|
||||||
// render a button for setting save locations.
|
|
||||||
// todo: should this be a set of radio buttons (well styled) since it's either/or choice?
|
// todo: should this be a set of radio buttons (well styled) since it's either/or choice?
|
||||||
const renderSaveLocationButton = (name, key, shouldRender = true)=>{
|
const renderSaveLocationButton = (name, key, shouldRender = true)=>{
|
||||||
if(!shouldRender) return null;
|
if(!shouldRender) return null;
|
||||||
|
|||||||
Reference in New Issue
Block a user