Files: eb3938470f7dee8766731b14c7345333971487e8 / pages / index.tsx
1392 bytesRaw
1 | import {Fragment, FunctionComponent} from 'react'; |
2 | import Image from 'next/image'; |
3 | |
4 | import {NextSeo} from 'next-seo'; |
5 | |
6 | import Header from '../components/header'; |
7 | import Contacts from '../components/contacts'; |
8 | |
9 | interface Props { |
10 | slogan: string; |
11 | about: string; |
12 | } |
13 | |
14 | const Index: FunctionComponent<Props> = props => { |
15 | return ( |
16 | <Fragment> |
17 | <NextSeo |
18 | title="Rômulo Alves" |
19 | description="Software Engineer working at CWI" |
20 | /> |
21 | <Header showMenu={false} /> |
22 | <main className="index"> |
23 | <h3>{props.slogan}</h3> |
24 | <section className="about"> |
25 | <div className="about-text" dangerouslySetInnerHTML={{__html: props.about}} /> |
26 | <div className="picture-container"> |
27 | <Image src="/picture.jpg" |
28 | alt="Picture of myself" |
29 | width={200} |
30 | height={200} |
31 | /> |
32 | </div> |
33 | </section> |
34 | <Contacts /> |
35 | </main> |
36 | </Fragment> |
37 | ); |
38 | }; |
39 | |
40 | export function getStaticProps() { |
41 | const data = require('../data/index').default; |
42 | const about = data.about.links.reduce((value, link) => { |
43 | return value.replace(new RegExp(link.expression, 'g'), |
44 | `<a href="${link.href}" title="${link.title || link.text}" target="_blank" rel="noopener">${link.text}</a>`); |
45 | }, data.about.text); |
46 | |
47 | return { |
48 | props: { |
49 | ...data, |
50 | about |
51 | } |
52 | }; |
53 | } |
54 | |
55 | export default Index; |
Built with git-ssb-web