mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-24 06:27:02 +02:00
chore(v2): remove unused hooks from bootstrap theme (#2931)
* chore(v2): remove unused hooks * chore(v2): Update aria label
This commit is contained in:
parent
6e37d3fb12
commit
22178ebded
4 changed files with 2 additions and 37 deletions
|
@ -12,7 +12,7 @@ function DocPaginator(props) {
|
|||
const {previous, next} = props.metadata;
|
||||
|
||||
return (
|
||||
<nav aria-label="Blog list page navigation" className="my-5 p-0">
|
||||
<nav aria-label="Doc list page navigation" className="my-5 p-0">
|
||||
<ul className="pagination justify-content-between">
|
||||
<li className="page-item mr-2">
|
||||
{previous && (
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
/**
|
||||
* 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';
|
||||
|
||||
const ThemeContext = React.createContext({
|
||||
isDarkTheme: false,
|
||||
setLightTheme: () => {},
|
||||
setDarkTheme: () => {},
|
||||
});
|
||||
|
||||
export default ThemeContext;
|
|
@ -6,7 +6,6 @@
|
|||
*/
|
||||
|
||||
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
||||
import useThemeContext from '@theme/hooks/useThemeContext';
|
||||
import useBaseUrl from '@docusaurus/useBaseUrl';
|
||||
import isInternalUrl from '@docusaurus/isInternalUrl';
|
||||
|
||||
|
@ -14,7 +13,6 @@ const useLogo = () => {
|
|||
const {
|
||||
siteConfig: {baseUrl, themeConfig: {navbar: {logo = {}} = {}}} = {},
|
||||
} = useDocusaurusContext();
|
||||
const {isDarkTheme} = useThemeContext();
|
||||
const logoLink = logo.href || baseUrl;
|
||||
let logoLinkProps = {};
|
||||
|
||||
|
@ -27,8 +25,7 @@ const useLogo = () => {
|
|||
};
|
||||
}
|
||||
|
||||
const logoSrc = logo.srcDark && isDarkTheme ? logo.srcDark : logo.src;
|
||||
const logoImageUrl = useBaseUrl(logoSrc);
|
||||
const logoImageUrl = useBaseUrl(logo.src);
|
||||
|
||||
return {
|
||||
logoLink,
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
/**
|
||||
* 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 {useContext} from 'react';
|
||||
|
||||
import ThemeContext from '@theme/ThemeContext';
|
||||
|
||||
function useThemeContext() {
|
||||
return useContext(ThemeContext);
|
||||
}
|
||||
|
||||
export default useThemeContext;
|
Loading…
Add table
Add a link
Reference in a new issue