feat(ui): open in new tab @ hoverable image

This commit is contained in:
psychedelicious 2023-04-24 22:11:37 +10:00
parent bee29714d9
commit c1b10b2222
2 changed files with 9 additions and 1 deletions

View File

@ -99,7 +99,8 @@
"loading": "Loading",
"loadingInvokeAI": "Loading Invoke AI",
"random": "Random",
"generate": "Generate"
"generate": "Generate",
"openInNewTab": "Open in New Tab"
},
"gallery": {
"generations": "Generations",

View File

@ -169,11 +169,18 @@ const HoverableImage = memo((props: HoverableImageProps) => {
// dispatch(setIsLightboxOpen(true));
};
const handleOpenInNewTab = () => {
window.open(getUrl(image.url), '_blank');
};
return (
<ContextMenu<HTMLDivElement>
menuProps={{ size: 'sm', isLazy: true }}
renderMenu={() => (
<MenuList>
<MenuItem onClickCapture={handleOpenInNewTab}>
{t('common.openInNewTab')}
</MenuItem>
{!disabledFeatures.includes('lightbox') && (
<MenuItem onClickCapture={handleLightBox}>
{t('parameters.openInViewer')}