* Add next suggestions and remove console logs * Add pomodoro timer * Add pomodoro switch in settings * Fix pomodoro setting * Add timezones to settings * Fix an issue with password reset * Cleanup * Sort tags alphabetically * Clean up today's view * Add an indicator for repeatedly added to today * Refactor tags * Add due date today item * Move recurrence to the subtitle area * Fix today layout * Add a badge to Inbox items * Move inbox badge to sidebar * Add quotes and progress bar * Add translations for quotes * Fix test issues * Add helper script for docker local * Set up overdue tasks * Add linux/arm/v7 build to deploy script * Add linux/arm/v7 build to deploy script pt2 * Fix an issue with helmet and SSL * Add volume db persistence * Fix cog icon issues
65 lines
1.8 KiB
TypeScript
65 lines
1.8 KiB
TypeScript
// Add type declaration for module.hot
|
|
declare const module: {
|
|
hot?: {
|
|
accept: (path: string, callback: () => void) => void;
|
|
};
|
|
};
|
|
|
|
import React from "react";
|
|
import { createRoot } from "react-dom/client";
|
|
import { BrowserRouter } from "react-router-dom";
|
|
import App from "./App";
|
|
import { ToastProvider } from "./components/Shared/ToastContext";
|
|
import './i18n'; // Import i18n config to initialize it
|
|
import './styles/markdown.css'; // Import markdown styles
|
|
import { I18nextProvider } from 'react-i18next';
|
|
import i18n from './i18n'; // Import the i18n instance with its configuration
|
|
|
|
const storedPreference = localStorage.getItem("isDarkMode");
|
|
const prefersDarkMode = window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
const isDarkMode = storedPreference
|
|
? storedPreference === "true"
|
|
: prefersDarkMode;
|
|
|
|
if (isDarkMode) {
|
|
document.documentElement.classList.add("dark");
|
|
} else {
|
|
document.documentElement.classList.remove("dark");
|
|
}
|
|
|
|
const container = document.getElementById("root");
|
|
|
|
// Store the root outside the if block so it can be accessed by the HMR code
|
|
let root: any;
|
|
|
|
if (container) {
|
|
root = createRoot(container);
|
|
root.render(
|
|
<I18nextProvider i18n={i18n}>
|
|
<BrowserRouter>
|
|
<ToastProvider>
|
|
<App />
|
|
</ToastProvider>
|
|
</BrowserRouter>
|
|
</I18nextProvider>
|
|
);
|
|
}
|
|
|
|
// Hot Module Replacement (HMR) - Remove this snippet to remove HMR.
|
|
// Learn more: https://www.webpackjs.com/concepts/hot-module-replacement/
|
|
if (module.hot) {
|
|
module.hot.accept('./App', () => {
|
|
// New version of App component imported
|
|
if (root) {
|
|
root.render(
|
|
<I18nextProvider i18n={i18n}>
|
|
<BrowserRouter>
|
|
<ToastProvider>
|
|
<App />
|
|
</ToastProvider>
|
|
</BrowserRouter>
|
|
</I18nextProvider>
|
|
);
|
|
}
|
|
});
|
|
}
|