3696 add emails tab empty state on shows (#3702)
* empty inbox * fix No Files alignment * add animation when exiting the screen * update calendar settings to be singular
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 5.7 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
@ -17,6 +17,13 @@ import {
|
|||||||
H1TitleFontColor,
|
H1TitleFontColor,
|
||||||
} from '@/ui/display/typography/components/H1Title';
|
} from '@/ui/display/typography/components/H1Title';
|
||||||
import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';
|
import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';
|
||||||
|
import AnimatedPlaceholder from '@/ui/layout/animated-placeholder/components/AnimatedPlaceholder';
|
||||||
|
import {
|
||||||
|
StyledEmptyContainer,
|
||||||
|
StyledEmptySubTitle,
|
||||||
|
StyledEmptyTextContainer,
|
||||||
|
StyledEmptyTitle,
|
||||||
|
} from '@/ui/layout/animated-placeholder/components/EmptyPlaceholderStyled';
|
||||||
import { Card } from '@/ui/layout/card/components/Card';
|
import { Card } from '@/ui/layout/card/components/Card';
|
||||||
import { Section } from '@/ui/layout/section/components/Section';
|
import { Section } from '@/ui/layout/section/components/Section';
|
||||||
import { getScopeIdFromComponentId } from '@/ui/utilities/recoil-scope/utils/getScopeIdFromComponentId';
|
import { getScopeIdFromComponentId } from '@/ui/utilities/recoil-scope/utils/getScopeIdFromComponentId';
|
||||||
@ -141,14 +148,27 @@ export const EmailThreads = ({
|
|||||||
const { totalNumberOfThreads, timelineThreads }: TimelineThreadsWithTotal =
|
const { totalNumberOfThreads, timelineThreads }: TimelineThreadsWithTotal =
|
||||||
data?.[queryName] ?? [];
|
data?.[queryName] ?? [];
|
||||||
|
|
||||||
|
if (!firstQueryLoading && !timelineThreads?.length) {
|
||||||
|
return (
|
||||||
|
<StyledEmptyContainer>
|
||||||
|
<AnimatedPlaceholder type="emptyInbox" />
|
||||||
|
<StyledEmptyTextContainer>
|
||||||
|
<StyledEmptyTitle>Empty Inbox</StyledEmptyTitle>
|
||||||
|
<StyledEmptySubTitle>
|
||||||
|
No email exchange has occurred with this record yet.
|
||||||
|
</StyledEmptySubTitle>
|
||||||
|
</StyledEmptyTextContainer>
|
||||||
|
</StyledEmptyContainer>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<StyledContainer>
|
<StyledContainer>
|
||||||
<Section>
|
<Section>
|
||||||
<StyledH1Title
|
<StyledH1Title
|
||||||
title={
|
title={
|
||||||
<>
|
<>
|
||||||
Inbox{' '}
|
Inbox <StyledEmailCount>{totalNumberOfThreads}</StyledEmailCount>
|
||||||
<StyledEmailCount>{totalNumberOfThreads ?? 0}</StyledEmailCount>
|
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
fontColor={H1TitleFontColor.Primary}
|
fontColor={H1TitleFontColor.Primary}
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
import { useEffect } from 'react';
|
import { useEffect } from 'react';
|
||||||
import styled from '@emotion/styled';
|
import styled from '@emotion/styled';
|
||||||
import { motion, useMotionValue, useTransform } from 'framer-motion';
|
import { motion, useMotionValue, useTransform } from 'framer-motion';
|
||||||
|
import { animate } from 'framer-motion';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
Background,
|
Background,
|
||||||
@ -56,12 +57,27 @@ const AnimatedPlaceholder = ({ type }: AnimatedPlaceholderProps) => {
|
|||||||
y.set(clientY);
|
y.set(clientY);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleLeave = () => {
|
||||||
|
animate(x, window.innerWidth / 2, {
|
||||||
|
type: 'spring',
|
||||||
|
stiffness: 100,
|
||||||
|
damping: 10,
|
||||||
|
});
|
||||||
|
animate(y, window.innerHeight / 2, {
|
||||||
|
type: 'spring',
|
||||||
|
stiffness: 100,
|
||||||
|
damping: 10,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
window.addEventListener('mousemove', handleMove);
|
window.addEventListener('mousemove', handleMove);
|
||||||
window.addEventListener('touchmove', handleMove);
|
window.addEventListener('touchmove', handleMove);
|
||||||
|
window.document.addEventListener('mouseleave', handleLeave);
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
window.removeEventListener('mousemove', handleMove);
|
window.removeEventListener('mousemove', handleMove);
|
||||||
window.removeEventListener('touchmove', handleMove);
|
window.removeEventListener('touchmove', handleMove);
|
||||||
|
window.document.removeEventListener('mouseleave', handleLeave);
|
||||||
};
|
};
|
||||||
}, [x, y]);
|
}, [x, y]);
|
||||||
|
|
||||||
|
|||||||
@ -9,7 +9,6 @@ export const StyledEmptyContainer = styled.div`
|
|||||||
gap: ${({ theme }) => theme.spacing(6)};
|
gap: ${({ theme }) => theme.spacing(6)};
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin: ${({ theme }) => theme.spacing(16)} 0px;
|
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const StyledEmptyTextContainer = styled.div`
|
export const StyledEmptyTextContainer = styled.div`
|
||||||
|
|||||||
@ -5,6 +5,7 @@ export const Background: Record<string, string> = {
|
|||||||
noTask: '/images/placeholders/background/no_task_bg.png',
|
noTask: '/images/placeholders/background/no_task_bg.png',
|
||||||
errorIndex: '/images/placeholders/background/error_index_bg.png',
|
errorIndex: '/images/placeholders/background/error_index_bg.png',
|
||||||
emptyTimeline: '/images/placeholders/background/empty_timeline_bg.png',
|
emptyTimeline: '/images/placeholders/background/empty_timeline_bg.png',
|
||||||
|
emptyInbox: '/images/placeholders/background/empty_inbox_bg.png',
|
||||||
error404: '/images/placeholders/background/404_bg.png',
|
error404: '/images/placeholders/background/404_bg.png',
|
||||||
error500: '/images/placeholders/background/500_bg.png',
|
error500: '/images/placeholders/background/500_bg.png',
|
||||||
};
|
};
|
||||||
@ -16,6 +17,7 @@ export const MovingImage: Record<string, string> = {
|
|||||||
noTask: '/images/placeholders/moving-image/no_task.png',
|
noTask: '/images/placeholders/moving-image/no_task.png',
|
||||||
errorIndex: '/images/placeholders/moving-image/error_index.png',
|
errorIndex: '/images/placeholders/moving-image/error_index.png',
|
||||||
emptyTimeline: '/images/placeholders/moving-image/empty_timeline.png',
|
emptyTimeline: '/images/placeholders/moving-image/empty_timeline.png',
|
||||||
|
emptyInbox: '/images/placeholders/moving-image/empty_inbox.png',
|
||||||
error404: '/images/placeholders/moving-image/404.png',
|
error404: '/images/placeholders/moving-image/404.png',
|
||||||
error500: '/images/placeholders/moving-image/500.png',
|
error500: '/images/placeholders/moving-image/500.png',
|
||||||
};
|
};
|
||||||
|
|||||||
@ -114,7 +114,7 @@ export const Submenu: Story = {
|
|||||||
/>
|
/>
|
||||||
<NavigationDrawerItem
|
<NavigationDrawerItem
|
||||||
level={2}
|
level={2}
|
||||||
label="Calendars"
|
label="Calendar"
|
||||||
Icon={IconCalendarEvent}
|
Icon={IconCalendarEvent}
|
||||||
soon
|
soon
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user