)}
- {
- showTutorial('create-account', true)
- }} sx={{
- position: 'fixed',
- bottom: '25px',
- right: '25px'
- }}>
-
-
+
+
+
+ {
+ showTutorial("create-account", true);
+ }}
+ sx={{
+ position: "fixed",
+ bottom: "25px",
+ right: "25px",
+ }}
+ >
+
+
>
);
};
diff --git a/src/components/DesktopSideBar.tsx b/src/components/DesktopSideBar.tsx
index 76f2f2e..244370e 100644
--- a/src/components/DesktopSideBar.tsx
+++ b/src/components/DesktopSideBar.tsx
@@ -1,86 +1,110 @@
-import { Box, ButtonBase } from '@mui/material';
-import React from 'react'
+import { Box, ButtonBase } from "@mui/material";
+import React from "react";
import { HomeIcon } from "../assets/Icons/HomeIcon";
import { MessagingIcon } from "../assets/Icons/MessagingIcon";
import { Save } from "./Save/Save";
import { HubsIcon } from "../assets/Icons/HubsIcon";
import { CoreSyncStatus } from "./CoreSyncStatus";
-import { IconWrapper } from './Desktop/DesktopFooter';
+import { IconWrapper } from "./Desktop/DesktopFooter";
import AppIcon from "./../assets/svgs/AppIcon.svg";
-import { useRecoilState } from 'recoil';
-import { enabledDevModeAtom } from '../atoms/global';
-import { AppsIcon } from '../assets/Icons/AppsIcon';
+import { useRecoilState } from "recoil";
+import { enabledDevModeAtom } from "../atoms/global";
+import { AppsIcon } from "../assets/Icons/AppsIcon";
+import ThemeSelector from "./Theme/ThemeSelector";
-export const DesktopSideBar = ({goToHome, setDesktopSideView, toggleSideViewDirects, hasUnreadDirects, isDirects, toggleSideViewGroups,hasUnreadGroups, isGroups, isApps, setDesktopViewMode, desktopViewMode, myName }) => {
- const [isEnabledDevMode, setIsEnabledDevMode] = useRecoilState(enabledDevModeAtom)
+export const DesktopSideBar = ({
+ goToHome,
+ setDesktopSideView,
+ toggleSideViewDirects,
+ hasUnreadDirects,
+ isDirects,
+ toggleSideViewGroups,
+ hasUnreadGroups,
+ isGroups,
+ isApps,
+ setDesktopViewMode,
+ desktopViewMode,
+ myName,
+}) => {
+ const [isEnabledDevMode, setIsEnabledDevMode] =
+ useRecoilState(enabledDevModeAtom);
return (
-
- {
- goToHome();
-
- }}
- >
-
-
-
-
- {
- setDesktopViewMode('apps')
- // setIsOpenSideViewDirects(false)
- // setIsOpenSideViewGroups(false)
- }}
- >
-
-
-
-
- {
- setDesktopViewMode('chat')
- }}
- >
+
+ {
+ goToHome();
+ }}
+ >
+
+
+ {
+ setDesktopViewMode("apps");
+ // setIsOpenSideViewDirects(false)
+ // setIsOpenSideViewGroups(false)
+ }}
+ >
-
-
-
- {/*
+
+
+
+ {
+ setDesktopViewMode("chat");
+ }}
+ >
+
+
+
+
+ {/* {
setDesktopSideView("groups");
toggleSideViewGroups()
@@ -98,23 +122,32 @@ export const DesktopSideBar = ({goToHome, setDesktopSideView, toggleSideViewDire
/>
*/}
-
- {/* */}
- {isEnabledDevMode && (
-
+ {/* */}
+ {isEnabledDevMode && (
+ {
- setDesktopViewMode('dev')
+ setDesktopViewMode("dev");
}}
>
-
+
- )}
-
- )
-}
+ )}
+
+
+
+ );
+};
diff --git a/src/components/Theme/ThemeContext.tsx b/src/components/Theme/ThemeContext.tsx
new file mode 100644
index 0000000..249b718
--- /dev/null
+++ b/src/components/Theme/ThemeContext.tsx
@@ -0,0 +1,23 @@
+import { createContext, useContext, useState, useMemo } from 'react';
+import { ThemeProvider as MuiThemeProvider } from '@mui/material/styles';
+import { darkTheme, lightTheme } from '../../styles/theme';
+
+const ThemeContext = createContext({ themeMode: 'light', toggleTheme: () => {} });
+
+export const ThemeProvider = ({ children }: { children: React.ReactNode }) => {
+ const [themeMode, setThemeMode] = useState('light');
+
+ const theme = useMemo(() => (themeMode === 'light' ? lightTheme : darkTheme), [themeMode]);
+
+ const toggleTheme = () => {
+ setThemeMode((prevMode) => (prevMode === 'light' ? 'dark' : 'light'));
+ };
+
+ return (
+
+ {children}
+
+ );
+};
+
+export const useThemeContext = () => useContext(ThemeContext);
\ No newline at end of file
diff --git a/src/components/Theme/ThemeSelector.tsx b/src/components/Theme/ThemeSelector.tsx
new file mode 100644
index 0000000..b9307f3
--- /dev/null
+++ b/src/components/Theme/ThemeSelector.tsx
@@ -0,0 +1,18 @@
+import { useThemeContext } from "./ThemeContext";
+import { Switch } from "@mui/material";
+import { Brightness4, Brightness7 } from "@mui/icons-material";
+
+const ThemeSelector = ({ style }) => {
+ const { themeMode, toggleTheme } = useThemeContext();
+
+ return (
+
+ {themeMode === "dark" ? : }
+
+
+ );
+};
+
+export default ThemeSelector;
diff --git a/src/main.tsx b/src/main.tsx
index 22bba47..cddf0dd 100644
--- a/src/main.tsx
+++ b/src/main.tsx
@@ -1,81 +1,139 @@
-import React from 'react'
-import ReactDOM from 'react-dom/client'
-import App from './App.tsx'
-import './index.css'
-import "./messaging/messagesToBackground";
-import { ThemeProvider, createTheme } from '@mui/material/styles';
-import { CssBaseline } from '@mui/material';
-import { MessageQueueProvider } from './MessageQueueContext.tsx';
-import { RecoilRoot } from 'recoil';
-const theme = createTheme({
- palette: {
- primary: {
- main: '#232428', // Primary color (e.g., used for buttons, headers, etc.)
- },
- secondary: {
- main: '#232428', // Secondary color
- },
- background: {
- default: '#27282c', // Default background color
- paper: '#1d1d1d', // Paper component background (for dropdowns, dialogs, etc.)
- },
- text: {
- primary: '#ffffff', // White as the primary text color
- secondary: '#b0b0b0', // Light gray for secondary text
- disabled: '#808080', // Gray for disabled text
- },
- action: {
- // disabledBackground: 'set color of background here',
- disabled: 'rgb(255 255 255 / 70%)'
- }
- },
- typography: {
- fontFamily: '"Inter", "Roboto", "Helvetica", "Arial", sans-serif', // Font family
- h1: {
- color: '#ffffff', // White color for h1 elements
- },
- h2: {
- color: '#ffffff', // White color for h2 elements
- },
- body1: {
- color: '#ffffff', // Default body text color
- },
- body2: {
- color: '#b0b0b0', // Lighter text for body2, often used for secondary text
- },
- },
- components: {
- MuiOutlinedInput: {
- styleOverrides: {
- root: {
- ".MuiOutlinedInput-notchedOutline": {
- borderColor: "white", // ⚪ Default outline color
- },
- },
- },
- },
- MuiSelect: {
- styleOverrides: {
- icon: {
- color: "white", // ✅ Caret (dropdown arrow) color
- },
- },
- },
- },
-});
+import React from "react";
+import ReactDOM from "react-dom/client";
+import App from "./App.tsx";
+import "./index.css";
+import "./messaging/messagesToBackground";
+import { CssBaseline } from "@mui/material";
+import { MessageQueueProvider } from "./MessageQueueContext.tsx";
+import { RecoilRoot } from "recoil";
+import { ThemeProvider } from "./components/Theme/ThemeContext.tsx";
-export default theme;
+// const darkTheme: ThemeOptions = {
+// palette: {
+// primary: {
+// main: "#232428", // Primary color (e.g., used for buttons, headers, etc.)
+// },
+// secondary: {
+// main: "#232428", // Secondary color
+// },
+// background: {
+// default: "#27282c", // Default background color
+// paper: "#1d1d1d", // Paper component background (for dropdowns, dialogs, etc.)
+// },
+// text: {
+// primary: "#ffffff", // White as the primary text color
+// secondary: "#b0b0b0", // Light gray for secondary text
+// disabled: "#808080", // Gray for disabled text
+// },
+// action: {
+// // disabledBackground: 'set color of background here',
+// disabled: "rgb(255 255 255 / 70%)",
+// },
+// },
+// typography: {
+// fontFamily: '"Inter", "Roboto", "Helvetica", "Arial", sans-serif', // Font family
+// h1: {
+// color: "#ffffff", // White color for h1 elements
+// },
+// h2: {
+// color: "#ffffff", // White color for h2 elements
+// },
+// body1: {
+// color: "#ffffff", // Default body text color
+// },
+// body2: {
+// color: "#b0b0b0", // Lighter text for body2, often used for secondary text
+// },
+// },
+// components: {
+// MuiOutlinedInput: {
+// styleOverrides: {
+// root: {
+// ".MuiOutlinedInput-notchedOutline": {
+// borderColor: "white", // ⚪ Default outline color
+// },
+// },
+// },
+// },
+// MuiSelect: {
+// styleOverrides: {
+// icon: {
+// color: "white", // ✅ Caret (dropdown arrow) color
+// },
+// },
+// },
+// },
+// }
+// const lightTheme: ThemeOptions = {
+// palette: {
+// primary: {
+// main: "#1976d2", // Primary color for buttons, headers, etc.
+// },
+// secondary: {
+// main: "#ff4081", // Secondary color with a vibrant pink touch
+// },
+// background: {
+// default: "#f5f5f5", // Light background color for the main UI
+// paper: "#ffffff", // Background color for Paper components (dialogs, dropdowns, etc.)
+// },
+// text: {
+// primary: "#212121", // Dark text for contrast and readability
+// secondary: "#616161", // Medium gray for secondary text
+// disabled: "#9e9e9e", // Light gray for disabled text
+// },
+// action: {
+// disabled: "rgb(0 0 0 / 50%)", // Color for disabled actions
+// },
+// },
+// typography: {
+// fontFamily: '"Inter", "Roboto", "Helvetica", "Arial", sans-serif', // Font family for consistency
+// h1: {
+// color: "#ffffff", // Dark color for main headings (h1)
+// },
+// h2: {
+// color: "#ffffff", // Dark color for subheadings (h2)
+// },
+// body1: {
+// color: "#ffffff", // Default body text color
+// },
+// body2: {
+// color: "#ffffff", // Lighter text for secondary content
+// },
+// },
+// components: {
+// MuiOutlinedInput: {
+// styleOverrides: {
+// root: {
+// ".MuiOutlinedInput-notchedOutline": {
+// borderColor: "#ffffff", // Darker outline for better input field visibility
+// },
+// },
+// },
+// },
+// MuiSelect: {
+// styleOverrides: {
+// icon: {
+// color: "#212121", // Dark dropdown arrow icon for contrast
+// },
+// },
+// },
+// },
+// };
-ReactDOM.createRoot(document.getElementById('root')!).render(
+// const theme = createTheme(lightTheme);
+
+// export default theme;
+
+ReactDOM.createRoot(document.getElementById("root")!).render(
<>
-
+
-
-
-
-
-
+
+
+
+
+
- >,
-)
+ >
+);