summaryrefslogtreecommitdiff
path: root/src/components/Selection.js
diff options
context:
space:
mode:
authorHaishan <[email protected]>2020-05-14 22:50:48 +0800
committerHaishan <[email protected]>2020-05-14 22:50:48 +0800
commitfaf4cba37c8dd123600a62ec4feb39cccd851bcb (patch)
tree144bc503428ff891e74684da487f04e2fce90d57 /src/components/Selection.js
parentaceb1b4a365b1d86d66c0538011580eb01270219 (diff)
chore: lib classnames -> clsx
Diffstat (limited to 'src/components/Selection.js')
-rw-r--r--src/components/Selection.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/components/Selection.js b/src/components/Selection.js
index 12816f9..725d500 100644
--- a/src/components/Selection.js
+++ b/src/components/Selection.js
@@ -1,6 +1,6 @@
import React from 'react';
import { func, array, number } from 'prop-types';
-import cx from 'classnames';
+import cx from 'clsx';
import s from './Selection.module.css';
@@ -8,7 +8,7 @@ export default function Selection({
OptionComponent,
optionPropsList,
selectedIndex,
- onChange
+ onChange,
}) {
return (
// TODO a11y
@@ -20,7 +20,7 @@ export default function Selection({
<div
key={idx}
className={className}
- onClick={ev => {
+ onClick={(ev) => {
ev.preventDefault();
if (idx !== selectedIndex) {
onChange(idx);
@@ -39,7 +39,7 @@ Selection.propTypes = {
OptionComponent: func,
optionPropsList: array,
selectedIndex: number,
- onChange: func
+ onChange: func,
};
// for test
@@ -51,7 +51,7 @@ export function Option({ title }) {
style={{
width: 100,
height: 60,
- backgroundColor: '#eee'
+ backgroundColor: '#eee',
}}
>
{title}