aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/@next/pages/community.tsx
blob: a02e7e6fdf37739343fabb414a46943a6a3c3162 (plain) (blame)
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
import * as _ from 'lodash';
import * as React from 'react';
import styled from 'styled-components';

import { colors } from 'ts/style/colors';

import { Banner } from 'ts/@next/components/banner';
import { Button } from 'ts/@next/components/button';
import { Icon } from 'ts/@next/components/icon';
import { ModalContact } from 'ts/@next/components/modals/modal_contact';
import { Column, Section, WrapGrid } from 'ts/@next/components/newLayout';
import { SiteWrap } from 'ts/@next/components/siteWrap';
import { Heading, Paragraph } from 'ts/@next/components/text';

interface EventProps {
    title: string;
    date: string;
    signupUrl: string;
    imageUrl: string;
}

interface CommunityLinkProps {
    bgColor: string;
    title?: string;
    icon?: string;
    url: string;
}

const events: EventProps[] = [
    {
        title: '0x London Meetup',
        date: 'October 20th 2018',
        imageUrl: '/images/@next/events/london.jpg',
        signupUrl: '#',
    },
    {
        title: '0x Berlin Meetup',
        date: 'October 20th 2018',
        imageUrl: '/images/@next/events/berlin.jpg',
        signupUrl: '#',
    },
    {
        title: '0x San Francisco Meetup',
        date: 'October 20th 2018',
        imageUrl: '/images/@next/events/sf.jpg',
        signupUrl: '#',
    },
];
const communityLinks: CommunityLinkProps[] = [
    {
        bgColor: '#1DA1F2',
        title: 'Twitter',
        icon: 'social-twitter',
        url: 'https://twitter.com/0xProject',
    },
    {
        bgColor: '#FF4500',
        title: 'Reddit',
        icon: 'social-reddit',
        url: 'https://twitter.com/0xProject',
    },
    {
        bgColor: '#7289DA',
        title: 'Twitter',
        icon: 'social-discord',
        url: 'https://twitter.com/0xProject',
    },
    {
        bgColor: '#3B5998',
        title: 'Facebook',
        icon: 'social-fb',
        url: 'https://twitter.com/0xProject',
    },
    {
        bgColor: '#181717',
        title: 'GitHub',
        icon: 'social-github',
        url: 'https://twitter.com/0xProject',
    },
    {
        bgColor: '#003831',
        title: 'Newsletter',
        icon: 'social-newsletter',
        url: 'https://twitter.com/0xProject',
    },
];

