Mirror of https://github.com/roostorg/coop github.com/roostorg/coop
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at main 25 lines 583 B view raw
1import React, { useEffect } from 'react'; 2import { useLocation } from 'react-router-dom'; 3 4export default function LegacyCSSProvider({ 5 children, 6}: { 7 children: React.ReactNode; 8}) { 9 const { pathname } = useLocation(); 10 11 useEffect(() => { 12 if (!pathname.startsWith('/dashboard')) { 13 const link = document.createElement('link'); 14 link.rel = 'stylesheet'; 15 link.href = '/styles/legacyStyles.css'; 16 document.head.appendChild(link); 17 18 return () => { 19 document.head.removeChild(link); 20 }; 21 } 22 }, [pathname]); 23 24 return <>{children}</>; 25}