|
1 | 1 | import * as React from 'react';
|
2 | 2 | import Collapse, { Panel } from 'mo/components/collapse';
|
| 3 | +import ExploreActionItem from './exploreActionItem'; |
3 | 4 | import { prefixClaName } from 'mo/common/className';
|
4 | 5 | import { activityBarService, editorService } from 'mo';
|
5 |
| - |
| 6 | +import classNames from 'classnames'; |
| 7 | +import './style.scss'; |
6 | 8 | interface IExplorerProps {
|
7 | 9 | }
|
8 | 10 |
|
@@ -30,18 +32,52 @@ export const Explorer: React.FunctionComponent<IExplorerProps> = (IExplorerProps
|
30 | 32 | const OpenCommand = function() {
|
31 | 33 | // MonacoEditor.editor.getModel().
|
32 | 34 | };
|
| 35 | + /** |
| 36 | + * waiting service |
| 37 | + * Temporarily use mock data |
| 38 | + */ |
| 39 | + const renderFileItems = () => { |
| 40 | + const data = [{ |
| 41 | + id: 1, |
| 42 | + iconName: 'codicon-new-file', |
| 43 | + name: 'New File', |
| 44 | + }, { |
| 45 | + id: 2, |
| 46 | + iconName: 'codicon-new-folder', |
| 47 | + name: 'New Folder', |
| 48 | + }, { |
| 49 | + id: 3, |
| 50 | + iconName: 'codicon-refresh', |
| 51 | + name: 'Refresh Explorer', |
| 52 | + }, { |
| 53 | + id: 4, |
| 54 | + iconName: 'codicon-collapse-all', |
| 55 | + name: 'Collapse Folders in Explorer', |
| 56 | + }]; |
| 57 | + return data.map((item: any) => <ExploreActionItem key={item.id} {...item} />); |
| 58 | + }; |
33 | 59 | return (
|
34 | 60 | <div className={prefixClaName('explorer', 'sidebar')}>
|
35 |
| - <Collapse className="dee"> |
36 |
| - <Panel header="OPEN EDITORS"> |
| 61 | + <Collapse |
| 62 | + accordion={true} |
| 63 | + expandIcon={({ isActive }: any) => <a className={classNames('codicon', isActive ? 'codicon-chevron-down' : 'codicon-chevron-right')}></a>} |
| 64 | + > |
| 65 | + <Panel header={<div className={prefixClaName('explorer-item', 'sidebar')}> |
| 66 | + <span>OPEN EDITORS</span> |
| 67 | + <span> |
| 68 | + {renderFileItems()} |
| 69 | + </span> |
| 70 | + </div>} key='OPEN EDITORS'> |
37 | 71 | OPEN EDITORS
|
38 | 72 | <button onClick={AddABar}>Add Bar</button>
|
39 | 73 | <button onClick={NewEditor}>New Editor</button>
|
40 | 74 | <button onClick={OpenCommand}>Command Palette</button>
|
41 | 75 | </Panel>
|
42 |
| - <Panel header="Sample-Folder"></Panel> |
43 |
| - <Panel header="OUTLINE"> |
44 |
| - OUTLINE |
| 76 | + <Panel header="Sample-Folder" key='Sample-Folder'> |
| 77 | + 文件夹 |
| 78 | + </Panel> |
| 79 | + <Panel header="OUTLINE" key='OUTLINE'> |
| 80 | + 时间线 |
45 | 81 | </Panel>
|
46 | 82 | </Collapse>
|
47 | 83 | </div>
|
|
0 commit comments