use monospace for memory and stack

pull/5370/head
yann300 3 years ago
parent fcadbfd9f9
commit d3969a68a4
  1. 6
      libs/remix-ui/debugger-ui/src/lib/vm-debugger/dropdown-panel.tsx
  2. 2
      libs/remix-ui/debugger-ui/src/lib/vm-debugger/memory-panel.tsx
  3. 2
      libs/remix-ui/debugger-ui/src/lib/vm-debugger/stack-panel.tsx
  4. 4
      libs/remix-ui/debugger-ui/src/types/index.ts

@ -7,7 +7,7 @@ import './styles/dropdown-panel.css'
export const DropdownPanel = (props: DropdownPanelProps) => { export const DropdownPanel = (props: DropdownPanelProps) => {
const [calldataObj, dispatch] = useReducer(reducer, initialState) const [calldataObj, dispatch] = useReducer(reducer, initialState)
const { dropdownName, dropdownMessage, calldata, header, loading, extractFunc, formatSelfFunc, registerEvent, triggerEvent, loadMoreEvent, loadMoreCompletedEvent } = props const { dropdownName, dropdownMessage, calldata, header, loading, extractFunc, formatSelfFunc, registerEvent, triggerEvent, loadMoreEvent, loadMoreCompletedEvent, headStyle, bodyStyle } = props
const extractDataDefault: ExtractFunc = (item, parent?) => { const extractDataDefault: ExtractFunc = (item, parent?) => {
const ret: ExtractData = {} const ret: ExtractData = {}
@ -193,14 +193,14 @@ export const DropdownPanel = (props: DropdownPanelProps) => {
return ( return (
<div className="border rounded px-1 mt-1 bg-light"> <div className="border rounded px-1 mt-1 bg-light">
<div className="py-0 px-1 title"> <div className="py-0 px-1 title" style={headStyle}>
<div className={state.toggleDropdown ? 'icon fas fa-caret-down' : 'icon fas fa-caret-right'} onClick={handleToggle}></div> <div className={state.toggleDropdown ? 'icon fas fa-caret-down' : 'icon fas fa-caret-right'} onClick={handleToggle}></div>
<div className="name" data-id={`dropdownPanel${uniquePanelName}`} onClick={handleToggle}>{dropdownName}</div><span className="nameDetail" onClick={handleToggle}>{header}</span> <div className="name" data-id={`dropdownPanel${uniquePanelName}`} onClick={handleToggle}>{dropdownName}</div><span className="nameDetail" onClick={handleToggle}>{header}</span>
<CopyToClipboard content={state.copiableContent} data-id={`dropdownPanelCopyToClipboard${uniquePanelName}`} /> <CopyToClipboard content={state.copiableContent} data-id={`dropdownPanelCopyToClipboard${uniquePanelName}`} />
</div> </div>
<div className='dropdownpanel' style={{ display: state.toggleDropdown ? 'block' : 'none' }}> <div className='dropdownpanel' style={{ display: state.toggleDropdown ? 'block' : 'none' }}>
<i className="refresh fas fa-sync" style={{ display: state.updating ? 'inline-block' : 'none' }} aria-hidden="true"></i> <i className="refresh fas fa-sync" style={{ display: state.updating ? 'inline-block' : 'none' }} aria-hidden="true"></i>
<div className='dropdowncontent' style={{ display: state.dropdownContent.display }}> <div className='dropdowncontent' style={{ display: state.dropdownContent.display, ...bodyStyle }}>
{ {
state.data && state.data &&
<TreeView id="treeView"> <TreeView id="treeView">

@ -3,7 +3,7 @@ import DropdownPanel from './dropdown-panel' // eslint-disable-line
export const MemoryPanel = ({ calldata }) => { export const MemoryPanel = ({ calldata }) => {
return ( return (
<DropdownPanel dropdownName='Memory' calldata={calldata || {}} /> <DropdownPanel bodyStyle={{ fontFamily: 'monospace' }} dropdownName='Memory' calldata={calldata || {}} />
) )
} }

@ -4,7 +4,7 @@ import DropdownPanel from './dropdown-panel' // eslint-disable-line
export const StackPanel = ({ calldata }) => { export const StackPanel = ({ calldata }) => {
return ( return (
<div id='stackpanel'> <div id='stackpanel'>
<DropdownPanel dropdownName='Stack' calldata={calldata || {}} /> <DropdownPanel bodyStyle={{ fontFamily: 'monospace' }} dropdownName='Stack' calldata={calldata || {}} />
</div> </div>
) )
} }

@ -27,7 +27,9 @@ export interface DropdownPanelProps {
registerEvent?: Function, registerEvent?: Function,
triggerEvent?: Function, triggerEvent?: Function,
loadMoreEvent?: string, loadMoreEvent?: string,
loadMoreCompletedEvent?: string loadMoreCompletedEvent?: string,
bodyStyle?: React.CSSProperties
headStyle?: React.CSSProperties
} }
export type FormatSelfFunc = (key: string | number, data: ExtractData) => JSX.Element export type FormatSelfFunc = (key: string | number, data: ExtractData) => JSX.Element

Loading…
Cancel
Save