From 00b2bf37eee9cdd2ff5280a507d03683ee798d6e Mon Sep 17 00:00:00 2001 From: Riley Davis Date: Wed, 1 Mar 2017 11:14:13 -0700 Subject: [PATCH] fix height of the table --- client/coral-admin/src/containers/Dashboard/FlagWidget.js | 6 +++++- client/coral-admin/src/containers/Dashboard/LikeWidget.js | 8 ++++++-- client/coral-admin/src/containers/Dashboard/Widget.css | 6 ++++++ 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/client/coral-admin/src/containers/Dashboard/FlagWidget.js b/client/coral-admin/src/containers/Dashboard/FlagWidget.js index 5d891b3bb..da71ac04a 100644 --- a/client/coral-admin/src/containers/Dashboard/FlagWidget.js +++ b/client/coral-admin/src/containers/Dashboard/FlagWidget.js @@ -40,7 +40,11 @@ const FlagWidget = (props) => { ); }) - : {lang.t('dashboard.no_flags')} + : {lang.t('dashboard.no_flags')} + } + { /* rows in a table with a fixed height will expand and ignore height. + this extra row will expand to fill the extra space. */ + assets.length < 10 ? : null } diff --git a/client/coral-admin/src/containers/Dashboard/LikeWidget.js b/client/coral-admin/src/containers/Dashboard/LikeWidget.js index d628c2e11..25e851966 100644 --- a/client/coral-admin/src/containers/Dashboard/LikeWidget.js +++ b/client/coral-admin/src/containers/Dashboard/LikeWidget.js @@ -26,7 +26,7 @@ const LikeWidget = (props) => { ? assets.map(asset => { const likeSummary = asset.action_summaries.find(s => s.type === 'LikeAssetActionSummary'); return ( - +

{asset.title}

@@ -41,7 +41,11 @@ const LikeWidget = (props) => { ); }) - : {lang.t('dashboard.no_likes')} + : {lang.t('dashboard.no_likes')} + } + { /* rows in a table with a fixed height will expand and ignore height. + this extra row will expand to fill the extra space. */ + assets.length < 10 ? : null } diff --git a/client/coral-admin/src/containers/Dashboard/Widget.css b/client/coral-admin/src/containers/Dashboard/Widget.css index a99c2febd..cb764d9cc 100644 --- a/client/coral-admin/src/containers/Dashboard/Widget.css +++ b/client/coral-admin/src/containers/Dashboard/Widget.css @@ -1,3 +1,7 @@ +:root { + --row-height: 80px; +} + .widget { box-sizing: border-box; margin: 10px 5px 5px 5px; @@ -18,6 +22,7 @@ width: 100%; border-collapse: collapse; user-select: none; + height: calc(var(--row-height) * 10); } .widgetTable thead th { @@ -35,6 +40,7 @@ cursor: pointer; border-bottom: 1px solid lightgrey; color: #555; + height: var(--row-height); } .rowLinkify:last-child {