Skip to content

Commit

Permalink
[Fix] id not match 오류 수정 #46
Browse files Browse the repository at this point in the history
  • Loading branch information
callmebyneon committed Jul 5, 2024
1 parent 7717586 commit 7ec247e
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 62 deletions.
113 changes: 54 additions & 59 deletions src/app/_components/TopBannerSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,63 +5,58 @@ import Button from "@/common/Atoms/Form/Button";
import { Container } from "@/common/Layout";

export default function TopBanner() {
return (
<section className="banner relative mb-8">
<div>
<BannerImage />
<Container>
<p className="text-H3 text-white absolute top-16 pl-[8.75rem]">
케밋에서 케미 터지는 스터디 장과 멤버들을 만나, <br />
놀라운 성장을 경험하세요!
</p>
</Container>
</div>
<div className="search-study mx-auto absolute z-10 bottom-0 left-[50vw] translate-y-1/2 -translate-x-1/2">
<form action="">
<div className="search-bar w-[866px] h-[68px] shadow-normal bg-white rounded-full border border-line-alt flex flex-row flex-nowrap gap-5 items-center justify-between px-6 py-3">
<Input.Select
id="select-category"
instaceId="select-category"
placeholder="직무 선택"
unstyled
options={CATEGORIES}
className="w-[160px]"
/>
<div className="h-4 w-0 border-l border-l-line-input"></div>
<Input.Select
id="select-goal"
instaceId="select-goal"
placeholder="목표 선택"
unstyled
options={GOALS}
className="w-[140px]"
/>
<div className="h-4 w-0 border-l border-l-line-input"></div>
<Input.Text
required
placeholder="검색어를 입력하세요"
className="border-none w-[400px] px-2 py-4 rounded-ten focus-visible:outline-1 focus-visible:outline-main-400"
/>
<Button variation="icon" size={24}>
<svg
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M15 15L21 21M10 17C6.13401 17 3 13.866 3 10C3 6.13401 6.13401 3 10 3C13.866 3 17 6.13401 17 10C17 13.866 13.866 17 10 17Z"
stroke="#2A7FFE"
strokeWidth="2.5"
strokeLinecap="round"
strokeLinejoin="round"
/>
</svg>
</Button>
</div>
</form>
</div>
</section>
);
return (
<section className="banner relative mb-8">
<div>
<BannerImage />
<Container>
<p className="text-H3 text-white absolute top-16 pl-[8.75rem]">
케밋에서 케미 터지는 스터디 장과 멤버들을 만나, <br />
놀라운 성장을 경험하세요!
</p>
</Container>
</div>
<div className="search-study mx-auto absolute z-10 bottom-0 left-[50vw] translate-y-1/2 -translate-x-1/2">
<form action="">
<div className="search-bar w-[866px] h-[68px] shadow-normal bg-white rounded-full border border-line-alt flex flex-row flex-nowrap gap-5 items-center justify-between px-6 py-3">
<Input.Select
placeholder="직무 선택"
unstyled
options={CATEGORIES}
className="w-[160px]"
/>
<div className="h-4 w-0 border-l border-l-line-input"></div>
<Input.Select
placeholder="목표 선택"
unstyled
options={GOALS}
className="w-[140px]"
/>
<div className="h-4 w-0 border-l border-l-line-input"></div>
<Input.Text
placeholder="검색어를 입력하세요"
className="border-none w-[400px] px-2 py-4 rounded-ten focus-visible:outline-1 focus-visible:outline-main-400"
/>
<Button variation="icon" size={24}>
<svg
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M15 15L21 21M10 17C6.13401 17 3 13.866 3 10C3 6.13401 6.13401 3 10 3C13.866 3 17 6.13401 17 10C17 13.866 13.866 17 10 17Z"
stroke="#2A7FFE"
strokeWidth="2.5"
strokeLinecap="round"
strokeLinejoin="round"
/>
</svg>
</Button>
</div>
</form>
</div>
</section>
);
}
14 changes: 11 additions & 3 deletions src/common/Atoms/Form/Select.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"use client";
import { useId } from "react";
import SelectInput, {
IndicatorsContainerProps,
MultiValueProps,
Expand All @@ -7,14 +8,18 @@ import CreatableSelect from "react-select/creatable";

const IndicatorsContainer = (_: IndicatorsContainerProps) => <></>;

export default ({
export default function ({
id = "",
styles = {},
isCreatable = false,
unstyled = false,
...restProps
}) =>
isCreatable ? (
}) {
const uniqueId = useId();
return isCreatable ? (
<CreatableSelect
id={uniqueId}
instanceId={uniqueId}
{...restProps}
/**
* multi select의 경우 indicator none, value label은 Keyword와 유사한 디자인
Expand Down Expand Up @@ -65,6 +70,8 @@ export default ({
/>
) : (
<SelectInput
id={uniqueId}
instanceId={uniqueId}
{...restProps}
components={unstyled ? { IndicatorsContainer } : {}}
styles={{
Expand Down Expand Up @@ -96,3 +103,4 @@ export default ({
}}
/>
);
}

0 comments on commit 7ec247e

Please sign in to comment.