Add info when no recent edit history to display
This commit is contained in:
parent
fe84016e79
commit
2ffa14cdbb
@ -1,6 +1,7 @@
|
|||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
|
|
||||||
import { BuildingEditSummary } from '../building/edit-history/building-edit-summary';
|
import { BuildingEditSummary } from '../building/edit-history/building-edit-summary';
|
||||||
|
import InfoBox from '../components/info-box';
|
||||||
import { EditHistoryEntry } from '../models/edit-history-entry';
|
import { EditHistoryEntry } from '../models/edit-history-entry';
|
||||||
|
|
||||||
const ChangesPage = () => {
|
const ChangesPage = () => {
|
||||||
@ -23,7 +24,9 @@ const ChangesPage = () => {
|
|||||||
<h1>Global edit history</h1>
|
<h1>Global edit history</h1>
|
||||||
|
|
||||||
<ul className="edit-history-list">
|
<ul className="edit-history-list">
|
||||||
{history && history.map(entry => (
|
{(history == undefined || history.length == 0) ?
|
||||||
|
<InfoBox msg="No changes in the last week"></InfoBox> :
|
||||||
|
history.map(entry => (
|
||||||
<li key={`${entry.revision_id}`} className="edit-history-list-element">
|
<li key={`${entry.revision_id}`} className="edit-history-list-element">
|
||||||
<BuildingEditSummary
|
<BuildingEditSummary
|
||||||
historyEntry={entry}
|
historyEntry={entry}
|
||||||
@ -31,7 +34,8 @@ const ChangesPage = () => {
|
|||||||
hyperlinkCategories={true}
|
hyperlinkCategories={true}
|
||||||
/>
|
/>
|
||||||
</li>
|
</li>
|
||||||
))}
|
))
|
||||||
|
}
|
||||||
</ul>
|
</ul>
|
||||||
</section>
|
</section>
|
||||||
</article>
|
</article>
|
||||||
|
Loading…
Reference in New Issue
Block a user