Skip to content

Commit

Permalink
fix(frontend/controller): change default citation format (#576)
Browse files Browse the repository at this point in the history
fixes #575
  • Loading branch information
saihaj authored Jun 2, 2020
1 parent 1b2ac37 commit 7f5ced3
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions app/frontend/src/Controller/Search.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,6 @@ const Search = ( { updateFocus, register, focused } ) => {
const showCitation = showResultCitations && shabad && shabad.section
const getEnglish = ( { nameEnglish } ) => nameEnglish
const getWriterName = () => getEnglish( writers[ shabad.writerId ] )
const getSection = () => getEnglish( shabad.section )
const getPageName = () => recommendedSources[ shabad.sourceId ].pageNameEnglish

return (
Expand Down Expand Up @@ -275,14 +274,11 @@ const Search = ( { updateFocus, register, focused } ) => {

{showCitation && (
<span className="citation">
(
{`${getWriterName()}. `}
{[
`"${getSection()}"`,
getWriterName(),
SOURCE_ABBREVIATIONS[ sourceId ],
`${getPageName()} ${sourcePage}`,
].reduce( ( prev, curr ) => [ prev, ', ', curr ] )}
)
].reduce( ( prev, curr ) => [ prev, ' - ', curr ] )}
</span>
)}

Expand Down

0 comments on commit 7f5ced3

Please sign in to comment.