-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from easyops-cn/steve/search-page
feat: search page to view all results
- Loading branch information
Showing
31 changed files
with
816 additions
and
166 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* https://loading.io/css/ */ | ||
.loadingRing { | ||
display: inline-block; | ||
position: relative; | ||
width: 20px; | ||
height: 20px; | ||
opacity: var(--search-local-loading-icon-opacity, 0.5); | ||
} | ||
|
||
.loadingRing div { | ||
box-sizing: border-box; | ||
display: block; | ||
position: absolute; | ||
width: 16px; | ||
height: 16px; | ||
margin: 2px; | ||
border: 2px solid | ||
var(--search-load-loading-icon-color, var(--ifm-navbar-search-input-color)); | ||
border-radius: 50%; | ||
animation: loading-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite; | ||
border-color: var( | ||
--search-load-loading-icon-color, | ||
var(--ifm-navbar-search-input-color) | ||
) | ||
transparent transparent transparent; | ||
} | ||
|
||
.loadingRing div:nth-child(1) { | ||
animation-delay: -0.45s; | ||
} | ||
|
||
.loadingRing div:nth-child(2) { | ||
animation-delay: -0.3s; | ||
} | ||
|
||
.loadingRing div:nth-child(3) { | ||
animation-delay: -0.15s; | ||
} | ||
|
||
@keyframes loading-ring { | ||
0% { | ||
transform: rotate(0deg); | ||
} | ||
100% { | ||
transform: rotate(360deg); | ||
} | ||
} |
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 @@ | ||
// istanbul ignore file | ||
import React from "react"; | ||
import clsx from "clsx"; | ||
import styles from "./LoadingRing.module.css"; | ||
|
||
export default function LoadingRing({ | ||
className, | ||
}: { | ||
className?: string; | ||
}): React.ReactElement { | ||
return ( | ||
<div className={clsx(styles.loadingRing, className)}> | ||
<div></div> | ||
<div></div> | ||
<div></div> | ||
<div></div> | ||
</div> | ||
); | ||
} |
File renamed without changes.
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,9 @@ | ||
import { iconNoResults } from "./icons"; | ||
import styles from "./SearchBar.module.css"; | ||
|
||
export function EmptyTemplate(): string { | ||
if (process.env.NODE_ENV === "production") { | ||
return `<span class="${styles.noResults}"><span class="${styles.noResultsIcon}">${iconNoResults}</span><span>No results.</span></span>`; | ||
} | ||
return `<span class="${styles.noResults}">⚠️ The search index is only available when you run docusaurus build!</span>`; | ||
} |
Oops, something went wrong.