-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add truncatedLength as an option to card body #225
add truncatedLength as an option to card body #225
Conversation
also update the Default Item story to show the proper values. Co-authored-by: leaannbradford <ltrammer@gmail.com> - ref: assaydepot/phenovista-digital-storefront#71
src/compounds/Item/CardBody.jsx
Outdated
@@ -26,13 +26,13 @@ const CardBody = ({ buttonLink, buttonProps, item, markdownDescriptionTruncated, | |||
</Card.Title> | |||
{orientation === 'horizontal' ? ( | |||
<> | |||
<div className='fw-light mh-300 overflow-auto mt-3'> | |||
<div className='fw-light mh-300 overflow-auto mt-3 testing'> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<div className='fw-light mh-300 overflow-auto mt-3 testing'> | |
<div className='fw-light mh-300 overflow-auto mt-3'> |
src/compounds/Item/CardBody.jsx
Outdated
@@ -4,7 +4,7 @@ import { Button, Card, Collapse } from 'react-bootstrap' | |||
import NextLink from '../../components/NextLink/NextLink' | |||
import LinkedButton from '../LinkedButton/LinkedButton' | |||
|
|||
const CardBody = ({ buttonLink, buttonProps, item, markdownDescriptionTruncated, markdownDescriptionExtended, orientation, titleLink, withButtonLink, withTitleLink }) => { | |||
const CardBody = ({ buttonLink, buttonProps, item, markdownDescriptionTruncated, markdownDescriptionExtended, truncatedLength, orientation, titleLink, withButtonLink, withTitleLink }) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what do you think about changing this variable name to truncateAt
? feels a little more semantic.
also, can you move this to after "titleLink"? the variables are alphabetized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summer called it cutOffIndex. Do you think it makes sense to use that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like truncateAt
is even more semantic than cutOffIndex
...but I'm fine with either.
Adds ability to pass in the truncated text length so the showmore toggle only shows according to what you want. Default is set to 300 still.