Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ui): settings menu layout #6654

Merged
merged 2 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
MenuGroup,
MenuItem,
MenuList,
Portal,
useDisclosure,
useGlobalMenuClose,
} from '@invoke-ai/ui-library';
Expand Down Expand Up @@ -44,49 +45,51 @@ 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>
<Portal>
<MenuList>
<MenuGroup title={t('upsell.professional')}>
<SettingsUpsellMenuItem menuText={t('upsell.inviteTeammates')} menuIcon={PiUsersBold} />
<SettingsUpsellMenuItem menuText={t('upsell.shareAccess')} menuIcon={PiShareNetworkFill} />
</MenuGroup>

<MenuGroup title={t('common.communityLabel')}>
{isGithubLinkEnabled && (
<MenuItem as="a" href={githubLink} target="_blank" icon={<RiGithubFill />}>
{t('common.githubLabel')}
</MenuItem>
)}
{isBugLinkEnabled && (
<MenuItem as="a" href={`${githubLink}/issues`} target="_blank" icon={<PiBugBeetleBold />}>
{t('common.reportBugLabel')}
</MenuItem>
)}
{isDiscordLinkEnabled && (
<MenuItem as="a" href={discordLink} target="_blank" icon={<RiDiscordFill />}>
{t('common.discordLabel')}
</MenuItem>
)}
</MenuGroup>
<MenuGroup title={t('common.settingsLabel')}>
<HotkeysModal>
<MenuItem as="button" icon={<PiKeyboardBold />}>
{t('common.hotkeysLabel')}
</MenuItem>
</HotkeysModal>
<SettingsModal>
<MenuItem as="button" icon={<PiToggleRightFill />}>
{t('common.settingsLabel')}
</MenuItem>
</SettingsModal>
</MenuGroup>
<MenuGroup title={t('accessibility.about')}>
<AboutModal>
<MenuItem as="button" icon={<PiInfoBold />}>
{t('accessibility.about')}
</MenuItem>
</AboutModal>
</MenuGroup>
</MenuList>
<MenuGroup title={t('common.communityLabel')}>
{isGithubLinkEnabled && (
<MenuItem as="a" href={githubLink} target="_blank" icon={<RiGithubFill />}>
{t('common.githubLabel')}
</MenuItem>
)}
{isBugLinkEnabled && (
<MenuItem as="a" href={`${githubLink}/issues`} target="_blank" icon={<PiBugBeetleBold />}>
{t('common.reportBugLabel')}
</MenuItem>
)}
{isDiscordLinkEnabled && (
<MenuItem as="a" href={discordLink} target="_blank" icon={<RiDiscordFill />}>
{t('common.discordLabel')}
</MenuItem>
)}
</MenuGroup>
<MenuGroup title={t('common.settingsLabel')}>
<HotkeysModal>
<MenuItem as="button" icon={<PiKeyboardBold />}>
{t('common.hotkeysLabel')}
</MenuItem>
</HotkeysModal>
<SettingsModal>
<MenuItem as="button" icon={<PiToggleRightFill />}>
{t('common.settingsLabel')}
</MenuItem>
</SettingsModal>
</MenuGroup>
<MenuGroup title={t('accessibility.about')}>
<AboutModal>
<MenuItem as="button" icon={<PiInfoBold />}>
{t('accessibility.about')}
</MenuItem>
</AboutModal>
</MenuGroup>
</MenuList>
</Portal>
</Menu>
);
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Box, Flex, Icon, MenuItem, Text, Tooltip } from '@invoke-ai/ui-library';
import { 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';
Expand All @@ -7,19 +7,11 @@ export const SettingsUpsellMenuItem = ({ menuText, menuIcon }: { menuText: strin
const { t } = useTranslation();

return (
<Tooltip label={t('upsell.professionalUpsell')} placement="right" zIndex={2}>
<Tooltip label={t('upsell.professionalUpsell')} placement="right" gutter={16}>
<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 gap="1" alignItems="center" justifyContent="space-between">
<Text>{menuText}</Text>
<Icon as={PiArrowUpBold} color="invokeYellow.500" />
</Flex>
</MenuItem>
</Tooltip>
Expand Down
Loading