Rename components to match prior convention

This commit is contained in:
Travis Ralston 2020-08-26 08:50:32 -06:00
parent 3e7d82b421
commit 82b015bd5f
8 changed files with 64 additions and 64 deletions

View file

@ -77,7 +77,7 @@ import ErrorDialog from "../views/dialogs/ErrorDialog";
import { RoomNotificationStateStore } from "../../stores/notifications/RoomNotificationStateStore";
import { SettingLevel } from "../../settings/SettingLevel";
import { leaveRoomBehaviour } from "../../utils/membership";
import PrototypeCreateGroupDialog from "../views/dialogs/PrototypeCreateGroupDialog";
import CreateCommunityPrototypeDialog from "../views/dialogs/CreateCommunityPrototypeDialog";
/** constants for MatrixChat.state.view */
export enum Views {
@ -623,7 +623,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
case 'view_create_group': {
let CreateGroupDialog = sdk.getComponent("dialogs.CreateGroupDialog")
if (SettingsStore.getValue("feature_communities_v2_prototypes")) {
CreateGroupDialog = PrototypeCreateGroupDialog;
CreateGroupDialog = CreateCommunityPrototypeDialog;
}
Modal.createTrackedDialog('Create Community', '', CreateGroupDialog);
break;

View file

@ -56,7 +56,7 @@ interface IState {
busy: boolean;
}
export default class PrototypeCommunityInviteDialog extends React.PureComponent<IProps, IState> {
export default class CommunityPrototypeInviteDialog extends React.PureComponent<IProps, IState> {
constructor(props: IProps) {
super(props);
@ -145,7 +145,7 @@ export default class PrototypeCommunityInviteDialog extends React.PureComponent<
private renderPerson(person: IPerson, key: any) {
const avatarSize = 36;
return (
<div className="mx_PrototypeCommunityInviteDialog_person" key={key}>
<div className="mx_CommunityPrototypeInviteDialog_person" key={key}>
<BaseAvatar
url={getHttpUriForMxc(
MatrixClientPeg.get().getHomeserverUrl(), person.user.getMxcAvatarUrl(),
@ -155,9 +155,9 @@ export default class PrototypeCommunityInviteDialog extends React.PureComponent<
width={avatarSize}
height={avatarSize}
/>
<div className="mx_PrototypeCommunityInviteDialog_personIdentifiers">
<span className="mx_PrototypeCommunityInviteDialog_personName">{person.user.name}</span>
<span className="mx_PrototypeCommunityInviteDialog_personId">{person.userId}</span>
<div className="mx_CommunityPrototypeInviteDialog_personIdentifiers">
<span className="mx_CommunityPrototypeInviteDialog_personName">{person.user.name}</span>
<span className="mx_CommunityPrototypeInviteDialog_personId">{person.userId}</span>
</div>
<StyledCheckbox onChange={(e) => this.setPersonToggle(person, e.target.checked)} />
</div>
@ -206,14 +206,14 @@ export default class PrototypeCommunityInviteDialog extends React.PureComponent<
<AccessibleButton
onClick={this.onShowMorePeople}
kind="link" key="more"
className="mx_PrototypeCommunityInviteDialog_morePeople"
className="mx_CommunityPrototypeInviteDialog_morePeople"
>{_t("Show more")}</AccessibleButton>
);
}
}
if (this.state.people.length > 0) {
peopleIntro = (
<div className="mx_PrototypeCommunityInviteDialog_people">
<div className="mx_CommunityPrototypeInviteDialog_people">
<span>{_t("People you know on %(brand)s", {brand: SdkConfig.get().brand})}</span>
<AccessibleButton onClick={this.onShowPeopleClick}>
{this.state.showPeople ? _t("Hide") : _t("Show")}
@ -230,7 +230,7 @@ export default class PrototypeCommunityInviteDialog extends React.PureComponent<
return (
<BaseDialog
className="mx_PrototypeCommunityInviteDialog"
className="mx_CommunityPrototypeInviteDialog"
onFinished={this.props.onFinished}
title={_t("Invite people to join %(communityName)s", {communityName: this.props.communityName})}
>
@ -242,7 +242,7 @@ export default class PrototypeCommunityInviteDialog extends React.PureComponent<
<AccessibleButton
kind="primary" onClick={this.onSubmit}
disabled={this.state.busy}
className="mx_PrototypeCommunityInviteDialog_primaryButton"
className="mx_CommunityPrototypeInviteDialog_primaryButton"
>{buttonText}</AccessibleButton>
</div>
</form>

View file

@ -37,7 +37,7 @@ interface IState {
avatarPreview: string;
}
export default class PrototypeCreateGroupDialog extends React.PureComponent<IProps, IState> {
export default class CreateCommunityPrototypeDialog extends React.PureComponent<IProps, IState> {
private avatarUploadRef: React.RefObject<HTMLInputElement> = React.createRef();
constructor(props: IProps) {
@ -138,7 +138,7 @@ export default class PrototypeCreateGroupDialog extends React.PureComponent<IPro
let communityId = null;
if (this.state.localpart) {
communityId = (
<span className="mx_PrototypeCreateGroupDialog_communityId">
<span className="mx_CreateCommunityPrototypeDialog_communityId">
{_t("Community ID: +<localpart />:%(domain)s", {
domain: MatrixClientPeg.getHomeserverName(),
}, {
@ -155,32 +155,32 @@ export default class PrototypeCreateGroupDialog extends React.PureComponent<IPro
}
let helpText = (
<span className="mx_PrototypeCreateGroupDialog_subtext">
<span className="mx_CreateCommunityPrototypeDialog_subtext">
{_t("You can change this later if needed.")}
</span>
);
if (this.state.error) {
helpText = (
<span className="mx_PrototypeCreateGroupDialog_subtext mx_PrototypeCreateGroupDialog_subtext_error">
<span className="mx_CreateCommunityPrototypeDialog_subtext mx_CreateCommunityPrototypeDialog_subtext_error">
{this.state.error}
</span>
);
}
let preview = <img src={this.state.avatarPreview} className="mx_PrototypeCreateGroupDialog_avatar" />;
let preview = <img src={this.state.avatarPreview} className="mx_CreateCommunityPrototypeDialog_avatar" />;
if (!this.state.avatarPreview) {
preview = <div className="mx_PrototypeCreateGroupDialog_placeholderAvatar" />
preview = <div className="mx_CreateCommunityPrototypeDialog_placeholderAvatar" />
}
return (
<BaseDialog
className="mx_PrototypeCreateGroupDialog"
className="mx_CreateCommunityPrototypeDialog"
onFinished={this.props.onFinished}
title={_t("What's the name of your community or team?")}
>
<form onSubmit={this.onSubmit}>
<div className="mx_Dialog_content">
<div className="mx_PrototypeCreateGroupDialog_colName">
<div className="mx_CreateCommunityPrototypeDialog_colName">
<Field
value={this.state.name}
onChange={this.onNameChange}
@ -188,7 +188,7 @@ export default class PrototypeCreateGroupDialog extends React.PureComponent<IPro
label={_t("Enter name")}
/>
{helpText}
<span className="mx_PrototypeCreateGroupDialog_subtext">
<span className="mx_CreateCommunityPrototypeDialog_subtext">
{/*nbsp is to reserve the height of this element when there's nothing*/}
&nbsp;{communityId}
</span>
@ -196,16 +196,16 @@ export default class PrototypeCreateGroupDialog extends React.PureComponent<IPro
{_t("Create")}
</AccessibleButton>
</div>
<div className="mx_PrototypeCreateGroupDialog_colAvatar">
<div className="mx_CreateCommunityPrototypeDialog_colAvatar">
<input
type="file" style={{display: "none"}}
ref={this.avatarUploadRef} accept="image/*"
onChange={this.onAvatarChanged}
/>
<AccessibleButton onClick={this.onChangeAvatar} className="mx_PrototypeCreateGroupDialog_avatarContainer">
<AccessibleButton onClick={this.onChangeAvatar} className="mx_CreateCommunityPrototypeDialog_avatarContainer">
{preview}
</AccessibleButton>
<div className="mx_PrototypeCreateGroupDialog_tip">
<div className="mx_CreateCommunityPrototypeDialog_tip">
<b>{_t("Add image (optional)")}</b>
<span>
{_t("An image will help people identify your community.")}