remove bulk edit view and related stuff unused
parent
e0fd910fa4
commit
a30ae8903b
@ -1,37 +0,0 @@
|
|||||||
/* global Whisper, */
|
|
||||||
|
|
||||||
// eslint-disable-next-line func-names
|
|
||||||
(function() {
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
window.Whisper = window.Whisper || {};
|
|
||||||
|
|
||||||
Whisper.BulkEditView = Whisper.View.extend({
|
|
||||||
initialize(options) {
|
|
||||||
this.memberView = null;
|
|
||||||
this.props = {
|
|
||||||
onCancel: options.onCancel,
|
|
||||||
onDelete: options.onDelete,
|
|
||||||
messageCount: 0,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
render() {
|
|
||||||
if (this.memberView) {
|
|
||||||
this.memberView.update(this.props);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.memberView = new Whisper.ReactWrapperView({
|
|
||||||
className: 'bulk-edit-view',
|
|
||||||
Component: window.Signal.Components.BulkEdit,
|
|
||||||
props: this.props,
|
|
||||||
});
|
|
||||||
|
|
||||||
this.$el.append(this.memberView.el);
|
|
||||||
},
|
|
||||||
|
|
||||||
update(selectionSize) {
|
|
||||||
this.props.messageCount = selectionSize;
|
|
||||||
this.render();
|
|
||||||
},
|
|
||||||
});
|
|
||||||
})();
|
|
@ -1,44 +0,0 @@
|
|||||||
import React from 'react';
|
|
||||||
import classNames from 'classnames';
|
|
||||||
|
|
||||||
interface Props {
|
|
||||||
messageCount: number;
|
|
||||||
onCancel: any;
|
|
||||||
onDelete: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
export class BulkEdit extends React.Component<Props> {
|
|
||||||
constructor(props: any) {
|
|
||||||
super(props);
|
|
||||||
}
|
|
||||||
|
|
||||||
public render() {
|
|
||||||
const classes = ['bulk-edit-container'];
|
|
||||||
|
|
||||||
if (this.props.messageCount === 0) {
|
|
||||||
classes.push('hidden');
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className={classNames(classes)}>
|
|
||||||
<span
|
|
||||||
className="delete-button"
|
|
||||||
role="button"
|
|
||||||
onClick={this.props.onDelete}
|
|
||||||
>
|
|
||||||
Delete
|
|
||||||
</span>
|
|
||||||
<span className="message-counter">
|
|
||||||
Messages selected: {this.props.messageCount}
|
|
||||||
</span>
|
|
||||||
<span
|
|
||||||
className="cancel-button"
|
|
||||||
role="button"
|
|
||||||
onClick={this.props.onCancel}
|
|
||||||
>
|
|
||||||
Cancel
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue