Skip to content

Commit dc77d56

Browse files
Try a different style
1 parent 1d512d5 commit dc77d56

File tree

1 file changed

+29
-19
lines changed

1 file changed

+29
-19
lines changed

src/components/Publications/Entry/Periodical.jsx

+29-19
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,35 @@
1-
// import { asMonth, quoteTitle } from '../../../utils'
2-
import { quoteTitle } from '../../../utils'
1+
import { asMonth, quoteTitle } from '../../../utils'
32
import Authors from './Authors'
43
import PropTypes from 'prop-types'
54

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+
}
2333

2434
Periodical.propTypes = {
2535
entry: PropTypes.shape({

0 commit comments

Comments
 (0)