-
Notifications
You must be signed in to change notification settings - Fork 286
Expand file tree
/
Copy pathAllRead.tsx
More file actions
30 lines (23 loc) · 828 Bytes
/
AllRead.tsx
File metadata and controls
30 lines (23 loc) · 828 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import { type FC, useContext, useMemo } from 'react';
import { AppContext } from '../context/App';
import { Constants } from '../utils/constants';
import { hasAnyFiltersSet } from '../utils/notifications/filters/filter';
import { EmojiSplash } from './layout/EmojiSplash';
interface IAllRead {
fullHeight?: boolean;
}
export const AllRead: FC<IAllRead> = ({ fullHeight = true }: IAllRead) => {
const { settings } = useContext(AppContext);
const hasFilters = hasAnyFiltersSet(settings);
const emoji = useMemo(
() =>
Constants.ALL_READ_EMOJIS[
Math.floor(Math.random() * Constants.ALL_READ_EMOJIS.length)
],
[],
);
const heading = `No new ${hasFilters ? 'filtered ' : ''} notifications`;
return (
<EmojiSplash emoji={emoji} fullHeight={fullHeight} heading={heading} />
);
};