-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(theme-classic): apply import/no-named-export eslint rule (#6283
- Loading branch information
Showing
18 changed files
with
258 additions
and
177 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
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
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
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
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
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
31 changes: 31 additions & 0 deletions
31
packages/docusaurus-theme-classic/src/theme/DocSidebarItems/index.tsx
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,31 @@ | ||
/** | ||
* 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, {memo} from 'react'; | ||
|
||
import DocSidebarItem from '@theme/DocSidebarItem'; | ||
|
||
import type {Props} from '@theme/DocSidebarItems'; | ||
|
||
// TODO this item should probably not receive the "activePath" props | ||
// TODO this triggers whole sidebar re-renders on navigation | ||
function DocSidebarItems({items, ...props}: Props): JSX.Element { | ||
return ( | ||
<> | ||
{items.map((item, index) => ( | ||
<DocSidebarItem | ||
key={index} // sidebar is static, the index does not change | ||
item={item} | ||
{...props} | ||
/> | ||
))} | ||
</> | ||
); | ||
} | ||
|
||
// Optimize sidebar at each "level" | ||
export default memo(DocSidebarItems); |
19 changes: 19 additions & 0 deletions
19
packages/docusaurus-theme-classic/src/theme/DocSidebarItems/styles.module.css
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,19 @@ | ||
/** | ||
* 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. | ||
*/ | ||
|
||
@media (min-width: 997px) { | ||
.menuLinkText { | ||
cursor: initial; | ||
} | ||
.menuLinkText:hover { | ||
background: none; | ||
} | ||
|
||
.menuLinkText.hasHref { | ||
cursor: pointer; | ||
} | ||
} |
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
Oops, something went wrong.