also allow clicking to hear audio on search results
This commit is contained in:
parent
1fefb4ca7e
commit
60ce765193
|
@ -8,6 +8,7 @@
|
||||||
import ExtraEntryInfo from "../components/ExtraEntryInfo";
|
import ExtraEntryInfo from "../components/ExtraEntryInfo";
|
||||||
import classNames from "classnames";
|
import classNames from "classnames";
|
||||||
import { Types as T, InlinePs } from "@lingdocs/ps-react";
|
import { Types as T, InlinePs } from "@lingdocs/ps-react";
|
||||||
|
import playStorageAudio from "./PlayStorageAudio";
|
||||||
|
|
||||||
function Entry({
|
function Entry({
|
||||||
entry,
|
entry,
|
||||||
|
@ -20,6 +21,12 @@ function Entry({
|
||||||
nonClickable?: boolean;
|
nonClickable?: boolean;
|
||||||
isolateEntry?: (ts: number) => void;
|
isolateEntry?: (ts: number) => void;
|
||||||
}) {
|
}) {
|
||||||
|
function handlePlayStorageAudio(
|
||||||
|
e: React.MouseEvent<HTMLElement, MouseEvent>
|
||||||
|
) {
|
||||||
|
e.stopPropagation();
|
||||||
|
playStorageAudio(entry.ts, () => null);
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={classNames("entry", { clickable: !nonClickable })}
|
className={classNames("entry", { clickable: !nonClickable })}
|
||||||
|
@ -34,7 +41,12 @@ function Entry({
|
||||||
</strong>
|
</strong>
|
||||||
{` `}
|
{` `}
|
||||||
<em>{entry.c}</em>
|
<em>{entry.c}</em>
|
||||||
{entry.a && !nonClickable && <i className="ml-2 fas fa-volume-down" />}
|
{entry.a && !nonClickable && (
|
||||||
|
<i
|
||||||
|
onClick={handlePlayStorageAudio}
|
||||||
|
className="clickable ml-2 fas fa-volume-down"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
<ExtraEntryInfo entry={entry} textOptions={textOptions} />
|
<ExtraEntryInfo entry={entry} textOptions={textOptions} />
|
||||||
<div className="entry-definition">{entry.e}</div>
|
<div className="entry-definition">{entry.e}</div>
|
||||||
|
|
Loading…
Reference in New Issue