Align admin, community, search, library, learning and course management with the mockup. Add saved courses, download history, public community feed, instructor directory, backend search, course views, admin content tools and community moderation. Harden API and Nginx for production.
27 lines
928 B
TypeScript
27 lines
928 B
TypeScript
import React, { useEffect } from 'react';
|
|
import { useLocation } from 'react-router-dom';
|
|
import { Sidebar } from './Sidebar';
|
|
import { MobileBack, MobileTabBar } from './MobileNavigation';
|
|
import { useIsMobile } from '../../hooks/useMediaQuery';
|
|
|
|
export const AppShell: React.FC<{ children: React.ReactNode }> = ({ children }) => {
|
|
const location = useLocation();
|
|
const isMobile = useIsMobile();
|
|
|
|
useEffect(() => {
|
|
window.scrollTo(0, 0);
|
|
document.body.classList.toggle('immersive', location.pathname.includes('/aulas/'));
|
|
return () => document.body.classList.remove('immersive');
|
|
}, [location.pathname]);
|
|
|
|
return (
|
|
<>
|
|
{!isMobile && <Sidebar />}
|
|
{isMobile && <MobileBack />}
|
|
{/* Keyed by path: the arrival animation only plays when navigating to a new page. */}
|
|
<div className="main" key={location.pathname}>{children}</div>
|
|
{isMobile && <MobileTabBar />}
|
|
</>
|
|
);
|
|
};
|