|
1 | | -import Head from 'next/head'; |
2 | | -import Image from 'next/image'; |
3 | | -import { useRouter } from 'next/router'; |
| 1 | +import NextImage from 'next/image'; |
4 | 2 | import { NextPage } from 'next'; |
5 | 3 | import { Translate } from 'i18n'; |
| 4 | +import { PageTemplate } from 'components/template'; |
| 5 | +import styled from 'styled-components'; |
6 | 6 |
|
7 | | -import styles from '../styles/Home.module.css'; |
| 7 | +const Image = styled(NextImage)` |
| 8 | + border-radius: 50%; |
| 9 | + box-shadow: 4px 4px 5px 0px rgba(0, 0, 0, 0.5); |
| 10 | +`; |
8 | 11 |
|
9 | | -type PageProps = { |
10 | | - t: Translate; |
11 | | -}; |
12 | | - |
13 | | -const Home: NextPage<PageProps> = ({ t }) => { |
14 | | - const { locale } = useRouter(); |
15 | | - return ( |
16 | | - <div className={styles.container}> |
17 | | - <Head> |
18 | | - <title>Create Next App</title> |
19 | | - <link rel="icon" href="/favicon.ico" /> |
20 | | - </Head> |
21 | | - |
22 | | - <main className={styles.main}> |
23 | | - <h1 className={styles.title}>{t('welcome')}</h1> |
24 | | - <p>Current locale: {locale}</p> |
25 | | - <Image |
26 | | - src="/takah.jpg" |
27 | | - alt="Picture of the author" |
28 | | - width={500} |
29 | | - height={500} |
30 | | - /> |
31 | | - |
32 | | - <p className={styles.description}> |
33 | | - Get started by editing |
34 | | - <code className={styles.code}>pages/index.js</code> |
35 | | - </p> |
| 12 | +const ImageContainer = styled.section` |
| 13 | + margin-top: 1rem; |
36 | 14 |
|
37 | | - <div className={styles.grid}> |
38 | | - <a href="https://nextjs.org/docs" className={styles.card}> |
39 | | - <h3>Documentation →</h3> |
40 | | - <p>Find in-depth information about Next.js features and API.</p> |
41 | | - </a> |
| 15 | + img { |
| 16 | + filter: invert(1); |
| 17 | + } |
42 | 18 |
|
43 | | - <a href="https://nextjs.org/learn" className={styles.card}> |
44 | | - <h3>Learn →</h3> |
45 | | - <p>Learn about Next.js in an interactive course with quizzes!</p> |
46 | | - </a> |
| 19 | + * + * { |
| 20 | + margin-left: 1rem; |
| 21 | + } |
| 22 | +`; |
47 | 23 |
|
48 | | - <a |
49 | | - href="https://github.com/vercel/next.js/tree/master/examples" |
50 | | - className={styles.card} |
51 | | - > |
52 | | - <h3>Examples →</h3> |
53 | | - <p>Discover and deploy boilerplate example Next.js projects.</p> |
54 | | - </a> |
55 | | - |
56 | | - <a |
57 | | - href="https://vercel.com/import?filter=next.js&utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app" |
58 | | - className={styles.card} |
59 | | - > |
60 | | - <h3>Deploy →</h3> |
61 | | - <p> |
62 | | - Instantly deploy your Next.js site to a public URL with Vercel. |
63 | | - </p> |
64 | | - </a> |
65 | | - </div> |
66 | | - </main> |
| 24 | +const socialMedias = { |
| 25 | + github: { |
| 26 | + alt: 'luistak', |
| 27 | + src: 'https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/github.svg', |
| 28 | + link: 'https://github.com/luistak', |
| 29 | + }, |
| 30 | + devto: { |
| 31 | + alt: 'luistak', |
| 32 | + src: 'https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/dev-dot-to.svg', |
| 33 | + link: 'https://dev.to/luistak', |
| 34 | + }, |
| 35 | + twitter: { |
| 36 | + alt: '_luistak', |
| 37 | + src: 'https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/twitter.svg', |
| 38 | + link: 'https://twitter.com/_luistak', |
| 39 | + }, |
| 40 | + linkedin: { |
| 41 | + alt: 'luis-takahashi', |
| 42 | + src: 'https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/linkedin.svg', |
| 43 | + link: 'https://linkedin.com/in/luis-takahashi', |
| 44 | + }, |
| 45 | +}; |
67 | 46 |
|
68 | | - <footer className={styles.footer}> |
| 47 | +type HomeProps = { |
| 48 | + t: Translate; |
| 49 | +}; |
| 50 | +const Home: NextPage<HomeProps> = ({ t }) => ( |
| 51 | + <PageTemplate t={t} title={t('author')}> |
| 52 | + <h1>{t('welcome')}</h1> |
| 53 | + <p>{t('bio')}</p> |
| 54 | + <Image |
| 55 | + src="/takah.jpg" |
| 56 | + alt="Picture of the author" |
| 57 | + width={100} |
| 58 | + height={100} |
| 59 | + style={{ margin: 'auto' }} |
| 60 | + /> |
| 61 | + <ImageContainer> |
| 62 | + {Object.entries(socialMedias).map(([socialMedia, { alt, src, link }]) => ( |
69 | 63 | <a |
70 | | - href="https://vercel.com?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app" |
| 64 | + key={socialMedia} |
| 65 | + href={link} |
71 | 66 | target="_blank" |
72 | | - rel="noopener noreferrer" |
| 67 | + rel="noreferrer noreferrer" |
73 | 68 | > |
74 | | - Powered by{' '} |
75 | | - <img src="/vercel.svg" alt="Vercel Logo" className={styles.logo} /> |
| 69 | + <img src={src} alt={alt} width={20} height={20} /> |
76 | 70 | </a> |
77 | | - </footer> |
78 | | - </div> |
79 | | - ); |
80 | | -}; |
| 71 | + ))} |
| 72 | + </ImageContainer> |
| 73 | + </PageTemplate> |
| 74 | +); |
81 | 75 |
|
82 | 76 | export default Home; |
0 commit comments