Sha256: c203c32be3e2ae50e4bfbabb7c4017797e5da035f57bd6fe2e2ceb1c5f805389

Contents?: true

Size: 1.01 KB

Versions: 6

Compression:

Stored size: 1.01 KB

Contents

/* @flow */

import React from 'react'
import classname from 'classnames'

import styles from './styles.scss'

type FlipProps = {
  children: React.ChildrenArray<React.Element<typeof FlipFront | typeof FlipBack>>,
  flipped: boolean,
}

type FlipSideProps = {
  children?: React.Node,
  className?: string,
}

const Flip = ({ children, flipped }: FlipProps) => (
  <div className={styles['flip-container']}>
    <div className={
        classname({
          [styles['flip']]: flipped,
          [styles['flap']]: !flipped,
        })
      }
    >
      {children}
    </div>
  </div>
)

// eslint-disable-next-line react/no-multi-comp
const FlipFront = ({
  children,
  className,
}: FlipSideProps) => (
  <div className={classname(styles.front, className)}>{children}</div>
)

// eslint-disable-next-line react/no-multi-comp
const FlipBack = ({
  children,
  className,
}: FlipSideProps) => (
  <div className={classname(styles.back, className)}>{children}</div>
)

Flip.Front = FlipFront
Flip.Back = FlipBack
export default Flip

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
playbook_ui-2.7.2 components/Flip/Flip.jsx
playbook_ui-2.7.1 components/Flip/Flip.jsx
playbook_ui-2.7.0 components/Flip/Flip.jsx
playbook_ui-2.6.0 components/Flip/Flip.jsx
playbook_ui-2.5.0 components/Flip/Flip.jsx
nitro_sg-3.0.2 components/Flip/Flip.jsx