|
1 | 1 | import React, { Component } from 'react'; |
2 | 2 | import * as PropTypes from 'prop-types'; |
3 | 3 | import cubejs from '@cubejs-client/core'; |
4 | | -import { PlusOutlined } from '@ant-design/icons'; |
5 | 4 | import { |
6 | | - Layout, Menu, Button, Tree, Tabs, Dropdown, Spin, Alert, Modal, Empty |
| 5 | + Layout, Menu, Button, Tree, Tabs, Spin, Alert, Modal, Empty |
7 | 6 | } from 'antd'; |
8 | 7 | import PrismCode from './PrismCode'; |
9 | 8 | import { playgroundAction } from './events'; |
@@ -173,14 +172,6 @@ class SchemaPage extends Component { |
173 | 172 | return <TreeNode {...item} />; |
174 | 173 | }); |
175 | 174 |
|
176 | | - const menu = ( |
177 | | - <Menu> |
178 | | - <Menu.Item onClick={() => this.generateSchema()}> |
179 | | - Generate Schema |
180 | | - </Menu.Item> |
181 | | - </Menu> |
182 | | - ); |
183 | | - |
184 | 175 | const renderTree = () => (Object.keys(tablesSchema || {}).length > 0 ? ( |
185 | 176 | <Tree |
186 | 177 | checkable |
@@ -214,24 +205,20 @@ class SchemaPage extends Component { |
214 | 205 | <Layout style={{ height: '100%' }}> |
215 | 206 | <Sider |
216 | 207 | width={300} |
217 | | - style={{ |
218 | | - background: '#fff', |
219 | | - borderRight: '1px solid #eee', |
220 | | - }} |
221 | 208 | className="schema-sidebar" |
222 | 209 | > |
223 | 210 | <Tabs |
224 | 211 | activeKey={activeTab} |
225 | 212 | onChange={(tab) => this.setState({ activeTab: tab })} |
226 | 213 | tabBarExtraContent={( |
227 | | - <Dropdown overlay={menu} placement="bottomRight" disabled={!checkedKeys.length}> |
228 | | - <Button |
229 | | - shape="circle" |
230 | | - icon={<PlusOutlined />} |
231 | | - type="primary" |
232 | | - /> |
233 | | - </Dropdown> |
234 | | -)} |
| 214 | + <Button |
| 215 | + disabled={!checkedKeys.length} |
| 216 | + type="primary" |
| 217 | + onClick={() => this.generateSchema()} |
| 218 | + > |
| 219 | + Generate Schema |
| 220 | + </Button> |
| 221 | + )} |
235 | 222 | > |
236 | 223 | <TabPane tab="Tables" key="schema"> |
237 | 224 | {schemaLoading ? <Spin style={{ width: '100%' }}/> : renderTreeOrError()} |
|
0 commit comments