Skip to content
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
243 changes: 232 additions & 11 deletions next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,13 @@ const nextConfig = {
},

webpack(config) {
// Grab the existing rule that handles SVG imports
const fileLoaderRule = config.module.rules.find((rule) => rule.test?.test?.('.svg'));

config.module.rules.push(
// Reapply the existing rule, but only for svg imports ending in ?url
{
...fileLoaderRule,
test: /\.svg$/i,
resourceQuery: /url/, // *.svg?url
resourceQuery: /url/,
},
// Convert all other *.svg imports to React components
{
test: /\.svg$/i,
issuer: fileLoaderRule.issuer,
Expand All @@ -56,27 +52,252 @@ const nextConfig = {
],
},
);

// Modify the file loader rule to ignore *.svg, since we have it handled now.
fileLoaderRule.exclude = /\.svg$/i;

config.module.rules.push({
test: /\.(woff|woff2|eot|ttf|otf)$/i,
type: 'asset/resource',
generator: {
filename: 'static/fonts/[name][ext]',
},
});

return config;
},

sassOptions: {
includePaths: ['styles'],
additionalData: `@import "src/styles/_globals.scss";`,
},

transpilePackages: ['three'],

async redirects() {
return [
{
source: '/(.*)',
has: [
{
type: 'header',
key: 'User-Agent',
value: '(.*MJ12bot.*)',
},
],
destination: '/401',
permanent: false,
},
{
source: '/(.*)',
has: [
{
type: 'header',
key: 'User-Agent',
value: '(.*Amazonbot.*)',
},
],
destination: '/401',
permanent: false,
},
{
source: '/(.*)',
has: [
{
type: 'header',
key: 'User-Agent',
value: '(.*ClaudeBot.*)',
},
],
destination: '/401',
permanent: false,
},
{
source: '/(.*)',
has: [
{
type: 'header',
key: 'User-Agent',
value: '(.*DotBot.*)',
},
],
destination: '/401',
permanent: false,
},
{
source: '/(.*)',
has: [
{
type: 'header',
key: 'User-Agent',
value: '(.*Linkbot.*)',
},
],
destination: '/401',
permanent: false,
},
{
source: '/(.*)',
has: [
{
type: 'header',
key: 'User-Agent',
value: '(.*Iframely.*)',
},
],
destination: '/401',
permanent: false,
},
{
source: '/(.*)',
has: [
{
type: 'header',
key: 'User-Agent',
value: '(.*AhrefsBot.*)',
},
],
destination: '/401',
permanent: false,
},
{
source: '/(.*)',
has: [
{
type: 'header',
key: 'User-Agent',
value: '(.*PetalBot.*)',
},
],
destination: '/401',
permanent: false,
},
{
source: '/(.*)',
has: [
{
type: 'header',
key: 'User-Agent',
value: '(.*BLEXBot.*)',
},
],
destination: '/401',
permanent: false,
},
{
source: '/(.*)',
has: [
{
type: 'header',
key: 'User-Agent',
value: '(.*woorankreview.*)',
},
],
destination: '/401',
permanent: false,
},
{
source: '/(.*)',
has: [
{
type: 'header',
key: 'User-Agent',
value: '(.*Barkrowler.*)',
},
],
destination: '/401',
permanent: false,
},
{
source: '/(.*)',
has: [
{
type: 'header',
key: 'User-Agent',
value: '(.*Neevabot.*)',
},
],
destination: '/401',
permanent: false,
},
{
source: '/(.*)',
has: [
{
type: 'header',
key: 'User-Agent',
value: '(.*SeoSiteCheckup.*)',
},
],
destination: '/401',
permanent: false,
},
{
source: '/(.*)',
has: [
{
type: 'header',
key: 'User-Agent',
value: '(.*SemrushBot.*)',
},
],
destination: '/401',
permanent: false,
},
{
source: '/(.*)',
has: [
{
type: 'header',
key: 'User-Agent',
value: '(.*RSiteAuditor.*)',
},
],
destination: '/401',
permanent: false,
},
{
source: '/(.*)',
has: [
{
type: 'header',
key: 'User-Agent',
value: '(.*YandexBot.*)',
},
],
destination: '/401',
permanent: false,
},
{
source: '/(.*)',
has: [
{
type: 'header',
key: 'User-Agent',
value: '(.*GrapeshotCrawler.*)',
},
],
destination: '/401',
permanent: false,
},
{
source: '/(.*)',
has: [
{
type: 'header',
key: 'User-Agent',
value: '(.*proximic.*)',
},
],
destination: '/401',
permanent: false,
},
{
source: '/wordpress',
destination: '/401',
permanent: true,
},
{
source: '/wp-login.php',
destination: '/401',
permanent: true,
},
];
},
};

