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 d60f43c740..d5c4801d76 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/BazaarOverviewCard/BazaarOverviewCard.tsx b/plugins/bazaar/src/components/BazaarOverviewCard/BazaarOverviewCard.tsx index c58ee3db1c..da43d4a206 100644 --- a/plugins/bazaar/src/components/BazaarOverviewCard/BazaarOverviewCard.tsx +++ b/plugins/bazaar/src/components/BazaarOverviewCard/BazaarOverviewCard.tsx @@ -146,7 +146,7 @@ export const BazaarOverviewCard = (props: BazaarOverviewCardProps) => { catalogEntities={unlinkedCatalogEntities || []} useTablePagination={false} gridSize={fullWidth ? 2 : 4} - height={fullHeight ? '13rem' : '7rem'} + height={fullHeight ? 'large' : 'small'} /> ); diff --git a/plugins/bazaar/src/components/ProjectCard/ProjectCard.tsx b/plugins/bazaar/src/components/ProjectCard/ProjectCard.tsx index 9193215804..97b247e289 100644 --- a/plugins/bazaar/src/components/ProjectCard/ProjectCard.tsx +++ b/plugins/bazaar/src/components/ProjectCard/ProjectCard.tsx @@ -29,39 +29,41 @@ 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; fetchBazaarProjects: () => Promise; catalogEntities: Entity[]; - height?: string; + height: 'large' | 'small'; }; -const useStyles = makeStyles({ +type StyleProps = { + height: 'large' | 'small'; +}; + +const useStyles = makeStyles((theme: BackstageTheme) => ({ + description: (props: StyleProps) => ({ + height: props.height === 'large' ? '10rem' : '4rem', + WebkitBackgroundClip: 'text', + backgroundImage: `linear-gradient(180deg, ${theme.palette.textContrast} 0%, ${theme.palette.textContrast} 60%, 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 +71,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 +105,7 @@ export const ProjectCard = ({ base: DateTime.now(), })}`} /> - + {Number(membersCount) === Number(1) diff --git a/plugins/bazaar/src/components/ProjectPreview/ProjectPreview.tsx b/plugins/bazaar/src/components/ProjectPreview/ProjectPreview.tsx index 216cf50c2f..8f7160600a 100644 --- a/plugins/bazaar/src/components/ProjectPreview/ProjectPreview.tsx +++ b/plugins/bazaar/src/components/ProjectPreview/ProjectPreview.tsx @@ -27,7 +27,7 @@ type Props = { catalogEntities: Entity[]; useTablePagination?: boolean; gridSize?: GridSize; - height: string; + height: 'large' | 'small'; }; const useStyles = makeStyles({ @@ -56,7 +56,7 @@ export const ProjectPreview = ({ catalogEntities, useTablePagination = true, gridSize = 2, - height, + height = 'large', }: Props) => { const classes = useStyles(); const [page, setPage] = useState(1); diff --git a/plugins/bazaar/src/components/SortView/SortView.tsx b/plugins/bazaar/src/components/SortView/SortView.tsx index 68b63a6885..b3e592fc6f 100644 --- a/plugins/bazaar/src/components/SortView/SortView.tsx +++ b/plugins/bazaar/src/components/SortView/SortView.tsx @@ -199,7 +199,7 @@ export const SortView = () => { bazaarProjects={getSearchResults() || []} fetchBazaarProjects={fetchBazaarProjects} catalogEntities={unlinkedCatalogEntities || []} - height="13rem" + height="large" /> diff --git a/yarn.lock b/yarn.lock index 8aec8d47ab..f8d4bc0759 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4801,6 +4801,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