Skip to content
This repository has been archived by the owner on Mar 5, 2024. It is now read-only.

Commit

Permalink
fixed truncating text on file card
Browse files Browse the repository at this point in the history
  • Loading branch information
Windosaurus committed Mar 31, 2022
1 parent 0a3b280 commit 927fd24
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions client/src/components/File/FileCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 && (
Expand Down Expand Up @@ -55,8 +59,8 @@ const FileCard = ({ fileId }) => {
</div>
</Col>
<Col>
<CardTitle className="font-weight-bold mb-0">
{file.name}
<CardTitle className="h4 font-weight-bold mb-0">
{truncate(file.name)}
</CardTitle>
</Col>
</Row>
Expand Down

0 comments on commit 927fd24

Please sign in to comment.