Skip to content

Commit e34d0da

Browse files
committed
add to ide shell
1 parent 49ece97 commit e34d0da

File tree

4 files changed

+21
-2
lines changed

4 files changed

+21
-2
lines changed

apps/remix-ide/src/app/components/top-bar.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
/* eslint-disable @nrwl/nx/enforce-module-boundaries */
12
import React from 'react'
23
import { RemixUiTopbar } from '@remix-ui/top-bar'
34
import packageJson from '../../../../../package.json'
45
import { EventEmitter } from 'events'
56
import { CustomRemixApi } from '@remix-api'
67
import { Plugin } from '@remixproject/engine'
78
import { PluginViewWrapper } from '@remix-ui/helper'
9+
import { AppAction } from 'libs/remix-ui/app/src/lib/remix-app/actions/app'
810

911
const TopBarProfile = {
1012
name: 'topbar',
@@ -18,6 +20,7 @@ const TopBarProfile = {
1820

1921
export class Topbar extends Plugin<any, CustomRemixApi> {
2022
dispatch: React.Dispatch<any> = () => { }
23+
appStateDispatch: React.Dispatch<AppAction> = () => { }
2124
htmlElement: HTMLDivElement
2225
events: EventEmitter
2326

@@ -26,13 +29,21 @@ export class Topbar extends Plugin<any, CustomRemixApi> {
2629
}
2730

2831
onActivation(): void {
29-
32+
this.renderComponent()
3033
}
3134

3235
onDeactivation(): void {
3336

3437
}
3538

39+
setDispatch(dispatch: React.Dispatch<any>) {
40+
this.dispatch = dispatch
41+
}
42+
43+
setAppStateDispatch(appStateDispatch: React.Dispatch<AppAction>) {
44+
this.appStateDispatch = appStateDispatch
45+
}
46+
3647
renderComponent() {
3748
this.dispatch({
3849
plugins: this,

libs/remix-ui/app/src/lib/remix-app/remix-app.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,10 @@ const RemixApp = (props: IRemixAppUi) => {
250250
{showManagePreferencesDialog && <ManagePreferencesDialog savePreferencesFn={() => setShowEnterDialog(true)}></ManagePreferencesDialog>}
251251
<div className='d-flex flex-column'>
252252
<div className={`remixIDE ${appReady ? '' : 'd-none'}`} data-id="remixIDE">
253+
<div className='top-bar'>
254+
{props.app.topBar.render()}
255+
<h1>Top Bar</h1>
256+
</div>
253257
<div id="icon-panel" data-id="remixIdeIconPanel" className="custom_icon_panel iconpanel bg-light">
254258
{props.app.menuicons.render()}
255259
</div>

libs/remix-ui/app/src/lib/remix-app/style/remix-app.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ pre {
3939
}
4040
.statusBar {
4141

42+
}
43+
44+
.top-bar {
45+
4246
}
4347
.pinnedpanel {
4448
width : 320px;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react'
22

33
export const RemixUiTopbar = () => {
4-
return <div>RemixUiTopbar</div>
4+
return <div className="display-1 text-danger">RemixUiTopbar</div>
55
}

0 commit comments

Comments
 (0)