mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-23 11:38:48 +02:00
chore(v2): replace classnames with clsx (#2895)
This commit is contained in:
parent
600ef7ae28
commit
afe9ff91a4
26 changed files with 76 additions and 80 deletions
|
@ -11,7 +11,7 @@ import React, {useEffect, useState, useReducer, useRef} from 'react';
|
|||
|
||||
import algoliaSearch from 'algoliasearch/lite';
|
||||
import algoliaSearchHelper from 'algoliasearch-helper';
|
||||
import classnames from 'classnames';
|
||||
import clsx from 'clsx';
|
||||
|
||||
import ExecutionEnvironment from '@docusaurus/ExecutionEnvironment';
|
||||
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
||||
|
@ -230,7 +230,7 @@ function Search() {
|
|||
|
||||
<form className="row" onSubmit={(e) => e.preventDefault()}>
|
||||
<div
|
||||
className={classnames('col', styles.searchQueryColumn, {
|
||||
className={clsx('col', styles.searchQueryColumn, {
|
||||
'col--9': versioningEnabled,
|
||||
'col--12': !versioningEnabled,
|
||||
})}>
|
||||
|
@ -249,7 +249,7 @@ function Search() {
|
|||
|
||||
{versioningEnabled && (
|
||||
<div
|
||||
className={classnames(
|
||||
className={clsx(
|
||||
'col',
|
||||
'col--3',
|
||||
'padding-left--none',
|
||||
|
@ -269,9 +269,8 @@ function Search() {
|
|||
)}
|
||||
</form>
|
||||
|
||||
<div className={classnames('row', 'margin-vert--sm')}>
|
||||
<div
|
||||
className={classnames('col', 'col--8', styles.searchResultsColumn)}>
|
||||
<div className={clsx('row', 'margin-vert--sm')}>
|
||||
<div className={clsx('col', 'col--8', styles.searchResultsColumn)}>
|
||||
{!!searchResultState.totalResults && (
|
||||
<strong>
|
||||
{searchResultState.totalResults}{' '}
|
||||
|
@ -280,7 +279,7 @@ function Search() {
|
|||
)}
|
||||
</div>
|
||||
|
||||
<div className={classnames('col', 'col--4', styles.searchLogoColumn)}>
|
||||
<div className={clsx('col', 'col--4', styles.searchLogoColumn)}>
|
||||
<a
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import React, {useState, useRef, useCallback} from 'react';
|
||||
import classnames from 'classnames';
|
||||
import clsx from 'clsx';
|
||||
|
||||
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
||||
import {useHistory} from '@docusaurus/router';
|
||||
|
@ -109,7 +109,7 @@ const Search = ({handleSearchBarToggle, isSearchBarExpanded}) => {
|
|||
<span
|
||||
aria-label="expand searchbar"
|
||||
role="button"
|
||||
className={classnames(styles.searchIconButton, {
|
||||
className={clsx(styles.searchIconButton, {
|
||||
[styles.searchIconButtonHidden]: isSearchBarExpanded,
|
||||
})}
|
||||
onClick={toggleSearchInput}
|
||||
|
@ -122,7 +122,7 @@ const Search = ({handleSearchBarToggle, isSearchBarExpanded}) => {
|
|||
type="search"
|
||||
placeholder="Search"
|
||||
aria-label="Search"
|
||||
className={classnames('navbar__search-input', styles.searchInput, {
|
||||
className={clsx('navbar__search-input', styles.searchInput, {
|
||||
[styles.searchInputExpanded]: isSearchBarExpanded,
|
||||
})}
|
||||
onMouseOver={handleSearchInput}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue