Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: change dynamic import #9

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions pages/[lng]/blog/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import { FC, useState } from 'react'
import { useRouter } from 'next/router'
import { GetServerSideProps, InferGetServerSidePropsType } from 'next'
import dynamic from 'next/dynamic'
import Link from 'next/link'
import { RiQuestionFill } from 'react-icons/ri'
import { IoChevronBack, IoChevronForward } from 'react-icons/io5'
Expand All @@ -13,13 +12,12 @@ import { useBrand } from 'lib/useBrand'
/* components */
import Layout from 'components/Layout/Layout'
import Breadcrumb from 'components/Breadcrumb/Breadcrumb'
import EmptyComponent from 'components/EmptyComponent/EmptyComponent'
/* styles */
import styleBlog from 'public/scss/pages/Blog.module.scss'
import stylePlaceHolder from 'public/scss/components/Placeholder.module.scss'
import stylePagination from 'public/scss/components/Pagination.module.scss'

const EmptyComponent = dynamic(() => import('components/EmptyComponent/EmptyComponent'))

const classesBlogs = {
blogsContainerClassName: styleBlog.blog_items,
blogContainerClassName: `blog_list ${styleBlog.blog_item}`,
Expand Down
4 changes: 1 addition & 3 deletions pages/[lng]/contact/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/* library package */
import { FC } from 'react'
import { GetServerSideProps, InferGetServerSidePropsType } from 'next'
import dynamic from 'next/dynamic'
import { toast } from 'react-toastify'
import {
useI18n,
Expand All @@ -14,14 +13,13 @@ import { useBrand } from 'lib/useBrand'
/* components */
import Layout from 'components/Layout/Layout'
import Breadcrumb from 'components/Breadcrumb/Breadcrumb'
import Placeholder from 'components/Placeholder'
/* styles */
import styleContact from 'public/scss/pages/Contact.module.scss'
import styleForm from 'public/scss/components/Form.module.scss'
import styleButton from 'public/scss/components/Button.module.scss'
import stylePlaceholder from 'public/scss/components/Placeholder.module.scss'

const Placeholder = dynamic(() => import('components/Placeholder'))

const classesContact = {
containerClassName: styleContact.contact_body,
mapClassName: 'd-none',
Expand Down
5 changes: 2 additions & 3 deletions pages/[lng]/login/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/* library package */
import { FC, useState } from 'react'
import { GetServerSideProps, InferGetServerSidePropsType } from 'next'
import dynamic from 'next/dynamic'
import { useRouter } from 'next/router'
import {
RiEyeCloseLine,
Expand All @@ -27,8 +26,8 @@ import { useWhatsAppOTPSetting } from 'lib/useWhatsAppOtp'
/* components */
import SEO from 'components/SEO'
import Layout from 'components/Layout/Layout'
const LoaderPages = dynamic(() => import("components/Loader/LoaderPages"))
const Loader = dynamic(() => import("components/Loader/Loader"))
import LoaderPages from 'components/Loader/LoaderPages'
import Loader from 'components/Loader/Loader'
import Breadcrumb from 'components/Breadcrumb/Breadcrumb'
/* styles */
import styleLogin from 'public/scss/pages/Login.module.scss'
Expand Down
7 changes: 3 additions & 4 deletions pages/[lng]/payment_method/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import { FC, ReactNode } from 'react'
import { GetServerSideProps, InferGetServerSidePropsType } from 'next'
import { useRouter } from 'next/router'
import dynamic from 'next/dynamic'
import { toast } from 'react-toastify'
import { HiCheckCircle } from 'react-icons/hi'
import { FiX } from 'react-icons/fi'
Expand All @@ -22,9 +21,9 @@ import Layout from 'components/Layout/Layout'
import EmptyComponent from 'components/EmptyComponent/EmptyComponent'
import Stepper from 'components/Stepper'
import HeaderCheckout from 'components/Header/HeaderCheckout'
const Loader = dynamic(() => import('components/Loader/Loader'))
const LoaderPages = dynamic(() => import('components/Loader/LoaderPages'))
const Placeholder = dynamic(() => import('components/Placeholder'))
import Loader from 'components/Loader/Loader'
import LoaderPages from 'components/Loader/LoaderPages'
import Placeholder from 'components/Placeholder'
/* styles */
import styleCustomer from 'public/scss/components/CustomerDetail.module.scss'
import styleBtn from 'public/scss/components/Button.module.scss'
Expand Down
7 changes: 3 additions & 4 deletions pages/[lng]/place_order/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
useState
} from 'react'
import { GetServerSideProps, InferGetServerSidePropsType } from 'next'
import dynamic from 'next/dynamic'
import { toast } from 'react-toastify'
import { BiTargetLock } from 'react-icons/bi'
import {
Expand All @@ -30,9 +29,9 @@ import Layout from 'components/Layout/Layout'
import HeaderCheckout from 'components/Header/HeaderCheckout'
import Stepper from 'components/Stepper'
import OrderSummaryBox from 'components/OrderSummaryBox'
const Popup = dynamic(() => import('components/Popup'))
const Loader = dynamic(() => import('components/Loader/Loader'))
const LoaderPages = dynamic(() => import('components/Loader/LoaderPages'))
import Popup from 'components/Popup'
import Loader from 'components/Loader/Loader'
import LoaderPages from 'components/Loader/LoaderPages'
/* styles */
import styleForm from 'public/scss/components/Form.module.scss'
import styleButton from 'public/scss/components/Button.module.scss'
Expand Down
7 changes: 3 additions & 4 deletions pages/[lng]/product/[slug].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
useState,
useEffect
} from 'react'
import dynamic from 'next/dynamic'
import { useRouter } from 'next/router'
import { toast } from 'react-toastify'
import {
Expand Down Expand Up @@ -36,9 +35,9 @@ import { formatPrice } from 'lib/formatPrice'
import SEO from 'components/SEO'
import Layout from 'components/Layout/Layout'
import Placeholder from 'components/Placeholder'
const EmptyComponent = dynamic(() => import('components/EmptyComponent/EmptyComponent'))
const Popup = dynamic(() => import('components/Popup'))
const SocialShare = dynamic(() => import('components/SocialShare'))
import EmptyComponent from 'components/EmptyComponent/EmptyComponent'
import Popup from 'components/Popup'
import SocialShare from 'components/SocialShare'
/* styles */
import styleEstimate from 'public/scss/components/EstimateShipping.module.scss'
import styleProductDetail from 'public/scss/components/ProductDetail.module.scss'
Expand Down
3 changes: 1 addition & 2 deletions pages/[lng]/products/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
} from 'react'
import { GetServerSideProps, InferGetServerSidePropsType } from 'next'
import { useRouter } from 'next/router'
import dynamic from 'next/dynamic'
import {
RiQuestionFill,
RiCloseLine
Expand All @@ -31,7 +30,7 @@ import SEO from 'components/SEO'
import Layout from 'components/Layout/Layout'
import Breadcrumb from 'components/Breadcrumb/Breadcrumb'
import EmptyComponent from 'components/EmptyComponent/EmptyComponent'
const Popup = dynamic(() => import('components/Popup'))
import Popup from 'components/Popup'
/* styles */
import styleButton from 'public/scss/components/Button.module.scss'
import styleProduct from 'public/scss/components/Product.module.scss'
Expand Down
5 changes: 2 additions & 3 deletions pages/[lng]/register/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import { FC, useState } from 'react'
import { GetServerSideProps, InferGetServerSidePropsType } from 'next'
import { useRouter } from 'next/router'
import dynamic from 'next/dynamic'
import { toast } from 'react-toastify'
import ReCAPTCHA from 'react-google-recaptcha'
import {
Expand Down Expand Up @@ -31,8 +30,8 @@ import { useWhatsAppOTPSetting } from 'lib/useWhatsAppOtp'
import SEO from 'components/SEO'
import Layout from 'components/Layout/Layout'
import Breadcrumbs from 'components/Breadcrumb/Breadcrumb'
const LoaderPages = dynamic(() => import("components/Loader/LoaderPages"))
const Loader = dynamic(() => import("components/Loader/Loader"))
import LoaderPages from 'components/Loader/LoaderPages'
import Loader from 'components/Loader/Loader'
/* styles */
import styleLogin from 'public/scss/pages/Login.module.scss'
import styleForm from 'public/scss/components/Form.module.scss'
Expand Down
5 changes: 2 additions & 3 deletions pages/[lng]/shipping_method/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import { FC, ReactNode } from 'react'
import { GetServerSideProps, InferGetServerSidePropsType } from 'next'
import { useRouter } from 'next/router'
import dynamic from 'next/dynamic'
import { toast } from 'react-toastify'
import { FiX } from 'react-icons/fi'
import { BiTargetLock } from 'react-icons/bi'
Expand All @@ -21,8 +20,8 @@ import Layout from 'components/Layout/Layout'
import HeaderCheckout from 'components/Header/HeaderCheckout'
import Stepper from 'components/Stepper'
import OrderSummaryBox from 'components/OrderSummaryBox'
const Placeholder = dynamic(() => import('components/Placeholder'))
const LoaderPages = dynamic(() => import('components/Loader/LoaderPages'))
import Placeholder from 'components/Placeholder'
import LoaderPages from 'components/Loader/LoaderPages'
/* styles */
import styleShipping from 'public/scss/components/Shipping.module.scss'
import styleCustomer from 'public/scss/components/CustomerDetail.module.scss'
Expand Down
3 changes: 1 addition & 2 deletions pages/[lng]/testimonials/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/* library package */
import { FC, useState } from 'react'
import { GetServerSideProps, InferGetServerSidePropsType } from 'next'
import dynamic from 'next/dynamic'
import { useRouter } from 'next/router'
import { toast } from 'react-toastify'
import ReCAPTCHA from 'react-google-recaptcha'
Expand All @@ -17,7 +16,7 @@ import { useBrand } from 'lib/useBrand'
/* components */
import Layout from 'components/Layout/Layout'
import Placeholder from 'components/Placeholder'
const Popup = dynamic(() => import('components/Popup'))
import Popup from 'components/Popup'
/* styles */
import styles from 'public/scss/pages/Testimonials.module.scss'

Expand Down