feat: add missing propTypes

This commit is contained in:
kasia.oczkowska
2024-06-05 13:26:56 +01:00
parent 725b38c697
commit 3f5df118a0
53 changed files with 597 additions and 81 deletions

View File

@@ -5,16 +5,21 @@ import CardActionArea from '@mui/material/CardActionArea';
import CardContent from '@mui/material/CardContent';
import Typography from '@mui/material/Typography';
import { DateTime } from 'luxon';
import PropTypes from 'prop-types';
import useFormatMessage from 'hooks/useFormatMessage';
const getHumanlyDate = (timestamp) =>
DateTime.fromMillis(timestamp).toRelative();
export default function NotificationCard(props) {
function NotificationCard(props) {
const { name, createdAt, documentationUrl, description } = props;
const formatMessage = useFormatMessage();
const relativeCreatedAt = getHumanlyDate(new Date(createdAt).getTime());
const subheader = formatMessage('notification.releasedAt', {
relativeDate: relativeCreatedAt,
});
return (
<Card>
<CardActionArea component={'a'} href={documentationUrl} target="_blank">
@@ -36,3 +41,12 @@ export default function NotificationCard(props) {
</Card>
);
}
NotificationCard.propTypes = {
name: PropTypes.string.isRequired,
createdAt: PropTypes.string.isRequired,
documentationUrl: PropTypes.string.isRequired,
description: PropTypes.string.isRequired,
};
export default NotificationCard;