From bd53700766239feeec3997214f28b82366effe33 Mon Sep 17 00:00:00 2001 From: HeskeyBaozi Date: Sat, 1 Sep 2018 13:12:29 +0800 Subject: [PATCH] default to icon --- site/theme/template/IconDisplay/index.jsx | 93 ----------------------- 1 file changed, 93 deletions(-) delete mode 100644 site/theme/template/IconDisplay/index.jsx diff --git a/site/theme/template/IconDisplay/index.jsx b/site/theme/template/IconDisplay/index.jsx deleted file mode 100644 index a34a8fb423..0000000000 --- a/site/theme/template/IconDisplay/index.jsx +++ /dev/null @@ -1,93 +0,0 @@ -import * as React from 'react'; -import manifest from '@ant-design/icons/lib/manifest'; -import Category from './Category'; -import { Radio, Icon as AntdIcon } from 'antd'; -import { FilledIcon, OutlinedIcon, TwoToneIcon } from './themeIcons'; -import { categories } from './fields'; -import { injectIntl } from 'react-intl'; -const Icon = AntdIcon; -class IconDisplay extends React.Component { - constructor() { - super(...arguments); - this.state = { - theme: 'outlined', - }; - this.handleChangeTheme = (e) => { - this.setState({ - theme: e.target.value, - }); - }; - } - getComputedDisplayList() { - return Object.keys(IconDisplay.cagetories) - .map((category) => ({ - category, - icons: IconDisplay.cagetories[category] - .filter((name) => manifest[IconDisplay.themeTypeMapper[this.state.theme]].indexOf(name) !== -1), - })) - .filter(({ icons }) => Boolean(icons.length)); - } - renderCategories(list) { - return list.map(({ category, icons }) => { - return (); - }); - } - render() { - const { intl: { messages } } = this.props; - const list = this.getComputedDisplayList(); - return (
-

{messages['app.docs.components.icon.pick-theme']}

- - - Outlined - - - Filled - - - Two Tone - - - {this.renderCategories(list)} -
); - } -} -IconDisplay.cagetories = categories; -IconDisplay.newIconNames = [ - // direction - 'border-bottom', 'border-horizontal', 'border-inner', - 'border-outter', 'border-left', 'border-right', 'border-top', - 'border-verticle', 'pic-center', 'pic-left', 'pic-right', - 'radius-bottomleft', 'radius-bottomright', 'radius-upleft', 'radius-upleft', - 'fullscreen', 'fullscreen-exit', - // suggestion - 'issues-close', 'stop', - // edit - 'scissor', 'snippets', 'diff', 'highlight', - 'align-center', 'align-left', 'align-right', 'bg-colors', - 'bold', 'italic', 'underline', 'redo', 'undo', 'zoom-in', 'zoom-out', - 'font-colors', 'font-size', 'line-height', 'colum-height', 'colum-width', - 'dash', 'small-dash', 'sort-ascending', 'sort-descending', - 'drag', 'ordered-list', 'radius-setting', - // data - 'radar-chart', 'heat-map', 'fall', 'rise', 'stock', 'box-plot', 'fund', - 'sliders', - // other - 'alert', 'audit', 'batch-folding', 'branches', - 'build', 'border', 'crown', - 'experiment', 'fire', - 'money-collect', 'property-safety', 'read', 'reconciliation', - 'rest', 'security-scan', 'insurance', 'interation', 'safety-certificate', - 'project', 'thunderbolt', 'block', 'cluster', 'deployment-unit', - 'dollar', 'euro', 'pound', 'file-done', 'file-exclamation', 'file-protect', - 'file-search', 'file-sync', 'gateway', 'gold', 'robot', - 'strikethrough', 'shopping', - // logo - 'alibaba', 'yahoo', -]; -IconDisplay.themeTypeMapper = { - filled: 'fill', - outlined: 'outline', - twoTone: 'twotone', -}; -export default injectIntl(IconDisplay);