feat: add Synchronization calendar settings (#4111)
* feat: add Calendar Settings section to Settings/Accounts/Calendars page Closes #4060 * refactor: rename components * feat: add Synchronization calendar settings Closes #4066
This commit is contained in:
@ -14,4 +14,4 @@ const StyledCardMedia = styled.div`
|
|||||||
width: ${({ theme }) => theme.spacing(6)};
|
width: ${({ theme }) => theme.spacing(6)};
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export { StyledCardMedia as SettingsAccountsInboxSettingsCardMedia };
|
export { StyledCardMedia as SettingsAccountsCardMedia };
|
||||||
@ -2,7 +2,7 @@ import { useTheme } from '@emotion/react';
|
|||||||
import styled from '@emotion/styled';
|
import styled from '@emotion/styled';
|
||||||
|
|
||||||
import { MessageChannel } from '@/accounts/types/MessageChannel';
|
import { MessageChannel } from '@/accounts/types/MessageChannel';
|
||||||
import { SettingsAccountsInboxSettingsCardMedia } from '@/settings/accounts/components/SettingsAccountsInboxSettingsCardMedia';
|
import { SettingsAccountsCardMedia } from '@/settings/accounts/components/SettingsAccountsCardMedia';
|
||||||
import { IconUser } from '@/ui/display/icon';
|
import { IconUser } from '@/ui/display/icon';
|
||||||
import { H2Title } from '@/ui/display/typography/components/H2Title';
|
import { H2Title } from '@/ui/display/typography/components/H2Title';
|
||||||
import { Toggle } from '@/ui/input/components/Toggle';
|
import { Toggle } from '@/ui/input/components/Toggle';
|
||||||
@ -42,9 +42,9 @@ export const SettingsAccountsInboxSettingsContactAutoCreateSection = ({
|
|||||||
/>
|
/>
|
||||||
<Card>
|
<Card>
|
||||||
<StyledCardContent>
|
<StyledCardContent>
|
||||||
<SettingsAccountsInboxSettingsCardMedia>
|
<SettingsAccountsCardMedia>
|
||||||
<IconUser size={theme.icon.size.sm} stroke={theme.icon.stroke.lg} />
|
<IconUser size={theme.icon.size.sm} stroke={theme.icon.stroke.lg} />
|
||||||
</SettingsAccountsInboxSettingsCardMedia>
|
</SettingsAccountsCardMedia>
|
||||||
<StyledTitle>Auto-creation</StyledTitle>
|
<StyledTitle>Auto-creation</StyledTitle>
|
||||||
<Toggle
|
<Toggle
|
||||||
value={messageChannel.isContactAutoCreationEnabled}
|
value={messageChannel.isContactAutoCreationEnabled}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import styled from '@emotion/styled';
|
import styled from '@emotion/styled';
|
||||||
|
|
||||||
import { SettingsAccountsInboxSettingsCardMedia } from '@/settings/accounts/components/SettingsAccountsInboxSettingsCardMedia';
|
import { SettingsAccountsCardMedia } from '@/settings/accounts/components/SettingsAccountsCardMedia';
|
||||||
import { H2Title } from '@/ui/display/typography/components/H2Title';
|
import { H2Title } from '@/ui/display/typography/components/H2Title';
|
||||||
import { Radio } from '@/ui/input/components/Radio';
|
import { Radio } from '@/ui/input/components/Radio';
|
||||||
import { Card } from '@/ui/layout/card/components/Card';
|
import { Card } from '@/ui/layout/card/components/Card';
|
||||||
@ -29,7 +29,7 @@ const StyledCardContent = styled(CardContent)`
|
|||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const StyledCardMedia = styled(SettingsAccountsInboxSettingsCardMedia)`
|
const StyledCardMedia = styled(SettingsAccountsCardMedia)`
|
||||||
align-items: stretch;
|
align-items: stretch;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +1,7 @@
|
|||||||
import { useTheme } from '@emotion/react';
|
import { useTheme } from '@emotion/react';
|
||||||
import styled from '@emotion/styled';
|
import styled from '@emotion/styled';
|
||||||
|
|
||||||
import { MessageChannel } from '@/accounts/types/MessageChannel';
|
import { SettingsAccountsCardMedia } from '@/settings/accounts/components/SettingsAccountsCardMedia';
|
||||||
import { SettingsAccountsInboxSettingsCardMedia } from '@/settings/accounts/components/SettingsAccountsInboxSettingsCardMedia';
|
|
||||||
import { IconRefresh } from '@/ui/display/icon';
|
import { IconRefresh } from '@/ui/display/icon';
|
||||||
import { H2Title } from '@/ui/display/typography/components/H2Title';
|
import { H2Title } from '@/ui/display/typography/components/H2Title';
|
||||||
import { Toggle } from '@/ui/input/components/Toggle';
|
import { Toggle } from '@/ui/input/components/Toggle';
|
||||||
@ -23,33 +22,34 @@ const StyledTitle = styled.span`
|
|||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
type SettingsAccountsInboxSettingsSynchronizationSectionProps = {
|
type SettingsAccountsSynchronizationSectionProps = {
|
||||||
messageChannel: MessageChannel;
|
cardTitle: string;
|
||||||
|
description: string;
|
||||||
|
isSynced: boolean;
|
||||||
onToggle: (value: boolean) => void;
|
onToggle: (value: boolean) => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const SettingsAccountsInboxSettingsSynchronizationSection = ({
|
export const SettingsAccountsSynchronizationSection = ({
|
||||||
messageChannel,
|
cardTitle,
|
||||||
|
description,
|
||||||
|
isSynced,
|
||||||
onToggle,
|
onToggle,
|
||||||
}: SettingsAccountsInboxSettingsSynchronizationSectionProps) => {
|
}: SettingsAccountsSynchronizationSectionProps) => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Section>
|
<Section>
|
||||||
<H2Title
|
<H2Title title="Synchronization" description={description} />
|
||||||
title="Synchronization"
|
|
||||||
description="Past and future emails will automatically be synced to this workspace"
|
|
||||||
/>
|
|
||||||
<Card>
|
<Card>
|
||||||
<StyledCardContent>
|
<StyledCardContent>
|
||||||
<SettingsAccountsInboxSettingsCardMedia>
|
<SettingsAccountsCardMedia>
|
||||||
<IconRefresh
|
<IconRefresh
|
||||||
size={theme.icon.size.sm}
|
size={theme.icon.size.sm}
|
||||||
stroke={theme.icon.stroke.lg}
|
stroke={theme.icon.stroke.lg}
|
||||||
/>
|
/>
|
||||||
</SettingsAccountsInboxSettingsCardMedia>
|
</SettingsAccountsCardMedia>
|
||||||
<StyledTitle>Sync emails</StyledTitle>
|
<StyledTitle>{cardTitle}</StyledTitle>
|
||||||
<Toggle value={messageChannel.isSynced} onChange={onToggle} />
|
<Toggle value={isSynced} onChange={onToggle} />
|
||||||
</StyledCardContent>
|
</StyledCardContent>
|
||||||
</Card>
|
</Card>
|
||||||
</Section>
|
</Section>
|
||||||
@ -1,5 +1,6 @@
|
|||||||
import { useParams } from 'react-router-dom';
|
import { useParams } from 'react-router-dom';
|
||||||
|
|
||||||
|
import { SettingsAccountsSynchronizationSection } from '@/settings/accounts/components/SettingsAccountsSynchronizationSection';
|
||||||
import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';
|
import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';
|
||||||
import { getSettingsPagePath } from '@/settings/utils/getSettingsPagePath';
|
import { getSettingsPagePath } from '@/settings/utils/getSettingsPagePath';
|
||||||
import { SettingsPath } from '@/types/SettingsPath';
|
import { SettingsPath } from '@/types/SettingsPath';
|
||||||
@ -30,6 +31,12 @@ export const SettingsAccountsCalendarsSettings = () => {
|
|||||||
{ children: connectedAccount?.handle || '' },
|
{ children: connectedAccount?.handle || '' },
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
|
<SettingsAccountsSynchronizationSection
|
||||||
|
description="Past and future calendar events will automatically be synced to this workspace"
|
||||||
|
cardTitle="Sync events"
|
||||||
|
isSynced={false}
|
||||||
|
onToggle={() => {}}
|
||||||
|
/>
|
||||||
</SettingsPageContainer>
|
</SettingsPageContainer>
|
||||||
</SubMenuTopBarContainer>
|
</SubMenuTopBarContainer>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -63,8 +63,10 @@ export const SettingsAccountsEmailsInboxSettings = () => {
|
|||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
{/* TODO : discuss the desired sync behaviour */}
|
{/* TODO : discuss the desired sync behaviour */}
|
||||||
{/* <SettingsAccountsInboxSettingsSynchronizationSection
|
{/* <SettingsAccountsSynchronizationSection
|
||||||
messageChannel={messageChannel}
|
description="Past and future emails will automatically be synced to this workspace"
|
||||||
|
cardTitle="Sync emails"
|
||||||
|
isSynced={!!messageChannel?.isSynced}
|
||||||
onToggle={handleSynchronizationToggle}
|
onToggle={handleSynchronizationToggle}
|
||||||
/> */}
|
/> */}
|
||||||
<SettingsAccountsInboxSettingsVisibilitySection
|
<SettingsAccountsInboxSettingsVisibilitySection
|
||||||
|
|||||||
Reference in New Issue
Block a user