Add mark requests as read to chat settings menu (#11107)
This commit is contained in:
@@ -41,7 +41,10 @@ import {ArrowRotateCounterClockwise_Stroke2_Corner0_Rounded as RetryIcon} from '
|
|||||||
import {BubbleSmile_Stroke2_Corner2_Rounded_Large as BubbleSmileIcon} from '#/components/icons/Bubble'
|
import {BubbleSmile_Stroke2_Corner2_Rounded_Large as BubbleSmileIcon} from '#/components/icons/Bubble'
|
||||||
import {CircleCheck_Stroke2_Corner0_Rounded as CircleCheckIcon} from '#/components/icons/CircleCheck'
|
import {CircleCheck_Stroke2_Corner0_Rounded as CircleCheckIcon} from '#/components/icons/CircleCheck'
|
||||||
import {CircleInfo_Stroke2_Corner0_Rounded as CircleInfoIcon} from '#/components/icons/CircleInfo'
|
import {CircleInfo_Stroke2_Corner0_Rounded as CircleInfoIcon} from '#/components/icons/CircleInfo'
|
||||||
import {Inbox_Stroke2_Corner2_Rounded_Large as InboxLargeIcon} from '#/components/icons/Inbox'
|
import {
|
||||||
|
Inbox_Stroke2_Corner2_Rounded as InboxIcon,
|
||||||
|
Inbox_Stroke2_Corner2_Rounded_Large as InboxLargeIcon,
|
||||||
|
} from '#/components/icons/Inbox'
|
||||||
import {
|
import {
|
||||||
MessagePlus_Stroke2_Corner0_Rounded as MessagePlusIcon,
|
MessagePlus_Stroke2_Corner0_Rounded as MessagePlusIcon,
|
||||||
MessagePlus_Stroke2_Corner0_Rounded as NewChatIcon,
|
MessagePlus_Stroke2_Corner0_Rounded as NewChatIcon,
|
||||||
@@ -635,6 +638,15 @@ function ChatSettingsMenu({
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const {mutate: markAllRequestsRead} = useUpdateAllRead('request', {
|
||||||
|
onMutate: () => {
|
||||||
|
Toast.show(l`Marked all requests as read`, {type: 'success'})
|
||||||
|
},
|
||||||
|
onError: () => {
|
||||||
|
Toast.show(l`Failed to mark all requests as read`, {type: 'error'})
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Menu.Root>
|
<Menu.Root>
|
||||||
<Menu.Trigger label={l`Chat options`}>{children}</Menu.Trigger>
|
<Menu.Trigger label={l`Chat options`}>{children}</Menu.Trigger>
|
||||||
@@ -648,6 +660,14 @@ function ChatSettingsMenu({
|
|||||||
<Trans>Mark all chats as read</Trans>
|
<Trans>Mark all chats as read</Trans>
|
||||||
</Menu.ItemText>
|
</Menu.ItemText>
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
|
<Menu.Item
|
||||||
|
label={l`Mark all requests as read`}
|
||||||
|
onPress={() => markAllRequestsRead()}>
|
||||||
|
<Menu.ItemIcon icon={InboxIcon} />
|
||||||
|
<Menu.ItemText>
|
||||||
|
<Trans>Mark all requests as read</Trans>
|
||||||
|
</Menu.ItemText>
|
||||||
|
</Menu.Item>
|
||||||
<Menu.Item
|
<Menu.Item
|
||||||
label={l`Chat settings`}
|
label={l`Chat settings`}
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user