This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'This is a very long description that should be truncated after 112 characters. ' +
'112 is the default but can be overridden if need be. You can also provide a custom truncation function ' +
'to truncate the description how you see fit. It will be passed the description, max length, and id.'
}
/>
</React.Fragment>
);
```
```js title=Basic-without-truncated-text
import React from 'react';
import { CatalogTile, CatalogTileBadge } from '@patternfly/react-catalog-view-extension';
import { CogIcon } from '@patternfly/react-icons';
import { pfLogo2 } from './examples/pfLogo2.svg'
SimpleNoTrunc = () => (
<React.Fragment>
<CatalogTile
id="simple"
iconImg={pfLogo2}
iconAlt="PatternFly logo"
badges={[
<CatalogTileBadge title="Certified">
<CogIcon />
</CatalogTileBadge>
]}
title="Patternfly-React"
vendor="provided by Red Hat"
maxDescriptionLength={-1}
description={
'This is a verylong description that is not truncated after 112 characters. ' +
'To turn off truncation, pass in a maxDescriptionLength of -1. Please note that this has changed from ' +
'PatternFly 3.'
'This is a very, very long description that should be truncated after three lines. ' +
'Three lines is the default for cards without a footer. Cards with a footer are truncated after one line. Truncation function use is deprecated; please pass in a maxDescriptionLength of -1 to override it. ' +
'This has changed from PatternFly 3.'
}
/>
</React.Fragment>
Expand All
@@ -96,10 +67,11 @@ SimpleFooter = () => (
]}
title="Patternfly-React"
vendor="provided by Red Hat"
maxDescriptionLength={-1}
description={
'This is a verylong description that should be truncated after 112 characters. ' +
'112 is the default but can be overridden if need be. You can also provide a custom truncation function ' +
'to truncate the description how you see fit. It will be passed the description, max length, and id.'
'This is a very, very long description that should be truncated after one line. ' +
'Three lines is the default for cards without a footer. Cards with a footer are truncated after one line. Truncation function use is deprecated; please pass in a maxDescriptionLength of -1 to override it. ' +
'This has changed from PatternFly 3.'
}
footer={
<span>
Expand All
@@ -120,7 +92,7 @@ import { pfLogo2 } from './examples/pfLogo2.svg'
Link = () => (
<React.Fragment>
<CatalogTile
id="simple"
id="link-variant"
iconImg={pfLogo2}
iconAlt="PatternFly logo"
badges={[
Expand All
@@ -130,11 +102,12 @@ Link = () => (
]}
href="http://patternfly.org/v4"
title="Patternfly-React"
vendor={<React.Fragment>provided by <a href="http://redhat.com">Red Hat</a></React.Fragment>}
vendor="provided by Red Hat"
maxDescriptionLength={-1}
description={
'This is a verylong description that should be truncated after 112 characters. ' +
'112 is the default but can be overridden if need be. You can also provide a custom truncation function ' +
'to truncate the description how you see fit. It will be passed the description, max length, and id.'
'This is a very, very long description that should be truncated after three lines. ' +
'Three lines is the default for cards without a footer. Cards with a footer are truncated after one line. Truncation function use is deprecated; please pass in a maxDescriptionLength of -1 to override it. ' +
'This has changed from PatternFly 3.'
}
/>
</React.Fragment>
Expand Down
Expand Up
@@ -163,10 +136,11 @@ MultiIcon = () => (
]}
title="Patternfly-React"
vendor={<React.Fragment>provided by <a href="http://redhat.com">Red Hat</a></React.Fragment>}
maxDescriptionLength={-1}
description={
'This is a verylong description that should be truncated after 112 characters. ' +
'112 is the default but can be overridden if need be. You can also provide a custom truncation function ' +
'to truncate the description how you see fit. It will be passed the description, max length, and id.'
'This is a very, very long description that should be truncated after three lines. ' +
'Three lines is the default for cards without a footer. Cards with a footer are truncated after one line. Truncation function use is deprecated; please pass in a maxDescriptionLength of -1 to override it. ' +
'This has changed from PatternFly 3.'
}
/>
</React.Fragment>
Expand All
@@ -181,21 +155,21 @@ import { pfLogo2 } from './examples/pfLogo2.svg'
TextBadge = () => (
<React.Fragment>
<CatalogTile
id="multiIcon"
id="text-badge"
iconImg={pfLogo2}
iconAlt="PatternFly logo"
badges={[
'Community'
]}
title="Patternfly-React"
vendor={<React.Fragment>provided by <a href="http://redhat.com">Red Hat</a></React.Fragment>}
maxDescriptionLength={-1}
description={
'This is a verylong description that should be truncated after 112 characters. ' +
'112 is the default but can be overridden if need be. You can also provide a custom truncation function ' +
'to truncate the description how you see fit. It will be passed the description, max length, and id.'
'This is a very, very long description that should be truncated after three lines. ' +
'Three lines is the default for cards without a footer. Cards with a footer are truncated after one line. Truncation function use is deprecated; please pass in a maxDescriptionLength of -1 to override it. ' +
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
improvement(CatalogTile): Removed truncation fade and fixed length #3378
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
Uh oh!
There was an error while loading. Please reload this page.
improvement(CatalogTile): Removed truncation fade and fixed length #3378
Filter by extension
Viewed files
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing