pull/5370/head
bunsenstraat 3 years ago
parent 47bd54fe67
commit 01cc36ddef
  1. 1
      apps/remix-ide/src/app/components/side-panel.tsx
  2. 5
      apps/remix-ide/src/app/components/vertical-icons.js
  3. 13
      libs/remix-ui/vertical-icons-panel/src/lib/components/Chevron.tsx
  4. 2
      libs/remix-ui/vertical-icons-panel/src/lib/components/Home.tsx
  5. 1
      libs/remix-ui/vertical-icons-panel/src/lib/components/RequiredSection.tsx
  6. 1
      libs/remix-ui/vertical-icons-panel/src/lib/components/Settings.tsx
  7. 4
      libs/remix-ui/vertical-icons-panel/src/lib/remix-ui-vertical-icons-panel.css
  8. 3
      libs/remix-ui/vertical-icons-panel/src/lib/remix-ui-vertical-icons-panel.tsx

@ -63,6 +63,7 @@ export class SidePanel extends AbstractPanel {
} }
removeView (profile) { removeView (profile) {
if(this.plugins[profile.name].active) this.call('menuicons', 'select', 'filePanel')
super.removeView(profile) super.removeView(profile)
this.emit('pluginDisabled', profile.name) this.emit('pluginDisabled', profile.name)
this.call('menuicons', 'unlinkContent', profile) this.call('menuicons', 'unlinkContent', profile)

@ -64,6 +64,11 @@ export class VerticalIcons extends Plugin {
} }
async activateHome() {
await this.call('manager', 'activatePlugin', 'home')
await this.call('tabs', 'focus', 'home')
}
/** /**
* Remove an icon from the map * Remove an icon from the map
* @param {ModuleProfile} profile The profile of the module * @param {ModuleProfile} profile The profile of the module

@ -3,14 +3,23 @@ import React, { MutableRefObject } from 'react'
export interface ChevronProps { export interface ChevronProps {
divElementRef: MutableRefObject<any> divElementRef: MutableRefObject<any>
cssRule: string cssRule: string,
direction: string
} }
function Chevron (props: ChevronProps) { function Chevron (props: ChevronProps) {
const click = () => {
if (props.direction === 'down') {
props.divElementRef.current.scrollBy(0, 40)
} else {
props.divElementRef.current.scrollBy(0, -40)
}
}
return ( return (
<> <>
{ props.divElementRef.current && props.divElementRef.current.scrollHeight > props.divElementRef.current.clientHeight { props.divElementRef.current && props.divElementRef.current.scrollHeight > props.divElementRef.current.clientHeight
? <i className={props.cssRule}></i> : null } ? <i onClick={click} className={props.cssRule}></i> : null }
</> </>
) )
} }

@ -11,7 +11,7 @@ function Home ({ verticalIconPlugin }: HomeProps) {
return ( return (
<div <div
className="pl-1 mt-2 remixui_homeIcon" className="pl-1 mt-2 remixui_homeIcon"
onClick={async () => verticalIconPlugin.activateHome()} onClick={async () => await verticalIconPlugin.activateHome()}
// @ts-ignore // @ts-ignore
plugin="home" plugin="home"
title="Home" title="Home"

@ -60,6 +60,7 @@ function RequiredSection ({ verticalIconsPlugin, itemContextAction, addActive, r
scrollableRef.current && scrollableRef.current.scrollHeight > scrollableRef.current.clientHeight scrollableRef.current && scrollableRef.current.scrollHeight > scrollableRef.current.clientHeight
? ( ? (
<Chevron <Chevron
direction='up'
divElementRef={scrollableRef} divElementRef={scrollableRef}
cssRule={'fa fa-chevron-up remixui_icon-chevron mt-0 mb-0 ml-1 pl-3'} cssRule={'fa fa-chevron-up remixui_icon-chevron mt-0 mb-0 ml-1 pl-3'}
/> />

@ -36,6 +36,7 @@ function Settings ({ scrollableRef, verticalIconsPlugin, itemContextAction, addA
<div id="settingsIcons" className="remixui_settings mb-0 flex-grow-0" data-id="vertialIconsSettingsIcons" ref={settingsRef}> <div id="settingsIcons" className="remixui_settings mb-0 flex-grow-0" data-id="vertialIconsSettingsIcons" ref={settingsRef}>
{ scrollableRef.current && scrollableRef.current.scrollHeight > scrollableRef.current.clientHeight ? (<Chevron { scrollableRef.current && scrollableRef.current.scrollHeight > scrollableRef.current.clientHeight ? (<Chevron
divElementRef={scrollableRef} divElementRef={scrollableRef}
direction='down'
cssRule={'fa fa-chevron-down remixui_icon-chevron mt-0 mb-0 ml-1 pl-3'} cssRule={'fa fa-chevron-down remixui_icon-chevron mt-0 mb-0 ml-1 pl-3'}
/>) : null } />) : null }
{Object.keys(verticalIconsPlugin.targetProfileForChange) {Object.keys(verticalIconsPlugin.targetProfileForChange)

@ -117,3 +117,7 @@
list-style: none; list-style: none;
margin: 0px; margin: 0px;
} }
.remixui_icon-chevron {
cursor: pointer;
}

@ -92,9 +92,6 @@ export function RemixUiVerticalIconsPanel ({
async function itemContextAction (e: any, name: string, documentation: string) { async function itemContextAction (e: any, name: string, documentation: string) {
verticalIconsPlugin.appManager.deactivatePlugin(name) verticalIconsPlugin.appManager.deactivatePlugin(name)
if (e.target.parentElement.classList.contains('active')) {
verticalIconsPlugin.select('filePanel')
}
verticalIconsPlugin.renderComponent() verticalIconsPlugin.renderComponent()
} }

Loading…
Cancel
Save