Fix-issue-370 (#9996)
Fixes the issue from introduced when alowing gmail and outlook. fixes https://github.com/twentyhq/core-team-issues/issues/370
This commit is contained in:
@ -1,6 +1,11 @@
|
||||
import { isGoogleCalendarEnabledState } from '@/client-config/states/isGoogleCalendarEnabledState';
|
||||
import { isGoogleMessagingEnabledState } from '@/client-config/states/isGoogleMessagingEnabledState';
|
||||
import { isMicrosoftCalendarEnabledState } from '@/client-config/states/isMicrosoftCalendarEnabledState';
|
||||
import { isMicrosoftMessagingEnabledState } from '@/client-config/states/isMicrosoftMessagingEnabledState';
|
||||
import { useTriggerApisOAuth } from '@/settings/accounts/hooks/useTriggerApiOAuth';
|
||||
import styled from '@emotion/styled';
|
||||
import { useLingui } from '@lingui/react/macro';
|
||||
import { useRecoilValue } from 'recoil';
|
||||
import {
|
||||
Button,
|
||||
Card,
|
||||
@ -33,23 +38,40 @@ export const SettingsAccountsListEmptyStateCard = ({
|
||||
|
||||
const { t } = useLingui();
|
||||
|
||||
const isGoogleMessagingEnabled = useRecoilValue(
|
||||
isGoogleMessagingEnabledState,
|
||||
);
|
||||
const isMicrosoftMessagingEnabled = useRecoilValue(
|
||||
isMicrosoftMessagingEnabledState,
|
||||
);
|
||||
|
||||
const isGoogleCalendarEnabled = useRecoilValue(isGoogleCalendarEnabledState);
|
||||
|
||||
const isMicrosoftCalendarEnabled = useRecoilValue(
|
||||
isMicrosoftCalendarEnabledState,
|
||||
);
|
||||
|
||||
return (
|
||||
<Card>
|
||||
<StyledHeader>{label || t`No connected account`}</StyledHeader>
|
||||
<StyledBody>
|
||||
<Button
|
||||
Icon={IconGoogle}
|
||||
title={t`Connect with Google`}
|
||||
variant="secondary"
|
||||
onClick={() => triggerApisOAuth('google')}
|
||||
/>
|
||||
{(isGoogleMessagingEnabled || isGoogleCalendarEnabled) && (
|
||||
<Button
|
||||
Icon={IconGoogle}
|
||||
title={t`Connect with Google`}
|
||||
variant="secondary"
|
||||
onClick={() => triggerApisOAuth('google')}
|
||||
/>
|
||||
)}
|
||||
|
||||
<Button
|
||||
Icon={IconMicrosoft}
|
||||
title={t`Connect with Microsoft`}
|
||||
variant="secondary"
|
||||
onClick={() => triggerApisOAuth('microsoft')}
|
||||
/>
|
||||
{(isMicrosoftMessagingEnabled || isMicrosoftCalendarEnabled) && (
|
||||
<Button
|
||||
Icon={IconMicrosoft}
|
||||
title={t`Connect with Microsoft`}
|
||||
variant="secondary"
|
||||
onClick={() => triggerApisOAuth('microsoft')}
|
||||
/>
|
||||
)}
|
||||
</StyledBody>
|
||||
</Card>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user