Skip to content

Commit

Permalink
feat(frontend/controller): re-order search result fields for readability
Browse files Browse the repository at this point in the history
- use non-location based css names
- use opacity for theme compatibility
  • Loading branch information
bhajneet authored and Harjot1Singh committed May 15, 2020
1 parent 1fe6a8f commit 5826ab9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 27 deletions.
27 changes: 10 additions & 17 deletions app/frontend/src/Controller/Search.css
Original file line number Diff line number Diff line change
Expand Up @@ -56,26 +56,19 @@
overflow: hidden;
}

.search .result .result-header {
display: flex;
flex-direction: row;
.search .result .secondary {
font-size: 0.8em;
margin-bottom: 0.2em;
color: rgba(121, 118, 118, 0.863);
opacity: .85;
}

.search .result .result-header .page {
margin-left: 30px;
.search .result .citation {
display: flex;
flex-direction: row;
font-size: 0.8em;
opacity: 0.55;
font-style: italic;
}

.search .result .result-header .author {
margin-left: 30px;
.search .result .citation > span + span {
padding-left: .25em;
}

.search .result .result-footer {
font-size: 0.8em;
color: rgba(121, 118, 118, 0.863);
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
21 changes: 11 additions & 10 deletions app/frontend/src/Controller/Search.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,23 +143,24 @@ const Search = ( { updateFocus, register, focused } ) => {
return (
<ListItem className={classNames( { focused } )} key={lineId} onClick={onClick} ref={ref}>
<div className="result">
<span className="result-header">
<span className="section">{shabad.section.nameEnglish}</span>
<span className="page">
{pageName}
{' '}
{sourcePage}
</span>
<span className="author">{writerName}</span>
</span>
<span className="gurmukhi text">
{beforeMatch ? <span className="words">{beforeMatch}</span> : null}
{match ? <span className="matched words">{match}</span> : null}
{afterMatch ? <span className="words">{afterMatch}</span> : null}
</span>
<span className="result-footer">
<span className="secondary text">
<span className="english-translation">{englishTranslation}</span>
</span>
<span className="citation">
<span className="author">({writerName}.</span>
<span className="section">"{shabad.section.nameEnglish}",</span>
<span className="page">
{pageName}
{' '}
{sourcePage})
</span>
</span>

</div>
</ListItem>
)
Expand Down

0 comments on commit 5826ab9

Please sign in to comment.