mirror of https://github.com/vector-im/riot-web
parent
83a4558d49
commit
c7870090f8
|
@ -29,7 +29,6 @@ import SettingsStore from '../../settings/SettingsStore';
|
||||||
import {_t} from "../../languageHandler";
|
import {_t} from "../../languageHandler";
|
||||||
import {haveTileForEvent} from "../views/rooms/EventTile";
|
import {haveTileForEvent} from "../views/rooms/EventTile";
|
||||||
import {textForEvent} from "../../TextForEvent";
|
import {textForEvent} from "../../TextForEvent";
|
||||||
import RedactionEventListSummary from "../views/elements/RedactionEventListSummary";
|
|
||||||
|
|
||||||
const CONTINUATION_MAX_INTERVAL = 5 * 60 * 1000; // 5 minutes
|
const CONTINUATION_MAX_INTERVAL = 5 * 60 * 1000; // 5 minutes
|
||||||
const continuedTypes = ['m.sticker', 'm.room.message'];
|
const continuedTypes = ['m.sticker', 'm.room.message'];
|
||||||
|
|
|
@ -22,8 +22,7 @@ import {MatrixEvent, RoomMember} from "matrix-js-sdk";
|
||||||
import {useStateToggle} from "../../../hooks/useStateToggle";
|
import {useStateToggle} from "../../../hooks/useStateToggle";
|
||||||
import AccessibleButton from "./AccessibleButton";
|
import AccessibleButton from "./AccessibleButton";
|
||||||
|
|
||||||
const EventListSummary = (props) => {
|
const EventListSummary = ({events, children, threshold=3, onToggle, startExpanded, summaryMembers=[], summaryText}) => {
|
||||||
const {events, children, threshold=3, onToggle, startExpanded, summaryMembers=[], summaryText, summary} = props;
|
|
||||||
const [expanded, toggleExpanded] = useStateToggle(startExpanded);
|
const [expanded, toggleExpanded] = useStateToggle(startExpanded);
|
||||||
|
|
||||||
// Whenever expanded changes call onToggle
|
// Whenever expanded changes call onToggle
|
||||||
|
@ -50,8 +49,6 @@ const EventListSummary = (props) => {
|
||||||
<div className="mx_EventListSummary_line"> </div>
|
<div className="mx_EventListSummary_line"> </div>
|
||||||
{ children }
|
{ children }
|
||||||
</React.Fragment>;
|
</React.Fragment>;
|
||||||
} else if (summary) {
|
|
||||||
body = summary;
|
|
||||||
} else {
|
} else {
|
||||||
const avatars = summaryMembers.map((m) => <MemberAvatar key={m.userId} member={m} width={14} height={14} />);
|
const avatars = summaryMembers.map((m) => <MemberAvatar key={m.userId} member={m} width={14} height={14} />);
|
||||||
body = (
|
body = (
|
||||||
|
@ -90,9 +87,6 @@ EventListSummary.propTypes = {
|
||||||
// Whether or not to begin with state.expanded=true
|
// Whether or not to begin with state.expanded=true
|
||||||
startExpanded: PropTypes.bool,
|
startExpanded: PropTypes.bool,
|
||||||
|
|
||||||
// The node to render as a summary when the summary is not collapsed,
|
|
||||||
// alternately summaryMembers and summaryText can be provided.
|
|
||||||
summary: PropTypes.node,
|
|
||||||
// The list of room members for which to show avatars next to the summary, ignored if summary is provided
|
// The list of room members for which to show avatars next to the summary, ignored if summary is provided
|
||||||
summaryMembers: PropTypes.arrayOf(PropTypes.instanceOf(RoomMember)),
|
summaryMembers: PropTypes.arrayOf(PropTypes.instanceOf(RoomMember)),
|
||||||
// The text to show as the summary of this event list, ignored if summary is provided
|
// The text to show as the summary of this event list, ignored if summary is provided
|
||||||
|
|
|
@ -1488,8 +1488,6 @@
|
||||||
"%(oneUser)smade no changes %(count)s times|one": "%(oneUser)smade no changes",
|
"%(oneUser)smade no changes %(count)s times|one": "%(oneUser)smade no changes",
|
||||||
"Power level": "Power level",
|
"Power level": "Power level",
|
||||||
"Custom level": "Custom level",
|
"Custom level": "Custom level",
|
||||||
"%(count)s messages deleted|other": "%(count)s messages deleted",
|
|
||||||
"%(count)s messages deleted by %(name)s|other": "%(count)s messages deleted by %(name)s",
|
|
||||||
"Unable to load event that was replied to, it either does not exist or you do not have permission to view it.": "Unable to load event that was replied to, it either does not exist or you do not have permission to view it.",
|
"Unable to load event that was replied to, it either does not exist or you do not have permission to view it.": "Unable to load event that was replied to, it either does not exist or you do not have permission to view it.",
|
||||||
"<a>In reply to</a> <pill>": "<a>In reply to</a> <pill>",
|
"<a>In reply to</a> <pill>": "<a>In reply to</a> <pill>",
|
||||||
"Room alias": "Room alias",
|
"Room alias": "Room alias",
|
||||||
|
|
Loading…
Reference in New Issue