|
1 | 1 | import React from 'react';
|
| 2 | +import Link from 'next/link'; |
| 3 | +import { Card, Button, Divider } from 'semantic-ui-react'; |
2 | 4 |
|
| 5 | +import { indexPageMeetupURL, reverseProxyCORS } from '../utils/urls'; |
| 6 | +import RowEvent from '../components/row-events'; |
3 | 7 | import publicPage from '../hocs/public-page';
|
4 | 8 |
|
| 9 | +const indexPageLearns = [ |
| 10 | + { |
| 11 | + link: '#', |
| 12 | + title: 'ReactJS', |
| 13 | + subject: 'Frontend Web Development', |
| 14 | + image: '', |
| 15 | + }, |
| 16 | + { |
| 17 | + link: '#', |
| 18 | + title: 'Laravel', |
| 19 | + subject: 'Backend Web Development', |
| 20 | + image: '', |
| 21 | + }, |
| 22 | + { |
| 23 | + link: '#', |
| 24 | + title: 'Go', |
| 25 | + subject: 'Programming Language', |
| 26 | + image: '', |
| 27 | + }, |
| 28 | + { |
| 29 | + link: '#', |
| 30 | + title: 'Security', |
| 31 | + subject: 'Networking', |
| 32 | + image: '', |
| 33 | + }, |
| 34 | + { |
| 35 | + link: '#', |
| 36 | + title: 'Blockchain', |
| 37 | + subject: 'Distributed Computing', |
| 38 | + image: '', |
| 39 | + }, |
| 40 | + { |
| 41 | + link: '#', |
| 42 | + title: 'Android', |
| 43 | + subject: 'Mobile Development', |
| 44 | + image: '', |
| 45 | + }, |
| 46 | +]; |
| 47 | + |
5 | 48 | class Home extends React.Component {
|
| 49 | + state = { |
| 50 | + indexPageEvent: '', |
| 51 | + }; |
| 52 | + |
| 53 | + async componentDidMount() { |
| 54 | + try { |
| 55 | + const requestEvent = await fetch( |
| 56 | + `${reverseProxyCORS}${indexPageMeetupURL}`, |
| 57 | + ); |
| 58 | + const requestEventJson = await requestEvent.json(); |
| 59 | + await this.setState({ |
| 60 | + indexPageEvent: requestEventJson[0], |
| 61 | + }); |
| 62 | + } catch (err) { |
| 63 | + console.log(err); |
| 64 | + } |
| 65 | + } |
| 66 | + |
6 | 67 | render() {
|
7 | 68 | return (
|
8 | 69 | <div>
|
9 | 70 | <main>
|
10 | 71 | <section className="about">
|
11 | 72 | <div className="about__container">
|
12 | 73 | <div className="about__content">
|
13 |
| - <img src="/static/banner.png" alt="words" /> |
| 74 | + <img src="/static/banner1280x370.png" alt="words" /> |
| 75 | + </div> |
| 76 | + <h1 className="about__tag"> |
| 77 | + On a mission to improve the state of tech in India |
| 78 | + </h1> |
| 79 | + </div> |
| 80 | + <Divider section /> |
| 81 | + </section> |
| 82 | + <section className="learn"> |
| 83 | + <div className="container"> |
| 84 | + <h2 className="titles">Open Source Learing Guides</h2> |
| 85 | + <h3 className="taglines"> |
| 86 | + Our guides are crowd-sourced recommendations of free online |
| 87 | + resource to learn any technology |
| 88 | + </h3> |
| 89 | + <div className="content"> |
| 90 | + <Card.Group itemsPerRow={3} stackable textAlign={'center'}> |
| 91 | + {indexPageLearns.map(learn => ( |
| 92 | + <Card |
| 93 | + raised |
| 94 | + key={learn.title} |
| 95 | + href={learn.link} |
| 96 | + header={learn.title} |
| 97 | + meta={learn.subject} |
| 98 | + /> |
| 99 | + ))} |
| 100 | + </Card.Group> |
| 101 | + </div> |
| 102 | + <Link href={'/learn'}> |
| 103 | + <Button basic color="grey"> |
| 104 | + SEE ALL AVAILABLE GUIDES |
| 105 | + </Button> |
| 106 | + </Link> |
| 107 | + </div> |
| 108 | + </section> |
| 109 | + <Divider section /> |
| 110 | + <section className="space"> |
| 111 | + <div className="container"> |
| 112 | + <h2 className="titles">Offline Co-Learning Spaces</h2> |
| 113 | + <h3 className="taglines"> |
| 114 | + Physical spaces where you can come down to engage in self |
| 115 | + learing, peer-learning and collaboration. |
| 116 | + </h3> |
| 117 | + <div className="space-content"> |
| 118 | + <div className="space_content_info"> |
| 119 | + These are dynamic learning environment where everyone learns |
| 120 | + at their own pace and compliments each other. We also organize |
| 121 | + weekly group activities like Open source evenings, casual |
| 122 | + hackathons etc. |
| 123 | + </div> |
| 124 | + <img |
| 125 | + className="space_content_info" |
| 126 | + src="https://static.vecteezy.com/system/resources/thumbnails/000/139/966/small/free-office-workspace-vector.png" |
| 127 | + /> |
14 | 128 | </div>
|
| 129 | + <Link href={'/learn'}> |
| 130 | + <Button basic color="grey"> |
| 131 | + LEARN MORE ABOUT HACKERSPACE |
| 132 | + </Button> |
| 133 | + </Link> |
| 134 | + </div> |
| 135 | + </section> |
| 136 | + <Divider section /> |
| 137 | + <section className="events"> |
| 138 | + <div className="container"> |
| 139 | + <h2 className="titles">Online & Offline Events</h2> |
| 140 | + <h3 className="taglines"> |
| 141 | + We do frequent online and offline events, covering broad range |
| 142 | + of topics. |
| 143 | + </h3> |
| 144 | + <div className="content"> |
| 145 | + {this.state.indexPageEvent ? ( |
| 146 | + <RowEvent |
| 147 | + key={this.state.indexPageEvent.id} |
| 148 | + name={this.state.indexPageEvent.name} |
| 149 | + description={this.state.indexPageEvent.description} |
| 150 | + yesCount={this.state.indexPageEvent.yes_rsvp_count} |
| 151 | + time={this.state.indexPageEvent.time} |
| 152 | + venue={this.state.indexPageEvent.venue} |
| 153 | + link={this.state.indexPageEvent.link} |
| 154 | + status={this.state.indexPageEvent.status} |
| 155 | + /> |
| 156 | + ) : ( |
| 157 | + <div /> |
| 158 | + )} |
| 159 | + </div> |
| 160 | + <Link href={'/events'}> |
| 161 | + <Button basic color="grey"> |
| 162 | + VIEW ALL EVENTS |
| 163 | + </Button> |
| 164 | + </Link> |
15 | 165 | </div>
|
16 | 166 | </section>
|
17 | 167 | </main>
|
18 | 168 | <style jsx>{`
|
| 169 | + main { |
| 170 | + background-color: #ffffff; |
| 171 | + } |
19 | 172 | .about {
|
20 |
| - background-color: #fff; |
| 173 | + background-color: #f4f7fb; |
21 | 174 | position: relative;
|
| 175 | + text-align: center; |
22 | 176 | }
|
23 | 177 | .about__container {
|
24 |
| - max-width: 1280px; |
| 178 | + padding-bottom: 30px; |
25 | 179 | min-height: calc(100vh - 260px);
|
26 | 180 | margin: 0 auto;
|
27 | 181 | display: flex;
|
28 | 182 | justify-content: center;
|
29 | 183 | align-items: center;
|
| 184 | + flex-direction: column; |
30 | 185 | }
|
31 | 186 | .about__content img {
|
32 | 187 | width: 100%;
|
33 | 188 | }
|
| 189 | + .about__tag { |
| 190 | + font-size: 2.5em; |
| 191 | + } |
| 192 | + .container { |
| 193 | + background-color: #ffffff; |
| 194 | + text-align: center; |
| 195 | + padding: 60px; |
| 196 | + } |
| 197 | + .taglines { |
| 198 | + padding-bottom: 20px; |
| 199 | + } |
| 200 | + .content { |
| 201 | + padding-bottom: 50px; |
| 202 | + } |
| 203 | + .space-content { |
| 204 | + display: flex; |
| 205 | + flex-wrap: wrap-reverse |
| 206 | + flex-wrap: wrap; |
| 207 | + justify-content: center; |
| 208 | + align-content: center; |
| 209 | + align-items: center; |
| 210 | + } |
| 211 | + .space_content_info { |
| 212 | + order: 0; |
| 213 | + flex: 0 1 auto; |
| 214 | + align-self: center; |
| 215 | + max-width: 600px; |
| 216 | + padding-left: 30px; |
| 217 | + padding-right: 30px; |
| 218 | + } |
34 | 219 | `}</style>
|
35 | 220 | </div>
|
36 | 221 | );
|
|
0 commit comments