Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs-infra] Fix anchor link hook #40836

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Comment on lines -73 to +75
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix is targetName -> componentName.

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
Loading