-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
List of fact-checks. Reference: CV2-4145.
- Loading branch information
1 parent
66b28d0
commit 583498f
Showing
7 changed files
with
210 additions
and
47 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
localization/react-intl/src/app/components/article/FactChecks.json
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 @@ | ||
[ | ||
{ | ||
"id": "factChecks.sortTitle", | ||
"description": "Label for sort criteria option displayed in a drop-down in the fact-checks page.", | ||
"defaultMessage": "Title" | ||
}, | ||
{ | ||
"id": "factChecks.sortLanguage", | ||
"description": "Label for sort criteria option displayed in a drop-down in the fact-checks page.", | ||
"defaultMessage": "Language" | ||
}, | ||
{ | ||
"id": "factChecks.sortDate", | ||
"description": "Label for sort criteria option displayed in a drop-down in the fact-checks page.", | ||
"defaultMessage": "Updated (date)" | ||
}, | ||
{ | ||
"id": "factChecks.title", | ||
"description": "Title of the fact-checks page.", | ||
"defaultMessage": "Claim & Fact-checks" | ||
} | ||
] |
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,66 @@ | ||
import React from 'react'; | ||
import { graphql } from 'react-relay/compat'; | ||
import PropTypes from 'prop-types'; | ||
import { FormattedMessage, defineMessages, injectIntl, intlShape } from 'react-intl'; | ||
import FactCheckIcon from '../../icons/fact_check.svg'; | ||
import Articles from './Articles'; | ||
|
||
const messages = defineMessages({ | ||
sortTitle: { | ||
id: 'factChecks.sortTitle', | ||
defaultMessage: 'Title', | ||
description: 'Label for sort criteria option displayed in a drop-down in the fact-checks page.', | ||
}, | ||
sortLanguage: { | ||
id: 'factChecks.sortLanguage', | ||
defaultMessage: 'Language', | ||
description: 'Label for sort criteria option displayed in a drop-down in the fact-checks page.', | ||
}, | ||
sortDate: { | ||
id: 'factChecks.sortDate', | ||
defaultMessage: 'Updated (date)', | ||
description: 'Label for sort criteria option displayed in a drop-down in the fact-checks page.', | ||
}, | ||
}); | ||
|
||
const FactChecks = ({ routeParams, intl }) => { | ||
const sortOptions = [ | ||
{ value: 'title', label: intl.formatMessage(messages.sortTitle) }, | ||
{ value: 'language', label: intl.formatMessage(messages.sortLanguage) }, | ||
{ value: 'updated_at', label: intl.formatMessage(messages.sortDate) }, | ||
]; | ||
|
||
const updateMutation = graphql` | ||
mutation FactChecksUpdateFactCheckMutation($input: UpdateFactCheckInput!) { | ||
updateFactCheck(input: $input) { | ||
fact_check { | ||
id | ||
tags | ||
} | ||
} | ||
} | ||
`; | ||
|
||
return ( | ||
<Articles | ||
type="fact-check" | ||
title={<FormattedMessage id="factChecks.title" defaultMessage="Claim & Fact-checks" description="Title of the fact-checks page." />} | ||
icon={<FactCheckIcon />} | ||
teamSlug={routeParams.team} | ||
sortOptions={sortOptions} | ||
filterOptions={['users', 'tags', 'range', 'language_filter']} | ||
updateMutation={updateMutation} | ||
/> | ||
); | ||
}; | ||
|
||
FactChecks.defaultProps = {}; | ||
|
||
FactChecks.propTypes = { | ||
routeParams: PropTypes.shape({ | ||
team: PropTypes.string.isRequired, // slug | ||
}).isRequired, | ||
intl: intlShape.isRequired, | ||
}; | ||
|
||
export default injectIntl(FactChecks); |
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 |
---|---|---|
|
@@ -39,4 +39,10 @@ | |
} | ||
} | ||
} | ||
|
||
.cardRightTop { | ||
display: flex; | ||
gap: 3px; | ||
justify-content: flex-end; | ||
} | ||
} |