eslint
This commit is contained in:
@@ -1,3 +1,3 @@
|
|||||||
{
|
{
|
||||||
"extends": "next/core-web-vitals"
|
"extends": ["standard", "standard-jsx", "standard-react", "next/core-web-vitals"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import Head from 'next/head'
|
import Head from 'next/head'
|
||||||
|
|
||||||
export default function Layout({ children }) {
|
export default function Layout ({ children }) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Head>
|
<Head>
|
||||||
<title>Warframe Center</title>
|
<title>Warframe Center</title>
|
||||||
<link rel="icon" href="/favicon.ico" />
|
<link rel='icon' href='/favicon.ico' />
|
||||||
</Head>
|
</Head>
|
||||||
<main>{children}</main>
|
<main>{children}</main>
|
||||||
</>
|
</>
|
||||||
|
|||||||
858
app/package-lock.json
generated
858
app/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -14,7 +14,15 @@
|
|||||||
"shared-stuff": "file:../shared-stuff"
|
"shared-stuff": "file:../shared-stuff"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"babel-eslint": "^10.1.0",
|
||||||
"eslint": "^8.11.0",
|
"eslint": "^8.11.0",
|
||||||
"eslint-config-next": "^12.1.0"
|
"eslint-config-next": "^12.1.0",
|
||||||
|
"eslint-config-standard": "^16.0.3",
|
||||||
|
"eslint-config-standard-jsx": "^10.0.0",
|
||||||
|
"eslint-config-standard-react": "^11.0.1",
|
||||||
|
"eslint-plugin-import": "^2.25.4",
|
||||||
|
"eslint-plugin-node": "^11.1.0",
|
||||||
|
"eslint-plugin-promise": "^6.0.0",
|
||||||
|
"eslint-plugin-react": "^7.29.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import '../styles/global.scss'
|
import '../styles/global.scss'
|
||||||
import Layout from '../components/layout'
|
import Layout from '../components/layout'
|
||||||
|
|
||||||
function MyApp({ Component, pageProps }) {
|
function MyApp ({ Component, pageProps }) {
|
||||||
return (
|
return (
|
||||||
<Layout>
|
<Layout>
|
||||||
<Component {...pageProps} />
|
<Component {...pageProps} />
|
||||||
|
|||||||
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 {
|
export default class ItemRow extends React.Component {
|
||||||
constructor ({ scanResult }) {
|
constructor ({ scanResult }) {
|
||||||
@@ -15,4 +15,4 @@ export default class ItemRow extends React.Component {
|
|||||||
</tr>
|
</tr>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import React from "react"
|
import React from 'react'
|
||||||
import ItemRow from './ItemRow'
|
import ItemRow from './ItemRow'
|
||||||
|
|
||||||
export default class Table extends React.Component {
|
export default class Table extends React.Component {
|
||||||
@@ -10,10 +10,10 @@ export default class Table extends React.Component {
|
|||||||
render () {
|
render () {
|
||||||
return (
|
return (
|
||||||
<table>
|
<table>
|
||||||
<thead></thead>
|
<thead />
|
||||||
<tbody>
|
<tbody>
|
||||||
{this.scanResults.map((scanResult) =>
|
{this.scanResults.map((scanResult) =>
|
||||||
<ItemRow
|
<ItemRow
|
||||||
key={scanResult._id}
|
key={scanResult._id}
|
||||||
scanResult={scanResult}
|
scanResult={scanResult}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import React from "react"
|
import React from 'react'
|
||||||
import dbConnect from '../../lib/dbConnect'
|
import dbConnect from '../../lib/dbConnect'
|
||||||
import { models } from 'shared-stuff'
|
import { models } from 'shared-stuff'
|
||||||
|
import Hero from './Hero'
|
||||||
import Table from './Table'
|
import Table from './Table'
|
||||||
|
|
||||||
export default class Home extends React.Component {
|
export default class Home extends React.Component {
|
||||||
@@ -11,16 +12,17 @@ export default class Home extends React.Component {
|
|||||||
|
|
||||||
render () {
|
render () {
|
||||||
return (
|
return (
|
||||||
<div>
|
<>
|
||||||
|
<Hero />
|
||||||
<Table
|
<Table
|
||||||
scanResults={this.scanResults}
|
scanResults={this.scanResults}
|
||||||
/>
|
/>
|
||||||
</div>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getServerSideProps() {
|
export async function getServerSideProps () {
|
||||||
try {
|
try {
|
||||||
await dbConnect()
|
await dbConnect()
|
||||||
const scanResults = await models.ScanResult.find({})
|
const scanResults = await models.ScanResult.find({})
|
||||||
@@ -28,12 +30,12 @@ export async function getServerSideProps() {
|
|||||||
return {
|
return {
|
||||||
props: {
|
props: {
|
||||||
scanResults: JSON.parse(JSON.stringify(scanResults))
|
scanResults: JSON.parse(JSON.stringify(scanResults))
|
||||||
},
|
}
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e)
|
console.error(e)
|
||||||
return {
|
return {
|
||||||
props: {},
|
props: {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user