mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-02-16 20:13:49 +00:00
Refactor: Implement lazy loading for BreweryPost and BeerPost pages
This commit is contained in:
@@ -2,10 +2,6 @@ import { NextPage, GetServerSideProps } from 'next';
|
||||
import Head from 'next/head';
|
||||
import Image from 'next/image';
|
||||
|
||||
import BeerInfoHeader from '@/components/BeerById/BeerInfoHeader';
|
||||
import BeerPostCommentsSection from '@/components/BeerById/BeerPostCommentsSection';
|
||||
import BeerRecommendations from '@/components/BeerById/BeerRecommendations';
|
||||
|
||||
import getBeerPostById from '@/services/BeerPost/getBeerPostById';
|
||||
|
||||
import beerPostQueryResult from '@/services/BeerPost/schema/BeerPostQueryResult';
|
||||
@@ -16,6 +12,13 @@ import 'react-responsive-carousel/lib/styles/carousel.min.css';
|
||||
import { Carousel } from 'react-responsive-carousel';
|
||||
import useMediaQuery from '@/hooks/utilities/useMediaQuery';
|
||||
import { Tab } from '@headlessui/react';
|
||||
import dynamic from 'next/dynamic';
|
||||
|
||||
const [BeerInfoHeader, BeerPostCommentsSection, BeerRecommendations] = [
|
||||
dynamic(() => import('@/components/BeerById/BeerInfoHeader')),
|
||||
dynamic(() => import('@/components/BeerById/BeerPostCommentsSection')),
|
||||
dynamic(() => import('@/components/BeerById/BeerRecommendations')),
|
||||
];
|
||||
|
||||
interface BeerPageProps {
|
||||
beerPost: z.infer<typeof beerPostQueryResult>;
|
||||
|
||||
Reference in New Issue
Block a user