Skip to content

Commit

Permalink
fix some errors
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfauquette committed Jul 18, 2024
1 parent 921228c commit 0aa6cf4
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 32 deletions.
6 changes: 0 additions & 6 deletions packages/mui-docs/src/Ad/Ad.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as React from 'react';
import PropTypes from 'prop-types';
import Typography from '@mui/material/Typography';
import Box from '@mui/material/Box';
import Paper from '@mui/material/Paper';
Expand Down Expand Up @@ -77,11 +76,6 @@ class AdErrorBoundary extends React.Component<{
eventLabel: string | null;
children?: React.ReactNode | undefined;
}> {
static propTypes = {
children: PropTypes.node.isRequired,
eventLabel: PropTypes.string,
};

state = { didError: false };

static getDerivedStateFromError() {
Expand Down
7 changes: 0 additions & 7 deletions packages/mui-docs/src/Ad/AdDisplay.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as React from 'react';
import PropTypes from 'prop-types';
import { styled } from '@mui/material/styles';
import { useTranslate } from '../i18n';
import { adShape } from './AdManager';
Expand Down Expand Up @@ -98,9 +97,3 @@ export default function AdDisplay(props: AdDisplayProps) {
);
/* eslint-enable react/no-danger */
}

AdDisplay.propTypes = {
ad: PropTypes.object.isRequired,
className: PropTypes.string,
shape: PropTypes.oneOf(['inline', 'auto']),
};
6 changes: 0 additions & 6 deletions packages/mui-docs/src/Ad/AdGuest.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as React from 'react';
import PropTypes from 'prop-types';
import Portal from '@mui/material/Portal';
import { AdContext } from './AdManager';

Expand Down Expand Up @@ -40,9 +39,4 @@ function AdGuest(props: AdGuestProps) {
);
}

AdGuest.propTypes = {
children: PropTypes.node,
classSelector: PropTypes.string,
};

export { AdGuest };
5 changes: 0 additions & 5 deletions packages/mui-docs/src/Ad/AdInHouse.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
import * as React from 'react';
import PropTypes from 'prop-types';
import AdDisplay, { AdParameters } from './AdDisplay';

export default function AdInHouse(props: { ad: Omit<AdParameters, 'poweredby' | 'label'> }) {
const { ad } = props;

return <AdDisplay ad={{ poweredby: 'MUI', label: `in-house-${ad.name}`, ...ad }} />;
}

AdInHouse.propTypes = {
ad: PropTypes.object.isRequired,
};
6 changes: 0 additions & 6 deletions packages/mui-docs/src/Ad/AdManager.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as React from 'react';
import PropTypes from 'prop-types';
import { unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/material/utils';

type AdPortal = {
Expand Down Expand Up @@ -36,8 +35,3 @@ export default function AdManager({ classSelector = '.description', children }:

return <AdContext.Provider value={portal}>{children}</AdContext.Provider>;
}

AdManager.propTypes = {
children: PropTypes.node,
classSelector: PropTypes.string,
};
9 changes: 7 additions & 2 deletions packages/mui-docs/src/Ad/ad.styles.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { alpha, Theme } from '@mui/material/styles';
import { CSSObject } from '@mui/styled-engine';

const adBodyImageStyles = (theme: Theme) => ({
type BodyImageStylesKeys = 'root' | 'imgWrapper' | 'img' | 'a' | 'description' | 'poweredby';

const adBodyImageStyles = (theme: Theme): Record<BodyImageStylesKeys, CSSObject> => ({
root: {
display: 'block',
overflow: 'hidden',
Expand Down Expand Up @@ -43,7 +46,9 @@ const adBodyImageStyles = (theme: Theme) => ({
},
});

const adBodyInlineStyles = (theme: Theme) => {
type BodyInlineStylesKeys = BodyImageStylesKeys | 'link';

const adBodyInlineStyles = (theme: Theme): Record<BodyInlineStylesKeys, CSSObject> => {
const baseline = adBodyImageStyles(theme);

return {
Expand Down

0 comments on commit 0aa6cf4

Please sign in to comment.