Skip to content

Commit 1e8511d

Browse files
committed
show the truncated length on the Item story
also update the Default Item story to show the proper values. Co-authored-by: leaannbradford <[email protected]> - ref: scientist-hq/phenovista-digital-storefront#71
1 parent 4e29e2a commit 1e8511d

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

src/compounds/Item/Item.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ const Item = ({ buttonLink, buttonProps, markdownDescriptionTruncated, markdownD
4949
markdownDescriptionExtended={markdownDescriptionExtended}
5050
orientation={orientation}
5151
titleLink={link}
52+
truncatedLength={truncatedLength}
5253
withButtonLink={withButtonLink}
5354
withTitleLink={withTitleLink}
5455
/>

src/compounds/Item/Item.stories.jsx

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,42 @@ Default.args = {
2525
},
2626
name: 'Microbiological Sterility Testing',
2727
slug: 'microbiological-sterility-testing',
28+
snippet: ''
2829
},
2930
titleLink: '/',
3031
orientation: 'vertical',
3132
style: {},
3233
withButtonLink: false,
3334
withTitleLink: false,
35+
markdownDescriptionTruncated: null,
36+
markdownDescriptionExtended: null
37+
}
38+
39+
export const Horizontal = Template.bind({})
40+
Horizontal.args = {
41+
buttonLink: '/',
42+
buttonProps: {
43+
backgroundColor: '#A9A9A9',
44+
label: 'Request this item',
45+
},
46+
item: {
47+
description: '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. 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.',
48+
id: 1,
49+
img: {
50+
src: item,
51+
alt: 'Several rows of test tubes with a liquid being put into one.',
52+
},
53+
name: 'Microbiological Sterility Testing',
54+
slug: 'microbiological-sterility-testing',
55+
},
56+
titleLink: '/',
57+
orientation: 'horizontal',
58+
style: {},
59+
withButtonLink: false,
60+
withTitleLink: false,
3461
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.',
35-
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.'
62+
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
3664
}
3765

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

0 commit comments

Comments
 (0)