-
Notifications
You must be signed in to change notification settings - Fork 287
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b52cbd5
commit b4545ea
Showing
5 changed files
with
116 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }) { | ||
return <Provider>{children}</Provider>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
noFooter, | ||
wrapperClassName, | ||
footerStyleProps, | ||
title, | ||
description, | ||
} = 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> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters