mirror of
https://github.com/Snigdha-OS/documentation.git
synced 2025-09-14 20:24:56 +02:00
29 lines
1.1 KiB
JavaScript
29 lines
1.1 KiB
JavaScript
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
import React from 'react';
|
|
import clsx from 'clsx';
|
|
import {useBlogPost} from '@docusaurus/theme-common/internal';
|
|
import BlogPostItemContainer from '@theme/BlogPostItem/Container';
|
|
import BlogPostItemHeader from '@theme/BlogPostItem/Header';
|
|
import BlogPostItemContent from '@theme/BlogPostItem/Content';
|
|
import BlogPostItemFooter from '@theme/BlogPostItem/Footer';
|
|
// apply a bottom margin in list view
|
|
function useContainerClassName() {
|
|
const {isBlogPostPage} = useBlogPost();
|
|
return !isBlogPostPage ? 'margin-bottom--xl' : undefined;
|
|
}
|
|
export default function BlogPostItem({children, className}) {
|
|
const containerClassName = useContainerClassName();
|
|
return (
|
|
<BlogPostItemContainer className={clsx(containerClassName, className)}>
|
|
<BlogPostItemHeader />
|
|
<BlogPostItemContent>{children}</BlogPostItemContent>
|
|
<BlogPostItemFooter />
|
|
</BlogPostItemContainer>
|
|
);
|
|
}
|