ensl_gathers/app/javascripts/components/gatherArchive.js
Absurdon 79be2b8155 docker+upgrade
* Updated dependencies
  - React update needed transformation of React.createClass to ES2015
  classes
  - removed some deprecations/deprecated packages
  - added mulitple @types Dependencies to devDependencies for IDE code
  completion support
* added Docker related files
  - Dockerfile with build container
  - docker-compose.yml with mongodb and app
2020-10-11 19:49:26 +02:00

35 lines
913 B
JavaScript

import React from "react";
import { array } from "prop-types";
import { CompletedGather } from "javascripts/components/gather";
class ArchivedGathers extends React.Component {
static propTypes = {
archive: array.isRequired,
maps: array.isRequired
}
render = () => {
let archive = this.props.archive
.sort((a, b) => {
return new Date(b.createdAt) - new Date(a.createdAt);
})
.map((archivedGather, index) => {
return <CompletedGather
key={archivedGather.gather.done.time}
show={(index === 0) ? true : false}
gather={archivedGather.gather}
maps={this.props.maps} />
});
return (
<div className="panel panel-primary">
<div className="panel-heading">Archived Gathers</div>
<div className="panel-body">
{archive}
</div>
</div>
);
}
}
export { ArchivedGathers }