Skip to content

Commit 77c3ccc

Browse files
committed
add dismiss button to messages
1 parent 45cda45 commit 77c3ccc

2 files changed

Lines changed: 31 additions & 0 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
default: minor
3+
---
4+
5+
Add a "Dismiss" button to command response messages.

src/app/features/room/message/Message.tsx

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -679,6 +679,7 @@ function MessageInternal(
679679
);
680680

681681
const MSG_CONTENT_STYLE = { maxWidth: '100%' };
682+
const isSableFeedback = mEvent.getId()?.startsWith('~sable-feedback-');
682683

683684
const msgContentJSX = (
684685
<Box
@@ -757,6 +758,31 @@ function MessageInternal(
757758
)}
758759
</Box>
759760
)}
761+
{isSableFeedback && (
762+
<Box className={css.SendStatusRow} alignItems="Center" gap="100">
763+
<Icon src={Icons.Info} size="100" />
764+
<Text size="T200" priority="300" as="span">
765+
Only you can see this.
766+
</Text>
767+
<Chip
768+
type="button"
769+
variant="SurfaceVariant"
770+
radii="Pill"
771+
outlined
772+
onClick={(evt: any) => {
773+
evt.preventDefault();
774+
evt.stopPropagation();
775+
const eventId = mEvent.getId();
776+
if (eventId) {
777+
room.removeEvent(eventId);
778+
room.emit(RoomEvent.LocalEchoUpdated, mEvent, room);
779+
}
780+
}}
781+
>
782+
<Text size="B300">Dismiss</Text>
783+
</Chip>
784+
</Box>
785+
)}
760786
</Box>
761787
);
762788

0 commit comments

Comments
 (0)