chore(v2): remove unused hooks from bootstrap theme (#2931)

* chore(v2): remove unused hooks

* chore(v2): Update aria label
This commit is contained in:
Fanny 2020-06-14 09:05:29 -03:00 committed by GitHub
parent 6e37d3fb12
commit 22178ebded
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 2 additions and 37 deletions

View file

@ -12,7 +12,7 @@ function DocPaginator(props) {
const {previous, next} = props.metadata; const {previous, next} = props.metadata;
return ( 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"> <ul className="pagination justify-content-between">
<li className="page-item mr-2"> <li className="page-item mr-2">
{previous && ( {previous && (

View file

@ -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;

View file

@ -6,7 +6,6 @@
*/ */
import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import useThemeContext from '@theme/hooks/useThemeContext';
import useBaseUrl from '@docusaurus/useBaseUrl'; import useBaseUrl from '@docusaurus/useBaseUrl';
import isInternalUrl from '@docusaurus/isInternalUrl'; import isInternalUrl from '@docusaurus/isInternalUrl';
@ -14,7 +13,6 @@ const useLogo = () => {
const { const {
siteConfig: {baseUrl, themeConfig: {navbar: {logo = {}} = {}}} = {}, siteConfig: {baseUrl, themeConfig: {navbar: {logo = {}} = {}}} = {},
} = useDocusaurusContext(); } = useDocusaurusContext();
const {isDarkTheme} = useThemeContext();
const logoLink = logo.href || baseUrl; const logoLink = logo.href || baseUrl;
let logoLinkProps = {}; let logoLinkProps = {};
@ -27,8 +25,7 @@ const useLogo = () => {
}; };
} }
const logoSrc = logo.srcDark && isDarkTheme ? logo.srcDark : logo.src; const logoImageUrl = useBaseUrl(logo.src);
const logoImageUrl = useBaseUrl(logoSrc);
return { return {
logoLink, logoLink,

View file

@ -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;