Skip to content

Commit 917ac59

Browse files
committed
only have expand ability if description is truncated
1 parent a724b5e commit 917ac59

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/compounds/Item/CardBody.jsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,11 @@ const CardBody = ({ buttonLink, buttonProps, item,
4141
<div className='fw-light'>{description.slice(cutOffIndex).trimStart()}</div>
4242
</Collapse>
4343
</div>
44-
<Button variant="link" onClick={() => setOpen(!open)} className="p-0 mt-3">
45-
{open ? ' Show less' : ' Read more'}
46-
</Button>
44+
{ description.length > 300 && (
45+
<Button variant="link" onClick={() => setOpen(!open)} className="p-0 mt-3">
46+
{open ? ' Show less' : ' Read more'}
47+
</Button>
48+
)}
4749
</>
4850
)}
4951
</div>

0 commit comments

Comments
 (0)