Allow embedding of share page.

This commit is contained in:
Mike Cao 2023-11-11 20:45:09 -08:00
parent 9cb6046844
commit eda2c07ea3
10 changed files with 58 additions and 39 deletions

View file

@ -4,7 +4,7 @@ import { usePathname } from 'next/navigation';
import UpdateNotice from 'components/common/UpdateNotice';
import { useRequireLogin, useConfig } from 'components/hooks';
export function Shell({ children }) {
export function App({ children }) {
const { user } = useRequireLogin();
const config = useConfig();
const pathname = usePathname();
@ -24,4 +24,4 @@ export function Shell({ children }) {
);
}
export default Shell;
export default App;

View file

@ -1,7 +1,7 @@
import Dashboard from 'app/(main)/dashboard/Dashboard';
import { Metadata } from 'next';
export default function DashboardPage() {
export default function () {
return <Dashboard />;
}

View file

@ -1,11 +1,11 @@
import Shell from './Shell';
import App from './App';
import NavBar from './NavBar';
import Page from 'components/layout/Page';
import styles from './layout.module.css';
export default function AppLayout({ children }) {
export default function ({ children }) {
return (
<Shell>
<App>
<main className={styles.layout}>
<nav className={styles.nav}>
<NavBar />
@ -14,6 +14,6 @@ export default function AppLayout({ children }) {
<Page>{children}</Page>
</section>
</main>
</Shell>
</App>
);
}

View file

@ -5,9 +5,9 @@ import useFilterQuery from 'components/hooks/useFilterQuery';
import DataTable from 'components/common/DataTable';
import useCache from 'store/cache';
export default function ReportsDataTable({ websiteId }) {
export default function ReportsDataTable({ websiteId }: { websiteId?: string }) {
const { get } = useApi();
const modified = useCache(state => state?.reports);
const modified = useCache(state => (state as any)?.reports);
const queryResult = useFilterQuery(['reports', { websiteId, modified }], params =>
get(websiteId ? `/websites/${websiteId}/reports` : `/reports`, params),
);

View file

@ -1,7 +1,7 @@
import ReportsHeader from './ReportsHeader';
import ReportsDataTable from './ReportsDataTable';
export default function ReportsPage() {
export default function () {
return (
<>
<ReportsHeader />