mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-11-24 03:26:57 +00:00
Merge branch 'master' into stopDividerButtonMovement
This commit is contained in:
1 file changed
+12
-14
@@ -236,10 +236,9 @@ const ListPage = ({ brewCollection = [{ title: '', class: '', brews: [] }], navI
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleLayoutChange = (e, mode)=>{
|
const handleLayoutChange = (mode)=>{
|
||||||
setLayoutMode(e.target.checked ? mode : DEFAULT_LAYOUT_MODE);
|
setLayoutMode(mode);
|
||||||
localStorage.setItem(USERPAGE_LAYOUT_MODE, e.target.checked ? mode : DEFAULT_LAYOUT_MODE);
|
localStorage.setItem(USERPAGE_LAYOUT_MODE, mode);
|
||||||
return;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const renderLayoutModeOptions = ()=>{
|
const renderLayoutModeOptions = ()=>{
|
||||||
@@ -247,36 +246,36 @@ const ListPage = ({ brewCollection = [{ title: '', class: '', brews: [] }], navI
|
|||||||
<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={()=>handleLayoutChange('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={()=>handleLayoutChange('list')} checked={layoutMode === 'list'} />
|
||||||
<i className='fas fa-bars'></i>
|
<i className='fas fa-bars'></i>
|
||||||
</label>
|
</label>
|
||||||
<label className='option' title='card'>
|
<label className='option' title='card'>
|
||||||
<input name='layout-mode' type='radio' onChange={(e)=>handleLayoutChange(e, 'card')} checked={layoutMode === 'card'} />
|
<input name='layout-mode' type='radio' onChange={()=>handleLayoutChange('card')} checked={layoutMode === 'card'} />
|
||||||
<i className='fac format-card'></i>
|
<i className='fac format-card'></i>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleThemeChange = (e, mode)=>{
|
const handleThemeChange = (mode)=>{
|
||||||
setThemeMode(e.target.checked ? mode : DEFAULT_THEME_MODE);
|
setThemeMode(mode);
|
||||||
localStorage.setItem(USERPAGE_THEME_MODE, e.target.checked ? mode : DEFAULT_THEME_MODE);
|
localStorage.setItem(USERPAGE_THEME_MODE, mode);
|
||||||
return;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
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={()=>handleThemeChange('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={()=>handleThemeChange('dark')} checked={themeMode === 'dark'}/>
|
||||||
<i className='fas fa-moon'/>
|
<i className='fas fa-moon'/>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
@@ -284,7 +283,6 @@ const ListPage = ({ brewCollection = [{ title: '', class: '', brews: [] }], navI
|
|||||||
};
|
};
|
||||||
|
|
||||||
const renderNav = ()=>{
|
const renderNav = ()=>{
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='listPageNav'>
|
<div className='listPageNav'>
|
||||||
{renderLayoutModeOptions()}
|
{renderLayoutModeOptions()}
|
||||||
|
|||||||
Reference in new issue
Block a user