diff --git a/.eslintrc.js b/.eslintrc.js index f13e39a..c0410e5 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -21,9 +21,9 @@ module.exports = { }, rules: { "@typescript-eslint/camelcase": ["off", { properties: "never" }], - "@typescript-eslint/quotes": ["error", "double"], + "@typescript-eslint/quotes": "off", camelcase: "off", - "comma-dangle": ["error", "never"], + "comma-dangle": "off", "no-extra-semi": 2, "no-irregular-whitespace": 2, "no-lonely-if": 2, diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7a7b621..50a41d1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,28 +4,28 @@ name: CI # Controls when the action will run. on: - # Triggers the workflow on push or pull request events but only for the master branch - push: - branches: [main] - pull_request: - branches: [main] + # Triggers the workflow on push or pull request events but only for the master branch + push: + branches: [main] + pull_request: + branches: [main] - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - # This workflow contains a single job called "build" - build: - # The type of runner that the job will run on - runs-on: ubuntu-latest + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 - - name: Build project - run: | - npm install - npm run build + - name: Build project + run: | + npm install + npm run build diff --git a/.prettierrc b/.prettierrc index b5f10b7..bb7c2e9 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,27 +1,27 @@ { - "bracketSpacing": true, - "printWidth": 80, - "proseWrap": "preserve", - "semi": true, - "singleQuote": true, - "trailingComma": "all", - "tabWidth": 4, - "useTabs": true, - "arrowParens": "always", - "endOfLine": "lf", - "overrides": [ - { - "files": "*.json", - "options": { - "singleQuote": false - } - }, - { - "files": ".*rc", - "options": { - "singleQuote": false, - "parser": "json" - } - } - ] -} \ No newline at end of file + "bracketSpacing": true, + "printWidth": 80, + "proseWrap": "preserve", + "semi": true, + "singleQuote": true, + "trailingComma": "all", + "tabWidth": 4, + "useTabs": true, + "arrowParens": "always", + "endOfLine": "lf", + "overrides": [ + { + "files": "*.json", + "options": { + "singleQuote": false + } + }, + { + "files": ".*rc", + "options": { + "singleQuote": false, + "parser": "json" + } + } + ] +} diff --git a/next.config.js b/next.config.js index 6fa5aa5..a70a2e2 100644 --- a/next.config.js +++ b/next.config.js @@ -1,13 +1,13 @@ const backends = { - local: "http://localhost:4000", - development: "https://dev.backend.tartanhacks.com", - staging: "https://stg.backend.tartanhacks.com", - production: "https://backend.tartanhacks.com" -} + local: 'http://localhost:4000', + development: 'https://dev.backend.tartanhacks.com', + staging: 'https://stg.backend.tartanhacks.com', + production: 'https://backend.tartanhacks.com', +}; module.exports = { - poweredByHeader: false, - reactStrictMode: false, - env: { - BACKEND_URL: backends[process.env.APP_ENV || "development"] - } -} + poweredByHeader: false, + reactStrictMode: false, + env: { + BACKEND_URL: backends['production' || 'development'], + }, +}; diff --git a/pages/_app.tsx b/pages/_app.tsx index fc9bd36..6badc4e 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -1,33 +1,33 @@ -import { StyledEngineProvider, ThemeProvider } from "@mui/material" -import type { AppProps } from "next/app" -import Head from "next/head" -import { ReactElement } from "react" -import { Provider } from "react-redux" -import Script from "next/script" -import store from "src/store" -import { theme } from "src/themes/theme" -import "styles/globals.scss" +import { StyledEngineProvider, ThemeProvider } from '@mui/material'; +import type { AppProps } from 'next/app'; +import Head from 'next/head'; +import { ReactElement } from 'react'; +import { Provider } from 'react-redux'; +import Script from 'next/script'; +import store from 'src/store'; +import { theme } from 'src/themes/theme'; +import 'styles/globals.scss'; const App = ({ Component, pageProps }: AppProps): ReactElement => { - return ( - <> - - TartanHacks - {/* Disable cache control */} - - - - - - - + - - - - - - - - - - ) -} + + + + + + + + + + + ); +}; -export default App +export default App; diff --git a/pages/_document.tsx b/pages/_document.tsx index 0ce7485..02b342a 100644 --- a/pages/_document.tsx +++ b/pages/_document.tsx @@ -1,36 +1,49 @@ -import Document, { Head, Html, Main, NextScript } from "next/document" -import React, { ReactElement } from "react" -import { theme } from "src/themes/theme" -import createEmotionServer from "@emotion/server/create-instance" -import createEmotionCache from "src/util/createEmotionCache" -import Script from "next/script" +import Document, { Head, Html, Main, NextScript } from 'next/document'; +import React, { ReactElement } from 'react'; +import { theme } from 'src/themes/theme'; +import createEmotionServer from '@emotion/server/create-instance'; +import createEmotionCache from 'src/util/createEmotionCache'; +import Script from 'next/script'; class MyDocument extends Document { - render(): ReactElement { - return ( - - - - - - - - - - - - -
- - - - - ) - } + + + + ); + } } // eslint-disable-next-line MyDocument.getInitialProps = async (ctx): Promise => { - // Resolution order - // - // On the server: - // 1. app.getInitialProps - // 2. page.getInitialProps - // 3. document.getInitialProps - // 4. app.render - // 5. page.render - // 6. document.render - // - // On the server with error: - // 1. document.getInitialProps - // 2. app.render - // 3. page.render - // 4. document.render - // - // On the client - // 1. app.getInitialProps - // 2. page.getInitialProps - // 3. app.render - // 4. page.render + // Resolution order + // + // On the server: + // 1. app.getInitialProps + // 2. page.getInitialProps + // 3. document.getInitialProps + // 4. app.render + // 5. page.render + // 6. document.render + // + // On the server with error: + // 1. document.getInitialProps + // 2. app.render + // 3. page.render + // 4. document.render + // + // On the client + // 1. app.getInitialProps + // 2. page.getInitialProps + // 3. app.render + // 4. page.render - const originalRenderPage = ctx.renderPage + const originalRenderPage = ctx.renderPage; - // You can consider sharing the same Emotion cache between all the SSR requests to speed up performance. - // However, be aware that it can have global side effects. - const cache = createEmotionCache() - const { extractCriticalToChunks } = createEmotionServer(cache) + // You can consider sharing the same Emotion cache between all the SSR requests to speed up performance. + // However, be aware that it can have global side effects. + const cache = createEmotionCache(); + const { extractCriticalToChunks } = createEmotionServer(cache); - ctx.renderPage = () => - originalRenderPage({ - enhanceApp: (App: any) => - function EnhanceApp(props) { - return - } - }) + ctx.renderPage = () => + originalRenderPage({ + enhanceApp: (App: any) => + function EnhanceApp(props) { + return ; + }, + }); - const initialProps = await Document.getInitialProps(ctx) - // This is important. It prevents Emotion to render invalid HTML. - // See https://github.com/mui/material-ui/issues/26561#issuecomment-855286153 - const emotionStyles = extractCriticalToChunks(initialProps.html) - const emotionStyleTags = emotionStyles.styles.map((style) => ( -