Last active
February 2, 2019 03:59
-
-
Save rodoabad/2abc884f7466f3cd1cb9b5a5ebc08346 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 * as React from 'react'; | |
import {Greeting} from './Greeting'; | |
import {Header} from './Header'; | |
import PropTypes from 'prop-types'; | |
import classnames from 'classnames'; | |
import {myComponent} from './MyComponent.scss'; | |
export const MyComponent = (props) => { | |
const { | |
className, | |
headerColor, | |
greetingColor, | |
greetingMessage, | |
...otherProps | |
} = props; | |
return ( | |
<section | |
{...otherProps} | |
className={classnames(className, myComponent)} | |
> | |
<Header color={headerColor}/> | |
<Greeting | |
color={greetingColor} | |
message={greetingMessage} | |
/> | |
</section> | |
); | |
} | |
MyComponent.propTypes = { | |
className: PropTypes.string.isRequired, | |
headerColor: PropTypes.string.isRequired, | |
greetingColor: PropTypes.string.isRequired, | |
greetingMessage: PropTypes.string.isRequired | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment