-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: create software card without image and use it in software overv…
…iew grid
- Loading branch information
1 parent
f2759b6
commit a2d7773
Showing
6 changed files
with
103 additions
and
21 deletions.
There are no files selected for viewing
This file contains 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 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 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
61 changes: 61 additions & 0 deletions
61
frontend/components/software/overview/cards/SoftwareCardNoImage.tsx
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// SPDX-FileCopyrightText: 2023 Dusan Mijatovic (Netherlands eScience Center) | ||
// SPDX-FileCopyrightText: 2023 Netherlands eScience Center | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import KeywordList from '~/components/cards/KeywordList' | ||
import CardTitleSubtitle from '~/components/cards/CardTitleSubtitle' | ||
import ProgrammingLanguageList from './ProgrammingLanguageList' | ||
import SoftwareMetrics from './SoftwareMetrics' | ||
|
||
type SoftwareCardContentProps = { | ||
// slug:string | ||
brand_name: string | ||
short_statement: string | ||
image_id: string | null | ||
keywords: string[], | ||
prog_lang: string[], | ||
contributor_cnt: number | null | ||
mention_cnt: number | null | ||
downloads?: number | ||
visibleKeywords?: number | ||
visibleProgLang?: number | ||
} | ||
|
||
export default function SoftwareCardNoImage(item:SoftwareCardContentProps) { | ||
|
||
return ( | ||
<div | ||
data-testid="software-card-content" | ||
className="flex-1 p-4 flex flex-col h-full transition overflow-hidden bg-base-100 shadow-md hover:shadow-lg rounded-md" > | ||
<CardTitleSubtitle | ||
title={item.brand_name} | ||
subtitle={item.short_statement} | ||
/> | ||
|
||
{/* keywords */} | ||
<div className="flex-1 overflow-auto py-2"> | ||
<KeywordList | ||
keywords={item.keywords} | ||
visibleNumberOfKeywords={item.visibleKeywords ?? 3} | ||
/> | ||
</div> | ||
|
||
<div className="flex gap-2 justify-between mt-4"> | ||
{/* Languages */} | ||
<ProgrammingLanguageList | ||
prog_lang={item.prog_lang} | ||
visibleNumberOfProgLang={item.visibleProgLang ?? 3} | ||
/> | ||
{/* Metrics */} | ||
<div className="flex gap-4"> | ||
<SoftwareMetrics | ||
contributor_cnt={item.contributor_cnt ?? 0} | ||
mention_cnt={item.mention_cnt ?? 0} | ||
downloads={item.downloads} | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
) | ||
} |
This file contains 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 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