2021-11-25 15:31:10 +00:00
|
|
|
/* Notes */
|
2021-10-06 11:00:09 +00:00
|
|
|
|
2021-11-25 15:31:10 +00:00
|
|
|
// This function is just a simple wrapper around lib/comparisonView.
|
|
|
|
// Most of the time, I'll want to edit that instead
|
2021-10-06 11:00:09 +00:00
|
|
|
|
|
|
|
/* Imports */
|
2021-11-25 15:31:10 +00:00
|
|
|
import React from "react";
|
2021-10-06 11:00:09 +00:00
|
|
|
import fs from 'fs';
|
|
|
|
import path from 'path';
|
2021-11-25 15:31:10 +00:00
|
|
|
import ComparisonView from '../lib/comparisonView.js'
|
2021-10-06 11:00:09 +00:00
|
|
|
|
2021-11-25 15:31:10 +00:00
|
|
|
/* Definitions */
|
|
|
|
const elementsDocument = '../data/listOfResearchOutputs.json'
|
2021-10-06 11:00:09 +00:00
|
|
|
|
|
|
|
/* React components */
|
|
|
|
export async function getStaticProps() {
|
|
|
|
const directory = path.join(process.cwd(), "pages")
|
2021-11-25 15:31:10 +00:00
|
|
|
let listOfElementsForView = JSON.parse(fs.readFileSync(path.join(directory, elementsDocument), 'utf8'));
|
2021-10-06 11:00:09 +00:00
|
|
|
return {
|
|
|
|
props: {
|
2021-11-25 15:31:10 +00:00
|
|
|
listOfElementsForView
|
2021-10-06 11:00:09 +00:00
|
|
|
},
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
// Main react component
|
2021-11-25 15:31:10 +00:00
|
|
|
export default function Home({ listOfElementsForView }) {
|
|
|
|
return(<ComparisonView listOfElementsForView={listOfElementsForView}/>)
|
2021-11-25 13:25:24 +00:00
|
|
|
}
|