(config)
| 67 | } |
| 68 | |
| 69 | genCodeString (config) { |
| 70 | const ignoreAttr = ['id'] |
| 71 | const myConfig = Object.keys(config) |
| 72 | .filter(key => !ignoreAttr.includes(key)) |
| 73 | .reduce((acc, key) => ({ ...acc, [key]: config[key] }), {}) |
| 74 | return "const config = " + |
| 75 | JSON.stringify(myConfig, null, 2) + |
| 76 | "\n" + |
| 77 | "const myConfig = genConfig(config)\n" + |
| 78 | "<NiceAvatar style={{ width: '5rem', height: '5rem' }} {...myConfig} />" |
| 79 | } |
| 80 | |
| 81 | render () { |
| 82 | const { config, shape, download } = this.props |