AddAdminForm,
TransferSiteForm,
TransferCommunityForm,
- Community,
} from 'lemmy-js-client';
import { BanType } from '../interfaces';
import { MomentTime } from './moment-time';
interface PostListingProps {
post: Post;
- communities: Community[]; // TODO this should be an optional
showCommunity?: boolean;
showBody?: boolean;
moderators?: CommunityUser[];
onCancel={this.handleEditCancel}
enableNsfw={this.props.enableNsfw}
enableDownvotes={this.props.enableDownvotes}
- communities={this.props.communities}
/>
</div>
)}
import { mdToHtml, toast } from '../utils';
import { MomentTime } from './moment-time';
import { PrivateMessageForm } from './private-message-form';
-import { UserListing, UserOther } from './user-listing';
+import { UserListing } from './user-listing';
import { i18n } from '../i18next';
interface PrivateMessageState {
showEdit: boolean;
collapsed: boolean;
viewSource: boolean;
- recipient: UserView;
}
interface PrivateMessageProps {
showEdit: false,
collapsed: false,
viewSource: false,
- recipient: {
- id: this.props.privateMessage.recipient_id,
- actor_id: this.props.privateMessage.recipient_actor_id,
- name: this.props.privateMessage.recipient_name,
- local: this.props.privateMessage.recipient_local,
- avatar: this.props.privateMessage.recipient_avatar,
- preferred_username: this.props.privateMessage
- .recipient_preferred_username,
- published: undefined,
- number_of_posts: 0,
- post_score: 0,
- number_of_comments: 0,
- comment_score: 0,
- banned: false,
- },
};
constructor(props: any, context: any) {
render() {
let message = this.props.privateMessage;
- let userOther: UserOther = this.mine
+ let userOther: UserView = this.mine
? {
name: message.recipient_name,
preferred_username: message.recipient_preferred_username,
local: message.recipient_local,
actor_id: message.recipient_actor_id,
published: message.published,
+ number_of_posts: 0,
+ post_score: 0,
+ number_of_comments: 0,
+ comment_score: 0,
+ banned: false,
}
: {
name: message.creator_name,
local: message.creator_local,
actor_id: message.creator_actor_id,
published: message.published,
+ number_of_posts: 0,
+ post_score: 0,
+ number_of_comments: 0,
+ comment_score: 0,
+ banned: false,
};
return (
</ul>
{this.state.showEdit && (
<PrivateMessageForm
- recipient={this.state.recipient}
+ recipient={userOther}
privateMessage={message}
onEdit={this.handlePrivateMessageEdit}
onCreate={this.handlePrivateMessageCreate}
</div>
{this.state.showReply && (
<PrivateMessageForm
- recipient={this.state.recipient}
+ recipient={userOther}
onCreate={this.handlePrivateMessageCreate}
/>
)}