summaryrefslogtreecommitdiff
path: root/src/components/StyleGuide.js
diff options
context:
space:
mode:
authorHaishan <[email protected]>2020-05-12 23:55:05 +0800
committerHaishan <[email protected]>2020-05-14 22:44:21 +0800
commitaceb1b4a365b1d86d66c0538011580eb01270219 (patch)
tree185d91e284249ab804b7b223e862a9d451664d13 /src/components/StyleGuide.js
parentb1d44d64556e3f226ec1d42e42f738eae36e664f (diff)
add: button to pause connection refresh
Diffstat (limited to 'src/components/StyleGuide.js')
-rw-r--r--src/components/StyleGuide.js18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/components/StyleGuide.js b/src/components/StyleGuide.js
index 4cb473d..0d71fc4 100644
--- a/src/components/StyleGuide.js
+++ b/src/components/StyleGuide.js
@@ -8,23 +8,27 @@ import Input from './Input';
import Button from './Button';
import { LoadingDot } from './shared/Basic';
+const noop = () => {
+ /* empty */
+};
+
const paneStyle = {
- padding: '20px 0'
+ padding: '20px 0',
};
const optionsRule = [
{
label: 'Global',
- value: 'Global'
+ value: 'Global',
},
{
label: 'Rule',
- value: 'Rule'
+ value: 'Rule',
},
{
label: 'Direct',
- value: 'Direct'
- }
+ value: 'Direct',
+ },
];
const Pane = ({ children, style }) => (
@@ -34,7 +38,7 @@ const Pane = ({ children, style }) => (
function useToggle(initialState = false) {
const [onoff, setonoff] = React.useState(initialState);
const handleChange = React.useCallback(() => {
- setonoff(x => !x);
+ setonoff((x) => !x);
}, []);
return [onoff, handleChange];
}
@@ -59,7 +63,7 @@ class StyleGuide extends PureComponent {
name="test"
options={optionsRule}
value="Rule"
- onChange={() => {}}
+ onChange={noop}
/>
</Pane>
<Pane>