import * as React from 'react'; import styled from 'styled-components'; import { blue } from '@ant-design/colors'; import { setTwoToneColor } from '../../src'; import * as AntdIcons from '../../src/icons'; const allIcons: { [key: string]: any; } = AntdIcons; const iconsList = Object.keys(allIcons) .filter(iconName => iconName.includes('TwoTone')); const Container = styled.div` display: flex; flex-flow: row wrap; width: 80vw; margin: auto; `; const Card = styled.div` height: 90px; margin: 12px 0 16px; width: 16.6666%; text-align: center; `; const NameDescription = styled.p` display: block; text-align: center; transform: scale(0.83); font-family: 'Lucida Console', Consolas; white-space: nowrap; `; const Text = styled.span` margin: 0 0.5rem; `; export default class AllIconDemo extends React.Component { state = { primaryColor: blue.primary!, }; componentWillMount() { setTwoToneColor(this.state.primaryColor); } onPrimaryColorChange = (e: React.SyntheticEvent) => { setTwoToneColor(e.currentTarget.value); this.setState({ primaryColor: e.currentTarget.value, }); } render() { return (

Two Tone

Primary Color

{this.state.primaryColor}
{ iconsList.map(iconName => { const Component = allIcons[iconName]; return ( {iconName} ); }) }
); } }