mirror of
https://github.com/NovaOSS/nova-betterchat.git
synced 2024-11-25 19:43:59 +01:00
parent
3eac852d17
commit
cefc874a6f
|
@ -1,13 +1,38 @@
|
|||
import React from 'react';
|
||||
import React, { useState } from 'react';
|
||||
|
||||
import PopupModal from '@components/PopupModal';
|
||||
import DeleteIcon from '@icon/DeleteIcon';
|
||||
import useInitialiseNewChat from '@hooks/useInitialiseNewChat';
|
||||
|
||||
const ClearConversation = () => {
|
||||
const initialiseNewChat = useInitialiseNewChat();
|
||||
const [isModalOpen, setIsModalOpen] = useState<boolean>(false);
|
||||
|
||||
const handleConfirm = () => {
|
||||
setIsModalOpen(false);
|
||||
initialiseNewChat();
|
||||
};
|
||||
|
||||
return (
|
||||
<a className='flex py-3 px-3 items-center gap-3 rounded-md hover:bg-gray-500/10 transition-colors duration-200 text-white cursor-pointer text-sm'>
|
||||
<DeleteIcon />
|
||||
Clear conversations
|
||||
</a>
|
||||
<>
|
||||
<a
|
||||
className='flex py-3 px-3 items-center gap-3 rounded-md hover:bg-gray-500/10 transition-colors duration-200 text-white cursor-pointer text-sm'
|
||||
onClick={() => {
|
||||
setIsModalOpen(true);
|
||||
}}
|
||||
>
|
||||
<DeleteIcon />
|
||||
Clear conversations
|
||||
</a>
|
||||
{isModalOpen && (
|
||||
<PopupModal
|
||||
setIsModalOpen={setIsModalOpen}
|
||||
title='Warning'
|
||||
message='Please be advised that by confirming this action, all messages will be deleted!'
|
||||
handleConfirm={handleConfirm}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ import Updates from './Updates';
|
|||
const MenuOptions = () => {
|
||||
return (
|
||||
<>
|
||||
{/* <ClearConversation /> */}
|
||||
<ClearConversation />
|
||||
<Config />
|
||||
<ThemeSwitcher />
|
||||
{/* <Account /> */}
|
||||
|
|
Loading…
Reference in a new issue