From 927fd244edf021c7dd79ffaab7414c6a9c394434 Mon Sep 17 00:00:00 2001 From: Windosaurus <42529415+Windosaurus@users.noreply.github.com> Date: Thu, 31 Mar 2022 16:09:14 -0400 Subject: [PATCH] fixed truncating text on file card --- client/src/components/File/FileCard.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/client/src/components/File/FileCard.js b/client/src/components/File/FileCard.js index 93b9878..5b1d22e 100644 --- a/client/src/components/File/FileCard.js +++ b/client/src/components/File/FileCard.js @@ -24,6 +24,10 @@ const FileCard = ({ fileId }) => { return split[1]; }; + const truncate = (text) => { + return text.length > 35 ? text.substring(0, 32) + '...' : text; + }; + return ( <> {file !== null && ( @@ -55,8 +59,8 @@ const FileCard = ({ fileId }) => {