mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-11-19 20:18:22 +00:00
optimize dropdown usage
This commit is contained in:
@@ -139,23 +139,15 @@ const SnippetBar = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const renderHistoryMenu = ()=>{
|
const renderHistoryMenu = ()=>{
|
||||||
if(!historyExists) return <Dropdown
|
|
||||||
groupName='History'
|
|
||||||
icon='fas fa-clock-rotate-left'
|
|
||||||
className='history'
|
|
||||||
customTrigger={<><i className='fas fa-clock-rotate-left' /></>}
|
|
||||||
disabled
|
|
||||||
>
|
|
||||||
</Dropdown>;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dropdown
|
<Dropdown
|
||||||
groupName='History'
|
groupName='History'
|
||||||
icon='fas fa-clock-rotate-left'
|
icon='fas fa-clock-rotate-left'
|
||||||
className='history'
|
className='history'
|
||||||
customTrigger={<><i className='fas fa-clock-rotate-left' /></>}
|
customTrigger={<><i className='fas fa-clock-rotate-left' /></>}
|
||||||
|
disabled={!historyExists}
|
||||||
>
|
>
|
||||||
{_.map(historyItems, (item, index)=>{
|
{historyExists && _.map(historyItems, (item, index)=>{
|
||||||
if(item.noData || !item.savedAt) return null;
|
if(item.noData || !item.savedAt) return null;
|
||||||
|
|
||||||
const saveTime = new Date(item.savedAt);
|
const saveTime = new Date(item.savedAt);
|
||||||
|
|||||||
Reference in New Issue
Block a user