-
Notifications
You must be signed in to change notification settings - Fork 287
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,20 @@ | ||
/** | ||
* SWIZZLED VERSION: 2.0.0-rc.1 | ||
* REASONS: | ||
* - The socials bar needed full width, so needed to be placed outside the default container. | ||
*/ | ||
|
||
import React from 'react'; | ||
import Footer from '@theme-original/Footer'; | ||
import type FooterType from '@theme/Footer'; | ||
import type { WrapperProps } from '@docusaurus/types'; | ||
import Social from '@site/src/components/Social'; | ||
|
||
type Props = WrapperProps<typeof FooterType>; | ||
type FooterProps = { | ||
footerStyleProps?: React.CSSProperties; | ||
}; | ||
|
||
export default function FooterWrapper(props: Props): JSX.Element { | ||
const FooterWrapper = ({ footerStyleProps }: FooterProps) => { | ||
return ( | ||
<> | ||
<Footer {...props} /> | ||
<Social /> | ||
</> | ||
<div> | ||
<div style={footerStyleProps}> | ||
<Footer /> | ||
<Social /> | ||
</div> | ||
</div> | ||
); | ||
} | ||
}; | ||
|
||
export default FooterWrapper; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import React from 'react'; | ||
import { composeProviders } from '@docusaurus/theme-common'; | ||
import { | ||
ColorModeProvider, | ||
AnnouncementBarProvider, | ||
DocsPreferredVersionContextProvider, | ||
ScrollControllerProvider, | ||
NavbarProvider, | ||
PluginHtmlClassNameProvider, | ||
} from '@docusaurus/theme-common/internal'; | ||
const Provider = composeProviders([ | ||
ColorModeProvider, | ||
AnnouncementBarProvider, | ||
ScrollControllerProvider, | ||
DocsPreferredVersionContextProvider, | ||
PluginHtmlClassNameProvider, | ||
NavbarProvider, | ||
]); | ||
export default function LayoutProvider({ children }) { | ||
Check failure on line 19 in src/theme/Layout/Provider/index.js GitHub Actions / consistency
|
||
return <Provider>{children}</Provider>; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import React from 'react'; | ||
import clsx from 'clsx'; | ||
import ErrorBoundary from '@docusaurus/ErrorBoundary'; | ||
import { | ||
PageMetadata, | ||
SkipToContentFallbackId, | ||
ThemeClassNames, | ||
} from '@docusaurus/theme-common'; | ||
import { useKeyboardNavigation } from '@docusaurus/theme-common/internal'; | ||
import SkipToContent from '@theme/SkipToContent'; | ||
import AnnouncementBar from '@theme/AnnouncementBar'; | ||
import Navbar from '@theme/Navbar'; | ||
import Footer from '@theme/Footer'; | ||
import LayoutProvider from '@theme/Layout/Provider'; | ||
import ErrorPageContent from '@theme/ErrorPageContent'; | ||
import styles from './styles.module.css'; | ||
export default function Layout(props) { | ||
const { | ||
children, | ||
Check failure on line 19 in src/theme/Layout/index.js GitHub Actions / consistency
|
||
noFooter, | ||
Check failure on line 20 in src/theme/Layout/index.js GitHub Actions / consistency
|
||
wrapperClassName, | ||
Check failure on line 21 in src/theme/Layout/index.js GitHub Actions / consistency
|
||
footerStyleProps, | ||
Check failure on line 22 in src/theme/Layout/index.js GitHub Actions / consistency
|
||
title, | ||
Check failure on line 23 in src/theme/Layout/index.js GitHub Actions / consistency
|
||
description, | ||
Check failure on line 24 in src/theme/Layout/index.js GitHub Actions / consistency
|
||
} = props; | ||
useKeyboardNavigation(); | ||
return ( | ||
<LayoutProvider> | ||
<PageMetadata title={title} description={description} /> | ||
|
||
<SkipToContent /> | ||
|
||
<AnnouncementBar /> | ||
|
||
<Navbar /> | ||
|
||
<div | ||
id={SkipToContentFallbackId} | ||
className={clsx( | ||
ThemeClassNames.wrapper.main, | ||
styles.mainWrapper, | ||
wrapperClassName, | ||
)} | ||
> | ||
<ErrorBoundary fallback={(params) => <ErrorPageContent {...params} />}> | ||
{children} | ||
</ErrorBoundary> | ||
</div> | ||
|
||
{!noFooter && <Footer footerStyleProps={footerStyleProps} />} | ||
</LayoutProvider> | ||
); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
html, | ||
body { | ||
height: 100%; | ||
} | ||
|
||
.mainWrapper { | ||
flex: 1 0 auto; | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
|
||
/* Docusaurus-specific utility class */ | ||
:global(.docusaurus-mt-lg) { | ||
margin-top: 3rem; | ||
} | ||
|
||
:global(#__docusaurus) { | ||
min-height: 100%; | ||
display: flex; | ||
flex-direction: column; | ||
} |