Add newline in Dialog Prompt #1480
-
I can't seem to get a newline into a snaps Dialog Prompt, should this work or do I have to use a new text() object in the panel for anytime I want a newline? my code: Object.values(chatHistory).forEach(val => {
if(address.toLowerCase() === val.fromaddr.toLowerCase()) {
convoBody += ' **' + from + ':** ' + val.message + '\n'
} else {
convoBody += ' **me:** ' + val.message + '\n'
}
});
...
const diagResponse = await snap.request({
method: 'snap_dialog',
params: {
type: 'prompt',
content: panel([heading('New Message From: ' + from), text(convoBody)]),
placeholder: 'Enter response to message here...',
},
}); I wanted to build my panel programmatically, hopefully it can be done still? Maybe I just need to build the union of objects to put in the panel() call, but I tried a few times and my syntax was bad maybe. |
Beta Was this translation helpful? Give feedback.
Answered by
Montoya
Jun 8, 2023
Replies: 1 comment 4 replies
-
There's no newline character, you would have to use a new |
Beta Was this translation helpful? Give feedback.
4 replies
Answer selected by
cryptoKevinL
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There's no newline character, you would have to use a new
text()
container for each line