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

View file

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