mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
feat(ui): tweak menu style, increase icon size
feat(ui) use `as` for menuitem links I had requested this be done with the chakra `Link` component, but actually using `as` is correct according to the docs. For other components, you are supposed to use `Link` but looks like `MenuItem` has this built in. Fixed in all places where we use it. Also: - fix github icon - give menu hamburger button padding - add menu motion props so it animates the same as other menus feat(ui): restore ColorModeButton @maryhipp chore(ui): lint feat(ui): remove colormodebutton again sry
This commit is contained in:
parent
819136c345
commit
dc8c3d8073
@ -1,5 +1,6 @@
|
|||||||
import { Link, MenuItem } from '@chakra-ui/react';
|
import { MenuItem } from '@chakra-ui/react';
|
||||||
import { createSelector } from '@reduxjs/toolkit';
|
import { createSelector } from '@reduxjs/toolkit';
|
||||||
|
import { skipToken } from '@reduxjs/toolkit/dist/query';
|
||||||
import { useAppToaster } from 'app/components/Toaster';
|
import { useAppToaster } from 'app/components/Toaster';
|
||||||
import { stateSelector } from 'app/store/store';
|
import { stateSelector } from 'app/store/store';
|
||||||
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
||||||
@ -33,10 +34,9 @@ import {
|
|||||||
useRemoveImageFromBoardMutation,
|
useRemoveImageFromBoardMutation,
|
||||||
} from 'services/api/endpoints/images';
|
} from 'services/api/endpoints/images';
|
||||||
import { ImageDTO } from 'services/api/types';
|
import { ImageDTO } from 'services/api/types';
|
||||||
|
import { useDebounce } from 'use-debounce';
|
||||||
import { AddImageToBoardContext } from '../../../../app/contexts/AddImageToBoardContext';
|
import { AddImageToBoardContext } from '../../../../app/contexts/AddImageToBoardContext';
|
||||||
import { sentImageToCanvas, sentImageToImg2Img } from '../../store/actions';
|
import { sentImageToCanvas, sentImageToImg2Img } from '../../store/actions';
|
||||||
import { useDebounce } from 'use-debounce';
|
|
||||||
import { skipToken } from '@reduxjs/toolkit/dist/query';
|
|
||||||
|
|
||||||
type SingleSelectionMenuItemsProps = {
|
type SingleSelectionMenuItemsProps = {
|
||||||
imageDTO: ImageDTO;
|
imageDTO: ImageDTO;
|
||||||
@ -154,21 +154,29 @@ const SingleSelectionMenuItems = (props: SingleSelectionMenuItemsProps) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Link href={imageDTO.image_url} target="_blank">
|
<MenuItem
|
||||||
<MenuItem icon={<FaExternalLinkAlt />}>
|
as="a"
|
||||||
{t('common.openInNewTab')}
|
href={imageDTO.image_url}
|
||||||
</MenuItem>
|
target="_blank"
|
||||||
</Link>
|
icon={<FaExternalLinkAlt />}
|
||||||
|
>
|
||||||
|
{t('common.openInNewTab')}
|
||||||
|
</MenuItem>
|
||||||
{isClipboardAPIAvailable && (
|
{isClipboardAPIAvailable && (
|
||||||
<MenuItem icon={<FaCopy />} onClickCapture={handleCopyImage}>
|
<MenuItem icon={<FaCopy />} onClickCapture={handleCopyImage}>
|
||||||
{t('parameters.copyImage')}
|
{t('parameters.copyImage')}
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
)}
|
)}
|
||||||
<Link download={true} href={imageDTO.image_url} target="_blank">
|
<MenuItem
|
||||||
<MenuItem icon={<FaDownload />} w="100%">
|
as="a"
|
||||||
{t('parameters.downloadImage')}
|
download={true}
|
||||||
</MenuItem>
|
href={imageDTO.image_url}
|
||||||
</Link>
|
target="_blank"
|
||||||
|
icon={<FaDownload />}
|
||||||
|
w="100%"
|
||||||
|
>
|
||||||
|
{t('parameters.downloadImage')}
|
||||||
|
</MenuItem>
|
||||||
<MenuItem
|
<MenuItem
|
||||||
icon={<FaQuoteRight />}
|
icon={<FaQuoteRight />}
|
||||||
onClickCapture={handleRecallPrompt}
|
onClickCapture={handleRecallPrompt}
|
||||||
|
@ -1,16 +1,29 @@
|
|||||||
import { Flex, Link, MenuGroup, Spacer } from '@chakra-ui/react';
|
import {
|
||||||
import { memo } from 'react';
|
Flex,
|
||||||
import StatusIndicator from './StatusIndicator';
|
Menu,
|
||||||
|
MenuButton,
|
||||||
import { Menu, MenuButton, MenuItem, MenuList } from '@chakra-ui/react';
|
MenuGroup,
|
||||||
|
MenuItem,
|
||||||
|
MenuList,
|
||||||
|
Spacer,
|
||||||
|
} from '@chakra-ui/react';
|
||||||
import IAIIconButton from 'common/components/IAIIconButton';
|
import IAIIconButton from 'common/components/IAIIconButton';
|
||||||
|
import { memo } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { FaBars, FaBug, FaDiscord, FaKeyboard } from 'react-icons/fa';
|
import {
|
||||||
import { MdSettings } from 'react-icons/md';
|
FaBars,
|
||||||
|
FaBug,
|
||||||
|
FaCog,
|
||||||
|
FaDiscord,
|
||||||
|
FaGithub,
|
||||||
|
FaKeyboard,
|
||||||
|
} from 'react-icons/fa';
|
||||||
|
import { menuListMotionProps } from 'theme/components/menu';
|
||||||
import { useFeatureStatus } from '../hooks/useFeatureStatus';
|
import { useFeatureStatus } from '../hooks/useFeatureStatus';
|
||||||
import HotkeysModal from './HotkeysModal/HotkeysModal';
|
import HotkeysModal from './HotkeysModal/HotkeysModal';
|
||||||
import InvokeAILogoComponent from './InvokeAILogoComponent';
|
import InvokeAILogoComponent from './InvokeAILogoComponent';
|
||||||
import SettingsModal from './SettingsModal/SettingsModal';
|
import SettingsModal from './SettingsModal/SettingsModal';
|
||||||
|
import StatusIndicator from './StatusIndicator';
|
||||||
|
|
||||||
const SiteHeader = () => {
|
const SiteHeader = () => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
@ -39,29 +52,39 @@ const SiteHeader = () => {
|
|||||||
variant="link"
|
variant="link"
|
||||||
aria-label={t('accessibility.menu')}
|
aria-label={t('accessibility.menu')}
|
||||||
icon={<FaBars />}
|
icon={<FaBars />}
|
||||||
|
sx={{ boxSize: 8 }}
|
||||||
/>
|
/>
|
||||||
<MenuList>
|
<MenuList motionProps={menuListMotionProps}>
|
||||||
<MenuGroup title={t('common.communityLabel')}>
|
<MenuGroup title={t('common.communityLabel')}>
|
||||||
{isGithubLinkEnabled && (
|
{isGithubLinkEnabled && (
|
||||||
<Link href={githubLink} target="_blank">
|
<MenuItem
|
||||||
<MenuItem icon={<FaDiscord />}>
|
as="a"
|
||||||
{t('common.githubLabel')}
|
href={githubLink}
|
||||||
</MenuItem>
|
target="_blank"
|
||||||
</Link>
|
icon={<FaGithub />}
|
||||||
|
>
|
||||||
|
{t('common.githubLabel')}
|
||||||
|
</MenuItem>
|
||||||
)}
|
)}
|
||||||
{isBugLinkEnabled && (
|
{isBugLinkEnabled && (
|
||||||
<Link href={`${githubLink}/issues`} target="_blank">
|
<MenuItem
|
||||||
<MenuItem icon={<FaBug />}>
|
as="a"
|
||||||
{t('common.reportBugLabel')}
|
href={`${githubLink}/issues`}
|
||||||
</MenuItem>
|
target="_blank"
|
||||||
</Link>
|
icon={<FaBug />}
|
||||||
|
>
|
||||||
|
{t('common.reportBugLabel')}
|
||||||
|
</MenuItem>
|
||||||
)}
|
)}
|
||||||
{isDiscordLinkEnabled && (
|
{isDiscordLinkEnabled && (
|
||||||
<Link href={discordLink} target="_blank">
|
<MenuItem
|
||||||
<MenuItem icon={<FaDiscord />}>
|
as="a"
|
||||||
{t('common.discordLabel')}
|
href={discordLink}
|
||||||
</MenuItem>
|
target="_blank"
|
||||||
</Link>
|
icon={<FaDiscord />}
|
||||||
|
>
|
||||||
|
{t('common.discordLabel')}
|
||||||
|
</MenuItem>
|
||||||
)}
|
)}
|
||||||
</MenuGroup>
|
</MenuGroup>
|
||||||
<MenuGroup title={t('common.settingsLabel')}>
|
<MenuGroup title={t('common.settingsLabel')}>
|
||||||
@ -71,7 +94,7 @@ const SiteHeader = () => {
|
|||||||
</MenuItem>
|
</MenuItem>
|
||||||
</HotkeysModal>
|
</HotkeysModal>
|
||||||
<SettingsModal>
|
<SettingsModal>
|
||||||
<MenuItem as="button" icon={<MdSettings />}>
|
<MenuItem as="button" icon={<FaCog />}>
|
||||||
{t('common.settingsLabel')}
|
{t('common.settingsLabel')}
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
</SettingsModal>
|
</SettingsModal>
|
||||||
|
@ -33,12 +33,16 @@ const invokeAI = definePartsStyle((props) => ({
|
|||||||
bg: mode('base.200', 'base.800')(props),
|
bg: mode('base.200', 'base.800')(props),
|
||||||
_hover: {
|
_hover: {
|
||||||
bg: mode('base.300', 'base.700')(props),
|
bg: mode('base.300', 'base.700')(props),
|
||||||
|
svg: {
|
||||||
|
opacity: 1,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
_focus: {
|
_focus: {
|
||||||
bg: mode('base.400', 'base.600')(props),
|
bg: mode('base.400', 'base.600')(props),
|
||||||
},
|
},
|
||||||
svg: {
|
svg: {
|
||||||
opacity: 0.5,
|
opacity: 0.7,
|
||||||
|
fontSize: 14,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user