Skip to content

Commit

Permalink
Merge pull request #321 from FRONTENDBOOTCAMP-11th/bug/#288-QA
Browse files Browse the repository at this point in the history
🐛 TypeSelector 타입 오류 해결
  • Loading branch information
Youjiiin authored Jan 21, 2025
2 parents 527a872 + 72e5765 commit 4b04bb7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
18 changes: 13 additions & 5 deletions src/components/TypeSelector.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
interface TypeSelectorTypes {
productsType: string;
setProductsType: (type: string) => void;
onClick: (page: number) => void;
onClick?: (page: number) => void;
}

const TypeSelector = ({ productsType, setProductsType, onClick }: TypeSelectorTypes) => {
const TypeSelector = ({
productsType,
setProductsType,
onClick,
}: TypeSelectorTypes) => {
return (
<div className="bg-white p-[2px] rounded-[5px] flex border">
<button
type="button"
onClick={() => {
onClick(1)
if (onClick) {
onClick(1);
}
setProductsType('buy');
}}
className={`text-[14px] w-[50%] py-3 rounded-[5px] font-medium ${
Expand All @@ -21,9 +27,11 @@ const TypeSelector = ({ productsType, setProductsType, onClick }: TypeSelectorTy
</button>

<button
type="button"
type="button"
onClick={() => {
onClick(1)
if (onClick) {
onClick(1);
}
setProductsType('sell');
}}
className={`text-[14px] w-[50%] py-3 rounded-[5px] font-medium ${
Expand Down
2 changes: 1 addition & 1 deletion src/pages/search/searchPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ const SearchPage: React.FC = () => {
</button>
<Select meetingLocation={location} setMeetingLocation={setLocation} />
</div>
<TypeSelector productsType={type} setProductsType={setType} />
<TypeSelector productsType={type} setProductsType={setType}/>
</div>

{/* 검색 결과 */}
Expand Down

0 comments on commit 4b04bb7

Please sign in to comment.