{"size": 1764, "ext": "js", "max_stars_repo_path": "src/Components/Swiper/EventCard.js", "max_stars_repo_name": "sarahevelynn/startupweeknav-frontend", "max_stars_repo_stars_event_min_datetime": "2018-04-24T21:57:11.000Z", "max_stars_repo_stars_event_max_datetime": "2018-04-24T21:57:11.000Z", "max_issues_repo_path": "src/Components/Swiper/EventCard.js", "max_issues_repo_name": "sarahevelynn/startupweeknav-frontend", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/Components/Swiper/EventCard.js", "max_forks_repo_name": "sarahevelynn/startupweeknav-frontend", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 23.8378378378, "max_line_length": 71, "alphanum_fraction": 0.5453514739}
import React from "react";
import { Text, View, Image, Linking, ScrollView } from "react-native";
import { Card } from "react-native-elements";
import Button from "../General/Button";
import CardSection from "../General/CardSection";
import CardContain from "../General/CardContain";

const EventCard = ({ event }) => {
  const {
    image,
    eventName,
    date,
    time,
    address,
    eventDescription,
    register,
    tickets
  } = event;
  const { cardContentStyle, cardInfoStyle, cardTicketStyle } = styles;
  return (
    <View>
      <CardContain>
        <Card
          key={event.id}
          title={event.eventName}
          image={{ uri: event.image }}
        >
          <CardSection>
            <View style={[cardContentStyle, { flexDirection: "row" }]}>
              <View style={cardInfoStyle}>
                <Text>{date}</Text>
                <Text>{time}</Text>
                <Text>{address}</Text>
              </View>
            </View>
          </CardSection>

          <CardSection>
            <Text>{eventDescription}</Text>
          </CardSection>

          <CardSection>
            <Button>{event.register}</Button>
            <Button
              onPress={() => Linking.openURL(event.tickets)}
              value={event.tickets}
            >
              Get Tickets
            </Button>
          </CardSection>
        </Card>
      </CardContain>
    </View>
  );
};

const styles = {
  cardContentStyle: {
    flexDirection: "column",
    flexWrap: "nowrap",
    justifyContent: "space-between"
  },
  cardInfoStyle: {
    flexDirection: "column",
    justifyContent: "flex-start"
  },
  cardTicketStyle: {
    flexDirection: "row",
    justifyContent: "space-around"
  }
};

export default EventCard;
