reorder delete confirmation button

This commit is contained in:
Jing Hua 2023-03-04 20:56:59 +08:00
parent a3149dc00e
commit e8c0ddaa96
2 changed files with 9 additions and 4 deletions

View file

@ -1,4 +1,5 @@
import React from 'react';
import useStore from '@store/store';
import Avatar from './Avatar';
import MessageContent from './MessageContent';
@ -24,10 +25,14 @@ const Message = ({
messageIndex: number;
sticky?: boolean;
}) => {
const stickyIndex = useStore((state) => state.messages.length);
return (
<div
className={`w-full border-b border-black/10 dark:border-gray-900/50 text-gray-800 dark:text-gray-100 group ${
backgroundStyle[messageIndex % 2]
sticky
? backgroundStyle[stickyIndex % 2]
: backgroundStyle[messageIndex % 2]
}`}
key={
messageIndex !== -1

View file

@ -188,15 +188,15 @@ const ContentView = ({
)}
{isDelete && (
<>
<button className='p-1 hover:text-white' onClick={handleDelete}>
<TickIcon />
</button>
<button
className='p-1 hover:text-white'
onClick={() => setIsDelete(false)}
>
<CrossIcon />
</button>
<button className='p-1 hover:text-white' onClick={handleDelete}>
<TickIcon />
</button>
</>
)}
</div>