mirror of
https://github.com/bellingcat/ukraine-timemap.git
synced 2026-06-08 03:18:36 +03:00
adds copiable API link (#79)
This commit is contained in:
committed by
GitHub
parent
e6a24297fc
commit
8f76e96075
@@ -31,6 +31,7 @@ Read Bellingcat's article about this project in
|
||||
|
||||
## Deployment
|
||||
This project is now living in github pages and the API has switched to auto-updated S3 files.
|
||||
Access it at https://bellingcat-embeds.ams3.cdn.digitaloceanspaces.com/production/ukr/timemap/api.json
|
||||
|
||||
Release with `npm run deploy`.
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ export class DownloadButton extends Component {
|
||||
onDownload(format, domain) {
|
||||
let filename = `ukr-civharm-${dayjs().format("YYYY-MM-DD")}`;
|
||||
if (format === "api") {
|
||||
console.log(config["API_DATA"])
|
||||
window.open(config["API_DATA"], '_blank');
|
||||
}else if (format === "csv") {
|
||||
let outputData = this.getCsvData(domain);
|
||||
@@ -68,6 +69,14 @@ export class DownloadButton extends Component {
|
||||
render() {
|
||||
const { language, domain, format } = this.props;
|
||||
const textByFormat = copy[language].toolbar.download.panel.formats[format];
|
||||
|
||||
let description = <span className="download-description">{textByFormat.description}</span>;
|
||||
|
||||
if(format=='api'){
|
||||
const endpoint = config["API_DATA"];
|
||||
description = <span className="download-description">{textByFormat.description} <a href={endpoint}>Copy API endpoint link from here.</a></span>
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="download-row">
|
||||
<span
|
||||
@@ -78,7 +87,7 @@ export class DownloadButton extends Component {
|
||||
<i className="material-icons">{"download"}</i>
|
||||
<span className="tab-caption">{textByFormat.label}</span>
|
||||
</span>
|
||||
<span className="download-description">{textByFormat.description}</span>
|
||||
{description}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user