import React from 'react' import PropTypes from 'prop-types' import { staticBadgeUrl } from '../lib/badge-url' export default class StaticBadgeMaker extends React.Component { static propTypes = { baseUrl: PropTypes.string, } state = { subject: '', status: '', color: '', } handleSubmit(e) { e.preventDefault() const { baseUrl } = this.props const { subject, status, color } = this.state const badgeUrl = staticBadgeUrl( baseUrl || window.location.href, subject, status, color ) document.location = badgeUrl } render() { return (
) } }