Skip to content

Instantly share code, notes, and snippets.

@hackingbeauty
Last active May 20, 2018 05:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hackingbeauty/cde96054fd5e6428666702e04af98db1 to your computer and use it in GitHub Desktop.
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
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