export class NextCommunity extends React.Component {
    public state = {
        isContactModalOpen: false,
    };
    public render(): React.ReactNode {
        return (
            <SiteWrap theme="light">
                <Section isTextCentered={true}>
                    <Column>
                        <Heading size="medium" isCentered={true}>
                            Community
                        </Heading>
                        <Paragraph size="medium" isCentered={true} isMuted={true} marginBottom="0">
                            The 0x community is a global, passionate group of crypto developers and enthusiasts. The official channels below provide a great forum for connecting and engaging with the community.
                        </Paragraph>
                        <LinkWrap>
                            <Button
                                to="#"
                                isWithArrow={true}
                                isAccentColor={true}
                            >
                                Join the 0x community
                            </Button>
                        </LinkWrap>
                    </Column>
                </Section>

                <Section isFullWidth={true}>
                    <WrapGrid isTextCentered={true} isWrapped={true} isFullWidth={false} isCentered={false} maxWidth="1151px">
                        {_.map(communityLinks, (link: CommunityLinkProps, index: number) => (
                            <CommunityLink
                                key={`cl-${index}`}
                                icon={link.icon}
                                title={link.title}
                                bgColor={link.bgColor}
                                url={link.url}
                            />
                        ))}
                    </WrapGrid>
                </Section>

                <EventsWrapper bgColor={colors.backgroundLight} isFullWidth={true} isCentered={true} isTextCentered={true}>
                    <Column maxWidth="720px">
                        <Heading size="medium" asElement="h2" isCentered={true} maxWidth="507px" marginBottom="30px">
                            Upcoming Events
                        </Heading>
                        <Paragraph size="medium" isCentered={true} isMuted={true}>
                            0x meetups happen all over the world on a monthly basis and are hosted by devoted members of the community. Want to host a meetup in your city? Reach out for help finding a venue, connecting with local 0x mentors, and promoting your events.
                        </Paragraph>
                        <LinkWrap>
                            <Button
                                to="#"
                                isWithArrow={true}
                                isAccentColor={true}
                            >
                                Get in Touch
                            </Button>
                            <Button
                                to="#"
                                isWithArrow={true}
                                isAccentColor={true}
                            >
                                Join Newsletter
                            </Button>
                        </LinkWrap>
                    </Column>
                    <WrapGrid isTextCentered={true} isWrapped={true} isFullWidth={false} isCentered={false} maxWidth="1149px">
                        {_.map(events, (ev: EventProps, index: number) => (
                            <Event
                                key={`event-${index}`}
                                title={ev.title}
                                date={ev.date}
                                signupUrl={ev.signupUrl}
                                imageUrl={ev.imageUrl}
                            />
                        ))}
                    </WrapGrid>
                </EventsWrapper>

                <Banner
                    heading="Ready to get started?"
                    subline="Dive into our docs, or contact us if needed"
                    mainCta={{ text: 'Get Started', href: '/docs' }}
                    secondaryCta={{ text: 'Get in Touch', onClick: this._onOpenContactModal.bind(this) }}
                />
                <ModalContact isOpen={this.state.isContactModalOpen} onDismiss={this._onDismissContactModal} />
            </SiteWrap>
        );
    }

    public _onOpenContactModal = (): void => {
        this.setState({ isContactModalOpen: true });
    }

    public _onDismissContactModal = (): void => {
        this.setState({ isContactModalOpen: false });
    }
}

const Event: React.FunctionComponent<EventProps> = (event: EventProps) => (
    <StyledEvent>
        <EventIcon name="logo-mark" size={30} margin={0} />
        <EventImage src={event.imageUrl} alt=""/>
        <EventContent>
            <Heading color={colors.white} size="small" marginBottom="0">
                {event.title}
            </Heading>
            <Paragraph color={colors.white} isMuted={0.65}>
                {event.date}
            </Paragraph>
            <Button
                color={colors.white}
                href={event.signupUrl}
                isWithArrow={true}
            >
                Sign Up
            </Button>
        </EventContent>
    </StyledEvent>
);

const CommunityLink: React.FunctionComponent<CommunityLinkProps> = (props: CommunityLinkProps) => (
    <StyledCommunityLink bgColor={props.bgColor} href={props.url}>
        <CommunityIcon name={props.icon} size={44} margin={0} />
        <CommunityTitle color={colors.white} isMuted={false} marginBottom="0">
            {props.title}
        </CommunityTitle>
    </StyledCommunityLink>
);

// Events
const EventsWrapper = styled(Section)`
    display: flex;
    align-items: center;
    flex-direction: column;
`;

// Event
const StyledEvent = styled.div`
    background-color: ${colors.brandDark};
    width: calc((100% / 3) - 30px);
    text-align: left;
    height: 424px;
    margin-top: 130px;
    position: relative;
`;

const EventIcon = styled(Icon)`
    position: absolute;
    top: 30px;
    left: 30px;
`;

const EventImage = styled.img`
    width: 100%;
    height: 260px;
    object-fit: cover;
`;

const EventContent = styled.div`
    padding: 30px 30px;
`;

// Community Links
const StyledCommunityLink = styled.a`
    background-color: ${(props: CommunityLinkProps) => props.bgColor};
    color: ${colors.white};
    width: 175px;
    height: 175px;
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
`;

const CommunityTitle = styled(Paragraph)`
    font-size: 20px;
    font-weight: 400;
`;

const CommunityIcon = styled(Icon)`
    margin-bottom: 20px;
`;

// Misc
const LinkWrap = styled.div`
    display: inline-flex;
    margin-top: 60px;

    a + a {
        margin-left: 60px;
    }
`;