Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/maxHeight-stateEvent-fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
default: patch
---

Added maximum height to state events
7 changes: 7 additions & 0 deletions src/app/hooks/timeline/TimelineEventRenderer.css.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { style } from '@vanilla-extract/css';
import { toRem } from 'folds';

export const StateEvent = style({
overflowY: 'scroll',
maxHeight: toRem(96),
});
16 changes: 9 additions & 7 deletions src/app/hooks/timeline/useTimelineEventRenderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ import {
Message,
Reactions,
} from '$features/room/message';

import { useSableCosmetics } from '$hooks/useSableCosmetics';
import * as css from './TimelineEventRenderer.css';

function DecoratedUser({ room, userId, userName }: DecoratedUserProps) {
const { color, font } = useSableCosmetics(userId, room ?? ({} as Room));
Expand Down Expand Up @@ -764,7 +766,7 @@ export function useTimelineEventRenderer({
iconSrc={parsed.icon}
content={
<Box grow="Yes" direction="Column">
<Text size="T300" priority="300">
<Text size="T300" priority="300" className={css.StateEvent}>
{parsed.body}
</Text>
</Box>
Expand Down Expand Up @@ -809,7 +811,7 @@ export function useTimelineEventRenderer({
iconSrc={Icons.Hash}
content={
<Box grow="Yes" direction="Column">
<Text size="T300" priority="300">
<Text size="T300" priority="300" className={css.StateEvent}>
<DecoratedUser userId={senderId} userName={senderName} room={room} />
{t('Organisms.RoomCommon.changed_room_name')}
</Text>
Expand Down Expand Up @@ -856,7 +858,7 @@ export function useTimelineEventRenderer({
iconSrc={Icons.Hash}
content={
<Box grow="Yes" direction="Column">
<Text size="T300" priority="300">
<Text size="T300" priority="300" className={css.StateEvent}>
<DecoratedUser userId={senderId} userName={senderName} room={room} />
{' changed room topic'}
</Text>
Expand Down Expand Up @@ -903,7 +905,7 @@ export function useTimelineEventRenderer({
iconSrc={Icons.Hash}
content={
<Box grow="Yes" direction="Column">
<Text size="T300" priority="300">
<Text size="T300" priority="300" className={css.StateEvent}>
<DecoratedUser userId={senderId} userName={senderName} room={room} />
{' changed room avatar'}
</Text>
Expand Down Expand Up @@ -957,7 +959,7 @@ export function useTimelineEventRenderer({
iconSrc={callJoined ? Icons.Phone : Icons.PhoneDown}
content={
<Box grow="Yes" direction="Column">
<Text size="T300" priority="300">
<Text size="T300" priority="300" className={css.StateEvent}>
<DecoratedUser userId={senderId} userName={senderName} room={room} />
{callJoined ? ' joined the call' : ' ended the call'}
</Text>
Expand Down Expand Up @@ -1092,7 +1094,7 @@ export function useTimelineEventRenderer({
iconSrc={Icons.Code}
content={
<Box grow="Yes" direction="Column">
<Text size="T300" priority="300">
<Text size="T300" priority="300" className={css.StateEvent}>
<DecoratedUser userId={senderId} userName={senderName} room={room} />
{' sent '}
<code className={customHtmlCss.Code}>{getType.call(mEvent)}</code>
Expand Down Expand Up @@ -1153,7 +1155,7 @@ export function useTimelineEventRenderer({
iconSrc={Icons.Code}
content={
<Box grow="Yes" direction="Column">
<Text size="T300" priority="300">
<Text size="T300" priority="300" className={css.StateEvent}>
<b>{senderName}</b>
{' sent '}
<code className={customHtmlCss.Code}>{getType.call(mEvent)}</code>
Expand Down
Loading