add getStaticProps to use static optimization

This commit is contained in:
Aarni Halinen
2021-04-01 18:46:28 +03:00
parent ac0d33ef93
commit 4eeb798d79
13 changed files with 39 additions and 13 deletions
+3 -1
View File
@@ -1,5 +1,5 @@
import React from "react";
import { NextPage } from "next";
import { NextPage, GetStaticProps } from "next";
import Head from "next/head";
import styled from "styled-components";
@@ -25,4 +25,6 @@ const NotFoundPage: NextPage = () => (
</>
);
export const getStaticProps: GetStaticProps = async () => ({ props: {} });
export default NotFoundPage;
+3 -1
View File
@@ -1,5 +1,5 @@
import React from "react";
import { NextPage } from "next";
import { NextPage, GetStaticProps } from "next";
import { formatRelative } from "date-fns";
import { toast } from "react-toastify";
import styled from "styled-components";
@@ -75,4 +75,6 @@ const AdminEventPage: NextPage = () => {
);
};
export const getStaticProps: GetStaticProps = async () => ({ props: {} });
export default AdminEventPage;
+3 -1
View File
@@ -1,5 +1,5 @@
import React from "react";
import { NextPage } from "next";
import { NextPage, GetStaticProps } from "next";
import { formatRelative } from "date-fns";
import { toast } from "react-toastify";
import styled from "styled-components";
@@ -75,4 +75,6 @@ const AdminFeedPage: NextPage = () => {
);
};
export const getStaticProps: GetStaticProps = async () => ({ props: {} });
export default AdminFeedPage;
+3 -1
View File
@@ -1,5 +1,5 @@
import React from "react";
import { NextPage } from "next";
import { NextPage, GetStaticProps } from "next";
import Head from "next/head";
import AdminPageWrapper from "@views/common/AdminPageWrapper";
@@ -16,4 +16,6 @@ const AdminFrontPage: NextPage = () => (
</>
);
export const getStaticProps: GetStaticProps = async () => ({ props: {} });
export default AdminFrontPage;
+3 -1
View File
@@ -1,5 +1,5 @@
import React from "react";
import { NextPage } from "next";
import { NextPage, GetStaticProps } from "next";
import { formatRelative } from "date-fns";
import { toast } from "react-toastify";
import styled from "styled-components";
@@ -79,4 +79,6 @@ const AdminJobAdPage: NextPage = () => {
);
};
export const getStaticProps: GetStaticProps = async () => ({ props: {} });
export default AdminJobAdPage;
+3 -1
View File
@@ -1,5 +1,5 @@
import React, { useState, useEffect } from "react";
import { NextPage } from "next";
import { NextPage, GetStaticProps } from "next";
import { useRouter } from "next/router";
import styled from "styled-components";
import { generateToken, setTokenCookie, isAuthenticated } from "@utils/auth";
@@ -80,4 +80,6 @@ const AdminLoginPage: NextPage = () => {
);
};
export const getStaticProps: GetStaticProps = async () => ({ props: {} });
export default AdminLoginPage;
+3 -1
View File
@@ -1,4 +1,4 @@
import { NextPage } from "next";
import { NextPage, GetStaticProps } from "next";
import { useRouter } from "next/router";
import { deleteTokenCookie } from "@utils/auth";
@@ -12,4 +12,6 @@ const AdminLogoutPage: NextPage = () => {
return null;
};
export const getStaticProps: GetStaticProps = async () => ({ props: {} });
export default AdminLogoutPage;
+3 -1
View File
@@ -1,5 +1,5 @@
import React, { useEffect, useState } from "react";
import { NextPage } from "next";
import { NextPage, GetStaticProps } from "next";
import { formatRelative } from "date-fns";
import { toast } from "react-toastify";
import styled from "styled-components";
@@ -84,4 +84,6 @@ const AdminSignupPage: NextPage = () => {
);
};
export const getStaticProps: GetStaticProps = async () => ({ props: {} });
export default AdminSignupPage;
+3 -1
View File
@@ -1,5 +1,5 @@
import React from "react";
import { NextPage } from "next";
import { NextPage, GetStaticProps } from "next";
import Head from "next/head";
import FreshmenPageView from "@views/FreshmenPage/FreshmenPageView";
import PageWrapper from "@views/common/PageWrapper";
@@ -15,4 +15,6 @@ const FreshmenPage: NextPage = () => (
</>
);
export const getStaticProps: GetStaticProps = async () => ({ props: {} });
export default FreshmenPage;
+3 -1
View File
@@ -1,5 +1,5 @@
import React from "react";
import { NextPage } from "next";
import { NextPage, GetStaticProps } from "next";
import Head from "next/head";
import GuildPageView from "@views/GuildPage/GuildPageView";
import PageWrapper from "@views/common/PageWrapper";
@@ -15,4 +15,6 @@ const GuildPage: NextPage = () => (
</>
);
export const getStaticProps: GetStaticProps = async () => ({ props: {} });
export default GuildPage;
+3 -1
View File
@@ -1,5 +1,5 @@
import React from "react";
import { NextPage } from "next";
import { NextPage, GetStaticProps } from "next";
import Head from "next/head";
import HonoraryPageView from "@views/HonoraryPage/HonoraryPageView";
import PageWrapper from "@views/common/PageWrapper";
@@ -15,4 +15,6 @@ const HonoraryPage: NextPage = () => (
</>
);
export const getStaticProps: GetStaticProps = async () => ({ props: {} });
export default HonoraryPage;
+3 -1
View File
@@ -1,5 +1,5 @@
import React from "react";
import { NextPage } from "next";
import { NextPage, GetStaticProps } from "next";
import Head from "next/head";
import StudiesPageView from "@views/StudiesPage/StudiesPageView";
import PageWrapper from "@views/common/PageWrapper";
@@ -15,4 +15,6 @@ const StudiesPage: NextPage = () => (
</>
);
export const getStaticProps: GetStaticProps = async () => ({ props: {} });
export default StudiesPage;
+3 -1
View File
@@ -1,5 +1,5 @@
import React from "react";
import { NextPage } from "next";
import { NextPage, GetStaticProps } from "next";
import Head from "next/head";
import ContactsPageView from "@views/ContactsPage/ContactsPageView";
import PageWrapper from "@views/common/PageWrapper";
@@ -15,4 +15,6 @@ const ContactsPage: NextPage = () => (
</>
);
export const getStaticProps: GetStaticProps = async () => ({ props: {} });
export default ContactsPage;