App-Main.js

import React from 'react';
import RoutesMain from '../routes/main';
import SvgIcons from '../components/common/icons';

import './App.scss';

function setTheme() {
  const now = new Date();
  const hour = now.getHours();
  const theme = hour > 18 || hour < 6 ? 'dark' : 'light';
  document.documentElement.setAttribute('data-theme', theme);
}

function AppMain() {
  setTheme();

  return (
    <>
      <RoutesMain />
      <SvgIcons />
    </>
  );
}

export default AppMain;