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'
|
||||
|
||||
export default function Layout({ children }) {
|
||||
export default function Layout ({ children }) {
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
<title>Warframe Center</title>
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
<link rel='icon' href='/favicon.ico' />
|
||||
</Head>
|
||||
<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"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-eslint": "^10.1.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 Layout from '../components/layout'
|
||||
|
||||
function MyApp({ Component, pageProps }) {
|
||||
function MyApp ({ Component, pageProps }) {
|
||||
return (
|
||||
<Layout>
|
||||
<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 {
|
||||
constructor ({ scanResult }) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React from "react"
|
||||
import React from 'react'
|
||||
import ItemRow from './ItemRow'
|
||||
|
||||
export default class Table extends React.Component {
|
||||
@@ -10,7 +10,7 @@ export default class Table extends React.Component {
|
||||
render () {
|
||||
return (
|
||||
<table>
|
||||
<thead></thead>
|
||||
<thead />
|
||||
<tbody>
|
||||
{this.scanResults.map((scanResult) =>
|
||||
<ItemRow
|
||||
|
||||
@@ -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