Skip to content

Commit

Permalink
Update text for more memory select
Browse files Browse the repository at this point in the history
  • Loading branch information
haydar-metin committed Mar 6, 2024
1 parent 975fcd2 commit 09b0b60
Showing 1 changed file with 20 additions and 16 deletions.
36 changes: 20 additions & 16 deletions src/webview/components/memory-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,25 @@ export const MoreMemorySelect: React.FC<MoreMemoryAboveSelectProps | MoreMemoryB
fetchMemory({ offset: newOffset });
};

const selector = <select
className={`bytes-select ${props.disabled ? 'p-disabled' : ''}`}
onChange={onSelectChange}
tabIndex={0}
disabled={props.disabled}
>
{props.options.map(option => (
<option
key={`more-memory-select-${option}`}
value={option}
>
{option}
</option>))}
</select>;

const isGrowing = props.direction === 'above' && props.shouldPrepend === true;
const growLabel = <span>Load {selector} more bytes {props.direction}</span>;
const moveLabel = <span>Move {selector} bytes {props.direction}</span>;

return (
<div
className={`more-memory-select ${props.disabled ? 'p-disabled' : ''}`}
Expand All @@ -95,22 +114,7 @@ export const MoreMemorySelect: React.FC<MoreMemoryAboveSelectProps | MoreMemoryB
ref={containerRef}
>
<div className='more-memory-select-top no-select'>
Load
<select
className={`bytes-select ${props.disabled ? 'p-disabled' : ''}`}
onChange={onSelectChange}
tabIndex={0}
disabled={props.disabled}
>
{props.options.map(option => (
<option
key={`more-memory-select-${option}`}
value={option}
>
{option}
</option>))}
</select>
{`more bytes ${props.direction}`}
{isGrowing ? growLabel : moveLabel}
</div>
</div>
);
Expand Down

0 comments on commit 09b0b60

Please sign in to comment.