delint some more
This commit is contained in:
parent
9ba33c7f80
commit
656a815991
2 changed files with 9 additions and 11 deletions
|
@ -163,11 +163,9 @@ export default class CreateCommunityPrototypeDialog extends React.PureComponent<
|
||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
if (this.state.error) {
|
if (this.state.error) {
|
||||||
|
const classes = "mx_CreateCommunityPrototypeDialog_subtext mx_CreateCommunityPrototypeDialog_subtext_error";
|
||||||
helpText = (
|
helpText = (
|
||||||
<span
|
<span className={classes}>
|
||||||
className={"mx_CreateCommunityPrototypeDialog_subtext " +
|
|
||||||
"mx_CreateCommunityPrototypeDialog_subtext_error"}
|
|
||||||
>
|
|
||||||
{this.state.error}
|
{this.state.error}
|
||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
|
|
|
@ -45,6 +45,7 @@ interface IState {
|
||||||
displayname: string;
|
displayname: string;
|
||||||
avatar_url: string;
|
avatar_url: string;
|
||||||
}
|
}
|
||||||
|
/* eslint-enable camelcase */
|
||||||
|
|
||||||
const AVATAR_SIZE = 32;
|
const AVATAR_SIZE = 32;
|
||||||
|
|
||||||
|
@ -64,18 +65,18 @@ export default class EventTilePreview extends React.Component<IProps, IState> {
|
||||||
const client = MatrixClientPeg.get();
|
const client = MatrixClientPeg.get();
|
||||||
const userId = client.getUserId();
|
const userId = client.getUserId();
|
||||||
const profileInfo = await client.getProfileInfo(userId);
|
const profileInfo = await client.getProfileInfo(userId);
|
||||||
const avatar_url = Avatar.avatarUrlForUser(
|
const avatarUrl = Avatar.avatarUrlForUser(
|
||||||
{avatarUrl: profileInfo.avatar_url},
|
{avatarUrl: profileInfo.avatar_url},
|
||||||
AVATAR_SIZE, AVATAR_SIZE, "crop");
|
AVATAR_SIZE, AVATAR_SIZE, "crop");
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
userId,
|
userId,
|
||||||
displayname: profileInfo.displayname,
|
displayname: profileInfo.displayname,
|
||||||
avatar_url,
|
avatar_url: avatarUrl,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private fakeEvent({userId, displayname, avatar_url}: IState) {
|
private fakeEvent({userId, displayname, avatar_url: avatarUrl}: IState) {
|
||||||
// Fake it till we make it
|
// Fake it till we make it
|
||||||
const event = new MatrixEvent(JSON.parse(`{
|
const event = new MatrixEvent(JSON.parse(`{
|
||||||
"type": "m.room.message",
|
"type": "m.room.message",
|
||||||
|
@ -85,12 +86,12 @@ export default class EventTilePreview extends React.Component<IProps, IState> {
|
||||||
"msgtype": "m.text",
|
"msgtype": "m.text",
|
||||||
"body": "${this.props.message}",
|
"body": "${this.props.message}",
|
||||||
"displayname": "${displayname}",
|
"displayname": "${displayname}",
|
||||||
"avatar_url": "${avatar_url}"
|
"avatar_url": "${avatarUrl}"
|
||||||
},
|
},
|
||||||
"msgtype": "m.text",
|
"msgtype": "m.text",
|
||||||
"body": "${this.props.message}",
|
"body": "${this.props.message}",
|
||||||
"displayname": "${displayname}",
|
"displayname": "${displayname}",
|
||||||
"avatar_url": "${avatar_url}"
|
"avatar_url": "${avatarUrl}"
|
||||||
},
|
},
|
||||||
"unsigned": {
|
"unsigned": {
|
||||||
"age": 97
|
"age": 97
|
||||||
|
@ -104,7 +105,7 @@ export default class EventTilePreview extends React.Component<IProps, IState> {
|
||||||
name: displayname,
|
name: displayname,
|
||||||
userId: userId,
|
userId: userId,
|
||||||
getAvatarUrl: (..._) => {
|
getAvatarUrl: (..._) => {
|
||||||
return avatar_url;
|
return avatarUrl;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -124,4 +125,3 @@ export default class EventTilePreview extends React.Component<IProps, IState> {
|
||||||
</div>;
|
</div>;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* eslint-enable camelcase */
|
|
||||||
|
|
Loading…
Reference in a new issue