pull/1964/head
bunsenstraat 3 years ago
parent 3b06a0491c
commit 77014377e3
  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) {
if(this.plugins[profile.name].active) this.call('menuicons', 'select', 'filePanel')
super.removeView(profile)
this.emit('pluginDisabled', profile.name)
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
* @param {ModuleProfile} profile The profile of the module

@ -3,14 +3,23 @@ import React, { MutableRefObject } from 'react'
export interface ChevronProps {
divElementRef: MutableRefObject<any>
cssRule: string
cssRule: string,
direction: string
}
function Chevron (props: ChevronProps) {
const click = () => {
if (props.direction === 'down') {
props.divElementRef.current.scrollBy(0, 40)
} else {
props.divElementRef.current.scrollBy(0, -40)
}
}
return (
<>
{ 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 (
<div
className="pl-1 mt-2 remixui_homeIcon"
onClick={async () => verticalIconPlugin.activateHome()}
onClick={async () => await verticalIconPlugin.activateHome()}
// @ts-ignore
plugin="home"
title="Home"

@ -60,6 +60,7 @@ function RequiredSection ({ verticalIconsPlugin, itemContextAction, addActive, r
scrollableRef.current && scrollableRef.current.scrollHeight > scrollableRef.current.clientHeight
? (
<Chevron
direction='up'
divElementRef={scrollableRef}
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}>
{ scrollableRef.current && scrollableRef.current.scrollHeight > scrollableRef.current.clientHeight ? (<Chevron
divElementRef={scrollableRef}
direction='down'
cssRule={'fa fa-chevron-down remixui_icon-chevron mt-0 mb-0 ml-1 pl-3'}
/>) : null }
{Object.keys(verticalIconsPlugin.targetProfileForChange)

@ -116,4 +116,8 @@
#menuitems {
list-style: none;
margin: 0px;
}
.remixui_icon-chevron {
cursor: pointer;
}

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

Loading…
Cancel
Save