Advertisement
Guest User

Untitled

a guest
Apr 21st, 2017
259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import React, { Component } from 'react';
  2. import FlipCard from 'react-flipcard';
  3. import { Flex, Box, Grid } from 'reflexbox'
  4.  
  5. export default class Flip extends Component {
  6.   constructor(props) {
  7.     super(props)
  8.     this.state = {
  9.       isFlipped: false,
  10.     }
  11.   }
  12.  
  13.   showBack() {
  14.     this.setState({
  15.       isFlipped: true,
  16.     });
  17.   }
  18.  
  19.   showFront() {
  20.     this.setState({
  21.       isFlipped: false,
  22.     });
  23.   }
  24.   render() {
  25.     const { children } = this.props
  26.  
  27.     return (
  28.           <FlipCard
  29.             disabled={false}
  30.             flipped={this.state.isFlipped}
  31.           >
  32.             { children }
  33.           </FlipCard>
  34.     );
  35.   }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement