From e9c179d5b618f17995f3d853e1ca6be63f2dc15a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Vi=E1=BB=87t=20H=C6=B0ng?= Date: Tue, 10 Jul 2018 08:44:20 +0700 Subject: [PATCH] prevent snippet item from clicking --- browser/render/components/tag-item/index.jsx | 6 ++++-- .../render/layouts/list-and-detail/snippet-item/index.jsx | 7 ++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/browser/render/components/tag-item/index.jsx b/browser/render/components/tag-item/index.jsx index 4e5e753..e9f5da2 100644 --- a/browser/render/components/tag-item/index.jsx +++ b/browser/render/components/tag-item/index.jsx @@ -4,8 +4,10 @@ import './tag-item' export default class TagItem extends React.Component { handleTagClick () { - const { tag } = this.props - eventEmitter.emit('tag:click', tag) + const { tag, notClickAble } = this.props + if (!notClickAble) { + eventEmitter.emit('tag:click', tag) + } } render () { diff --git a/browser/render/layouts/list-and-detail/snippet-item/index.jsx b/browser/render/layouts/list-and-detail/snippet-item/index.jsx index 485b07f..925af6f 100644 --- a/browser/render/layouts/list-and-detail/snippet-item/index.jsx +++ b/browser/render/layouts/list-and-detail/snippet-item/index.jsx @@ -53,7 +53,12 @@ export default class SnippetItem extends React.Component {

{tags.length > 0 ? ( tags.map((tag, index) => ( - + )) ) : ( No tag