Merge branch 'main' into chainchompa/simple-upscale-updates

This commit is contained in:
chainchompa 2024-07-23 13:27:48 -04:00 committed by GitHub
commit bf6066d834
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 48 additions and 3 deletions

View File

@ -1654,6 +1654,12 @@
"missingUpscaleModel": "Missing upscale model",
"missingTileControlNetModel": "No valid tile ControlNet models installed"
},
"upsell": {
"inviteTeammates": "Invite Teammates",
"professional": "Professional",
"professionalUpsell": "Available in Invokes Professional Edition. Click here or visit invoke.com/pricing for more details.",
"shareAccess": "Share Access"
},
"ui": {
"tabs": {
"generation": "Generation",

View File

@ -14,10 +14,18 @@ import { useFeatureStatus } from 'features/system/hooks/useFeatureStatus';
import { discordLink, githubLink } from 'features/system/store/constants';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
import { PiBugBeetleBold, PiInfoBold, PiKeyboardBold, PiToggleRightFill } from 'react-icons/pi';
import {
PiBugBeetleBold,
PiInfoBold,
PiKeyboardBold,
PiShareNetworkFill,
PiToggleRightFill,
PiUsersBold,
} from 'react-icons/pi';
import { RiDiscordFill, RiGithubFill, RiSettings4Line } from 'react-icons/ri';
import SettingsModal from './SettingsModal';
import { SettingsUpsellMenuItem } from './SettingsUpsellMenuItem';
const SettingsMenu = () => {
const { t } = useTranslation();
const { isOpen, onOpen, onClose } = useDisclosure();
@ -28,7 +36,7 @@ const SettingsMenu = () => {
const isGithubLinkEnabled = useFeatureStatus('githubLink');
return (
<Menu isOpen={isOpen} onOpen={onOpen} onClose={onClose}>
<Menu isOpen={isOpen} onOpen={onOpen} onClose={onClose} autoSelect={false}>
<MenuButton
as={IconButton}
variant="link"
@ -36,8 +44,12 @@ const SettingsMenu = () => {
icon={<RiSettings4Line fontSize={20} />}
boxSize={8}
/>
<MenuList zIndex={1}>
<MenuGroup title={t('upsell.professional')}>
<SettingsUpsellMenuItem menuText={t('upsell.inviteTeammates')} menuIcon={PiUsersBold} />
<SettingsUpsellMenuItem menuText={t('upsell.shareAccess')} menuIcon={PiShareNetworkFill} />
</MenuGroup>
<MenuList>
<MenuGroup title={t('common.communityLabel')}>
{isGithubLinkEnabled && (
<MenuItem as="a" href={githubLink} target="_blank" icon={<RiGithubFill />}>

View File

@ -0,0 +1,27 @@
import { Box, Flex, Icon, MenuItem, Text, Tooltip } from '@invoke-ai/ui-library';
import { useTranslation } from 'react-i18next';
import type { IconType } from 'react-icons';
import { PiArrowUpBold } from 'react-icons/pi';
export const SettingsUpsellMenuItem = ({ menuText, menuIcon }: { menuText: string; menuIcon: IconType }) => {
const { t } = useTranslation();
return (
<Tooltip label={t('upsell.professionalUpsell')} placement="right" zIndex={2}>
<MenuItem as="a" href="http://invoke.com/pricing" target="_blank" icon={menuIcon({})}>
<Flex gap="1" alignItems="center">
<Text pb="2px">{menuText}</Text>
<Box>
<Icon
as={PiArrowUpBold}
sx={{
mt: '2px',
fill: 'invokeYellow.500',
}}
/>
</Box>
</Flex>
</MenuItem>
</Tooltip>
);
};