Skip to content

Commit

Permalink
Support Next.js export output
Browse files Browse the repository at this point in the history
  • Loading branch information
agarun committed May 11, 2024
1 parent 6c36697 commit 313c113
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
10 changes: 9 additions & 1 deletion src/app/[slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
import dynamic from 'next/dynamic';
import { getPage } from '@/lib/api';
import { Masonry } from '@/lib/masonry';
import Nav from '@/lib/nav';

const Masonry = dynamic(() => import('@/lib/masonry'), {
ssr: false
});

function capitalize(string: string): string {
return string[0].toUpperCase() + string.slice(1).toLowerCase();
}

export async function generateStaticParams() {
return [{ slug: 'azerbaijan' }];
}

async function Page({ params: { slug } }: { params: { slug: string } }) {
const photos = await getPage(capitalize(slug));

Expand Down
1 change: 0 additions & 1 deletion src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import dynamic from 'next/dynamic';
import './globals.css';

// `react-globe.gl` is not compatible with SSR
const Globe = dynamic(() => import('@/lib/globe'), {
ssr: false
});
Expand Down
2 changes: 2 additions & 0 deletions src/lib/masonry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,5 @@ export const Masonry = ({ items = [], ...props }) => {
</section>
);
};

export default Masonry;

0 comments on commit 313c113

Please sign in to comment.