# All files / components/Note Note.js

0% Statements 0/20
0% Branches 0/4
0% Functions 0/2
0% Lines 0/10

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39

     import React from 'react';
    import PropTypes from 'prop-types';
    import NoteContainer from './styles/NoteContainer';
    import NoteCorner from './styles/NoteCorner';
    import { defaultProps } from 'recompose';

    const Note = ({ children, Container, Corner }) => (
      <Container>
        {children}
        <Corner />
      </Container>
    );

    Note.propTypes = {
      /**
       * Contents of the note
       */
      children: PropTypes.node.isRequired,
      /**
       * Override the component that renders the outer container
       */
      Container: PropTypes.func,
      /**
       * Override the component that renders the corner
       */
      Corner: PropTypes.func,
    };

    Note.defaultProps = {
      Container: NoteContainer,
      Corner: NoteCorner,
    };

    Note.Alternate = defaultProps({
      Container: NoteContainer.Alternate,
    })(Note);

    export default Note;