bring back sticky copy button
This commit is contained in:
parent
fbf2853f54
commit
6f1fcbcc0f
2 changed files with 3 additions and 5 deletions
|
@ -70,7 +70,7 @@ export default function ChatScreen() {
|
||||||
>
|
>
|
||||||
<div className="flex flex-col w-full max-w-[900px] mx-auto">
|
<div className="flex flex-col w-full max-w-[900px] mx-auto">
|
||||||
{/* chat messages */}
|
{/* 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">
|
<div className="mt-auto flex justify-center">
|
||||||
{/* placeholder to shift the message to the bottom */}
|
{/* placeholder to shift the message to the bottom */}
|
||||||
{viewingConversation ? '' : 'Send a message to start'}
|
{viewingConversation ? '' : 'Send a message to start'}
|
||||||
|
|
|
@ -77,7 +77,7 @@ const CodeBlockButtons: React.ElementType<
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={classNames({
|
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,
|
'display-none': !node?.position,
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
|
@ -152,9 +152,7 @@ function rehypeCustomCopyButton() {
|
||||||
// replace current node
|
// replace current node
|
||||||
preNode.properties.visited = 'true';
|
preNode.properties.visited = 'true';
|
||||||
node.tagName = 'div';
|
node.tagName = 'div';
|
||||||
node.properties = {
|
node.properties = {};
|
||||||
className: 'relative my-4',
|
|
||||||
};
|
|
||||||
// add node for button
|
// add node for button
|
||||||
const btnNode: ElementContent = {
|
const btnNode: ElementContent = {
|
||||||
type: 'element',
|
type: 'element',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue