Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: tune padding and background in ByteCodeValue and DisassembledCodeValue. #831

Merged
merged 1 commit into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/assets/styles/explorer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,13 @@ hr.dotted {
.h-dotted-area {
border: dashed 1px $h-highlight-color;
}
/* Code box (source, bytecode, assembly code) */
.h-code-box {
border: 0.5px solid dimgrey;
gap: 0.42rem;
overflow-y: auto;
min-height: 5rem
}

//
// MODALS
Expand Down
6 changes: 3 additions & 3 deletions src/components/contract/ContractByteCodeSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@
<StringValue :string-value="solcVersion ?? undefined"/>
</template>
</Property>
<div class="columns is-multiline h-is-property-text">
<div id="bytecode" class="column is-6" :class="{'is-full': !isSmallScreen}">
<div class="columns is-multiline h-is-property-text pt-3">
<div id="bytecode" class="column is-6 pt-0" :class="{'is-full': !isSmallScreen}">
<p class="has-text-weight-light">Runtime Bytecode</p>
<ByteCodeValue :byte-code="byteCode ?? undefined" class="mt-3 mb-4"/>
</div>
<div id="assembly-code" class="column is-6" :class="{'h-has-column-separator':isSmallScreen}">
<div id="assembly-code" class="column is-6 pt-0" :class="{'h-has-column-separator':isSmallScreen}">
<div class="is-flex is-align-items-center is-justify-content-space-between">
<p class="has-text-weight-light">Assembly Bytecode</p>
<div class="is-flex is-align-items-center is-justify-content-end">
Expand Down
15 changes: 3 additions & 12 deletions src/components/values/ByteCodeValue.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
<template>

<div v-if="textValue" id="bytecode"
class="pl-1 mt-2 mr-1 code-data-box">
class="h-code-box h-has-page-background pt-1 pl-3 pr-2 pb-2 mt-2 mr-1"
style="max-height: 400px;">
<HexaValue :byte-string="textValue" :copyable="false"/>
</div>

Expand Down Expand Up @@ -69,14 +70,4 @@ export default defineComponent({
<!-- STYLE -->
<!-- --------------------------------------------------------------------------------------------------------------- -->

<style>

.code-data-box {
border: 0.5px solid dimgrey;
gap: 0.42rem;
max-height: 20rem;
overflow-y: auto;
min-height: 5rem
}

</style>
<style/>
20 changes: 5 additions & 15 deletions src/components/values/DisassembledCodeValue.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@
<!-- --------------------------------------------------------------------------------------------------------------- -->

<template>
<div v-if="disassembly" id="disassembly" class="mt-2 p-2 is-flex analyzed-data-box">
<div v-for="opcode in disassembly" v-if="disassembly && disassembly.length > 0" :key="opcode.index16">
<div v-if="disassembly" id="disassembly"
class="h-code-box h-has-page-background is-family-monospace mt-2 px-3 py-1"
style="max-height: 400px;">
<div v-for="opcode in disassembly" v-if="disassembly && disassembly.length > 0" :key="opcode.index16">
<OpcodeValue :opcode="opcode" :show-hexa-opcode="showHexaOpcode"/>
</div>
<p v-else class="has-text-grey is-italic has-text-weight-medium">{{ disassembledError }}</p>
Expand Down Expand Up @@ -92,16 +94,4 @@ export default defineComponent({
<!-- STYLE -->
<!-- --------------------------------------------------------------------------------------------------------------- -->

<style>

.analyzed-data-box {
border: 0.5px solid dimgrey;
gap: 0.42rem;
flex-direction: column;
max-height: 20rem;
overflow-y: auto;
font-family: novamonoregular, monospace;
min-height: 5rem
}

</style>
<style/>