Skip to content

Commit

Permalink
[docs] Remove redundant files and fix regression (#36775)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeeshanTamboli authored Apr 4, 2023
1 parent 4ead1ea commit fda2bc0
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 302 deletions.
2 changes: 1 addition & 1 deletion docs/src/modules/components/ComponentsApiContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { exactProp } from '@mui/utils';
import { useTranslate, useUserLanguage } from 'docs/src/modules/utils/i18n';
import { SlotsTable } from 'docs/src/modules/components/ApiPage';
import Divider from 'docs/src/modules/components/ApiDivider';
import PropertiesTable from 'docs/src/modules/components/PropretiesTable';
import PropertiesTable from 'docs/src/modules/components/PropertiesTable';
import HighlightedCode from 'docs/src/modules/components/HighlightedCode';
import MarkdownElement from 'docs/src/modules/components/MarkdownElement';

Expand Down
178 changes: 0 additions & 178 deletions docs/src/modules/components/HookApiPage.js

This file was deleted.

2 changes: 1 addition & 1 deletion docs/src/modules/components/HooksApiContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import kebabCase from 'lodash/kebabCase';
import { exactProp } from '@mui/utils';
import { useTranslate, useUserLanguage } from 'docs/src/modules/utils/i18n';
import Divider from 'docs/src/modules/components/ApiDivider';
import PropertiesTable from 'docs/src/modules/components/PropretiesTable';
import PropertiesTable from 'docs/src/modules/components/PropertiesTable';
import HighlightedCode from 'docs/src/modules/components/HighlightedCode';
import MarkdownElement from 'docs/src/modules/components/MarkdownElement';

Expand Down
22 changes: 21 additions & 1 deletion docs/src/modules/components/MarkdownDocsV2.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import Box from '@mui/material/Box';
import { CssVarsProvider, useColorScheme } from '@mui/joy/styles';
import ComponentsApiContent from 'docs/src/modules/components/ComponentsApiContent';
import HooksApiContent from 'docs/src/modules/components/HooksApiContent';
import { getTranslatedHeader as getHookTranslatedHeader } from 'docs/src/modules/components/HookApiPage';
import { getTranslatedHeader as getComponentTranslatedHeader } from 'docs/src/modules/components/ApiPage';
import MarkdownElement from 'docs/src/modules/components/MarkdownElementV2';
import { pathnameToLanguage } from 'docs/src/modules/utils/helpers';
Expand All @@ -30,6 +29,27 @@ JoyModeObserver.propTypes = {
mode: PropTypes.oneOf(['light', 'dark']),
};

function getHookTranslatedHeader(t, header) {
const translations = {
demos: t('api-docs.demos'),
import: t('api-docs.import'),
'hook-name': t('api-docs.hookName'),
parameters: t('api-docs.parameters'),
'return-value': t('api-docs.returnValue'),
};

// TODO Drop runtime type-checking once we type-check this file
if (!translations.hasOwnProperty(header)) {
throw new TypeError(
`Unable to translate header '${header}'. Did you mean one of '${Object.keys(
translations,
).join("', '")}'`,
);
}

return translations[header] || header;
}

export default function MarkdownDocsV2(props) {
const theme = useTheme();
const router = useRouter();
Expand Down
121 changes: 0 additions & 121 deletions docs/src/modules/components/PropretiesTable.js

This file was deleted.

0 comments on commit fda2bc0

Please sign in to comment.