diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f393e155f..993816daaf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## Current ### Features +- [#2433](https://github.com/poanetwork/blockscout/pull/2433) - Add a functionality to try Eth RPC methods in the documentation - [#2529](https://github.com/poanetwork/blockscout/pull/2529) - show both eth value and token transfers on transaction overview page - [#2376](https://github.com/poanetwork/blockscout/pull/2376) - Split API and WebApp routes - [#2477](https://github.com/poanetwork/blockscout/pull/2477) - aggregate token transfers on transaction page @@ -10,12 +11,16 @@ ### Fixes - [#2538](https://github.com/poanetwork/blockscout/pull/2538) - fetch the last not empty coin balance records +- [#2543](https://github.com/poanetwork/blockscout/pull/2543) - do not hide search input during logs search +- [#2524](https://github.com/poanetwork/blockscout/pull/2524) - fix dark theme validator data styles +- [#2532](https://github.com/poanetwork/blockscout/pull/2532) - don't show empty token transfers on the transaction overview page - [#2528](https://github.com/poanetwork/blockscout/pull/2528) - fix coin history chart data - [#2520](https://github.com/poanetwork/blockscout/pull/2520) - Hide loading message when fetching is failed - [#2523](https://github.com/poanetwork/blockscout/pull/2523) - Avoid importing internal_transactions of pending transactions - [#2519](https://github.com/poanetwork/blockscout/pull/2519) - enable `First` page button in pagination - [#2517](https://github.com/poanetwork/blockscout/pull/2517) - remove duplicate indexes - [#2515](https://github.com/poanetwork/blockscout/pull/2515) - do not aggregate NFT token transfers +- [#2514](https://github.com/poanetwork/blockscout/pull/2514) - Isolating of staking dapp css && extracting of non-critical css - [#2512](https://github.com/poanetwork/blockscout/pull/2512) - alert link fix - [#2508](https://github.com/poanetwork/blockscout/pull/2508) - logs view columns fix - [#2506](https://github.com/poanetwork/blockscout/pull/2506) - fix two active tab in the top menu diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md index 4de2ef6baf..3075397e8d 100644 --- a/ISSUE_TEMPLATE.md +++ b/ISSUE_TEMPLATE.md @@ -4,6 +4,7 @@ * Elixir & Erlang/OTP versions (`elixir -version`): * Operating System: +* Blockscout Version/branch: ### Steps to reproduce diff --git a/apps/block_scout_web/assets/css/app.scss b/apps/block_scout_web/assets/css/app.scss index e91df91740..0e7d98f656 100644 --- a/apps/block_scout_web/assets/css/app.scss +++ b/apps/block_scout_web/assets/css/app.scss @@ -24,7 +24,6 @@ $fa-font-path: "~@fortawesome/fontawesome-free/webfonts"; @import "node_modules/bootstrap/scss/reboot"; @import "node_modules/bootstrap/scss/grid"; @import "node_modules/bootstrap/scss/code"; -@import "node_modules/bootstrap/scss/modal"; @import "node_modules/bootstrap/scss/close"; @import "node_modules/bootstrap/scss/buttons"; @import "node_modules/bootstrap/scss/forms"; @@ -50,7 +49,6 @@ $fa-font-path: "~@fortawesome/fontawesome-free/webfonts"; @import "node_modules/bootstrap/scss/navbar"; @import "node_modules/bootstrap/scss/pagination"; @import "node_modules/bootstrap/scss/tables"; -@import "node_modules/bootstrap/scss/tooltip"; @import "node_modules/bootstrap/scss/transitions"; // Code highlight @@ -75,8 +73,11 @@ $fa-font-path: "~@fortawesome/fontawesome-free/webfonts"; @import "components/filter"; @import "components/button"; @import "components/table"; -@import "components/qr-code"; @import "components/navbar"; +@import "components/alerts"; + +@import "theme/dark-theme"; + @import "components/animations"; @import "components/card"; @import "components/tile"; @@ -93,42 +94,30 @@ $fa-font-path: "~@fortawesome/fontawesome-free/webfonts"; @import "components/transaction-input"; @import "components/coin-balance-tile"; @import "components/highlight"; -@import "components/copy_icon"; @import "components/btn_full"; @import "components/btn_line"; -@import "components/stakes"; @import "components/check"; +@import "components/stakes_variables"; @import "components/stakes_table"; @import "components/i_tooltip"; @import "components/check_tooltip"; @import "components/tooltip"; -@import "components/progress_from_to"; -@import "components/stakes_empty_content"; -@import "components/stakes_btn_remove_pool"; -@import "components/modal"; -@import "components/modal_validator_info"; @import "components/form"; -@import "components/stakes_progress"; -@import "components/modal_status"; -@import "components/modal_bottom_disclaimer"; -@import "components/modal_become_candidate"; -@import "components/modal_stake"; @import "components/btn_copy"; @import "components/btn_qr"; @import "components/btn_address_card"; @import "components/btn_dropdown_line"; @import "components/transaction"; @import "components/api"; -@import "components/alerts"; @import "components/verify_other_explorers"; @import "components/errors"; @import "components/log-search"; @import "components/radio"; +@import "components/modal_variables"; @import "components/network-selector"; @import "components/new_smart_contract"; @import "components/radio_big"; @import "components/btn_no_border"; -@import "theme/dark-theme"; :export { dashboardBannerChartAxisFontColor: $dashboard-banner-chart-axis-font-color; diff --git a/apps/block_scout_web/assets/css/components/_api.scss b/apps/block_scout_web/assets/css/components/_api.scss index 820e1e8f01..6f46956780 100644 --- a/apps/block_scout_web/assets/css/components/_api.scss +++ b/apps/block_scout_web/assets/css/components/_api.scss @@ -116,6 +116,10 @@ $api-doc-list-item-view-more-color: $api-doc-list-item-title-color !default; margin: 0; } +.api-doc-list-item-description { + width: 100% +} + .api-doc-list-item-controls { display: flex; flex-direction: column; diff --git a/apps/block_scout_web/assets/css/components/_button.scss b/apps/block_scout_web/assets/css/components/_button.scss index d6a9e7b020..53bca7a83a 100644 --- a/apps/block_scout_web/assets/css/components/_button.scss +++ b/apps/block_scout_web/assets/css/components/_button.scss @@ -23,6 +23,7 @@ $button-secondary-color: $secondary !default; background-color: darken($button-primary-color, 10%); border-color: darken($button-primary-color, 10%); color: #fff; + outline: none !important; text-decoration: none; } diff --git a/apps/block_scout_web/assets/css/components/_form.scss b/apps/block_scout_web/assets/css/components/_form.scss index 5346afcb7c..4b13065a05 100644 --- a/apps/block_scout_web/assets/css/components/_form.scss +++ b/apps/block_scout_web/assets/css/components/_form.scss @@ -9,6 +9,11 @@ $form-control-border-color: #e2e5ec !default; border-radius: 4px; } + &:focus { + border-color: $secondary; + box-shadow: none; + } + &.n-b-r { border-right: none; } diff --git a/apps/block_scout_web/assets/css/components/_modal.scss b/apps/block_scout_web/assets/css/components/_modal.scss index bc9e16c875..4e70be687c 100644 --- a/apps/block_scout_web/assets/css/components/_modal.scss +++ b/apps/block_scout_web/assets/css/components/_modal.scss @@ -1,9 +1,3 @@ -$modal-overlay-color: rgba($primary, 0.9) !default; -$modal-horizontal-padding: 30px !default; -$modal-vertical-padding: 25px !default; -$modal-border-radius: 10px !default; -$modal-gray-background: #f6f7f9 !default; - .modal-backdrop { background-color: $modal-overlay-color; diff --git a/apps/block_scout_web/assets/css/components/_modal_variables.scss b/apps/block_scout_web/assets/css/components/_modal_variables.scss new file mode 100644 index 0000000000..92e2a94a33 --- /dev/null +++ b/apps/block_scout_web/assets/css/components/_modal_variables.scss @@ -0,0 +1,5 @@ +$modal-overlay-color: rgba($primary, 0.9) !default; +$modal-horizontal-padding: 30px !default; +$modal-vertical-padding: 25px !default; +$modal-border-radius: 10px !default; +$modal-gray-background: #f6f7f9 !default; \ No newline at end of file diff --git a/apps/block_scout_web/assets/css/components/_stakes_variables.scss b/apps/block_scout_web/assets/css/components/_stakes_variables.scss new file mode 100644 index 0000000000..4c23ea421b --- /dev/null +++ b/apps/block_scout_web/assets/css/components/_stakes_variables.scss @@ -0,0 +1,2 @@ +$stakes-banned-background: #fff3f7 !default; +$stakes-banned-color: #ff7986 !default; \ No newline at end of file diff --git a/apps/block_scout_web/assets/css/components/_copy_icon.scss b/apps/block_scout_web/assets/css/components/stakes/_copy_icon.scss similarity index 100% rename from apps/block_scout_web/assets/css/components/_copy_icon.scss rename to apps/block_scout_web/assets/css/components/stakes/_copy_icon.scss diff --git a/apps/block_scout_web/assets/css/components/_modal_become_candidate.scss b/apps/block_scout_web/assets/css/components/stakes/_modal_become_candidate.scss similarity index 100% rename from apps/block_scout_web/assets/css/components/_modal_become_candidate.scss rename to apps/block_scout_web/assets/css/components/stakes/_modal_become_candidate.scss diff --git a/apps/block_scout_web/assets/css/components/_modal_bottom_disclaimer.scss b/apps/block_scout_web/assets/css/components/stakes/_modal_bottom_disclaimer.scss similarity index 100% rename from apps/block_scout_web/assets/css/components/_modal_bottom_disclaimer.scss rename to apps/block_scout_web/assets/css/components/stakes/_modal_bottom_disclaimer.scss diff --git a/apps/block_scout_web/assets/css/components/_modal_stake.scss b/apps/block_scout_web/assets/css/components/stakes/_modal_stake.scss similarity index 100% rename from apps/block_scout_web/assets/css/components/_modal_stake.scss rename to apps/block_scout_web/assets/css/components/stakes/_modal_stake.scss diff --git a/apps/block_scout_web/assets/css/components/_modal_validator_info.scss b/apps/block_scout_web/assets/css/components/stakes/_modal_validator_info.scss similarity index 100% rename from apps/block_scout_web/assets/css/components/_modal_validator_info.scss rename to apps/block_scout_web/assets/css/components/stakes/_modal_validator_info.scss diff --git a/apps/block_scout_web/assets/css/components/_progress_from_to.scss b/apps/block_scout_web/assets/css/components/stakes/_progress_from_to.scss similarity index 100% rename from apps/block_scout_web/assets/css/components/_progress_from_to.scss rename to apps/block_scout_web/assets/css/components/stakes/_progress_from_to.scss diff --git a/apps/block_scout_web/assets/css/components/_stakes.scss b/apps/block_scout_web/assets/css/components/stakes/_stakes.scss similarity index 96% rename from apps/block_scout_web/assets/css/components/_stakes.scss rename to apps/block_scout_web/assets/css/components/stakes/_stakes.scss index 87271bc983..c6335ec066 100644 --- a/apps/block_scout_web/assets/css/components/_stakes.scss +++ b/apps/block_scout_web/assets/css/components/stakes/_stakes.scss @@ -1,8 +1,6 @@ $stakes-dashboard-copy-icon-color: $copy-icon-color !default; $stakes-address-color: $primary !default; $stakes-control-color: $primary !default; -$stakes-banned-color: #ff7986 !default; -$stakes-banned-background: #fff3f7 !default; $stakes-stats-item-color: #fff !default; $stakes-stats-item-border-color: #fff !default; diff --git a/apps/block_scout_web/assets/css/components/_stakes_btn_remove_pool.scss b/apps/block_scout_web/assets/css/components/stakes/_stakes_btn_remove_pool.scss similarity index 100% rename from apps/block_scout_web/assets/css/components/_stakes_btn_remove_pool.scss rename to apps/block_scout_web/assets/css/components/stakes/_stakes_btn_remove_pool.scss diff --git a/apps/block_scout_web/assets/css/components/_stakes_empty_content.scss b/apps/block_scout_web/assets/css/components/stakes/_stakes_empty_content.scss similarity index 100% rename from apps/block_scout_web/assets/css/components/_stakes_empty_content.scss rename to apps/block_scout_web/assets/css/components/stakes/_stakes_empty_content.scss diff --git a/apps/block_scout_web/assets/css/components/_stakes_progress.scss b/apps/block_scout_web/assets/css/components/stakes/_stakes_progress.scss similarity index 100% rename from apps/block_scout_web/assets/css/components/_stakes_progress.scss rename to apps/block_scout_web/assets/css/components/stakes/_stakes_progress.scss diff --git a/apps/block_scout_web/assets/css/non-critical.scss b/apps/block_scout_web/assets/css/non-critical.scss new file mode 100644 index 0000000000..81d5bd2b09 --- /dev/null +++ b/apps/block_scout_web/assets/css/non-critical.scss @@ -0,0 +1,13 @@ +// Bootstrap Core CSS +@import "node_modules/bootstrap/scss/functions"; +@import "node_modules/bootstrap/scss/mixins"; + +@import "theme/variables"; + +@import "node_modules/bootstrap/scss/modal"; +@import "node_modules/bootstrap/scss/tooltip"; + +@import "components/qr-code"; +@import "components/modal_variables"; +@import "components/modal"; +@import "components/modal_status"; \ No newline at end of file diff --git a/apps/block_scout_web/assets/css/stakes.scss b/apps/block_scout_web/assets/css/stakes.scss new file mode 100644 index 0000000000..77ada07b46 --- /dev/null +++ b/apps/block_scout_web/assets/css/stakes.scss @@ -0,0 +1,20 @@ +@import "./mixins"; + +// Bootstrap Core CSS +@import "node_modules/bootstrap/scss/functions"; +@import "node_modules/bootstrap/scss/mixins"; + +@import "theme/variables"; + +@import "components/stakes_variables"; +@import "components/stakes/copy_icon"; +@import "components/stakes/stakes"; +@import "components/stakes/progress_from_to"; +@import "components/stakes/stakes_empty_content"; +@import "components/stakes/stakes_btn_remove_pool"; +@import "components/modal_variables"; +@import "components/stakes/stakes_progress"; +@import "components/stakes/modal_stake"; +@import "components/stakes/modal_become_candidate"; +@import "components/stakes/modal_validator_info"; +@import "components/stakes/modal_bottom_disclaimer"; \ No newline at end of file diff --git a/apps/block_scout_web/assets/css/theme/_base_variables.scss b/apps/block_scout_web/assets/css/theme/_base_variables.scss index 2238327bd4..b4cf443f05 100644 --- a/apps/block_scout_web/assets/css/theme/_base_variables.scss +++ b/apps/block_scout_web/assets/css/theme/_base_variables.scss @@ -359,7 +359,7 @@ $input-btn-padding-y: 0.375rem !default; $input-btn-padding-x: 0.75rem !default; $input-btn-line-height: $line-height-base !default; -$input-btn-focus-width: 0.2rem !default; +$input-btn-focus-width: 1px !default; $input-btn-focus-color: rgba($component-active-bg, 0.25) !default; $input-btn-focus-box-shadow: 0 0 0 $input-btn-focus-width $input-btn-focus-color !default; diff --git a/apps/block_scout_web/assets/css/theme/_dai_variables.scss b/apps/block_scout_web/assets/css/theme/_dai_variables.scss index 0c09660240..6722369c7f 100644 --- a/apps/block_scout_web/assets/css/theme/_dai_variables.scss +++ b/apps/block_scout_web/assets/css/theme/_dai_variables.scss @@ -38,6 +38,7 @@ $btn-line-bg: #fff; // button bg $btn-line-color: $secondary; // button border and font color && hover bg color $btn-copy-color: $secondary; // btn copy $btn-qr-color: $secondary; // btn qr-code +$btn-address-card-icon-color: $secondary; // btn address color //links & tile $tile-body-a-color: $secondary; diff --git a/apps/block_scout_web/assets/css/theme/_dark-theme.scss b/apps/block_scout_web/assets/css/theme/_dark-theme.scss index fe807aea60..dd1ee83d96 100644 --- a/apps/block_scout_web/assets/css/theme/_dark-theme.scss +++ b/apps/block_scout_web/assets/css/theme/_dark-theme.scss @@ -234,7 +234,7 @@ $labels-dark: #8a8dba; // header nav, labels } } - .btn-copy-icon, .btn-qr-icon { + .btn-copy-icon, .btn-qr-icon, .btn-address-card-icon { border-color: $dark-primary; path { fill: $dark-primary; @@ -578,9 +578,41 @@ $labels-dark: #8a8dba; // header nav, labels } } } - .verify-other-explorers-cell { - .exp-logo { - color: #333 !important; + + #explorersModal { + .modal-title { + color: #fff; + } + + .text-muted { + color: $labels-dark; + } + + .modal-footer { + border-top-color: darken($labels-dark, 30); + } + + .modal-content { + background-color: $dark-light-bg; + + .btn-primary { + background-color: $dark-primary; + border-color: $dark-primary; + &:hover { + background-color: $dark-primary; + border-color: $dark-primary; + } + } + } + + .verify-other-explorers-cell { + .exp-logo { + color: #fff; + } + } + + .close { + color: #fff; } } @@ -681,8 +713,69 @@ $labels-dark: #8a8dba; // header nav, labels border-right-color: #3f436b !important; } - // alert link + // 'text dark' label + .text-dark { + color: #fff; + } + + // validator info + #validatorModal { + .modal-title { + color: #fff; + } + + .text-muted { + color: $labels-dark; + } + + .modal-footer { + border-top-color: darken($labels-dark, 30); + } + + .modal-content { + background-color: $dark-light-bg; + + .btn-primary { + background-color: $dark-primary; + border-color: $dark-primary; + &:hover { + background-color: $dark-primary; + border-color: $dark-primary; + } + } + } + + .close { + color: #fff; + } + } + + // alerts .alert-link { - color: $dark-secondary; + color: $labels-dark; + } + + .alert-danger { + background-color: $dark-light; + border-color: $dark-light; + .alert-link { + color: $alert-danger-color; + } + } + + .tile .alert { + background: rgba(#000, .1); + } + + // primary buttons + .btn-full-primary, .button-primary { + background: $dark-primary; + border-color: $dark-primary; + color: #fff; + &:hover { + background: darken($dark-primary, 6); + border-color: darken($dark-primary, 6); + color: #fff; + } } } \ No newline at end of file diff --git a/apps/block_scout_web/assets/css/theme/_ethereum_classic_variables.scss b/apps/block_scout_web/assets/css/theme/_ethereum_classic_variables.scss index dff677d7cc..6b8d6d7f96 100644 --- a/apps/block_scout_web/assets/css/theme/_ethereum_classic_variables.scss +++ b/apps/block_scout_web/assets/css/theme/_ethereum_classic_variables.scss @@ -34,6 +34,7 @@ $btn-line-bg: #fff; // button bg $btn-line-color: $tertiary; // button border and font color && hover bg color $btn-copy-color: $tertiary; // btn copy $btn-qr-color: $tertiary; // btn qr-code +$btn-address-card-icon-color: $tertiary; // btn address color //links & tile $tile-body-a-color: $tertiary; diff --git a/apps/block_scout_web/assets/css/theme/_ethereum_variables.scss b/apps/block_scout_web/assets/css/theme/_ethereum_variables.scss index 0b5cac0c43..a06e0be93e 100644 --- a/apps/block_scout_web/assets/css/theme/_ethereum_variables.scss +++ b/apps/block_scout_web/assets/css/theme/_ethereum_variables.scss @@ -37,6 +37,7 @@ $btn-line-bg: #fff; // button bg $btn-line-color: $secondary; // button border and font color && hover bg color $btn-copy-color: $secondary; // btn copy $btn-qr-color: $secondary; // btn qr-code +$btn-address-card-icon-color: $secondary; // btn address color //links & tile $tile-body-a-color: $secondary; diff --git a/apps/block_scout_web/assets/css/theme/_goerli_variables.scss b/apps/block_scout_web/assets/css/theme/_goerli_variables.scss index 04f953b477..af57f2d1a2 100644 --- a/apps/block_scout_web/assets/css/theme/_goerli_variables.scss +++ b/apps/block_scout_web/assets/css/theme/_goerli_variables.scss @@ -43,6 +43,7 @@ $btn-line-bg: #fff; // button bg $btn-line-color: $sub-accent-color; // button border and font color && hover bg color $btn-copy-color: $sub-accent-color; // btn copy $btn-qr-color: $sub-accent-color; // btn qr-code +$btn-address-card-icon-color: $sub-accent-color; // btn address color //links & tile $tile-body-a-color: $sub-accent-color; diff --git a/apps/block_scout_web/assets/css/theme/_kovan_variables.scss b/apps/block_scout_web/assets/css/theme/_kovan_variables.scss index a4edc629d0..b47c3de0b2 100644 --- a/apps/block_scout_web/assets/css/theme/_kovan_variables.scss +++ b/apps/block_scout_web/assets/css/theme/_kovan_variables.scss @@ -38,6 +38,7 @@ $btn-line-bg: #fff; // button bg $btn-line-color: $tertiary; // button border and font color && hover bg color $btn-copy-color: $tertiary; // btn copy $btn-qr-color: $tertiary; // btn qr-code +$btn-address-card-icon-color: $tertiary; // btn address color //links & tile $tile-body-a-color: $tertiary; diff --git a/apps/block_scout_web/assets/css/theme/_lukso_variables.scss b/apps/block_scout_web/assets/css/theme/_lukso_variables.scss index a7b608bfa8..abfcc05472 100644 --- a/apps/block_scout_web/assets/css/theme/_lukso_variables.scss +++ b/apps/block_scout_web/assets/css/theme/_lukso_variables.scss @@ -44,6 +44,7 @@ $btn-line-bg: #fff; // button bg $btn-line-color: $primary; // button border and font color && hover bg color $btn-copy-color: $primary; // btn copy $btn-qr-color: $primary; // btn qr-code +$btn-address-card-icon-color: $primary; // btn address color // card $card-background-1: $primary; diff --git a/apps/block_scout_web/assets/css/theme/_neutral_variables.scss b/apps/block_scout_web/assets/css/theme/_neutral_variables.scss index 120a11c222..536ecdc105 100644 --- a/apps/block_scout_web/assets/css/theme/_neutral_variables.scss +++ b/apps/block_scout_web/assets/css/theme/_neutral_variables.scss @@ -40,6 +40,7 @@ $btn-line-bg: #fff; // button bg $btn-line-color: $primary; // button border and font color && hover bg color $btn-copy-color: $primary; // btn copy $btn-qr-color: $primary; // btn qr-code +$btn-address-card-icon-color: $primary; // btn address color //links & tile $tile-body-a-color: $primary; diff --git a/apps/block_scout_web/assets/css/theme/_poa_variables.scss b/apps/block_scout_web/assets/css/theme/_poa_variables.scss index 120a11c222..536ecdc105 100644 --- a/apps/block_scout_web/assets/css/theme/_poa_variables.scss +++ b/apps/block_scout_web/assets/css/theme/_poa_variables.scss @@ -40,6 +40,7 @@ $btn-line-bg: #fff; // button bg $btn-line-color: $primary; // button border and font color && hover bg color $btn-copy-color: $primary; // btn copy $btn-qr-color: $primary; // btn qr-code +$btn-address-card-icon-color: $primary; // btn address color //links & tile $tile-body-a-color: $primary; diff --git a/apps/block_scout_web/assets/css/theme/_rinkeby_variables.scss b/apps/block_scout_web/assets/css/theme/_rinkeby_variables.scss index 4fa700c50e..21388bb315 100644 --- a/apps/block_scout_web/assets/css/theme/_rinkeby_variables.scss +++ b/apps/block_scout_web/assets/css/theme/_rinkeby_variables.scss @@ -37,6 +37,7 @@ $btn-line-bg: #fff; // button bg $btn-line-color: $secondary; // button border and font color && hover bg color $btn-copy-color: $secondary; // btn copy $btn-qr-color: $secondary; // btn qr-code +$btn-address-card-icon-color: $secondary; // btn address color //links & tile $tile-body-a-color: $secondary; diff --git a/apps/block_scout_web/assets/css/theme/_ropsten_variables.scss b/apps/block_scout_web/assets/css/theme/_ropsten_variables.scss index 4fa700c50e..21388bb315 100644 --- a/apps/block_scout_web/assets/css/theme/_ropsten_variables.scss +++ b/apps/block_scout_web/assets/css/theme/_ropsten_variables.scss @@ -37,6 +37,7 @@ $btn-line-bg: #fff; // button bg $btn-line-color: $secondary; // button border and font color && hover bg color $btn-copy-color: $secondary; // btn copy $btn-qr-color: $secondary; // btn qr-code +$btn-address-card-icon-color: $secondary; // btn address color //links & tile $tile-body-a-color: $secondary; diff --git a/apps/block_scout_web/assets/css/theme/_rsk_variables.scss b/apps/block_scout_web/assets/css/theme/_rsk_variables.scss index d33996a89e..8d3bff31d2 100644 --- a/apps/block_scout_web/assets/css/theme/_rsk_variables.scss +++ b/apps/block_scout_web/assets/css/theme/_rsk_variables.scss @@ -38,6 +38,7 @@ $btn-line-bg: #fff; // button bg $btn-line-color: $secondary; // button border and font color && hover bg color $btn-copy-color: $secondary; // btn copy $btn-qr-color: $secondary; // btn qr-code +$btn-address-card-icon-color: $secondary; // btn address color // card $card-background-1: $secondary; diff --git a/apps/block_scout_web/assets/css/theme/_sokol_variables.scss b/apps/block_scout_web/assets/css/theme/_sokol_variables.scss index 8d479f397d..2860342f1e 100644 --- a/apps/block_scout_web/assets/css/theme/_sokol_variables.scss +++ b/apps/block_scout_web/assets/css/theme/_sokol_variables.scss @@ -49,6 +49,7 @@ $btn-line-bg: #fff; // button bg $btn-line-color: $sub-accent-color; // button border and font color && hover bg color $btn-copy-color: $sub-accent-color; // btn copy $btn-qr-color: $sub-accent-color; // btn qr-code +$btn-address-card-icon-color: $sub-accent-color; // btn address color //links & tile $tile-body-a-color: $sub-accent-color; diff --git a/apps/block_scout_web/assets/js/app.js b/apps/block_scout_web/assets/js/app.js index 89059dd306..a33dab821d 100644 --- a/apps/block_scout_web/assets/js/app.js +++ b/apps/block_scout_web/assets/js/app.js @@ -59,5 +59,6 @@ import './lib/async_listing_load' import './lib/tooltip' import './lib/modals' import './lib/try_api' +import './lib/try_eth_api' import './lib/card_tabs' import './lib/network_selector' diff --git a/apps/block_scout_web/assets/js/lib/try_eth_api.js b/apps/block_scout_web/assets/js/lib/try_eth_api.js new file mode 100644 index 0000000000..a3dd7b6f4e --- /dev/null +++ b/apps/block_scout_web/assets/js/lib/try_eth_api.js @@ -0,0 +1,70 @@ +import $ from 'jquery' + +function composeCurlCommand (data) { + return `curl -H "content-type: application/json" -X POST --data '${JSON.stringify(data)}'` +} + +function handleResponse (data, xhr, clickedButton) { + const module = clickedButton.attr('data-module') + const action = clickedButton.attr('data-action') + const curl = $(`[data-selector="${module}-${action}-curl"]`)[0] + const code = $(`[data-selector="${module}-${action}-server-response-code"]`)[0] + const body = $(`[data-selector="${module}-${action}-server-response-body"]`)[0] + + curl.innerHTML = composeCurlCommand(data) + code.innerHTML = xhr.status + body.innerHTML = JSON.stringify(xhr.responseJSON, undefined, 2) + $(`[data-selector="${module}-${action}-try-api-ui-result"]`).show() + $(`[data-selector="${module}-${action}-btn-try-api-clear"]`).show() + clickedButton.html(clickedButton.data('original-text')) + clickedButton.prop('disabled', false) +} + +function wrapJsonRpc (method, params) { + return { + id: 0, + jsonrpc: '2.0', + method: method, + params: params + } +} + +function parseInput (input) { + const type = $(input).attr('data-parameter-type') + const value = $(input).val() + + switch (type) { + case 'string': + return value + case 'json': + return JSON.parse(value) + default: + return value + } +} + +$('button[data-try-eth-api-ui-button-type="execute"]').click(event => { + const clickedButton = $(event.target) + const module = clickedButton.attr('data-module') + const action = clickedButton.attr('data-action') + const inputs = $(`input[data-selector="${module}-${action}-try-api-ui"]`) + const params = $.map(inputs, parseInput) + const formData = wrapJsonRpc(action, params) + console.log(formData) + const loadingText = ' Loading...' + + clickedButton.prop('disabled', true) + clickedButton.data('original-text', clickedButton.html()) + + if (clickedButton.html() !== loadingText) { + clickedButton.html(loadingText) + } + + $.ajax({ + url: '/api/eth_rpc', + type: 'POST', + data: JSON.stringify(formData), + dataType: 'json', + contentType: 'application/json; charset=utf-8' + }).then((_data, _status, xhr) => handleResponse(formData, xhr, clickedButton)) +}) diff --git a/apps/block_scout_web/assets/js/pages/address/logs.js b/apps/block_scout_web/assets/js/pages/address/logs.js index 5c9bed9da2..bf0c041b39 100644 --- a/apps/block_scout_web/assets/js/pages/address/logs.js +++ b/apps/block_scout_web/assets/js/pages/address/logs.js @@ -45,7 +45,7 @@ const elements = { }, '[data-search]': { render ($el, state) { - if (state.emptyResponse) { + if (state.emptyResponse && !state.isSearch) { return $el.hide() } diff --git a/apps/block_scout_web/assets/js/pages/stakes.js b/apps/block_scout_web/assets/js/pages/stakes.js new file mode 100644 index 0000000000..dd379d254f --- /dev/null +++ b/apps/block_scout_web/assets/js/pages/stakes.js @@ -0,0 +1 @@ +import '../../css/stakes.scss' diff --git a/apps/block_scout_web/assets/webpack.config.js b/apps/block_scout_web/assets/webpack.config.js index 05ac405ab0..4bc4862175 100644 --- a/apps/block_scout_web/assets/webpack.config.js +++ b/apps/block_scout_web/assets/webpack.config.js @@ -69,9 +69,13 @@ const awesompleteJs = { const appJs = { - entry: './js/app.js', + entry: { + app: './js/app.js', + stakes: './js/pages/stakes.js', + 'non-critical': './css/non-critical.scss', + }, output: { - filename: 'app.js', + filename: '[name].js', path: path.resolve(__dirname, '../priv/static/js') }, optimization: { @@ -120,7 +124,7 @@ const appJs = }, plugins: [ new MiniCssExtractPlugin({ - filename: '../css/app.css' + filename: '../css/[name].css' }), new CopyWebpackPlugin([{ from: 'static/', to: '../' }]), new ContextReplacementPlugin(/moment[\/\\]locale$/, /en/) diff --git a/apps/block_scout_web/lib/block_scout_web/templates/api_docs/_eth_rpc_item.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/api_docs/_eth_rpc_item.html.eex new file mode 100644 index 0000000000..7f342b4a16 --- /dev/null +++ b/apps/block_scout_web/lib/block_scout_web/templates/api_docs/_eth_rpc_item.html.eex @@ -0,0 +1,182 @@ +
<%= raw @info.notes %>
+ + curl -X POST --data '{"id":0,"jsonrpc":"2.0","method": "<%= @action %>", params: []}' + ++
<%= param.description %>
+ " + data-parameter-type='<%= param.type %>' + data-required='<%= if param.required, do: "true", else: "false" %>' + data-selector='<%= "eth-#{@action}-try-api-ui" %>' + type="text", + value='<%= param.default %>' + /> +<%= gettext "Response Body" %>
+successful operation+
Supported Method | -Notes | -Parameters example | -
---|---|---|
<%= method %> | -<%= Map.get(info, :notes, "N/A") %> | -<%= Map.get(info, :example, "N/A") %> | -