mirror of
https://github.com/Aviortheking/next-template.git
synced 2025-07-24 22:29:51 +00:00
v3.1: Upgraded to NextJS 12
Static Dockerfile Signed-off-by: Avior <github@avior.me>
This commit is contained in:
@ -1,3 +0,0 @@
|
||||
// Put your program constants here
|
||||
|
||||
export const TEST = true
|
10
src/components/README.md
Normal file
10
src/components/README.md
Normal file
@ -0,0 +1,10 @@
|
||||
# Components used through the app
|
||||
|
||||
folder architecture:
|
||||
|
||||
```
|
||||
components
|
||||
|-- componentName
|
||||
|-- index.tsx
|
||||
|-- componentName.styl
|
||||
```
|
4
src/globals.styl
Normal file
4
src/globals.styl
Normal file
@ -0,0 +1,4 @@
|
||||
// Here is your global Stylus styling affecting the whole page
|
||||
|
||||
html, body
|
||||
background white
|
1
src/libs/README.md
Normal file
1
src/libs/README.md
Normal file
@ -0,0 +1 @@
|
||||
# Libs used through the app (frontend/backend libs)
|
1
src/models/README.md
Normal file
1
src/models/README.md
Normal file
@ -0,0 +1 @@
|
||||
the different models you app uses
|
@ -1,22 +1,12 @@
|
||||
import React from 'react'
|
||||
import App from 'next/app'
|
||||
import Router from 'next/router'
|
||||
import { DefaultSeo } from 'next-seo'
|
||||
import { NotificationManager, Navbar, Loader, Footer } from '@dzeio/components'
|
||||
|
||||
// import '../styl/globals.styl'
|
||||
// import '../globals.styl'
|
||||
import '@dzeio/components/style.css'
|
||||
|
||||
export default class CustomApp extends App<unknown, unknown, {path?: string}> {
|
||||
|
||||
public componentDidMount(): void {
|
||||
this.checkMessage()
|
||||
this.setState({ path: Router.asPath })
|
||||
Router.events.on('routeChangeComplete', () => {
|
||||
this.checkMessage()
|
||||
this.setState({ path: Router.asPath })
|
||||
})
|
||||
}
|
||||
export default class CustomApp extends App {
|
||||
|
||||
public render(): JSX.Element {
|
||||
const { Component, pageProps } = this.props
|
||||
@ -28,10 +18,7 @@ export default class CustomApp extends App<unknown, unknown, {path?: string}> {
|
||||
title="Sitemap"
|
||||
description="Site description"
|
||||
/>
|
||||
<Navbar
|
||||
type="navbar"
|
||||
items={[]}
|
||||
/>
|
||||
<Navbar menu={[{name: 'Hello'}, {name: 'World'}]} />
|
||||
<Loader auto={{ increment: [1, 10], interval: [5, 50] }} />
|
||||
<Component {...pageProps} />
|
||||
<NotificationManager manageRoutes />
|
||||
@ -39,12 +26,4 @@ export default class CustomApp extends App<unknown, unknown, {path?: string}> {
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
private checkMessage() {
|
||||
const msg = Router.query.message
|
||||
if (typeof msg === 'string') {
|
||||
NotificationManager.addNotification(msg)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
2
src/pages/index.module.styl
Normal file
2
src/pages/index.module.styl
Normal file
@ -0,0 +1,2 @@
|
||||
.test
|
||||
background: orange !important
|
@ -1,10 +1,12 @@
|
||||
import React from 'react'
|
||||
import { Text } from '@dzeio/components'
|
||||
|
||||
import css from './index.module.styl'
|
||||
|
||||
export default class Homepage extends React.Component {
|
||||
|
||||
public render = (): JSX.Element => (
|
||||
<main>
|
||||
<main className={css.test}>
|
||||
<Text>Hello World !</Text>
|
||||
</main>
|
||||
)
|
||||
|
@ -1,3 +0,0 @@
|
||||
// Global styl here
|
||||
html, body
|
||||
background white
|
4
src/styl/stylus.d.ts
vendored
4
src/styl/stylus.d.ts
vendored
@ -1,4 +0,0 @@
|
||||
declare module '*.styl' {
|
||||
const content: any
|
||||
export = content
|
||||
}
|
Reference in New Issue
Block a user