refactor(theme-classic): replace color mode toggle with button; remove switchConfig (#6771)

Co-authored-by: sebastienlorber <lorber.sebastien@gmail.com>
This commit is contained in:
Joshua Chen 2022-03-02 22:57:17 +08:00 committed by GitHub
parent b1492135c2
commit 7ec44bb32c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 282 additions and 356 deletions

View file

@ -6,8 +6,8 @@
*/
import React from 'react';
import OriginalToggle from '@theme-original/Toggle';
import type {Props} from '@theme/Toggle';
import OriginalToggle from '@theme-original/ColorModeToggle';
import type {Props} from '@theme/ColorModeToggle';
import {
lightStorage,
darkStorage,
@ -24,7 +24,7 @@ import {
// session storage, and we need to apply the same style when toggling modes even
// when we are not on the styling-layout page. The only way to do this so far is
// by hooking into the Toggle component.
export default function Toggle(props: Props): JSX.Element {
export default function ColorModeToggle(props: Props): JSX.Element {
return (
<OriginalToggle
{...props}