Skip to content

Commit

Permalink
fix: fix resource card description height
Browse files Browse the repository at this point in the history
  • Loading branch information
csm-thu committed Jul 8, 2024
1 parent 691f9a2 commit f3321e8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
19 changes: 6 additions & 13 deletions src/cards/ResourceCard/ResourceCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the MIT license.
import React from 'react';
import PropTypes from 'prop-types';
import { Typography, Button, Card, CardHeader, CardContent, CardActions, Tooltip, Fade } from '@mui/material';
import { Typography, Button, Card, CardHeader, CardContent, CardActions } from '@mui/material';
import { DefaultAvatar } from '../../misc';
import useStyles from './style';

Expand All @@ -26,18 +26,11 @@ export const ResourceCard = ({ id, name, description, action, style }) => {
title={name}
/>
<CardContent data-cy={'resource-content'}>
<Tooltip
TransitionComponent={Fade}
TransitionProps={{ timeout: 600 }}
key="resource-description-tooltip"
title={description ?? ''}
>
<div className={classes.description}>
<Typography noWrap={true} color="textSecondary" variant="body2">
{description}
</Typography>
</div>
</Tooltip>
<div className={classes.description}>
<Typography color="textSecondary" variant="body2">
{description}
</Typography>
</div>
</CardContent>
{actionButton}
</Card>
Expand Down
4 changes: 4 additions & 0 deletions src/cards/ResourceCard/style.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ const useStyles = makeStyles(() => ({
flexDirection: 'column',
justifyContent: 'space-between',
},
description: {
height: '70px',
overflow: 'auto',
},
}));

export default useStyles;

0 comments on commit f3321e8

Please sign in to comment.