Skip to content

Commit df9788a

Browse files
committed
refactor: remove unnecessary deps
1 parent d69a6ba commit df9788a

File tree

10 files changed

+291
-615
lines changed

10 files changed

+291
-615
lines changed

package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959
"@types/react-dom": "^18",
6060
"@types/react-swipeable-views": "^0",
6161
"@types/stylis": "^4.2.5",
62-
"autoprefixer": "^10.0.1",
6362
"babel-jest": "^29.7.0",
6463
"dotenv": "^16.4.5",
6564
"env-cmd": "^10.1.0",
@@ -69,8 +68,6 @@
6968
"graphql-codegen": "^0.4.0",
7069
"husky": "^9.0.11",
7170
"jest": "^29.7.0",
72-
"postcss": "^8",
73-
"tailwindcss": "^3.3.0",
7471
"ts-jest": "^29.1.2",
7572
"typescript": "5.4"
7673
},

postcss.config.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/app/[locale]/(main)/(homepage)/page.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const getCategories = async () => {
2626
query: GET_MAIN_CATEGORIES,
2727
variables: {
2828
first: 6,
29+
parent: 0,
2930
},
3031
});
3132

src/app/[locale]/(main)/categories/components/SubCategories.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ const SubCategories: FC<SubCategoriesProps> = ({ name, parentId, items }) => {
5151
{items.map((item) => {
5252
return (
5353
<SubCategoryItem
54-
src={item.image.sourceUrl}
54+
key={item.id}
55+
src={item.image?.sourceUrl}
5556
name={item.name}
5657
id={item.id}
5758
/>

src/app/[locale]/(main)/categories/components/SubCategoryItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const SubCategoryItem: FC<SubCategoryItemProps> = ({ id, src, name }) => {
4444
textOverflow: 'ellipsis',
4545
overflow: 'hidden',
4646
display: '-webkit-box',
47-
'-webkit-line-clamp': '2',
47+
'-webkit-line-clamp': '3',
4848
'-webkit-box-orient': 'vertical',
4949
}}
5050
>

src/app/[locale]/(main)/categories/page.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
'use client';
22

33
import { GET_ALL_CATEGORIES_QUERY } from '@/graphql/queries/categories';
4-
import { CategoriesQuery } from '@/graphql/types/graphql';
4+
import { GetAllCategoriesQuery } from '@/graphql/types/graphql';
55
import { useQuery } from '@apollo/client';
66
import { Stack } from '@mui/material';
77
import { useEffect, useState } from 'react';
88
import MenuCategoryItem from './components/MenuCategoryItem';
99
import SubCategories from './components/SubCategories';
1010
import Loading from './loading';
1111

12-
const page = () => {
13-
const { data, loading } = useQuery<CategoriesQuery>(
12+
const Page = () => {
13+
const { data, loading } = useQuery<GetAllCategoriesQuery>(
1414
GET_ALL_CATEGORIES_QUERY,
1515
{
1616
variables: {
@@ -65,4 +65,4 @@ const page = () => {
6565
);
6666
};
6767

68-
export default page;
68+
export default Page;

src/graphql/types/gql.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ const documents = {
2828
"\n query GetCart {\n cart {\n ...CartContent\n }\n }\n \n": types.GetCartDocument,
2929
"\n mutation UpdateCartItemQuantities($items: [CartItemQuantityInput]) {\n updateItemQuantities(input: { items: $items }) {\n cart {\n ...CartContent\n }\n items {\n ...CartItemContent\n }\n }\n }\n \n \n": types.UpdateCartItemQuantitiesDocument,
3030
"\n mutation EmptyCart {\n emptyCart(input: {}) {\n cart {\n contents {\n nodes {\n key\n }\n }\n }\n }\n }\n": types.EmptyCartDocument,
31-
"\n query Categories {\n productCategories(first: 1000) {\n nodes {\n id: databaseId\n name\n parentId: parentDatabaseId\n }\n }\n }\n": types.CategoriesDocument,
32-
"\n query GetMainCategories {\n productCategories(where: { parent: null, orderby: TERM_ORDER }) {\n edges {\n node {\n id: databaseId\n name\n image {\n id: databaseId\n sourceUrl\n }\n }\n }\n }\n }\n": types.GetMainCategoriesDocument,
31+
"\n query GetAllCategories($first: Int) {\n productCategories(\n where: { orderby: TERM_ORDER, order: ASC }\n first: $first\n ) {\n nodes {\n id: databaseId\n name\n parentId: parentDatabaseId\n image {\n id: databaseId\n sourceUrl\n }\n }\n }\n }\n": types.GetAllCategoriesDocument,
32+
"\n query GetMainCategories($parent: Int, $first: Int) {\n productCategories(\n where: { parent: $parent, orderby: TERM_ORDER }\n first: $first\n ) {\n edges {\n node {\n id: databaseId\n name\n image {\n id: databaseId\n sourceUrl\n }\n }\n }\n }\n }\n": types.GetMainCategoriesDocument,
3333
"\n query GetCustomerBilling {\n customer {\n billing {\n firstName\n lastName\n address1\n state\n city\n phone\n postcode\n }\n }\n }\n": types.GetCustomerBillingDocument,
3434
"\n query GetCustomerSession {\n customer {\n sessionToken\n }\n }\n": types.GetCustomerSessionDocument,
3535
"\n query GetCustomerProfile {\n customer {\n id\n firstName\n lastName\n username\n orderCount\n }\n }\n": types.GetCustomerProfileDocument,
@@ -122,11 +122,11 @@ export function graphql(source: "\n mutation EmptyCart {\n emptyCart(input:
122122
/**
123123
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
124124
*/
125-
export function graphql(source: "\n query Categories {\n productCategories(first: 1000) {\n nodes {\n id: databaseId\n name\n parentId: parentDatabaseId\n }\n }\n }\n"): (typeof documents)["\n query Categories {\n productCategories(first: 1000) {\n nodes {\n id: databaseId\n name\n parentId: parentDatabaseId\n }\n }\n }\n"];
125+
export function graphql(source: "\n query GetAllCategories($first: Int) {\n productCategories(\n where: { orderby: TERM_ORDER, order: ASC }\n first: $first\n ) {\n nodes {\n id: databaseId\n name\n parentId: parentDatabaseId\n image {\n id: databaseId\n sourceUrl\n }\n }\n }\n }\n"): (typeof documents)["\n query GetAllCategories($first: Int) {\n productCategories(\n where: { orderby: TERM_ORDER, order: ASC }\n first: $first\n ) {\n nodes {\n id: databaseId\n name\n parentId: parentDatabaseId\n image {\n id: databaseId\n sourceUrl\n }\n }\n }\n }\n"];
126126
/**
127127
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
128128
*/
129-
export function graphql(source: "\n query GetMainCategories {\n productCategories(where: { parent: null, orderby: TERM_ORDER }) {\n edges {\n node {\n id: databaseId\n name\n image {\n id: databaseId\n sourceUrl\n }\n }\n }\n }\n }\n"): (typeof documents)["\n query GetMainCategories {\n productCategories(where: { parent: null, orderby: TERM_ORDER }) {\n edges {\n node {\n id: databaseId\n name\n image {\n id: databaseId\n sourceUrl\n }\n }\n }\n }\n }\n"];
129+
export function graphql(source: "\n query GetMainCategories($parent: Int, $first: Int) {\n productCategories(\n where: { parent: $parent, orderby: TERM_ORDER }\n first: $first\n ) {\n edges {\n node {\n id: databaseId\n name\n image {\n id: databaseId\n sourceUrl\n }\n }\n }\n }\n }\n"): (typeof documents)["\n query GetMainCategories($parent: Int, $first: Int) {\n productCategories(\n where: { parent: $parent, orderby: TERM_ORDER }\n first: $first\n ) {\n edges {\n node {\n id: databaseId\n name\n image {\n id: databaseId\n sourceUrl\n }\n }\n }\n }\n }\n"];
130130
/**
131131
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
132132
*/

0 commit comments

Comments
 (0)