{"size": 1565, "ext": "js", "max_stars_repo_path": "gui/src/containers/Bridges/New.js", "max_stars_repo_name": "dtekeshe/chainlink", "max_stars_repo_stars_event_min_datetime": "2019-01-04T21:48:00.000Z", "max_stars_repo_stars_event_max_datetime": "2019-01-04T21:48:00.000Z", "max_issues_repo_path": "gui/src/containers/Bridges/New.js", "max_issues_repo_name": "dtekeshe/chainlink", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "gui/src/containers/Bridges/New.js", "max_forks_repo_name": "dtekeshe/chainlink", "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": 30.6862745098, "max_line_length": 83, "alphanum_fraction": 0.7047923323}
import React from 'react'
import { connect } from 'react-redux'
import { Link } from 'react-static'
import Grid from '@material-ui/core/Grid'
import PaddedCard from 'components/PaddedCard'
import Title from 'components/Title'
import Breadcrumb from 'components/Breadcrumb'
import BreadcrumbItem from 'components/BreadcrumbItem'
import Form from 'components/Bridges/Form'
import ErrorMessage from 'components/Notifications/DefaultError'
import Content from 'components/Content'
import { createBridge } from 'actions'
import matchRouteAndMapDispatchToProps from 'utils/matchRouteAndMapDispatchToProps'

const SuccessNotification = ({name}) => (<React.Fragment>
  Successfully created bridge <Link to={`/bridges/${name}`}>{name}</Link>
</React.Fragment>)

const New = props => (
  <Content>
    <Breadcrumb>
      <BreadcrumbItem href='/'>Dashboard</BreadcrumbItem>
      <BreadcrumbItem>></BreadcrumbItem>
      <BreadcrumbItem href='/bridges'>Bridges</BreadcrumbItem>
      <BreadcrumbItem>></BreadcrumbItem>
      <BreadcrumbItem>New</BreadcrumbItem>
    </Breadcrumb>
    <Title>New Bridge</Title>

    <Grid container spacing={40}>
      <Grid item xs={12}>
        <PaddedCard>
          <Form
            actionText='Create Bridge'
            onSubmit={props.createBridge}
            onSuccess={SuccessNotification}
            onError={ErrorMessage}
          />
        </PaddedCard>
      </Grid>
    </Grid>
  </Content>
)

export const ConnectedNew = connect(
  null,
  matchRouteAndMapDispatchToProps({createBridge})
)(New)

export default ConnectedNew
