mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-16 23:45:33 +01:00
adds dark mode and logs errors in message response
This commit is contained in:
parent
58498ed951
commit
b5042a738e
13 changed files with 13873 additions and 536 deletions
|
|
@ -1,5 +1,4 @@
|
|||
import React from 'react';
|
||||
import NavLink from './NavLink';
|
||||
import TrashIcon from '../svg/TrashIcon';
|
||||
import manualSWR from '~/utils/fetchers';
|
||||
import { useDispatch } from 'react-redux';
|
||||
|
|
|
|||
19
src/components/Nav/DarkMode.jsx
Normal file
19
src/components/Nav/DarkMode.jsx
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import React, { useState, useContext } from 'react';
|
||||
import DarkModeIcon from '../svg/DarkModeIcon';
|
||||
import { ThemeContext } from '~/hooks/ThemeContext';
|
||||
|
||||
export default function DarkMode() {
|
||||
const { theme, setTheme } = useContext(ThemeContext);
|
||||
|
||||
const clickHandler = () => setTheme(theme === 'dark' ? 'light' : 'dark');
|
||||
|
||||
return (
|
||||
<a
|
||||
className="flex cursor-pointer items-center gap-3 rounded-md py-3 px-3 text-sm text-white transition-colors duration-200 hover:bg-gray-500/10"
|
||||
onClick={clickHandler}
|
||||
>
|
||||
<DarkModeIcon />
|
||||
Dark mode
|
||||
</a>
|
||||
);
|
||||
}
|
||||
|
|
@ -1,17 +1,14 @@
|
|||
import React from 'react';
|
||||
import ClearConvos from './ClearConvos';
|
||||
import NavLink from './NavLink';
|
||||
import DarkModeIcon from '../svg/DarkModeIcon';
|
||||
import LogOutIcon from '../svg/LogOutIcon';
|
||||
import ClearConvos from './ClearConvos';
|
||||
import DarkMode from './DarkMode';
|
||||
|
||||
export default function NavLinks() {
|
||||
return (
|
||||
<>
|
||||
<ClearConvos />
|
||||
<NavLink
|
||||
svg={DarkModeIcon}
|
||||
text="Dark mode"
|
||||
/>
|
||||
<DarkMode />
|
||||
<NavLink
|
||||
svg={LogOutIcon}
|
||||
text="Log out"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue