diff --git a/apps/remix-ide/src/app/components/side-panel.tsx b/apps/remix-ide/src/app/components/side-panel.tsx index 3e62f8bea1..1a3ebc0f30 100644 --- a/apps/remix-ide/src/app/components/side-panel.tsx +++ b/apps/remix-ide/src/app/components/side-panel.tsx @@ -73,7 +73,6 @@ export class SidePanel extends AbstractPanel { await this.call('pinnedPanel', 'pinView', profile, this.plugins[profile.name].view) if (this.plugins[profile.name].active) this.call('menuicons', 'select', 'filePanel') super.remove(profile.name) - this.call('menuicons', 'unlinkContent', profile) this.renderComponent() } @@ -85,7 +84,6 @@ export class SidePanel extends AbstractPanel { super.addView(profile, view) this.plugins[activePlugin].active = false this.plugins[profile.name].active = true - await this.call('menuicons', 'linkContent', profile) this.showContent(profile.name) } diff --git a/apps/remix-ide/src/app/components/vertical-icons.tsx b/apps/remix-ide/src/app/components/vertical-icons.tsx index 4d54c5a855..c46df20fda 100644 --- a/apps/remix-ide/src/app/components/vertical-icons.tsx +++ b/apps/remix-ide/src/app/components/vertical-icons.tsx @@ -79,6 +79,16 @@ export class VerticalIcons extends Plugin { } this.renderComponent() }) + + this.on('pinnedPanel', 'pinnedPlugin', (profile) => { + this.icons[profile.name].pinned = true + this.renderComponent() + }) + + this.on('pinnedPanel', 'unPinnedPlugin', (profile) => { + this.icons[profile.name].pinned = false + this.renderComponent() + }) } async linkContent(profile: Profile) { @@ -87,6 +97,7 @@ export class VerticalIcons extends Plugin { this.icons[profile.name] = { profile: profile, active: false, + pinned: false, canbeDeactivated: await this.call('manager', 'canDeactivate', this.profile, profile), timestamp: Date.now() } diff --git a/libs/remix-ui/vertical-icons-panel/src/lib/components/Icon.tsx b/libs/remix-ui/vertical-icons-panel/src/lib/components/Icon.tsx index 00fb539fa6..e50746d3f4 100644 --- a/libs/remix-ui/vertical-icons-panel/src/lib/components/Icon.tsx +++ b/libs/remix-ui/vertical-icons-panel/src/lib/components/Icon.tsx @@ -88,10 +88,10 @@ const Icon = ({ iconRecord, verticalIconPlugin, contextMenuAction, theme }: Icon return ( <>
- {iconRecord.active &&
} + >
{ - ;(verticalIconPlugin as any).toggle(name) + if (iconRecord.pinned) { + console.log('called an already pinned plugin') + } else { + (verticalIconPlugin as any).toggle(name) + } }} {...{ plugin: name }} onContextMenu={(e: any) => { @@ -133,6 +137,10 @@ const Icon = ({ iconRecord, verticalIconPlugin, contextMenuAction, theme }: Icon contextMenuAction={contextMenuAction} /> ) : null} +
) diff --git a/libs/remix-ui/vertical-icons-panel/src/lib/types/index.ts b/libs/remix-ui/vertical-icons-panel/src/lib/types/index.ts index 754c897b8b..c95930ad4f 100644 --- a/libs/remix-ui/vertical-icons-panel/src/lib/types/index.ts +++ b/libs/remix-ui/vertical-icons-panel/src/lib/types/index.ts @@ -3,6 +3,7 @@ import { Profile } from '@remixproject/plugin-utils' export type IconRecord = { profile: Profile active: boolean + pinned: boolean class?: string canbeDeactivated?: boolean isRequired?: boolean