Merge pull request #2842 from urbit/mp/chat/message-fixing

chat: message input fixes
This commit is contained in:
ixv 2020-05-05 17:59:07 -07:00 committed by GitHub
commit 277debf710
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 5 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 596 B

After

Width:  |  Height:  |  Size: 611 B

View File

@ -151,8 +151,8 @@ export class ChatInput extends Component {
}
getLetterType(letter) {
if (letter.startsWith('/me')) {
letter = letter.slice(3);
if (letter.startsWith('/me ')) {
letter = letter.slice(4);
// remove insignificant leading whitespace.
// aces might be relevant to style.
while (letter[0] === '\n') {
@ -321,8 +321,12 @@ export class ChatInput extends Component {
extraKeys: {
Tab: cm =>
this.patpAutocomplete(cm.getValue(), true),
'Enter': cm =>
this.messageSubmit(),
'Enter': () => {
this.messageSubmit();
if (this.state.code) {
this.toggleCode();
}
},
'Shift-3': cm =>
cm.getValue().length === 0
? this.toggleCode()
@ -384,7 +388,7 @@ export class ChatInput extends Component {
style={{ filter: state.code && 'invert(100%)', height: '100%', width: '100%' }}
onClick={this.toggleCode}
src="/~chat/img/CodeEval.png"
className="contrast-10-d bg-white bg-none-d"
className="contrast-10-d bg-white bg-none-d ba b--gray1-d br1"
/>
</div>
</div>