-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.tsx
86 lines (73 loc) · 2.86 KB
/
index.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faLaptopCode } from '@fortawesome/free-solid-svg-icons';
import { MailIcon } from '@heroicons/react/solid';
import type { NextPage } from 'next';
import Head from 'next/head';
import Image from 'next/image';
import tw, { styled } from 'twin.macro';
import { Button, ButtonWithIcon } from './../design-system';
const Container = tw.div`py-0 px-8`;
const Main = tw.main`h-screen w-full flex flex-col justify-center items-center`;
const Title = tw.h1`text-black font-bold text-lg md:text-2xl`;
interface FlexContainerProps {
direction: 'vertical' | 'horizontal';
}
const FlexContainer = styled.div(({ direction }: FlexContainerProps) => [
tw`flex w-1/2 justify-between my-2`,
direction === 'vertical' ? tw`flex-col` : tw`flex-row`,
]);
const Home: NextPage = () => {
return (
<Container>
<Head>
<title>Create Next App</title>
<meta name='description' content='Generated by create next app' />
<link rel='icon' href='/favicon.ico' />
</Head>
<Main>
<Title>
Welcome to <a href='https://nextjs.org'>Next.js!</a>
</Title>
<FlexContainer direction='horizontal'>
<Button>Buy</Button>
<Button variant='secondary'>Buy</Button>
<Button variant='primary'>Buy</Button>
</FlexContainer>
<FlexContainer direction='horizontal'>
<ButtonWithIcon icon={MailIcon} />
<ButtonWithIcon icon={MailIcon} variant='secondary' />
<ButtonWithIcon icon={MailIcon} variant='primary' />
</FlexContainer>
<FlexContainer direction='horizontal'>
<ButtonWithIcon icon={MailIcon} iconPosition='leading'>
Contact
</ButtonWithIcon>
<ButtonWithIcon icon={MailIcon} iconPosition='leading' variant='secondary'>
Contact
</ButtonWithIcon>
<ButtonWithIcon icon={MailIcon} iconPosition='leading' variant='primary'>
Contact
</ButtonWithIcon>
</FlexContainer>
<FlexContainer direction='horizontal'>
<ButtonWithIcon icon={MailIcon} iconPosition='trailing'>
Contact
</ButtonWithIcon>
<ButtonWithIcon icon={MailIcon} iconPosition='trailing' variant='secondary'>
Contact
</ButtonWithIcon>
<ButtonWithIcon icon={MailIcon} iconPosition='trailing' variant='primary'>
Contact
</ButtonWithIcon>
</FlexContainer>
<FlexContainer direction='horizontal'>
<FontAwesomeIcon icon={faLaptopCode} size='2x' />
<FontAwesomeIcon icon={['fab', 'apple']} size='2x' />
<FontAwesomeIcon icon='rocket' size='2x' />
</FlexContainer>
<Image src='/images/profile.jpg' height={144} width={144} alt='Your Name' />
</Main>
</Container>
);
};
export default Home;