/* eslint react/prop-types: "off" */ import React from 'react' import { FlexContext, Layoutable as layoutable, FlexContainer, } from 'react-flexbox-svg' import generateColors from './colors' import setTweenInterval from './tween' class Circle extends React.Component { render() { return } } Circle.layout = { margin: 10, height: 100, width: 100 } const LayoutableCircle = layoutable(props => Circle.layout)(Circle) export default class DynamicCollection extends React.Component { constructor(props) { super(props) this.colors = generateColors(18) this.state = { height: 700, width: 700 } } componentDidMount() { this.tweenInterval = setTweenInterval( width => { this.setState({ width }) }, 25, { min: 150, max: 700 } ) } componentWillUnmount() { clearInterval(this.tweenInterval) } render() { const { height, width } = this.state const containerStyle = { height, width, flexDirection: 'row', flexWrap: 'wrap', } const formatColor = rgb => `rgb(${rgb.join(', ')})` return ( {this.colors.map((color, index) => ( ))} ) } }