Skip to content

Commit

Permalink
Merge pull request #133 from Eagle2gle/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
m4nd4r1n authored Apr 6, 2023
2 parents 0b15af7 + 758ba67 commit 48eeea4
Show file tree
Hide file tree
Showing 83 changed files with 7,789 additions and 1,521 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
"caseInsensitive": true
}
}
]
],
"react/prop-types": "off"
}
}
5,899 changes: 5,675 additions & 224 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
"lint": "next lint"
},
"dependencies": {
"@lukemorales/query-key-factory": "^1.2.0",
"@ant-design/charts": "^1.4.2",
"@next/eslint-plugin-next": "^13.1.2",
"@next/font": "13.1.2",
"@reduxjs/toolkit": "^1.9.1",
Expand Down
60 changes: 0 additions & 60 deletions src/components/RecentUploadCarousel.tsx

This file was deleted.

118 changes: 0 additions & 118 deletions src/components/RecommendedList.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion src/components/Thumbnail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const Thumbnail = () => {
<div className="hero overflow-hidden pt-28 pb-24">
<div className="hero-overlay absolute left-0 right-0 h-56">
<Image
className="w-full object-cover"
className="w-full object-cover object-center-7/10"
src="/images/thumbnail.jpeg"
alt="썸네일 이미지"
fill
Expand Down
109 changes: 0 additions & 109 deletions src/components/TopFiveList.tsx

This file was deleted.

30 changes: 10 additions & 20 deletions src/components/cahoot/BuyButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,43 +4,33 @@ import Image from 'next/image';
import { useRouter } from 'next/router';

import { useSuspendedQuery } from '@/hooks/useSuspendedQuery';
import { api } from '@/libs/client/api';
import { fetcher } from '@/libs/client/fetcher';
import { queries } from '@/queries';
import { useTypeSelector } from '@/store';
import type { CahootDetailType } from '@/types/cahoot';
import type { Response } from '@/types/response';
import classNames from '@/utils/classnames';
import { useMutation } from '@tanstack/react-query';

import type { HTTPError } from 'ky-universal';

import Modal from '../common/Modal';

const BuyButton = () => {
const router = useRouter();
const {
query: { id },
} = useRouter();
const { queryFn, queryKey } = queries.cahoots.detail(String(id));
const {
data: {
data: { images, title, stockPrice },
},
} = useSuspendedQuery<Response<CahootDetailType>>(
['cahoot/detail', router.query.id],
fetcher(`${process.env.NEXT_PUBLIC_HOST}/api/cahoots/${router.query.id}?info=detail`)
);
} = useSuspendedQuery(queryKey, queryFn);
const quantity = useTypeSelector(({ cahootOrder }) => cahootOrder.quantity);
const token = useTypeSelector((state) => state.user.token);
const token = useTypeSelector((state) => state.user.token) ?? '';
const {
mutate,
isLoading,
data: response,
} = useMutation<Response, Error, { stocks: number }>({
mutationFn: (data) =>
api
.post(`auth/cahoots/${router.query.id}`, {
json: data,
headers: {
Authorization: `Bearer ${token}`,
},
})
.json(),
});
} = useMutation<Response, HTTPError, { stocks: number }>(queries.cahoots.buy(String(id), token));
const modalOpenRef = useRef<HTMLLabelElement>(null);

const onBuyClick: React.MouseEventHandler<HTMLButtonElement> = () => {
Expand Down
Loading

0 comments on commit 48eeea4

Please sign in to comment.