forked from Gitlink/gitlink_help_center
新增功能:文档反馈系统 #2
|
|
@ -1,76 +1,9 @@
|
|||
import React from 'react';
|
||||
import clsx from 'clsx';
|
||||
import {ThemeClassNames} from '@docusaurus/theme-common';
|
||||
import {useDoc} from '@docusaurus/theme-common/internal';
|
||||
import LastUpdated from '@theme/LastUpdated';
|
||||
import EditThisPage from '@theme/EditThisPage';
|
||||
import TagsListInline from '@theme/TagsListInline';
|
||||
import DocFeedback from '@site/src/components/DocFeedback';
|
||||
|
||||
import styles from './styles.module.css';
|
||||
|
||||
function TagsRow(props) {
|
||||
return (
|
||||
<div
|
||||
className={clsx(
|
||||
ThemeClassNames.docs.docFooterTagsRow,
|
||||
'row margin-bottom--sm',
|
||||
)}>
|
||||
<div className="col">
|
||||
<TagsListInline {...props} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function EditMetaRow({
|
||||
editUrl,
|
||||
lastUpdatedAt,
|
||||
lastUpdatedBy,
|
||||
formattedLastUpdatedAt,
|
||||
}) {
|
||||
return (
|
||||
<div className={clsx(ThemeClassNames.docs.docFooterEditMetaRow, 'row')}>
|
||||
|
||||
<div className={clsx('col', styles.lastUpdated)}>
|
||||
<LastUpdated
|
||||
lastUpdatedAt={lastUpdatedAt}
|
||||
formattedLastUpdatedAt={formattedLastUpdatedAt}
|
||||
lastUpdatedBy={lastUpdatedBy}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default function DocItemFooter() {
|
||||
const {metadata} = useDoc();
|
||||
const {
|
||||
editUrl,
|
||||
lastUpdatedAt,
|
||||
formattedLastUpdatedAt,
|
||||
lastUpdatedBy,
|
||||
tags,
|
||||
} = metadata;
|
||||
|
||||
const canDisplayTagsRow = tags.length > 0;
|
||||
|
||||
|
||||
if (!canDisplayFooter) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<footer
|
||||
className={clsx(ThemeClassNames.docs.docFooter, 'docusaurus-mt-lg')}>
|
||||
<EditMetaRow
|
||||
editUrl={editUrl}
|
||||
lastUpdatedAt={lastUpdatedAt}
|
||||
lastUpdatedBy={lastUpdatedBy}
|
||||
formattedLastUpdatedAt={formattedLastUpdatedAt}
|
||||
/>
|
||||
)}
|
||||
<footer className="docusaurus-mt-lg">
|
||||
<DocFeedback />
|
||||
</footer>
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in New Issue