Renamed (app) folder to (main).

This commit is contained in:
Mike Cao 2023-10-03 16:05:17 -07:00
parent 5c15778c9b
commit c990459238
167 changed files with 48 additions and 114 deletions

27
src/app/(main)/Shell.tsx Normal file
View file

@ -0,0 +1,27 @@
'use client';
import Script from 'next/script';
import { usePathname } from 'next/navigation';
import UpdateNotice from 'components/common/UpdateNotice';
import { useRequireLogin, useConfig } from 'components/hooks';
export function Shell({ children }) {
const { user } = useRequireLogin();
const config = useConfig();
const pathname = usePathname();
if (!user || !config) {
return null;
}
return (
<>
{children}
<UpdateNotice user={user} config={config} />
{process.env.NODE_ENV === 'production' && !pathname.includes('/share/') && (
<Script src={`telemetry.js`} />
)}
</>
);
}
export default Shell;