Chore: move PaletteStyleTag (#28086)

pull/28091/head
Guilherme Gazzo 3 years ago committed by GitHub
parent f4c5005519
commit b2a19d649c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      apps/meteor/client/views/root/AppLayout.tsx
  2. 4
      apps/meteor/client/views/root/MainLayout/LayoutWithSidebar.tsx

@ -1,5 +1,3 @@
import { PaletteStyleTag } from '@rocket.chat/ui-theming/src/PaletteStyleTag';
import { SidebarPaletteStyleTag } from '@rocket.chat/ui-theming/src/SidebarPaletteStyleTag';
import type { ReactElement } from 'react';
import React, { useEffect, Suspense } from 'react';
import { useSyncExternalStore } from 'use-sync-external-store/shim';
@ -30,8 +28,6 @@ const AppLayout = (): ReactElement => {
return (
<>
<PaletteStyleTag />
<SidebarPaletteStyleTag />
<Suspense fallback={<PageLoading />}>{layout}</Suspense>
{portals}
</>

@ -1,5 +1,7 @@
import { Box } from '@rocket.chat/fuselage';
import { useLayout, useCurrentRoute, useRoutePath, useSetting, useCurrentModal, useRoute } from '@rocket.chat/ui-contexts';
import { PaletteStyleTag } from '@rocket.chat/ui-theming/src/PaletteStyleTag';
import { SidebarPaletteStyleTag } from '@rocket.chat/ui-theming/src/SidebarPaletteStyleTag';
import type { ReactElement, ReactNode } from 'react';
import React, { useEffect, useRef } from 'react';
@ -45,6 +47,8 @@ const LayoutWithSidebar = ({ children }: { children: ReactNode }): ReactElement
className={[embeddedLayout ? 'embedded-view' : undefined, 'menu-nav'].filter(Boolean).join(' ')}
aria-hidden={Boolean(modal)}
>
<PaletteStyleTag />
<SidebarPaletteStyleTag />
{!removeSidenav ? <Sidebar /> : null}
<div className={['rc-old', 'main-content', readReceiptsEnabled ? 'read-receipts-enabled' : undefined].filter(Boolean).join(' ')}>
{children}

Loading…
Cancel
Save