export default nextConfig;
32 changes: 14 additions & 18 deletions src/app/shop/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
// import { ReactNode } from 'react';
import { ReactNode } from 'react';

// import Breadcrumb from '@/components/Breadcrumb/Breadcrumb';
import Breadcrumb from '@/components/Breadcrumb/Breadcrumb';

// interface ShopLayoutProps {
// children: ReactNode;
// }

// export default function ShopLayout({ children }: ShopLayoutProps) {
// return (
// <section>
// <div>
// <Breadcrumb />
// {children}
// </div>
// </section>
// );
// }
interface ShopLayoutProps {
children: ReactNode;
}

export default function ShopLayout() {
return null;
export default function ShopLayout({ children }: ShopLayoutProps) {
return (
<section>
<div>
<Breadcrumb />
{children}
</div>
</section>
);
}
76 changes: 36 additions & 40 deletions src/app/shop/page.tsx
Original file line number Diff line number Diff line change
@@ -1,46 +1,42 @@
// import { getAllProductList } from '@/api/productAPI';
// import Pagination from '@/components/Pagination/Pagination';
// import type { ProductParams } from '@/types/productItemType';
// import classNames from 'classnames/bind';
// import CategoryMenu from './_components/Category/CategoryMenu';
// import CategoryTitle from './_components/Category/CategoryTitle';
// import ProductList from './_components/Product/ProductList';
// import Sort from './_components/Sort/Sort';
// import styles from './page.module.scss';
import { getAllProductList } from '@/api/productAPI';
import Pagination from '@/components/Pagination/Pagination';
import type { ProductParams } from '@/types/productItemType';
import classNames from 'classnames/bind';
import CategoryMenu from './_components/Category/CategoryMenu';
import CategoryTitle from './_components/Category/CategoryTitle';
import ProductList from './_components/Product/ProductList';
import Sort from './_components/Sort/Sort';
import styles from './page.module.scss';

// const cn = classNames.bind(styles);
const cn = classNames.bind(styles);

// interface ShopAllPageProps {
// searchParams: { [key: string]: string | string[] | undefined };
// }

// export default async function ShopAllPage({ searchParams }: ShopAllPageProps) {
// const sortParam = Array.isArray(searchParams.sort) ? searchParams.sort[0] : searchParams.sort || 'createdAt_desc';
// const pageParam = Array.isArray(searchParams.page) ? searchParams.page[0] : searchParams.page || '0';
interface ShopAllPageProps {
searchParams: { [key: string]: string | string[] | undefined };
}

// const getAllProductParams: ProductParams = {
// sort: sortParam as string,
// page: pageParam as string,
// size: '16',
// };
export default async function ShopAllPage({ searchParams }: ShopAllPageProps) {
const sortParam = Array.isArray(searchParams.sort) ? searchParams.sort[0] : searchParams.sort || 'createdAt_desc';
const pageParam = Array.isArray(searchParams.page) ? searchParams.page[0] : searchParams.page || '0';

// const { data } = await getAllProductList(getAllProductParams);
// const { content, ...rest } = data;
// return (
// <>
// <div className={cn('title-wrap')}>
// <CategoryTitle totalCount={rest.totalElements}>전체상품</CategoryTitle>
// <Sort />
// </div>
// <CategoryMenu />
// <section className={cn('list-section')}>
// <ProductList content={content} size='lg' />
// <Pagination {...rest} searchParams={searchParams} />
// </section>
// </>
// );
// }
const getAllProductParams: ProductParams = {
sort: sortParam as string,
page: pageParam as string,
size: '16',
};

export default async function ShopAllPage() {
return null;
const { data } = await getAllProductList(getAllProductParams);
const { content, ...rest } = data;
return (
<>
<div className={cn('title-wrap')}>
<CategoryTitle totalCount={rest.totalElements}>전체상품</CategoryTitle>
<Sort />
</div>
<CategoryMenu />
<section className={cn('list-section')}>
<ProductList content={content} size='lg' />
<Pagination {...rest} searchParams={searchParams} />
</section>
</>
);
}
Loading
Loading