mirror of
https://github.com/urbit/shrub.git
synced 2024-12-21 01:41:37 +03:00
hark-fe: add read all button
This commit is contained in:
parent
a7934c1878
commit
f5e4dc2423
@ -76,6 +76,7 @@
|
||||
set-dnd+bo
|
||||
read-count+stats-index
|
||||
read-each+read-graph-index
|
||||
read-all+ul
|
||||
==
|
||||
--
|
||||
::
|
||||
|
@ -109,6 +109,9 @@ export class HarkApi extends BaseApi<StoreState> {
|
||||
seen() {
|
||||
return this.harkAction({ seen: null });
|
||||
}
|
||||
readAll() {
|
||||
return this.harkAction({ 'read-all': null });
|
||||
}
|
||||
|
||||
mute(notif: IndexedNotification) {
|
||||
if('graph' in notif.index && 'graph' in notif.notification.contents) {
|
||||
|
@ -40,6 +40,9 @@ export default function NotificationsScreen(props: any) {
|
||||
const onSubmit = async (values: { groups: string }) => {
|
||||
setFilter({ groups: values.groups ? [values.groups] : [] });
|
||||
};
|
||||
const onReadAll = useCallback(() => {
|
||||
props.api.hark.readAll()
|
||||
}, []);
|
||||
const groupFilterDesc =
|
||||
filter.groups.length === 0
|
||||
? "All"
|
||||
@ -81,6 +84,19 @@ export default function NotificationsScreen(props: any) {
|
||||
</HeaderLink>
|
||||
</Box>
|
||||
</Row>
|
||||
<Row
|
||||
justifyContent="space-between">
|
||||
<Box
|
||||
mr="1"
|
||||
overflow="hidden"
|
||||
onClick={onReadAll}
|
||||
cursor="pointer"
|
||||
>
|
||||
<Text mr="1" color="blue">
|
||||
Mark All Read
|
||||
</Text>
|
||||
</Box>
|
||||
|
||||
<Dropdown
|
||||
alignX="right"
|
||||
alignY="top"
|
||||
@ -115,6 +131,7 @@ export default function NotificationsScreen(props: any) {
|
||||
</Box>
|
||||
</Dropdown>
|
||||
</Row>
|
||||
</Row>
|
||||
{view === "preferences" && (
|
||||
<NotificationPreferences
|
||||
graphConfig={props.notificationsGraphConfig}
|
||||
|
Loading…
Reference in New Issue
Block a user