bring back sticky copy button

This commit is contained in:
Xuan Son Nguyen 2025-02-08 14:53:51 +01:00
parent fbf2853f54
commit 6f1fcbcc0f
2 changed files with 3 additions and 5 deletions

View file

@ -70,7 +70,7 @@ export default function ChatScreen() {
>
<div className="flex flex-col w-full max-w-[900px] mx-auto">
{/* chat messages */}
<div id="messages-list" className="flex flex-col grow overflow-y-auto">
<div id="messages-list" className="grow">
<div className="mt-auto flex justify-center">
{/* placeholder to shift the message to the bottom */}
{viewingConversation ? '' : 'Send a message to start'}

View file

@ -77,7 +77,7 @@ const CodeBlockButtons: React.ElementType<
return (
<div
className={classNames({
'text-right sticky top-4 mb-2 mr-2 h-0': true,
'text-right sticky top-[7em] mb-2 mr-2 h-0': true,
'display-none': !node?.position,
})}
>
@ -152,9 +152,7 @@ function rehypeCustomCopyButton() {
// replace current node
preNode.properties.visited = 'true';
node.tagName = 'div';
node.properties = {
className: 'relative my-4',
};
node.properties = {};
// add node for button
const btnNode: ElementContent = {
type: 'element',