• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

alkem-io / client-web / #9533

05 Dec 2024 02:27PM UTC coverage: 5.947%. First build
#9533

Pull #7254

travis-ci

Pull Request #7254: In-app Notifications v1 for Beta Testers

194 of 10628 branches covered (1.83%)

Branch coverage included in aggregate %.

40 of 177 new or added lines in 15 files covered. (22.6%)

1532 of 18394 relevant lines covered (8.33%)

0.19 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/main/inAppNotifications/InAppNotificationsList.tsx
1
import { useTranslation } from 'react-i18next';
2
import { useInAppNotifications } from './useInAppNotifications';
3
import { InAppNotificationItem } from './InAppNotificationItem';
4
import Loading from '@/core/ui/loading/Loading';
5
import { Caption } from '@/core/ui/typography';
6
import Gutters from '@/core/ui/grid/Gutters';
7
import { Box } from '@mui/material';
NEW
8
import useLazyLoading from '@/domain/shared/pagination/useLazyLoading';
×
NEW
9

×
NEW
10
const Loader = ({ ref }) => (
×
11
  <Box ref={ref} display="flex" justifyContent="center" padding={2}>
NEW
12
    <Loading />
×
NEW
13
  </Box>
×
NEW
14
);
×
15

16
export const InAppNotificationsList = () => {
17
  const { t } = useTranslation();
18
  const { notificationsInApp, isLoading, fetchMore, hasMore } = useInAppNotifications();
19

20
  const loader = useLazyLoading(Loader, {
NEW
21
    fetchMore,
×
22
    loading: isLoading,
23
    hasMore,
24
  });
25

26
  if (notificationsInApp.length === 0) {
27
    if (isLoading) {
NEW
28
      return (
×
29
        <Gutters alignItems={'center'}>
30
          <Loading />
NEW
31
        </Gutters>
×
32
      );
33
    }
34

35
    return (
36
      <Gutters alignItems={'center'}>
37
        <Caption>{t('components.inAppNotifications.emptyInbox')}</Caption>
38
      </Gutters>
39
    );
40
  }
41

42
  return (
43
    <>
44
      {notificationsInApp.map(item => (
45
        <InAppNotificationItem key={`${item.id}-notification`} {...item} />
46
      ))}
47
      {loader}
48
    </>
49
  );
50
};
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc