Show time since last render.
This commit is contained in:
@@ -17,7 +17,15 @@
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.subtitle {
|
||||
color: #aaa;
|
||||
}
|
||||
|
||||
.value {
|
||||
text-align: center;
|
||||
border: 1px solid #888;
|
||||
}
|
||||
|
||||
.menu {
|
||||
margin: .5em;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import React from 'react';
|
||||
import moment from 'moment';
|
||||
import './App.css';
|
||||
import {
|
||||
Columns,
|
||||
@@ -186,7 +187,7 @@ class App extends React.Component {
|
||||
|
||||
images = imageMetadata.map((metadata) => {
|
||||
let {name, ratio, image} = metadata;
|
||||
let width = 256;
|
||||
let width = 384;
|
||||
let height = (ratio * width).toFixed();
|
||||
let url = ROOT + image + '?t=' + timestamp;
|
||||
const mouseMove = (e) => {
|
||||
@@ -217,9 +218,13 @@ class App extends React.Component {
|
||||
<p className="name">{name}</p>
|
||||
</div>)
|
||||
});
|
||||
let time = moment.unix(timestamp);
|
||||
mainContent = <div>
|
||||
<Heading>
|
||||
Run @ {new Date(timestamp * 1000).toLocaleString()}
|
||||
Run @ {time.format("llll")}
|
||||
</Heading>
|
||||
<Heading subtitle>
|
||||
{time.fromNow()}
|
||||
</Heading>
|
||||
{images}
|
||||
</div>;
|
||||
|
||||
Reference in New Issue
Block a user