|
1 |
| -// import { asMonth, quoteTitle } from '../../../utils' |
2 |
| -import { quoteTitle } from '../../../utils' |
| 1 | +import { asMonth, quoteTitle } from '../../../utils' |
3 | 2 | import Authors from './Authors'
|
4 | 3 | import PropTypes from 'prop-types'
|
5 | 4 |
|
6 |
| -const Periodical = ({ entry }) => ( |
7 |
| - <> |
8 |
| - <Authors>{entry.author}</Authors>,{' '} |
9 |
| - {quoteTitle(entry.title, [entry.journal, entry.volume, entry.number, entry.pages, entry.month, entry.year])}{' '} |
10 |
| - {/* {entry.journal && ( |
11 |
| - <> |
12 |
| - <i>{entry.journal}</i>,{' '} |
13 |
| - </> |
14 |
| - )} |
15 |
| - {entry.volume && <>vol. {entry.volume}, </>} |
16 |
| - {entry.number && <>no. {entry.number}, </>} |
17 |
| - {entry.pages && <>pp. {entry.pages}, </>}*/} |
18 |
| - {/* {entry.month && asMonth(entry.month)} */} |
19 |
| - {/*{entry.year && <>{entry.year}</>} |
20 |
| - {(entry.journal || entry.volume || entry.number || entry.pages || entry.month || entry.year) && <>.</>} */} |
21 |
| - </> |
22 |
| -) |
| 5 | +const Periodical = ({ entry }) => { |
| 6 | + const title = quoteTitle(entry.title, [ |
| 7 | + entry.journal, |
| 8 | + entry.volume, |
| 9 | + entry.number, |
| 10 | + entry.pages, |
| 11 | + entry.month, |
| 12 | + entry.year, |
| 13 | + ]) |
| 14 | + const journal = entry.journal ? <i>{entry.journal}, </i> : '' |
| 15 | + const volume = entry.volume ? `vol. ${entry.volume}, ` : '' |
| 16 | + const number = entry.number ? `no. ${entry.number}, ` : '' |
| 17 | + const pages = entry.pages ? `pp. ${entry.pages}, ` : '' |
| 18 | + const month = entry.month ? `${asMonth(entry.month)} ` : '' |
| 19 | + const year = entry.year ? entry.year : '' |
| 20 | + const stop = entry.journal || entry.volume || entry.number || entry.pages || entry.month || entry.year ? '.' : '' |
| 21 | + return ( |
| 22 | + <> |
| 23 | + <Authors>{entry.author}</Authors>, {title} {journal} |
| 24 | + {volume} |
| 25 | + {number} |
| 26 | + {pages} |
| 27 | + {month} |
| 28 | + {year} |
| 29 | + {stop} |
| 30 | + </> |
| 31 | + ) |
| 32 | +} |
23 | 33 |
|
24 | 34 | Periodical.propTypes = {
|
25 | 35 | entry: PropTypes.shape({
|
|
0 commit comments