- portrait on phones is min(38vw,160px), was min(50vw,210px): at 390px the text column beside it was ~85px - outside list markers ignored the portrait silhouette and landed under the art; inside markers wrap with the text - Jump to Latest sits 8px (was 16px) above the timeline's lower edge - preview banner is in flow above the app, not fixed over the room header and connection strip - on the pretend server the training line and the registration checkbox say nothing is trained (trainingNoticeText); the real sentence and its wording are unchanged and still await Meta's legal read Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
27 lines
974 B
TypeScript
27 lines
974 B
TypeScript
import { Text, color, config } from 'folds';
|
|
import { Room } from 'matrix-js-sdk';
|
|
import React from 'react';
|
|
import { useStateEvent } from '../../hooks/useStateEvent';
|
|
import { useClientConfig } from '../../hooks/useClientConfig';
|
|
import {
|
|
ROOM_NOTICE_EVENT_TYPE,
|
|
parseRoomNotice,
|
|
roomTrainingLine,
|
|
} from '../../utils/trainingNotice';
|
|
|
|
// The room's notice state event decides the line; no event, or a malformed one, no line. The
|
|
// collector reads the version from the same event, so nothing is stored in the browser.
|
|
export function RoomTrainingLine({ room }: { room: Room }) {
|
|
const event = useStateEvent(room, ROOM_NOTICE_EVENT_TYPE);
|
|
const { previewDemo } = useClientConfig();
|
|
const line = roomTrainingLine(parseRoomNotice(event?.getContent()), previewDemo);
|
|
if (!line) return null;
|
|
return (
|
|
<Text
|
|
size="T200"
|
|
style={{ padding: `${config.space.S100} 0`, color: color.SurfaceVariant.OnContainer }}
|
|
>
|
|
{line}
|
|
</Text>
|
|
);
|
|
}
|