Merge pull request #4100 from ethereum/festyless

fe style improvements
pull/5370/head
Liana Husikyan 1 year ago committed by GitHub
commit d34a7ca136
  1. 2
      libs/remix-ui/workspace/src/lib/components/file-explorer-context-menu.tsx
  2. 25
      libs/remix-ui/workspace/src/lib/components/file-explorer-menu.tsx
  3. 7
      libs/remix-ui/workspace/src/lib/components/file-explorer.tsx
  4. 4
      libs/remix-ui/workspace/src/lib/css/file-explorer.css

@ -111,7 +111,7 @@ export const FileExplorerContextMenu = (props: FileExplorerContextMenuProps) =>
return groupedActions.map((groupItem, groupIndex) => return groupedActions.map((groupItem, groupIndex) =>
groupItem.map((item, index) => { groupItem.map((item, index) => {
key++ key++
const className = `remixui_liitem ${group !== item.group ? 'border-top' : ''}` const className = `px-3 remixui_liitem ${group !== item.group ? 'border-top' : ''}`
group = item.group group = item.group
if (item.name === 'Upload File') { if (item.name === 'Upload File') {
return ( return (

@ -67,12 +67,7 @@ export const FileExplorerMenu = (props: FileExplorerMenuProps) => {
return ( return (
<> <>
<CustomTooltip placement="top" tooltipId="remixuilabelTooltip" tooltipClasses="text-nowrap" tooltipText={props.title}> <span data-id="spanContaining" className="pl-0 pb-1 w-50">
<span className="remixui_label" data-path={props.title} style={{fontWeight: 'bold'}}>
{props.title}
</span>
</CustomTooltip>
<span className="pl-0 pb-1">
{state.menuItems.map(({action, title, icon, placement}, index) => { {state.menuItems.map(({action, title, icon, placement}, index) => {
if (action === 'uploadFile') { if (action === 'uploadFile') {
return ( return (
@ -83,7 +78,13 @@ export const FileExplorerMenu = (props: FileExplorerMenuProps) => {
tooltipText={<FormattedMessage id={`filePanel.${action}`} defaultMessage={title} />} tooltipText={<FormattedMessage id={`filePanel.${action}`} defaultMessage={title} />}
key={`index-${action}-${placement}-${icon}`} key={`index-${action}-${placement}-${icon}`}
> >
<label id={action} style={{fontSize: '1.1rem', cursor: 'pointer'}} data-id={'fileExplorerUploadFile' + action} className={icon + ' mb-0 px-1 remixui_newFile'} key={`index-${action}-${placement}-${icon}`}> <label
id={action}
style={{fontSize: '1.1rem', cursor: 'pointer'}}
data-id={'fileExplorerUploadFile' + action}
className={icon + ' mx-1 remixui_menuItem'}
key={`index-${action}-${placement}-${icon}`}
>
<input <input
id="fileUpload" id="fileUpload"
data-id="fileExplorerFileUpload" data-id="fileExplorerFileUpload"
@ -108,7 +109,13 @@ export const FileExplorerMenu = (props: FileExplorerMenuProps) => {
tooltipText={<FormattedMessage id={`filePanel.${action}`} defaultMessage={title} />} tooltipText={<FormattedMessage id={`filePanel.${action}`} defaultMessage={title} />}
key={`index-${action}-${placement}-${icon}`} key={`index-${action}-${placement}-${icon}`}
> >
<label id={action} style={{fontSize: '1.1rem', cursor: 'pointer'}} data-id={'fileExplorerUploadFolder' + action} className={icon + ' mb-0 px-1 remixui_newFile'} key={`index-${action}-${placement}-${icon}`}> <label
id={action}
style={{fontSize: '1.1rem', cursor: 'pointer'}}
data-id={'fileExplorerUploadFolder' + action}
className={icon + ' mx-1 remixui_menuItem'}
key={`index-${action}-${placement}-${icon}`}
>
<input <input
id="folderUpload" id="folderUpload"
data-id="fileExplorerFolderUpload" data-id="fileExplorerFolderUpload"
@ -151,7 +158,7 @@ export const FileExplorerMenu = (props: FileExplorerMenuProps) => {
state.actions[action]() state.actions[action]()
} }
}} }}
className={'newFile ' + icon + ' pr-2 pl-1 remixui_newFile'} className={icon + ' mx-1 remixui_menuItem'}
key={`${action}-${title}-${index}`} key={`${action}-${title}-${index}`}
></label> ></label>
</CustomTooltip> </CustomTooltip>

@ -1,6 +1,6 @@
import React, {useEffect, useState, useRef, SyntheticEvent} from 'react' // eslint-disable-line import React, {useEffect, useState, useRef, SyntheticEvent} from 'react' // eslint-disable-line
import {useIntl} from 'react-intl' import {useIntl} from 'react-intl'
import {TreeView, TreeViewItem} from '@remix-ui/tree-view' // eslint-disable-line import {TreeView} from '@remix-ui/tree-view' // eslint-disable-line
import {FileExplorerMenu} from './file-explorer-menu' // eslint-disable-line import {FileExplorerMenu} from './file-explorer-menu' // eslint-disable-line
import {FileExplorerContextMenu} from './file-explorer-context-menu' // eslint-disable-line import {FileExplorerContextMenu} from './file-explorer-context-menu' // eslint-disable-line
import {FileExplorerProps, FileType, WorkSpaceState} from '../types' import {FileExplorerProps, FileType, WorkSpaceState} from '../types'
@ -358,7 +358,7 @@ export const FileExplorer = (props: FileExplorerProps) => {
data-id={`treeViewDivMenu`} data-id={`treeViewDivMenu`}
className={`d-flex flex-row align-items-center`} className={`d-flex flex-row align-items-center`}
> >
<span className="w-100 pl-2"> <span className="w-100 pl-2 mt-1">
<div onClick={handleFileExplorerMenuClick}> <div onClick={handleFileExplorerMenuClick}>
<FileExplorerMenu <FileExplorerMenu
title={''} title={''}
@ -394,7 +394,8 @@ export const FileExplorer = (props: FileExplorerProps) => {
showIconsMenu={props.showIconsMenu} showIconsMenu={props.showIconsMenu}
hideIconsMenu={props.hideIconsMenu} hideIconsMenu={props.hideIconsMenu}
/> />
))} ))
}
</TreeView> </TreeView>
</div> </div>
<Draggable isDraggable={false} file={{ name: '/', path: '/', type: 'folder', isDirectory: true }} expandedPath={props.expandPath} handleClickFolder={null}> <Draggable isDraggable={false} file={{ name: '/', path: '/', type: 'folder', isDirectory: true }} expandedPath={props.expandPath} handleClickFolder={null}>

@ -23,10 +23,10 @@ input[type="file"] {
.remixui_file { .remixui_file {
padding : 4px; padding : 4px;
} }
.remixui_newFile i { .remixui_menuItem i {
cursor : pointer; cursor : pointer;
} }
.remixui_newFile:hover { .remixui_menuItem:hover {
transform : scale(1.3); transform : scale(1.3);
} }
.remixui_menu { .remixui_menu {

Loading…
Cancel
Save