-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Created a widget for placeholder view in react-components
Move the placeholder widget to the react-components npm package This would allow it to be used by both theia and vscode extension Signed-off-by: hriday-panchasara <hriday.panchasara@ericsson.com>
- Loading branch information
1 parent
91f9083
commit 7811eab
Showing
4 changed files
with
74 additions
and
18 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
packages/react-components/src/trace-explorer/trace-explorer-placeholder-widget.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { faSpinner } from '@fortawesome/free-solid-svg-icons'; | ||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; | ||
import * as React from 'react'; | ||
|
||
export interface ReactPlaceholderWidgetProps { | ||
loading: boolean; | ||
handleOpenTrace: () => void; | ||
} | ||
|
||
export class ReactExplorerPlaceholderWidget extends React.Component<ReactPlaceholderWidgetProps, unknown> { | ||
constructor(props: ReactPlaceholderWidgetProps) { | ||
super(props); | ||
} | ||
|
||
render(): React.ReactNode { | ||
return <div className='placeholder-container' tabIndex={0}> | ||
<div className='center'>{'You have not yet opened a trace.'}</div> | ||
<div className='placeholder-open-workspace-button-container'> | ||
<button className='plcaeholder-open-workspace-button' title='Select a trace to open' | ||
onClick={this.props.handleOpenTrace} disabled={this.props.loading}> | ||
{this.props.loading && ( | ||
<FontAwesomeIcon | ||
icon={faSpinner} | ||
spin | ||
style={{ marginRight: '5px' }} | ||
/> | ||
)} | ||
{this.props.loading && <span>Connecting to trace server</span>} | ||
{!this.props.loading && <span>Open Trace</span>} | ||
</button> | ||
</div> | ||
</div>; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters