Skip to content

feat: add EventComponent (system message) redesign#3007

Open
arnautov-anton wants to merge 1 commit intomasterfrom
feat/event-component-redesign
Open

feat: add EventComponent (system message) redesign#3007
arnautov-anton wants to merge 1 commit intomasterfrom
feat/event-component-redesign

Conversation

@arnautov-anton
Copy link
Contributor

No description provided.

Comment on lines -68 to -87
if (event?.type === 'member.removed' || event?.type === 'member.added') {
const name = event.user?.name || event.user?.id;
const sentence = `${name} ${
event.type === 'member.added' ? 'has joined the chat' : 'was removed from the chat'
}`;

return (
<div className='str-chat__event-component__channel-event'>
<Avatar imageUrl={event.user?.image} size='md' userName={name} />
<div className='str-chat__event-component__channel-event__content'>
<em className='str-chat__event-component__channel-event__sentence'>
{sentence}
</em>
<div className='str-chat__event-component__channel-event__date'>
{getDateString({ ...getDateOptions, format: 'LT' })}
</div>
</div>
</div>
);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is dead code and apparently has been for a while - I couldn't get event object to appear in my message.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes this is dead code

@github-actions
Copy link

Size Change: -443 B (-0.1%)

Total Size: 433 kB

Filename Size Change
./dist/cjs/index.js 216 kB -402 B (-0.19%)
./dist/css/index.css 43.5 kB -41 B (-0.09%)
ℹ️ View Unchanged
Filename Size
./dist/audioProcessing-BbOs2wMd.js 1.32 kB
./dist/Channel-CqpzcDQo.js 20.2 kB
./dist/ChannelPreview-CBJXfEFg.js 14.1 kB
./dist/cjs/emojis.js 2.97 kB
./dist/cjs/experimental.js 3.81 kB
./dist/cjs/mp3-encoder.js 1.27 kB
./dist/css/v2/emoji-mart.css 1.84 kB
./dist/css/v2/emoji-replacement.css 300 B
./dist/css/v2/index.css 39.4 kB
./dist/css/v2/index.layout.css 22.8 kB
./dist/limits-C0Hh89Qv.js 65.2 kB

compressed-size-action

data-unsafe-inner-html
/>
) : (
<span>{message.text}</span>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's easier to just render text as adding/removing members does not provide useful information by default, mute/unmute does not return args (the user.id in question) nor enriched user object, that is being muted and finally ban/unban returns args but args also contain message so args look like "jane being naughty".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants