From 91d3fa91f33ef4c173a7da64c776041087a50a25 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Mon, 29 Jul 2019 10:49:43 -0400 Subject: [PATCH] cleanup --- src/ui/component/claimTags/view.jsx | 4 ++++ src/ui/component/expandable/view.jsx | 6 ++---- src/ui/scss/component/_expandable.scss | 1 - 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/ui/component/claimTags/view.jsx b/src/ui/component/claimTags/view.jsx index dde5d7382..7e5b20401 100644 --- a/src/ui/component/claimTags/view.jsx +++ b/src/ui/component/claimTags/view.jsx @@ -42,6 +42,10 @@ export default function ClaimTags(props: Props) { } } + if (!tagsToDisplay.length) { + return null; + } + return (
{tagsToDisplay.map(tag => ( diff --git a/src/ui/component/expandable/view.jsx b/src/ui/component/expandable/view.jsx index 607e713a8..15b0fe37a 100644 --- a/src/ui/component/expandable/view.jsx +++ b/src/ui/component/expandable/view.jsx @@ -4,9 +4,7 @@ import classnames from 'classnames'; import Button from 'component/button'; import { useRect } from '@reach/rect'; -// Note: -// When we use this in other parts of the app, we will probably need to -// add props for collapsed height +const COLLAPSED_HEIGHT = 120; type Props = { children: React$Node | Array, @@ -24,7 +22,7 @@ export default function Expandable(props: Props) { return (
- {rect && rect.height > 120 ? ( + {rect && rect.height > COLLAPSED_HEIGHT ? (