chat-js: only show scrollbars if overflow

Uses overflow: auto on the code attachments so that scrollbars only
appear if the content overflows the container. Adds borders on sent Hoon
code to improve visual seperation.
This commit is contained in:
Liam Fitzgerald 2020-04-28 12:50:37 +10:00
parent 3196179fbd
commit a7253d4480
2 changed files with 5 additions and 5 deletions

View File

@ -71,7 +71,7 @@ h2 {
}
.clamp-attachment {
overflow: scroll;
overflow: auto;
max-height: 10em;
max-width: 100%;
}

View File

@ -65,17 +65,17 @@ export class Message extends Component {
(!!letter.code.output &&
letter.code.output.length && letter.code.output.length > 0) ?
(
<pre className="f7 clamp-attachment pa1 mt0 mb0">
<pre className="f7 clamp-attachment pa1 mt0 mb0 b--gray4 b--gray1-d bl br bb">
{letter.code.output[0].join('\n')}
</pre>
) : null;
return (
<span>
<pre className="f7 clamp-attachment pa1 mt0 mb0 bg-light-gray">
<div className="mv2">
<pre className="f7 clamp-attachment pa1 mt0 mb0 bg-light-gray b--gray4 b--gray1-d ba">
{letter.code.expression}
</pre>
{outputElement}
</span>
</div>
);
} else if ('url' in letter) {
let imgMatch =