Skip to content

Commit

Permalink
[core] Use componentStyles.name over componentName (mui#35303)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari authored and felipe.richter committed Dec 6, 2022
1 parent 422d6b4 commit f218fff
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions docs/src/modules/components/ApiPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ PropsTable.propTypes = {
};

function ClassesTable(props) {
const { componentName, componentStyles, classDescriptions } = props;
const { componentStyles, classDescriptions } = props;
const t = useTranslate();

return (
Expand All @@ -139,7 +139,8 @@ function ClassesTable(props) {
</td>
<td align="left">
<span className="prop-name">
.{componentStyles.globalClasses[className] || `Mui${componentName}-${className}`}
.
{componentStyles.globalClasses[className] || `${componentStyles.name}-${className}`}
</span>
</td>
<td
Expand All @@ -161,7 +162,6 @@ function ClassesTable(props) {

ClassesTable.propTypes = {
classDescriptions: PropTypes.object.isRequired,
componentName: PropTypes.string.isRequired,
componentStyles: PropTypes.object.isRequired,
};

Expand Down Expand Up @@ -371,11 +371,7 @@ import { ${componentName} } from '${source}';`}
{Object.keys(componentStyles.classes).length ? (
<React.Fragment>
<Heading hash="css" />
<ClassesTable
componentName={componentName}
componentStyles={componentStyles}
classDescriptions={classDescriptions}
/>
<ClassesTable componentStyles={componentStyles} classDescriptions={classDescriptions} />
<br />
<span dangerouslySetInnerHTML={{ __html: t('api-docs.overrideStyles') }} />
<span
Expand Down

0 comments on commit f218fff

Please sign in to comment.