added docker stuff and updated next.js to ^7.0.0

This commit is contained in:
JJ Kasper
2018-09-21 15:17:55 -05:00
parent 2230f72160
commit 56f9ee318f
62 changed files with 16686 additions and 11907 deletions

View File

@@ -40,11 +40,10 @@ class Index extends Component {
static getDerivedStateFromProps(nextProps, prevState) {
let { docs, total, page, $search } = nextProps
if (
docs.length !== prevState.docs.length ||
page !== prevState.page ||
$search !== prevState.$search
!prevState.didInit &&
(page !== prevState.page || $search !== prevState.$search)
) {
return { total, docs, page, $search, pending: false }
return { total, docs, page, $search, pending: false, didInit: true }
}
return null
}
@@ -92,6 +91,10 @@ class Index extends Component {
this.updDocs(1)
}
componentDidMount() {
this.updDocs(1)
}
componentDidUpdate(prevProps) {
const { user, docs } = this.props
if (prevProps.user.email === user.email) return
@@ -152,7 +155,9 @@ class Index extends Component {
</tr>
</thead>
<tbody>
{docs.map(doc => <DocItem {...doc} key={doc.id} />)}
{docs.map(doc => (
<DocItem {...doc} key={doc.id} />
))}
</tbody>
</table>
{pages < 2 ? null : (