move panel logic to individual files

This commit is contained in:
Lewis Moten
2024-05-11 15:16:24 -04:00
parent 6647e5b51d
commit 6895e5b7a2
6 changed files with 258 additions and 73 deletions

20
Panels/MessagePanel.js Normal file
View File

@@ -0,0 +1,20 @@
import BasePanel from './BasePanel';
class MessagePanel extends BasePanel {
constructor() {
super('Message');
this.addInputText('text-to-send', '', 'messageChange');
this.addButton('send-button', 'Send', 'send');
this.addSection('Received');
this.addProgressBar('received-progress', .50);
this.addCode('decoded-text', '', 'small');
}
getSendButtonText = () => this.getValueById('send-button');
setSendButtonText = text => this.setValueById('send-button', text);
setMessage = text => this.setValueById('text-to-send', text);
getMessage = () => this.getValueById('text-to-send');
setProgress = percent => this.setProgressById('received-progress', percent);
setReceived = (html) => this.setHtmlById('decoded-text', html);
}
export default MessagePanel;