-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add Convoy page * refine convoy page * Update Slides.jsx * fix cover images in slides * refine person page
- Loading branch information
1 parent
3a3bcb4
commit affe17d
Showing
16 changed files
with
343 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import DocumentItem from './DocumentItem' | ||
|
||
import { StatusError, StatusSuccess, useGetJSON } from '../hooks/data' | ||
|
||
const ListOfDocuments = ({ params, className = '', hideIfEmpty, onClick, itemProps, children }) => { | ||
const { data, status, error } = useGetJSON({ | ||
url: '/api/document', | ||
params, | ||
}) | ||
|
||
if (status === StatusError) { | ||
console.error('[ListOfDocuments] error in reading api:', status, params, data, error) | ||
return null | ||
} | ||
if (status === StatusSuccess && !data.results.length && hideIfEmpty) { | ||
return null | ||
} | ||
|
||
return ( | ||
<section className={`ListOfDocuments ${className}`}> | ||
{children} | ||
<ol> | ||
{status === StatusSuccess | ||
? data.results.map((doc) => ( | ||
<li key={doc.slug}> | ||
<DocumentItem doc={doc} onClick={onClick} {...itemProps} /> | ||
</li> | ||
)) | ||
: null} | ||
</ol> | ||
</section> | ||
) | ||
} | ||
|
||
export default ListOfDocuments |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
.MetadataField { | ||
display: flex; | ||
align-items: center; | ||
} | ||
.MetadataField label { | ||
font-family: var(--bs-font-sans-serif-italic); | ||
opacity: 0.6; | ||
width: 40%; | ||
flex-shrink: 1; | ||
word-break: normal; | ||
/* text-transform: uppercase; | ||
font-size: var(--small-font-size); */ | ||
/* display: block; */ | ||
margin-right: var(--size-3); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import './MetadataField.css' | ||
import { useTranslation } from 'react-i18next' | ||
|
||
const MetadataField = ({ label, value, className = '', hideIfEmpty = false }) => { | ||
var { t } = useTranslation() | ||
|
||
if ( | ||
hideIfEmpty && | ||
(typeof value === 'undefined' || | ||
value === null || | ||
(typeof value === 'string' && value.length === 0)) | ||
) { | ||
return null | ||
} | ||
const valueAsDate = new Date(value) | ||
|
||
return ( | ||
<div className={`MetadataField ${className}`}> | ||
<label>{t('metadataField_' + label)}</label> | ||
{typeof value === 'undefined' || value === null ? <span>—</span> : null} | ||
{typeof value === 'string' && value.length === 0 ? <span>—</span> : null} | ||
{typeof value === 'string' && isNaN(valueAsDate) && value.length > 0 ? ( | ||
<span>{value}</span> | ||
) : null} | ||
{typeof value === 'string' && !isNaN(valueAsDate) ? ( | ||
<span>{t('dateShort', { date: valueAsDate })}</span> | ||
) : null} | ||
{Array.isArray(value) ? value.map((v, i) => <span key={i}>{v}</span>) : null} | ||
</div> | ||
) | ||
} | ||
|
||
export default MetadataField |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
.Convoy label { | ||
display: block; | ||
margin: 0.5rem 0; | ||
font-weight: 700; | ||
text-transform: uppercase; | ||
} | ||
|
||
.Convoy__StoryModule.no-footnotes .FootnoteDefinition { | ||
display: none !important; | ||
} | ||
|
||
.Convoy__StoryModule.first p:first-of-type { | ||
font-size: 1.2em; | ||
} | ||
|
||
.Convoy__StoryModule.first p:first-of-type > em { | ||
font-style: normal; | ||
} | ||
|
||
.Convoy__StoryEndnotes a { | ||
word-break: break-all; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.