mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-10 23:02:56 +02:00
feat(v2): add support another Prism theme for dark mode (#1984)
* feat(v2): add support another Prism theme for dark mode * add dynamically change Prism theme * Prepare for review * PR review changes * feat(v2): useThemeContext Co-authored-by: Yangshun Tay <tay.yang.shun@gmail.com>
This commit is contained in:
parent
dad50823b6
commit
92c68ed742
9 changed files with 84 additions and 9 deletions
|
@ -9,6 +9,8 @@ import React from 'react';
|
|||
import Head from '@docusaurus/Head';
|
||||
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
||||
import useBaseUrl from '@docusaurus/useBaseUrl';
|
||||
|
||||
import ThemeProvider from '@theme/ThemeProvider';
|
||||
import Navbar from '@theme/Navbar';
|
||||
import Footer from '@theme/Footer';
|
||||
|
||||
|
@ -37,8 +39,9 @@ function Layout(props) {
|
|||
const metaImage = image || defaultImage;
|
||||
const metaImageUrl = siteUrl + useBaseUrl(metaImage);
|
||||
const faviconUrl = useBaseUrl(favicon);
|
||||
|
||||
return (
|
||||
<>
|
||||
<ThemeProvider>
|
||||
<Head>
|
||||
{/* TODO: Do not assume that it is in english language */}
|
||||
<html lang="en" />
|
||||
|
@ -66,7 +69,7 @@ function Layout(props) {
|
|||
<Navbar />
|
||||
<div className="main-wrapper">{children}</div>
|
||||
{!noFooter && <Footer />}
|
||||
</>
|
||||
</ThemeProvider>
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue