UI: Simplify definition view in symbol gloss
@@ -168,22 +168,23 @@ class SimpleSymbolGloss extends React.PureComponent<Props, State> {
"contextual-symbol-gloss"
)}
>
- {definedHere && <div className="gloss__section">Defined here.</div>}
+ {definedHere && (
+ <div className="gloss__section">
+ <p>Defined here.</p>
+ </div>
+ )}
{!definedHere && definitions.length > 0 && (
<div className="gloss__section">
- <GlossSection id={`definitions-symbol-${symbol.id}`}>
- {definitions.map((d, i) => (
<Snippet
- key={i}
- id={`symbol-${symbol.id}-definition-${i}`}
- sentence={definitionSentences[i]}
- linkText={getLinkText(originalSymbol, definitionSentences[i])}
+ id={`symbol-${symbol.id}-definition`}
+ sentence={definitionSentences[0]}
+ linkText={
+ " " + getLinkText(originalSymbol, definitionSentences[0])
+ }
handleJumpToSnippet={this.props.handleJumpToEntity}
>
- {d}
+ {definitions[0]}
</Snippet>
- ))}
- </GlossSection>
</div>
)}
<div className="gloss__section">
@@ -216,7 +217,7 @@ class SimpleSymbolGloss extends React.PureComponent<Props, State> {
)}
</span>
))}
- . <VoteButton context={{ for: "nicknames" }} />
+ .
</span>
</p>
) : null}
@@ -233,9 +234,9 @@ function getLinkText(source: Entity, destination: Entity) {
return null;
}
if (sourcePage === destPage) {
- return `See in context on this page`;
+ return null;
} else {
- return `See in context on page ${destPage + 1}`;
+ return `(See in context on page ${destPage + 1})`;
}
}
@@ -652,13 +653,9 @@ class Snippet extends React.PureComponent<SnippetProps> {
render() {
const { sentence } = this.props;
return (
- <>
- <div className="snippet">
+ <p>
<RichText>{cleanTex(this.props.children)}</RichText>
- </div>
{this.props.handleJumpToSnippet && this.props.linkText ? (
- <p>
- {" "}
<EntityLinkSpan
id={`${this.props.id}-text-link`}
entityId={sentence ? sentence.id : undefined}
@@ -666,10 +663,8 @@ class Snippet extends React.PureComponent<SnippetProps> {
>
{this.props.linkText}
</EntityLinkSpan>
- {"."}
- </p>
) : null}
- </>
+ </p>
);
}
}
