Skip to content

Conversation

labradford
Copy link
Collaborator

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.

{orientation === 'horizontal' ? (
<>
<div className='fw-light mh-300 overflow-auto mt-3'>
<div className='fw-light mh-300 overflow-auto mt-3 testing'>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<div className='fw-light mh-300 overflow-auto mt-3 testing'>
<div className='fw-light mh-300 overflow-auto mt-3'>

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 }) => {
Copy link
Member

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.

Copy link
Collaborator Author

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?

Copy link
Member

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.

@alishaevn alishaevn merged commit f15906f into main May 10, 2024
@alishaevn alishaevn deleted the iphenovista71-add-truncated-length-to-cardbody branch May 10, 2024 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants