react-icons/bs#BsCheckAll TypeScript Examples
The following examples show how to use
react-icons/bs#BsCheckAll.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: NotificationsTable.tsx From bluebubbles-server with Apache License 2.0 | 6 votes |
NotificationsTable = ({ notifications }: { notifications: Array<NotificationItem> }): JSX.Element => {
return (
<Table variant="striped" colorScheme="blue">
<TableCaption>
Alerts are normal to have. As long as the server recovers,
you have nothing to worry about. Alerts are mostly helpful when you
are experiencing an issue and want to see if any errors have occured.
</TableCaption>
<Thead>
<Tr>
<Th>Type</Th>
<Th>Notification</Th>
<Th isNumeric>Time / Read</Th>
</Tr>
</Thead>
<Tbody>
{notifications.map(item => (
<Tr key={item.id} color={(item?.read ?? false) ? 'gray.400' : 'current'}>
<Td>
<Icon
ml={2}
fontSize="24"
as={AlertTypeIcon[item.type] ?? AiOutlineWarning}
/>
</Td>
<Td>{item.message}</Td>
<Td isNumeric>
<Flex flexDirection="row" justifyContent='flex-end' alignItems='center'>
<Text mr={1}>{item.timestamp.toLocaleString()}</Text>
{(item?.read ?? false) ? <BsCheckAll fontSize={24} /> : null}
</Flex>
</Td>
</Tr>
))}
</Tbody>
</Table>
);
}
Example #2
Source File: Navigation.tsx From bluebubbles-server with Apache License 2.0 | 5 votes |
Navigation = (): JSX.Element => {
const { isOpen, onOpen, onClose } = useDisclosure();
const {
isOpen: isNotificationsOpen,
onOpen: onNotificationOpen,
onClose: onNotificationClose
} = useDisclosure();
const notifications: Array<NotificationItem> = useAppSelector(state => state.notificationStore.notifications);
const unreadCount = notifications.filter(e => !e.read).length;
const dispatch = useAppDispatch();
return (
<Box minH="100vh">
<Router>
<SidebarContent onClose={() => onClose} display={{ base: 'none', md: 'block' }} />
<Drawer
autoFocus={false}
isOpen={isOpen}
placement="left"
onClose={onClose}
returnFocusOnClose={false}
onOverlayClick={onClose}
size="full"
>
<DrawerContent>
<SidebarContent onClose={onClose} />
</DrawerContent>
</Drawer>
{/* mobilenav */}
<MobileNav onOpen={onOpen} onNotificationOpen={onNotificationOpen} unreadCount={unreadCount} />
<Box ml={{ base: 0, md: 60 }} p="2">
<Routes>
<Route path="/settings" element={<SettingsLayout />} />
<Route path="/logs" element={<LogsLayout />} />
<Route path="/contacts" element={<ContactsLayout />} />
<Route path="/fcm" element={<FcmLayout />} />
<Route path="/devices" element={<DevicesLayout />} />
<Route path="/webhooks" element={<ApiLayout />} />
<Route path="/guides" element={<GuidesLayout />} />
<Route path="/" element={<HomeLayout />} />
</Routes>
</Box>
</Router>
<Drawer onClose={() => closeNotification(onNotificationClose, dispatch)} isOpen={isNotificationsOpen} size="lg">
<DrawerOverlay />
<DrawerContent>
<DrawerHeader>Notifications / Alerts ({unreadCount})</DrawerHeader>
<DrawerBody>
<Menu>
<MenuButton
as={Button}
rightIcon={<BsChevronDown />}
width="12em"mr={5}
mb={4}
>
Manage
</MenuButton>
<MenuList>
<MenuItem icon={<FiTrash />} onClick={() => {
dispatch(clearAlerts());
}}>
Clear Alerts
</MenuItem>
<MenuItem icon={<BsCheckAll />} onClick={() => {
dispatch(readAll());
}}>
Mark All as Read
</MenuItem>
</MenuList>
</Menu>
<NotificationsTable notifications={notifications} />
</DrawerBody>
</DrawerContent>
</Drawer>
</Box>
);
}