Files
compor-academy/components/shell/AppShell.tsx
Cauê Faleiros 21085e887d
All checks were successful
CI / Validate frontend and API (push) Successful in 2m22s
CI / Build and publish Docker images (push) Successful in 1m6s
feat: finalize academy redesign and production readiness
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.
2026-11-05 15:06:53 -03:00

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 />}
</>
);
};