Skip to content

Commit 7de0610

Browse files
committed
feedback
1 parent 1e8511d commit 7de0610

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/compounds/Item/CardBody.jsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Button, Card, Collapse } from 'react-bootstrap'
44
import NextLink from '../../components/NextLink/NextLink'
55
import LinkedButton from '../LinkedButton/LinkedButton'
66

7-
const CardBody = ({ buttonLink, buttonProps, item, markdownDescriptionTruncated, markdownDescriptionExtended, truncatedLength, orientation, titleLink, withButtonLink, withTitleLink }) => {
7+
const CardBody = ({ buttonLink, buttonProps, item, markdownDescriptionTruncated, markdownDescriptionExtended, orientation, titleLink, truncateAt, withButtonLink, withTitleLink }) => {
88
const { id, description, name, snippet } = item
99
const [open, setOpen] = useState(false)
1010

@@ -26,13 +26,13 @@ const CardBody = ({ buttonLink, buttonProps, item, markdownDescriptionTruncated,
2626
</Card.Title>
2727
{orientation === 'horizontal' ? (
2828
<>
29-
<div className='fw-light mh-300 overflow-auto mt-3 testing'>
29+
<div className='fw-light mh-300 overflow-auto mt-3'>
3030
{markdownDescriptionTruncated}
3131
<Collapse in={open}>
3232
<div className='fw-light'>{markdownDescriptionExtended}</div>
3333
</Collapse>
3434
</div>
35-
{description?.length > truncatedLength && (
35+
{description?.length > truncateAt && (
3636
<Button variant="link" onClick={() => setOpen(!open)} className="p-0 mt-3">
3737
{open ? ' Show less' : ' Read more'}
3838
</Button>
@@ -86,7 +86,7 @@ CardBody.propTypes = {
8686
PropTypes.string,
8787
PropTypes.elementType,
8888
]),
89-
truncatedLength: PropTypes.number,
89+
truncateAt: PropTypes.number,
9090
orientation: PropTypes.oneOf(['horizontal', 'vertical']),
9191
titleLink: PropTypes.string,
9292
withButtonLink: PropTypes.bool,
@@ -101,7 +101,7 @@ CardBody.defaultProps = {
101101
},
102102
markdownDescriptionTruncated: '',
103103
markdownDescriptionExtended: '',
104-
truncatedLength: 300,
104+
truncateAt: 300,
105105
orientation: 'vertical',
106106
titleLink: '',
107107
withButtonLink: false,

src/compounds/Item/Item.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import ItemLoading from './ItemLoading'
88
import NextLink from '../../components/NextLink/NextLink'
99
import './item.scss'
1010

11-
const Item = ({ buttonLink, buttonProps, markdownDescriptionTruncated, markdownDescriptionExtended, truncatedLength, href, isLoading, item, orientation, titleLink,
11+
const Item = ({ buttonLink, buttonProps, markdownDescriptionTruncated, markdownDescriptionExtended, href, isLoading, item, orientation, titleLink, truncateAt,
1212
withButtonLink, withTitleLink, width }) => {
1313
if (isLoading) {
1414
return (
@@ -49,7 +49,7 @@ const Item = ({ buttonLink, buttonProps, markdownDescriptionTruncated, markdownD
4949
markdownDescriptionExtended={markdownDescriptionExtended}
5050
orientation={orientation}
5151
titleLink={link}
52-
truncatedLength={truncatedLength}
52+
truncateAt={truncateAt}
5353
withButtonLink={withButtonLink}
5454
withTitleLink={withTitleLink}
5555
/>
@@ -70,7 +70,7 @@ const Item = ({ buttonLink, buttonProps, markdownDescriptionTruncated, markdownD
7070
item={item}
7171
markdownDescriptionTruncated={markdownDescriptionTruncated}
7272
markdownDescriptionExtended={markdownDescriptionExtended}
73-
truncatedLength={truncatedLength}
73+
truncateAt={truncateAt}
7474
orientation={orientation}
7575
titleLink={link}
7676
withButtonLink={withButtonLink}

src/compounds/Item/Item.stories.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Horizontal.args = {
6060
withTitleLink: false,
6161
markdownDescriptionTruncated: 'Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old.',
6262
markdownDescriptionExtended: 'Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.',
63-
truncatedLength: 300
63+
truncateAt: 300
6464
}
6565

6666
export const isLoading = Template.bind({})

0 commit comments

Comments
 (0)