-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathevents.tsx
More file actions
35 lines (34 loc) · 1019 Bytes
/
events.tsx
File metadata and controls
35 lines (34 loc) · 1019 Bytes
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
import React from "react";
import { Box, Heading, Text, Button, Flex, Link } from "@chakra-ui/core";
import { graphql } from "gatsby";
import { EventDetails } from "../../types";
import { Event } from "../event";
export const Events: FunctionComponent = data => {
console.log(data);
const events: EventDetails[] = data.allMdx.edges.map(
({ node: { frontmatter: eventDetails } }) => eventDetails as EventDetails
);
return (
<Flex
id="events"
px={[10, 20, 30, 40]}
py={[10, 10, 20, 20]}
// color="primary"
align="center"
textAlign="left"
direction="column"
backgroundColor="text"
>
<Box>
<Heading width={"100%"} mb={[5]} color="primary" textAlign="center">
Upcoming Events
</Heading>
<Flex maxW="100vw" wrap="wrap" justify="center" align="center">
{events.map((eventDetails, index) => (
<Event key={index} {...eventDetails} />
))}
</Flex>
</Box>
</Flex>
);
};