Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
20 changes: 20 additions & 0 deletions docs/src/modules/components/ApiPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,26 @@ export default function ApiPage(props: ApiPageProps) {
layoutStorageKey={layoutStorageKey.classes}
displayClassKeys
/>

{pageContent.filename ? (
<div
className="MuiCallout-root MuiCallout-info"
style={{
alignItems: 'baseline',
gap: '4px',
marginTop: 0,
}}
>
<p
dangerouslySetInnerHTML={{
__html: t('api-docs.seeSourceCode').replace(
'{{href}}',
`${process.env.SOURCE_CODE_REPO}/blob/v${process.env.LIB_VERSION}${pageContent.filename}`,
),
}}
/>
</div>
) : null}
</MarkdownElement>
<svg style={{ display: 'none' }} xmlns="http://www.w3.org/2000/svg">
<symbol id="anchor-link-icon" viewBox="0 0 12 6">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export function ComponentLinkHeader(props: ComponentLinkHeaderProps) {
size="small"
variant="outlined"
rel="nofollow"
href={`${process.env.SOURCE_CODE_REPO}/tree/${process.env.SOURCE_GITHUB_BRANCH}/${headers.githubSource}`}
href={`${process.env.SOURCE_CODE_REPO}/blob/v${process.env.LIB_VERSION}/${headers.githubSource}`}
icon={<GitHubIcon />}
data-ga-event-category="ComponentLinkHeader"
data-ga-event-action="click"
Expand Down
1 change: 1 addition & 0 deletions packages/mui-docs/src/translations/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"refNotHeld": "The component cannot hold a ref.",
"refRootElement": "The <code>ref</code> is forwarded to the root element.",
"ruleName": "Rule name",
"seeSourceCode": "If you did not find the information in this page, consider having a look at the <a href=\"{{href}}\">implementation of the component</a> for more detail.",
"signature": "Signature",
"slots": "Slots",
"spreadHint": "Props of the {{spreadHintElement}} component are also available.",
Expand Down