eslint
This commit is contained in:
12
app/pages/home/Hero.js
Normal file
12
app/pages/home/Hero.js
Normal file
@@ -0,0 +1,12 @@
|
||||
import React from 'react'
|
||||
import styles from './Hero.module.scss'
|
||||
|
||||
export default class Hero extends React.Component {
|
||||
render () {
|
||||
return (
|
||||
<div className={styles.hero}>
|
||||
Hero
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
9
app/pages/home/Hero.module.scss
Normal file
9
app/pages/home/Hero.module.scss
Normal file
@@ -0,0 +1,9 @@
|
||||
.hero {
|
||||
width: 100%;
|
||||
padding: 128px 0;
|
||||
position: relative;
|
||||
background: white;
|
||||
color: black;
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import React from "react"
|
||||
import React from 'react'
|
||||
|
||||
export default class ItemRow extends React.Component {
|
||||
constructor ({ scanResult }) {
|
||||
@@ -15,4 +15,4 @@ export default class ItemRow extends React.Component {
|
||||
</tr>
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React from "react"
|
||||
import React from 'react'
|
||||
import ItemRow from './ItemRow'
|
||||
|
||||
export default class Table extends React.Component {
|
||||
@@ -10,10 +10,10 @@ export default class Table extends React.Component {
|
||||
render () {
|
||||
return (
|
||||
<table>
|
||||
<thead></thead>
|
||||
<thead />
|
||||
<tbody>
|
||||
{this.scanResults.map((scanResult) =>
|
||||
<ItemRow
|
||||
{this.scanResults.map((scanResult) =>
|
||||
<ItemRow
|
||||
key={scanResult._id}
|
||||
scanResult={scanResult}
|
||||
/>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import React from "react"
|
||||
import React from 'react'
|
||||
import dbConnect from '../../lib/dbConnect'
|
||||
import { models } from 'shared-stuff'
|
||||
import Hero from './Hero'
|
||||
import Table from './Table'
|
||||
|
||||
export default class Home extends React.Component {
|
||||
@@ -11,16 +12,17 @@ export default class Home extends React.Component {
|
||||
|
||||
render () {
|
||||
return (
|
||||
<div>
|
||||
<>
|
||||
<Hero />
|
||||
<Table
|
||||
scanResults={this.scanResults}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export async function getServerSideProps() {
|
||||
export async function getServerSideProps () {
|
||||
try {
|
||||
await dbConnect()
|
||||
const scanResults = await models.ScanResult.find({})
|
||||
@@ -28,12 +30,12 @@ export async function getServerSideProps() {
|
||||
return {
|
||||
props: {
|
||||
scanResults: JSON.parse(JSON.stringify(scanResults))
|
||||
},
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
return {
|
||||
props: {},
|
||||
props: {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user