Clean up comments in skeleton components
This commit is contained in:
parent
c37352679d
commit
f8cbadaba5
3 changed files with 37 additions and 18 deletions
|
@ -29,6 +29,15 @@ import { ActionPayload } from "../../../dispatcher-types";
|
||||||
import dis from "../../../dispatcher";
|
import dis from "../../../dispatcher";
|
||||||
import RoomSublist2 from "./RoomSublist2";
|
import RoomSublist2 from "./RoomSublist2";
|
||||||
|
|
||||||
|
/*******************************************************************
|
||||||
|
* CAUTION *
|
||||||
|
*******************************************************************
|
||||||
|
* This is a work in progress implementation and isn't complete or *
|
||||||
|
* even useful as a component. Please avoid using it until this *
|
||||||
|
* warning disappears. *
|
||||||
|
*******************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
onKeyDown: (ev: React.KeyboardEvent) => void;
|
onKeyDown: (ev: React.KeyboardEvent) => void;
|
||||||
onFocus: (ev: React.FocusEvent) => void;
|
onFocus: (ev: React.FocusEvent) => void;
|
||||||
|
@ -152,6 +161,7 @@ export default class RoomList2 extends React.Component<IProps, IState> {
|
||||||
}
|
}
|
||||||
|
|
||||||
private prepareLayouts() {
|
private prepareLayouts() {
|
||||||
|
// TODO: Change layout engine for FTUE support
|
||||||
this.unfilteredLayout = new Layout((tagId: string, height: number) => {
|
this.unfilteredLayout = new Layout((tagId: string, height: number) => {
|
||||||
const sublist = this.sublistRefs[tagId];
|
const sublist = this.sublistRefs[tagId];
|
||||||
if (sublist) sublist.current.setHeight(height);
|
if (sublist) sublist.current.setHeight(height);
|
||||||
|
@ -177,15 +187,6 @@ export default class RoomList2 extends React.Component<IProps, IState> {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private collectSublistRef(tagId: string, ref: React.RefObject<RoomSublist2>) {
|
|
||||||
// TODO: Is this needed?
|
|
||||||
if (!ref) {
|
|
||||||
delete this.sublistRefs[tagId];
|
|
||||||
} else {
|
|
||||||
this.sublistRefs[tagId] = ref;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private renderSublists(): React.ReactElement[] {
|
private renderSublists(): React.ReactElement[] {
|
||||||
const components: React.ReactElement[] = [];
|
const components: React.ReactElement[] = [];
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,15 @@ import AccessibleTooltipButton from "../../views/elements/AccessibleTooltipButto
|
||||||
import * as FormattingUtils from '../../../utils/FormattingUtils';
|
import * as FormattingUtils from '../../../utils/FormattingUtils';
|
||||||
import RoomTile2 from "./RoomTile2";
|
import RoomTile2 from "./RoomTile2";
|
||||||
|
|
||||||
|
/*******************************************************************
|
||||||
|
* CAUTION *
|
||||||
|
*******************************************************************
|
||||||
|
* This is a work in progress implementation and isn't complete or *
|
||||||
|
* even useful as a component. Please avoid using it until this *
|
||||||
|
* warning disappears. *
|
||||||
|
*******************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
forRooms: boolean;
|
forRooms: boolean;
|
||||||
rooms?: Room[];
|
rooms?: Room[];
|
||||||
|
@ -50,12 +59,11 @@ interface IProps {
|
||||||
interface IState {
|
interface IState {
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Finish stub
|
|
||||||
export default class RoomSublist2 extends React.Component<IProps, IState> {
|
export default class RoomSublist2 extends React.Component<IProps, IState> {
|
||||||
private headerButton = createRef();
|
private headerButton = createRef();
|
||||||
|
|
||||||
public setHeight(size: number) {
|
public setHeight(size: number) {
|
||||||
// TODO: Do a thing
|
// TODO: Do a thing (maybe - height changes are different in FTUE)
|
||||||
}
|
}
|
||||||
|
|
||||||
private hasTiles(): boolean {
|
private hasTiles(): boolean {
|
||||||
|
@ -107,8 +115,10 @@ export default class RoomSublist2 extends React.Component<IProps, IState> {
|
||||||
return (
|
return (
|
||||||
<RovingTabIndexWrapper inputRef={this.headerButton}>
|
<RovingTabIndexWrapper inputRef={this.headerButton}>
|
||||||
{({onFocus, isActive, ref}) => {
|
{({onFocus, isActive, ref}) => {
|
||||||
|
// TODO: Use onFocus
|
||||||
const tabIndex = isActive ? 0 : -1;
|
const tabIndex = isActive ? 0 : -1;
|
||||||
|
|
||||||
|
// TODO: Collapsed state
|
||||||
let badge;
|
let badge;
|
||||||
if (true) { // !isCollapsed
|
if (true) { // !isCollapsed
|
||||||
const badgeClasses = classNames({
|
const badgeClasses = classNames({
|
||||||
|
@ -156,7 +166,7 @@ export default class RoomSublist2 extends React.Component<IProps, IState> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: a11y
|
// TODO: a11y (see old component)
|
||||||
return (
|
return (
|
||||||
<div className={"mx_RoomSubList_labelContainer"}>
|
<div className={"mx_RoomSubList_labelContainer"}>
|
||||||
<AccessibleButton
|
<AccessibleButton
|
||||||
|
|
|
@ -31,12 +31,21 @@ import { EffectiveMembership, getEffectiveMembership } from "../../../stores/roo
|
||||||
import * as Unread from '../../../Unread';
|
import * as Unread from '../../../Unread';
|
||||||
import * as FormattingUtils from "../../../utils/FormattingUtils";
|
import * as FormattingUtils from "../../../utils/FormattingUtils";
|
||||||
|
|
||||||
|
/*******************************************************************
|
||||||
|
* CAUTION *
|
||||||
|
*******************************************************************
|
||||||
|
* This is a work in progress implementation and isn't complete or *
|
||||||
|
* even useful as a component. Please avoid using it until this *
|
||||||
|
* warning disappears. *
|
||||||
|
*******************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
room: Room;
|
room: Room;
|
||||||
|
|
||||||
// TODO: Allow faslifying counts (for invites and stuff)
|
// TODO: Allow falsifying counts (for invites and stuff)
|
||||||
// TODO: Transparency?
|
// TODO: Transparency? Was this ever used?
|
||||||
// TODO: Incoming call?
|
// TODO: Incoming call boxes?
|
||||||
}
|
}
|
||||||
|
|
||||||
interface IBadgeState {
|
interface IBadgeState {
|
||||||
|
@ -51,13 +60,11 @@ interface IState extends IBadgeState {
|
||||||
hover: boolean;
|
hover: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Finish stub
|
|
||||||
export default class RoomTile2 extends React.Component<IProps, IState> {
|
export default class RoomTile2 extends React.Component<IProps, IState> {
|
||||||
private roomTile = createRef();
|
private roomTile = createRef();
|
||||||
|
|
||||||
// TODO: Custom status
|
// TODO: Custom status
|
||||||
// TODO: Lock icon
|
// TODO: Lock icon
|
||||||
// TODO: DM indicator
|
|
||||||
// TODO: Presence indicator
|
// TODO: Presence indicator
|
||||||
// TODO: e2e shields
|
// TODO: e2e shields
|
||||||
// TODO: Handle changes to room aesthetics (name, join rules, etc)
|
// TODO: Handle changes to room aesthetics (name, join rules, etc)
|
||||||
|
@ -78,7 +85,7 @@ export default class RoomTile2 extends React.Component<IProps, IState> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public componentWillUnmount() {
|
public componentWillUnmount() {
|
||||||
|
// TODO: Listen for changes to the badge count and update as needed
|
||||||
}
|
}
|
||||||
|
|
||||||
private updateBadgeCount() {
|
private updateBadgeCount() {
|
||||||
|
@ -168,6 +175,7 @@ export default class RoomTile2 extends React.Component<IProps, IState> {
|
||||||
'mx_RoomTile_badgeShown': this.state.showBadge,
|
'mx_RoomTile_badgeShown': this.state.showBadge,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// TODO: Support collapsed state properly
|
||||||
let tooltip = null;
|
let tooltip = null;
|
||||||
if (false) { // isCollapsed
|
if (false) { // isCollapsed
|
||||||
if (this.state.hover) {
|
if (this.state.hover) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue