Skip to content

Commit

Permalink
Merge pull request #41 from LikeLion-KNU/feature/#7
Browse files Browse the repository at this point in the history
Feature/#7
  • Loading branch information
Hyoeunkh authored May 20, 2024
2 parents 1ac41cb + 2db356a commit 093e00d
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/components/display/Booth.styled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ export const BoothLink = styled(Link)`
span {
display: flex;
align-items: center;
flex-direction: column;
width: 100%;
padding-left: 20px;
padding-left: 10px;
gap: 1px;
}
`;

Expand Down
12 changes: 10 additions & 2 deletions src/components/display/Booth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { Heart } from "./Heart";
export interface IBooth {
index: number;
name: string;
host: string;
num: number;
likeable: boolean;
category: string;
Expand All @@ -20,7 +21,7 @@ const itemVariants: Variants = {
visible: { opacity: 1, y: 0 },
};

export const Booth: React.FC<IBooth> = ({ index, name, num, likeable, category, isNavigatable }) => {
export const Booth: React.FC<IBooth> = ({ index, host, name, num, likeable, category, isNavigatable }) => {
const { likeable: likeAble, handleLikeBtnClick } = useLikes(likeable, category, index);

return (
Expand All @@ -40,7 +41,14 @@ export const Booth: React.FC<IBooth> = ({ index, name, num, likeable, category,
<BoothLink to={isNavigatable ? `/booth/${category}/${index}` : ""}>
{isNavigatable && <Index category={category}>{category !== "it" ? index : `IT-${index}`}</Index>}
<Text size="m" weight="bold" variant="#5D5A88">
{name}
{host && (
<Text size="xs" weight="bold" variant="#5D5A88">
{`[ ${host} ]`}
</Text>
)}
<Text size="m" weight="bold" variant="#5D5A88">
{name}
</Text>
</Text>
</BoothLink>
<Heart num={likeAble ? num + 1 : num} likable={likeAble} onClick={handleLikeBtnClick} />
Expand Down
1 change: 1 addition & 0 deletions src/components/display/BoothInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ const BoothInfo: React.FC<BoothInfoProps> = ({ boothDetail }) => {
isNavigatable={false}
index={boothDetail.boothnum}
name={boothDetail.boothName}
host={boothDetail.host}
num={boothDetail.likes}
likeable={!boothDetail.likable}
category={boothDetail.categori}
Expand Down
6 changes: 5 additions & 1 deletion src/pages/BoothListPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,18 @@ const BoothListPage: React.FC = () => {
boothList &&
boothList
.filter((booth) => {
return booth.boothnum === parseInt(input) || booth.boothName.includes(input);
return (
(booth.boothnum === parseInt(input) || booth.boothName.includes(input)) &&
(!booth.host || booth.host.includes(input))
);
})
.map((booth) => {
return (
<Booth
isNavigatable={true}
index={booth.boothnum}
name={booth.boothName}
host={booth.host}
num={booth.likes}
likeable={!booth.likable}
category={booth.categori}
Expand Down
2 changes: 2 additions & 0 deletions src/services/booth/booth.types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export interface IBoothItem {
id: number;
boothName: string;
host: string;
likes: number;
categori: string;
boothnum: number;
Expand All @@ -15,6 +16,7 @@ export interface IReadAllBoothResponse {
export interface IReadBoothByIdResponse {
id: number;
boothName: string;
host: string;
likes: number;
categori: string;
boothnum: number;
Expand Down

0 comments on commit 093e00d

Please sign in to comment.