added docker stuff and updated next.js to ^7.0.0
This commit is contained in:
@@ -14,7 +14,6 @@ export default class MyDocument extends Document {
|
||||
/>
|
||||
<link rel="shortcut icon" href={favicon} type="image/x-icon" />
|
||||
<link rel="icon" href={favicon} type="image/x-icon" />
|
||||
<link rel="stylesheet" href={getUrl('/_next/static/style.css')} />
|
||||
<title>My Knowledge Base</title>
|
||||
<script
|
||||
dangerouslySetInnerHTML={{
|
||||
|
||||
@@ -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 : (
|
||||
|
||||
@@ -27,6 +27,7 @@ class k extends Component {
|
||||
window.alert(`Could not delete doc, ${del.message}`)
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const { found, id, doc } = this.props
|
||||
if (!found)
|
||||
|
||||
Reference in New Issue
Block a user