From fdc15783065e95992647405a8ba0be63f94d9468 Mon Sep 17 00:00:00 2001 From: CPunisher <1343316114@qq.com> Date: Sat, 9 May 2020 14:47:08 +0800 Subject: [PATCH] Reconstruct code --- src/components/style/Style.js | 8 ++++---- src/components/style/StyleList.js | 2 +- src/containers/Renderer.js | 3 ++- src/containers/StyleListViewer.js | 9 +++++++-- src/reducers/index.js | 1 - 5 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/components/style/Style.js b/src/components/style/Style.js index 83b705e..7369d07 100644 --- a/src/components/style/Style.js +++ b/src/components/style/Style.js @@ -1,4 +1,4 @@ -import React from 'react' +import React from "react"; import PropTypes from 'prop-types' function calClassName(selected) { @@ -6,9 +6,9 @@ function calClassName(selected) { return 'Qr-item'; } -const Style = ({ value, renderer, selected, onClick }) => ( +const Style = ({ value, renderer, selected, onSelected }) => (
+ onMouseDown={onSelected}>
{renderer} @@ -24,7 +24,7 @@ Style.propTypes = { value: PropTypes.string.isRequired, renderer: PropTypes.object.isRequired, selected: PropTypes.bool.isRequired, - onClick: PropTypes.func.isRequired + onSelected: PropTypes.func.isRequired } export default Style; diff --git a/src/components/style/StyleList.js b/src/components/style/StyleList.js index de01b64..4a9f57f 100644 --- a/src/components/style/StyleList.js +++ b/src/components/style/StyleList.js @@ -8,7 +8,7 @@ const StyleList = ({ styles, onSelected }) => (