mirror of
https://github.com/Snigdha-OS/documentation.git
synced 2025-09-14 20:24:56 +02:00
22 lines
729 B
JavaScript
22 lines
729 B
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 {useWindowSize} from '@docusaurus/theme-common';
|
|
import BlogSidebarDesktop from '@theme/BlogSidebar/Desktop';
|
|
import BlogSidebarMobile from '@theme/BlogSidebar/Mobile';
|
|
export default function BlogSidebar({sidebar}) {
|
|
const windowSize = useWindowSize();
|
|
if (!sidebar?.items.length) {
|
|
return null;
|
|
}
|
|
// Mobile sidebar doesn't need to be server-rendered
|
|
if (windowSize === 'mobile') {
|
|
return <BlogSidebarMobile sidebar={sidebar} />;
|
|
}
|
|
return <BlogSidebarDesktop sidebar={sidebar} />;
|
|
}
|