diff --git a/.changeset/clever-starfishes-destroy.md b/.changeset/clever-starfishes-destroy.md new file mode 100644 index 0000000000..3d520410d8 --- /dev/null +++ b/.changeset/clever-starfishes-destroy.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-bazaar': patch +--- + +Created soft cut on `ProjectCard` to indicate more content. diff --git a/plugins/bazaar/media/overviewCard.png b/plugins/bazaar/media/overviewCard.png index ef41ca48e5..a2c2756d9b 100644 Binary files a/plugins/bazaar/media/overviewCard.png and b/plugins/bazaar/media/overviewCard.png differ diff --git a/plugins/bazaar/package.json b/plugins/bazaar/package.json index 3a806f408b..c155fd875b 100644 --- a/plugins/bazaar/package.json +++ b/plugins/bazaar/package.json @@ -30,6 +30,7 @@ "@backstage/errors": "workspace:^", "@backstage/plugin-catalog": "workspace:^", "@backstage/plugin-catalog-react": "workspace:^", + "@backstage/theme": "workspace:^", "@date-io/luxon": "1.x", "@material-ui/core": "^4.12.2", "@material-ui/icons": "^4.9.1", diff --git a/plugins/bazaar/src/components/ProjectCard/ProjectCard.tsx b/plugins/bazaar/src/components/ProjectCard/ProjectCard.tsx index 9193215804..c52e7f80d6 100644 --- a/plugins/bazaar/src/components/ProjectCard/ProjectCard.tsx +++ b/plugins/bazaar/src/components/ProjectCard/ProjectCard.tsx @@ -29,6 +29,7 @@ import { BazaarProject } from '../../types'; import { DateTime } from 'luxon'; import { HomePageBazaarInfoCard } from '../HomePageBazaarInfoCard'; import { Entity } from '@backstage/catalog-model'; +import { BackstageTheme } from '@backstage/theme'; type Props = { project: BazaarProject; @@ -37,31 +38,40 @@ type Props = { height?: string; }; -const useStyles = makeStyles({ +type StyleProps = { + height?: string; +}; + +const useStyles = makeStyles((theme: BackstageTheme) => ({ + description: (props: StyleProps) => ({ + height: props.height === '7rem' ? '3.7rem' : '10.2rem', + display: '-webkit-box', + WebkitLineClamp: 7, + WebkitBoxOrient: 'vertical', + overflow: 'hidden', + '-webkit-background-clip': 'text', + backgroundImage: `linear-gradient(180deg, ${ + theme.palette.textContrast + } 0%, ${theme.palette.textContrast} ${ + props.height === '7rem' ? '60%' : '75%' + }, transparent 100%)`, + color: 'transparent', + }), statusTag: { display: 'inline-block', whiteSpace: 'nowrap', marginBottom: '0.8rem', }, - description: { - display: '-webkit-box', - WebkitLineClamp: 7, - WebkitBoxOrient: 'vertical', - overflow: 'hidden', - }, memberCount: { float: 'right', }, - content: { - height: '13rem', - }, header: { whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', height: '5rem', }, -}); +})); export const ProjectCard = ({ project, @@ -69,7 +79,7 @@ export const ProjectCard = ({ catalogEntities, height, }: Props) => { - const classes = useStyles(); + const classes = useStyles({ height }); const [openCard, setOpenCard] = useState(false); const { id, title, status, updatedAt, description, membersCount } = project; @@ -103,7 +113,7 @@ export const ProjectCard = ({ base: DateTime.now(), })}`} /> - + {Number(membersCount) === Number(1) diff --git a/yarn.lock b/yarn.lock index ef0f0deb4f..39339e7d33 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4825,6 +4825,7 @@ __metadata: "@backstage/errors": "workspace:^" "@backstage/plugin-catalog": "workspace:^" "@backstage/plugin-catalog-react": "workspace:^" + "@backstage/theme": "workspace:^" "@date-io/luxon": 1.x "@material-ui/core": ^4.12.2 "@material-ui/icons": ^4.9.1