Skip to content

Commit

Permalink
[docs-infra] Fix anchor link hook (mui#40836)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari authored and mostafa-rio committed Feb 3, 2024
1 parent fe7dc4f commit 4c9dc09
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 21 deletions.
22 changes: 11 additions & 11 deletions docs/src/modules/components/ApiPage/list/PropertiesList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,28 +129,28 @@ export function getHash({
return `${kebabCase(componentName)}-${sectionName}-${propName}`;
}

export interface PropDescriptionParams {
export interface Properties {
additionalInfo: string[];
componentName: string;
propName: string;
seeMoreDescription?: string;
deprecationInfo?: string;
description?: string;
requiresRef?: string;
isOptional?: boolean;
isRequired?: boolean;
isDeprecated?: boolean;
hooksParameters?: boolean;
hooksReturnValue?: boolean;
deprecationInfo?: string;
typeName: string;
isDeprecated?: boolean;
isOptional?: boolean;
isRequired?: boolean;
propDefault?: string;
additionalInfo: string[];
propName: string;
requiresRef?: string;
seeMoreDescription?: string;
signature?: string;
signatureArgs?: { argName: string; argDescription?: string }[];
signatureReturnDescription?: string;
typeName: string;
}

interface PropertiesListProps {
properties: PropDescriptionParams[];
properties: Properties[];
displayOption: 'collapsed' | 'expanded';
}

Expand Down
7 changes: 2 additions & 5 deletions docs/src/modules/components/ApiPage/table/PropertiesTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ import {
brandingDarkTheme as darkTheme,
brandingLightTheme as lightTheme,
} from 'docs/src/modules/brandingTheme';
import {
PropDescriptionParams,
getHash,
} from 'docs/src/modules/components/ApiPage/list/PropertiesList';
import { Properties, getHash } from 'docs/src/modules/components/ApiPage/list/PropertiesList';
import StyledTableContainer from 'docs/src/modules/components/ApiPage/table/StyledTableContainer';
import ApiWarning from 'docs/src/modules/components/ApiPage/ApiWarning';

Expand Down Expand Up @@ -120,7 +117,7 @@ function PropDescription({ description }: { description: string }) {
}

interface PropertiesTableProps {
properties: PropDescriptionParams[];
properties: Properties[];
}

export default function PropertiesTable(props: PropertiesTableProps) {
Expand Down
10 changes: 5 additions & 5 deletions docs/src/modules/components/HooksApiContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ export default function HooksApiContent(props) {
{Object.keys(parameters).length > 0 ? (
<PropertiesSection
properties={parameters}
targetName={hookNameKebabCase}
hooksParameters
propertiesDescriptions={parametersDescriptions}
componentName={hookName}
hooksParameters
level="h3"
title="api-docs.parameters"
titleHash={`${hookNameKebabCase}-parameters`}
Expand All @@ -81,11 +81,11 @@ export default function HooksApiContent(props) {
<span>{t('api-docs.hooksNoParameters')}</span>
)}
<PropertiesSection
showOptionalAbbr
properties={returnValue}
targetName={hookNameKebabCase}
hooksReturnValue
propertiesDescriptions={returnValueDescriptions}
componentName={hookName}
showOptionalAbbr
hooksReturnValue
level="h3"
title="api-docs.returnValue"
titleHash={`${hookNameKebabCase}-return-value`}
Expand Down

0 comments on commit 4c9dc09

Please sign in to comment.