mirror of
https://github.com/NovaOSS/nova-betterchat.git
synced 2024-11-25 22:13:59 +01:00
reorder delete confirmation button
This commit is contained in:
parent
a3149dc00e
commit
e8c0ddaa96
|
@ -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
|
||||||
|
|
|
@ -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>
|
||||||
|
|
Loading…
Reference in a new issue