Skip to content

Instantly share code, notes, and snippets.

@leohxj
Created October 13, 2018 06:05
Show Gist options
  • Save leohxj/76117b9ede040f6baf704da8f98ef620 to your computer and use it in GitHub Desktop.
Save leohxj/76117b9ede040f6baf704da8f98ef620 to your computer and use it in GitHub Desktop.
#react
import PropTypes from 'prop-types';
import React from 'react';
import styles from './index.less';
export default function Banner({ hasLogo }) {
const logo = hasLogo ? <div className={styles.logo} /> : null;
return <div className={styles.container}>{logo}</div>;
}
Banner.propTypes = {
hasLogo: PropTypes.bool
};
Banner.defaultProps = {
hasLogo: false
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment