Skip to content

Commit ebc2128

Browse files
committedMar 21, 2019
#6 검색 베이스 선택 가능한 select 컴포넌트 개발
See: Github issue #6 --------------------------------------- ### 작업파일 * components/index.js * components/Combo/Combo.jsx,Combo.scss --------------------------------------- ### 작업내용 * react-select사용하여 콤보 구현 * 인자로 item을 배열로 넘김
1 parent 9db1962 commit ebc2128

File tree

6 files changed

+450
-8
lines changed

6 files changed

+450
-8
lines changed
 

‎package-lock.json

+192
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"react-redux": "^6.0.1",
1212
"react-router-dom": "^4.3.1",
1313
"react-scripts": "2.1.8",
14+
"react-select": "^2.4.2",
1415
"redux": "^4.0.1",
1516
"redux-logger": "^3.0.6",
1617
"redux-saga": "^1.0.2",

‎src/components/Combo/Combo.jsx

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import React from "react";
2+
import Select from "react-select"; //select libery사용
3+
import classNames from "classnames/bind";
4+
import styles from "./Combo.scss";
5+
6+
const cx = classNames.bind(styles);
7+
8+
const Combo = ({ className, options, handleChange, defaultValue }) => {
9+
return (
10+
<Select
11+
className={cx(className, { default: !className })}
12+
options={options}
13+
onChange={handleChange}
14+
defaultValue={defaultValue}
15+
/>
16+
);
17+
};
18+
19+
export default Combo;

‎src/components/Combo/Combo.scss

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.default {
2+
width: 100px;
3+
height: 50px;
4+
}

‎src/components/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@ import Button from "./Button/Button";
22
import Div from "./Div/Div";
33
import Edit from "./Edit/Edit";
44
import Popup from "./Popup/Popup";
5+
import Combo from "./Combo/Combo";
56

6-
export { Button, Div, Edit, Popup };
7+
export { Button, Div, Edit, Popup, Combo };

0 commit comments

Comments
 (0)
Please sign in to comment.