refactor(Settings.jsx) move tabs to separate components, rewrite General in TS, fix react warnings

chore(client): remove unnecessary dependencies from package.json
feat(client): add General tab to Settings component
feat(client): add CogIcon component
refactor(client): move General tab content to separate file
fix(client): fix clearConvosMutation call in Settings component

feat(svg): add CogIcon component
refactor(conversation.js): add useCallback hook to newConversation function
refactor(conversations.js): add useCallback hook to refreshConversations function
chore(tsconfig.json): change jsx option to 'preserve'
This commit is contained in:
Daniel Avila 2023-06-11 13:45:28 -04:00 committed by Danny Avila
parent f171628948
commit 544d72ee1d
10 changed files with 134 additions and 125 deletions

View file

@ -1,4 +1,5 @@
import endpoints from './endpoints';
import { useCallback } from 'react';
import {
atom,
selector,
@ -112,7 +113,7 @@ const useConversation = () => {
);
const newConversation = (template = {}, preset) => {
const newConversation = useCallback((template = {}, preset) => {
switchToConversation(
{
conversationId: 'new',
@ -122,7 +123,7 @@ const useConversation = () => {
[],
preset
);
};
}, [switchToConversation]);
const searchPlaceholderConversation = () => {
switchToConversation(

View file

@ -1,4 +1,5 @@
import { atom, useSetRecoilState } from 'recoil';
import { useCallback } from 'react';
const refreshConversationsHint = atom({
key: 'refreshConversationsHint',
@ -8,7 +9,9 @@ const refreshConversationsHint = atom({
const useConversations = () => {
const setRefreshConversationsHint = useSetRecoilState(refreshConversationsHint);
const refreshConversations = () => setRefreshConversationsHint((prevState) => prevState + 1);
const refreshConversations = useCallback(() => {
setRefreshConversationsHint((prevState) => prevState + 1);
}, [setRefreshConversationsHint]);
return { refreshConversations };
};