* Move EventTileBubble to shared components as is * Added documentation and updated stories and unit tests * Move 'global' element web css to _common.pcss * Adding playwright snapshots * Updated comments * Added legacy mx_MessageTimestamp class and updated snapshots * Regenerate snapshots with correct hash * Changes to css and removed timestamp from properties after review. * Update screenshot for room-list and fix flaky CI playwright test. * Blur the play button before matching screenshots * Changed to button focused instead of blur for consistancy * Stabilize play button appearance in CI (disabled due to decoding) * Force play button appearance in CI (disabled due to decoding) * Add comments on playwright test changes. Change from React.RefObject<any> to Ref<HTMLDivElement> in EncryptionEvent.tsx * Update playwright/e2e/composer/CIDER.spec.ts Co-authored-by: Michael Telatynski <7t3chguy@gmail.com> * Update playwright/e2e/composer/CIDER.spec.ts Co-authored-by: Michael Telatynski <7t3chguy@gmail.com> * Update playwright/e2e/crypto/toasts.spec.ts Co-authored-by: Michael Telatynski <7t3chguy@gmail.com> --------- Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
65 lines
1.6 KiB
TypeScript
65 lines
1.6 KiB
TypeScript
/*
|
|
* Copyright 2026 Element Creations Ltd.
|
|
*
|
|
* SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
|
|
* Please see LICENSE files in the repository root for full details.
|
|
*/
|
|
|
|
import React, { type JSX, type ReactNode } from "react";
|
|
import classNames from "classnames";
|
|
|
|
import styles from "./EventTileBubble.module.css";
|
|
|
|
export interface EventTileBubbleProps {
|
|
/**
|
|
* Icon rendered at the start of the bubble.
|
|
*/
|
|
icon: JSX.Element;
|
|
/**
|
|
* Main title text for the bubble.
|
|
*/
|
|
title: string;
|
|
/**
|
|
* Optional subtitle rendered beneath the title.
|
|
*/
|
|
subtitle?: ReactNode;
|
|
/**
|
|
* Optional extra class name for the container.
|
|
*/
|
|
className?: string;
|
|
/**
|
|
* Optional children rendered between subtitle and timestamp.
|
|
*/
|
|
children?: JSX.Element;
|
|
/**
|
|
* Forwarded ref for the container element.
|
|
*/
|
|
ref?: React.RefObject<HTMLDivElement>;
|
|
}
|
|
|
|
/**
|
|
* EventTileBubble renders a compact event tile with an icon, title, and optional subtitle/content.
|
|
*
|
|
* @example
|
|
* ```tsx
|
|
* <EventTileBubble icon={<Icon />} title="Room created" />
|
|
* ```
|
|
*/
|
|
export function EventTileBubble({
|
|
icon,
|
|
title,
|
|
subtitle,
|
|
className,
|
|
children,
|
|
ref,
|
|
}: EventTileBubbleProps): JSX.Element {
|
|
return (
|
|
<div className={classNames(styles.container, className)} ref={ref}>
|
|
{icon}
|
|
<div className={styles.title}>{title}</div>
|
|
{subtitle && <div className={styles.subtitle}>{subtitle}</div>}
|
|
{children}
|
|
</div>
|
|
);
|
|
}
|