2020-06-14 09:06:49 +00:00
import Head from "next/head" ;
2020-06-14 13:22:07 +00:00
import CaseSection from "../components/CaseSection" ;
2020-06-14 14:20:45 +00:00
import HomeSection from "../components/HomeSection" ;
2020-06-14 08:40:51 +00:00
2020-06-14 11:47:02 +00:00
export default function Home ( { person , caseStudies } ) {
2020-06-14 14:20:45 +00:00
const caseSectionRef = React . useRef ( ) ;
function scrollToRef ( ) {
console . log ( caseSectionRef . current . offsetTop ) ;
if ( typeof window !== "undefined" ) {
console . log ( caseSectionRef . current . offsetTop ) ;
window . scrollTo ( 0 , caseSectionRef . current . offsetTop ) ;
}
}
2020-06-14 08:40:51 +00:00
return (
< div className = "container" >
< Head >
< title > Create Next App < / t i t l e >
< link rel = "icon" href = "/favicon.ico" / >
< / H e a d >
2020-06-14 11:47:02 +00:00
2020-06-14 14:20:45 +00:00
< HomeSection scrollFunction = { scrollToRef . bind ( this ) } person = { person } / >
2020-06-14 11:47:02 +00:00
2020-06-14 14:20:45 +00:00
< div ref = { caseSectionRef } >
< CaseSection caseStudies = { caseStudies } / >
< / d i v >
2020-06-14 08:40:51 +00:00
< / d i v >
2020-06-14 09:06:49 +00:00
) ;
2020-06-14 08:40:51 +00:00
}
2020-06-14 11:47:02 +00:00
export async function getStaticProps ( ) {
const person = {
firstName : "Tanguy" ,
lastName : "Herbron" ,
description : "Full Stack Developer" ,
infos : {
location : {
value : "Copenhagen, Denmark" ,
link : "https://www.visitcopenhagen.com/" ,
} ,
github : {
value : "/TanguyHerbron" ,
link : "https://github.com/TanguyHerbron" ,
} ,
linkedin : {
value : "Tanguy Herbron" ,
link : "https://linkedin.com/in/tanguy-herbron-5a3772150" ,
} ,
email : {
value : "tanguy.herbron@outlook.com" ,
link : "mailto:tanguy.herbron@outlook.com" ,
} ,
} ,
} ;
const caseStudies = [
{
title : "Moodle" ,
short _description :
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip." ,
date : "June 12, 2020" ,
2020-06-14 13:22:07 +00:00
cover : "/images/bongo.png" ,
2020-06-14 11:47:02 +00:00
} ,
{
title : "Doodle" ,
short _description :
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip." ,
date : "June 12, 2020" ,
2020-06-14 13:22:07 +00:00
cover : "/images/bongo.png" ,
2020-06-14 11:47:02 +00:00
} ,
{
title : "Poodle" ,
short _description :
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip." ,
date : "June 12, 2020" ,
2020-06-14 13:22:07 +00:00
cover : "/images/bongo.png" ,
2020-06-14 11:47:02 +00:00
} ,
] ;
return {
props : {
person : person ,
caseStudies : caseStudies ,
} ,
} ;
}