Skip to content

Commit

Permalink
Stop using defaultProps in MosaicRenderPreview component
Browse files Browse the repository at this point in the history
  • Loading branch information
marlo-longley committed Oct 29, 2024
1 parent 6a0d2a4 commit dbddf67
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions src/components/MosaicRenderPreview.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,19 @@ import PropTypes from 'prop-types';
import MinimalWindow from '../containers/MinimalWindow';

/**
* MosaicRenderPreview is used to for the preview when dragging a mosaic window/tile
*/
export function MosaicRenderPreview(props) {
const {
t, title, windowId,
} = props;

* MosaicRenderPreview is used for the preview when dragging a mosaic window/tile
*/
export function MosaicRenderPreview({
t = k => k,
title = '',
windowId,
}) {
return (
<MinimalWindow windowId={`${windowId}-preview`} label={t('previewWindowTitle', { title })} ariaLabel={false} />
<MinimalWindow
windowId={`${windowId}-preview`}
label={t('previewWindowTitle', { title })}
ariaLabel={false}
/>
);
}

Expand All @@ -19,8 +23,3 @@ MosaicRenderPreview.propTypes = {
title: PropTypes.string,

Check failure on line 23 in src/components/MosaicRenderPreview.js

View workflow job for this annotation

GitHub Actions / build (18.x)

propType "title" is not required, but has no corresponding defaultProps declaration

Check failure on line 23 in src/components/MosaicRenderPreview.js

View workflow job for this annotation

GitHub Actions / build (20.x)

propType "title" is not required, but has no corresponding defaultProps declaration
windowId: PropTypes.string.isRequired, // eslint-disable-line react/no-unused-prop-types
};

MosaicRenderPreview.defaultProps = {
t: k => k,
title: '',
};

0 comments on commit dbddf67

Please sign in to comment.