From 5635f65ee9e286e0a234580f392f9081a6fd9086 Mon Sep 17 00:00:00 2001 From: Mary Hipp Date: Tue, 23 Jul 2024 10:34:11 -0400 Subject: [PATCH] feat(ui): add upsells for pro edition to settings menu --- invokeai/frontend/web/public/locales/en.json | 6 +++++ .../components/SettingsModal/SettingsMenu.tsx | 18 ++++++++++--- .../SettingsModal/SettingsUpsellMenuItem.tsx | 27 +++++++++++++++++++ 3 files changed, 48 insertions(+), 3 deletions(-) create mode 100644 invokeai/frontend/web/src/features/system/components/SettingsModal/SettingsUpsellMenuItem.tsx diff --git a/invokeai/frontend/web/public/locales/en.json b/invokeai/frontend/web/public/locales/en.json index 8fc600d6c9..70b44a301f 100644 --- a/invokeai/frontend/web/public/locales/en.json +++ b/invokeai/frontend/web/public/locales/en.json @@ -1654,6 +1654,12 @@ "missingUpscaleModel": "Missing upscale model", "missingTileControlNetModel": "No valid tile ControlNet models installed" }, + "upsell": { + "inviteTeammates": "Invite Teammates", + "professional": "Professional", + "professionalUpsell": "Available in Invokeā€™s Professional Edition. Click here or visit invoke.com/pricing for more details.", + "shareAccess": "Share Access" + }, "ui": { "tabs": { "generation": "Generation", diff --git a/invokeai/frontend/web/src/features/system/components/SettingsModal/SettingsMenu.tsx b/invokeai/frontend/web/src/features/system/components/SettingsModal/SettingsMenu.tsx index b424a129ee..2e0bd637c1 100644 --- a/invokeai/frontend/web/src/features/system/components/SettingsModal/SettingsMenu.tsx +++ b/invokeai/frontend/web/src/features/system/components/SettingsModal/SettingsMenu.tsx @@ -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 ( - + { icon={} boxSize={8} /> + + + + + - {isGithubLinkEnabled && ( }> diff --git a/invokeai/frontend/web/src/features/system/components/SettingsModal/SettingsUpsellMenuItem.tsx b/invokeai/frontend/web/src/features/system/components/SettingsModal/SettingsUpsellMenuItem.tsx new file mode 100644 index 0000000000..f9d9f88f11 --- /dev/null +++ b/invokeai/frontend/web/src/features/system/components/SettingsModal/SettingsUpsellMenuItem.tsx @@ -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 ( + + + + {menuText} + + + + + + + ); +};