L
This commit is contained in:
parent
ae4cc8cfe6
commit
e9ab93557a
4 changed files with 8 additions and 4 deletions
|
@ -15,6 +15,10 @@ export default function SearchBar({ isLoading, setSearchQuery }: SearchBarProps)
|
|||
setSearchQuery(internalQuery);
|
||||
};
|
||||
|
||||
let rightElement;
|
||||
if (isLoading) rightElement = <Spinner />;
|
||||
else rightElement = <SearchIcon />;
|
||||
|
||||
return (
|
||||
<form onSubmit={onSubmit}>
|
||||
<InputGroup>
|
||||
|
@ -26,9 +30,7 @@ export default function SearchBar({ isLoading, setSearchQuery }: SearchBarProps)
|
|||
value={internalQuery}
|
||||
onChange={(evt) => setInternalQuery(evt.target.value)}
|
||||
/>
|
||||
<InputRightElement>
|
||||
{{ false: <SearchIcon />, true: <Spinner /> }[isLoading]}
|
||||
</InputRightElement>
|
||||
<InputRightElement>{rightElement}</InputRightElement>
|
||||
</InputGroup>
|
||||
</form>
|
||||
);
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
// @ts-ignore: https://git.mzhang.io/michael/houhou/issues/4
|
||||
import buildFormatter from "react-timeago/es6/formatters/buildFormatter";
|
||||
// @ts-ignore: https://git.mzhang.io/michael/houhou/issues/4
|
||||
import shortEnStrings from "react-timeago/es6/language-strings/en-short";
|
||||
import classNames from "classnames";
|
||||
import { KanjiSrsInfo } from "../lib/kanji";
|
||||
|
|
|
@ -19,7 +19,7 @@ export default function VocabList({ className, kanjiId }: VocabListProps) {
|
|||
|
||||
if (!data) {
|
||||
console.error(error);
|
||||
return;
|
||||
return <>Error {error}</>;
|
||||
}
|
||||
|
||||
return (
|
||||
|
|
0
src/index.d.ts
vendored
Normal file
0
src/index.d.ts
vendored
Normal file
Loading…
Reference in a new issue