Skip to content

Commit

Permalink
Make engagement tiles clickable (#1847)
Browse files Browse the repository at this point in the history
* Add hover effect for engagement tile

* Add on click functionality for engagement tile

* remove unused import
  • Loading branch information
jadmsaadaot authored Jul 17, 2023
1 parent 4ceabbf commit e65ddb9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { openNotification } from 'services/notificationService/notificationSlice
import { VideoWidget } from 'models/videoWidget';
import { fetchVideoWidgets } from 'services/widgetService/VideoService';
import ReactPlayer from 'react-player/lazy';
import { AppConfig } from 'config';

interface VideoWidgetProps {
widget: Widget;
Expand Down
14 changes: 13 additions & 1 deletion met-web/src/components/landing/EngagementTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,19 @@ const EngagementTile = ({ passedEngagement, engagementId }: EngagementTileProps)
const { name, end_date, start_date, description, status_id, banner_url, submission_status } = loadedEngagement;
const EngagementDate = `${dayjs(start_date).format(dateFormat)} to ${dayjs(end_date).format(dateFormat)}`;
return (
<Card sx={{ maxWidth: 345 }}>
<Card
sx={{
maxWidth: 345,
'&:hover': {
backgroundColor: '#F2F2F2',
cursor: 'pointer',
opacity: 0.5,
},
}}
onClick={() => {
window.open(engagementUrl, '_blank');
}}
>
<When condition={Boolean(banner_url)}>
<CardMedia sx={{ height: 140 }} image={banner_url} title={name} />
</When>
Expand Down

0 comments on commit e65ddb9

Please sign in to comment.