Last active
May 20, 2018 05:39
-
-
Save hackingbeauty/cde96054fd5e6428666702e04af98db1 to your computer and use it in GitHub Desktop.
ModalHeader component for a large-scale React application as taught in the course "How To Write A Single Page Application" - www.singlepageapplication.com
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react' | |
import PropTypes from 'prop-types' | |
import { modalHeaderStyles } from './styles.scss' | |
import { Modal as ReactBootstrapModal } from 'react-bootstrap' | |
class ModalHeader extends Component { | |
constructor(props) { | |
super(props) | |
} | |
render() { | |
const { children, title } = this.props | |
return ( | |
<div className={modalHeaderStyles}> | |
<ReactBootstrapModal.Header> | |
<ReactBootstrapModal.Title>{title}</ReactBootstrapModal.Title> | |
{children} | |
</ReactBootstrapModal.Header> | |
</div> | |
) | |
} | |
} | |
ModalHeader.propTypes = { | |
children: PropTypes.node, | |
title: PropTypes.string | |
} | |
ModalHeader.defaultProps = {} | |
export default ModalHeader |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment