Skip to content

Commit

Permalink
Merge pull request #48 from IDEA-Research/feature/dataset_desc
Browse files Browse the repository at this point in the history
feat(dataset): add description for dataset list
  • Loading branch information
shuyuew authored Jul 6, 2023
2 parents 2e53c8d + bd5c2fd commit 2ea3106
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 8 additions & 3 deletions packages/app/src/components/DatasetItem/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,22 @@
padding-right: 6px;
}

.group {
.desc {
max-height: 32px;
color: #67738c;
margin-bottom: 16px;
padding: 0 2px;
font-size: 12px;
height: 12px;
height: 28px;
line-height: 130%;
white-space: nowrap;
word-wrap: break-word;
text-overflow: ellipsis;
overflow: hidden;
display: box;
-webkit-line-clamp: 2;

/* !autoprefixer: off */
-webkit-box-orient: vertical;
}
}

Expand Down
6 changes: 2 additions & 4 deletions packages/app/src/components/DatasetItem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const DatasetItem: React.FC<IProps> = (props) => {
<div className={styles.imgBox}>
<div className={styles.imgWrap}>
<Image
src={data?.coverUrl}
src={data?.coverUrl ?? ''}
alt="cover"
onError={(e: any) => {
e.target.src = generateDefaultCover(data?.objectTypes);
Expand Down Expand Up @@ -76,9 +76,7 @@ const DatasetItem: React.FC<IProps> = (props) => {
)}
</div>
</div>

<div className={styles.group}>{data.groupName}</div>

<div className={styles.desc}>{data.description}</div>
<div className={styles.extra}>
<div className={styles.extra_item}>
<span>{data.numImages}</span>
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/utils/datasets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { includes } from 'lodash';
* @param type
*/
export const generateDefaultCover = (type: string[]) => {
let _img_index: number = 5;
let _img_index: number = 0;

if (includes(type, 'Classification')) {
_img_index = 1;
Expand Down

0 comments on commit 2ea3106

Please sign in to comment.