diff --git a/src/assets/icons/remix.png b/src/assets/icons/remix.png new file mode 100644 index 00000000..77197378 Binary files /dev/null and b/src/assets/icons/remix.png differ diff --git a/src/assets/svg/link.svg b/src/assets/svg/link.svg new file mode 100644 index 00000000..a7bb7622 --- /dev/null +++ b/src/assets/svg/link.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/src/components/ContractCode.vue b/src/components/ContractCode.vue index 90f55686..1a294509 100644 --- a/src/components/ContractCode.vue +++ b/src/components/ContractCode.vue @@ -12,7 +12,7 @@

Contract Source

- + @@ -144,6 +144,16 @@ export default { const result = this.result || {} const { constructorArguments: decoded, encodedConstructorArguments: encoded } = result return (encoded || decoded) ? { encoded, decoded } : undefined + }, + remixLink () { + const address = this.data.address + + // backend url format: without protocol and trailing slash + // const backend = process.env.WS_URL // Staging behind VPN -> Remix cannot reach it + const backend = 'mock-backend.netlify.app/.netlify/functions/index' // TODO: Update with the correct backend once QA is done + const link = `https://remix.ethereum.org/?address=${address}&blockscout=${backend}` + + return link } }, methods: { @@ -159,28 +169,5 @@ export default { } } -// + diff --git a/src/components/RemixLink.vue b/src/components/RemixLink.vue new file mode 100644 index 00000000..8de1ae87 --- /dev/null +++ b/src/components/RemixLink.vue @@ -0,0 +1,44 @@ + + + + + diff --git a/src/components/Search/CtrlSearch.vue b/src/components/Search/CtrlSearch.vue index 59c0bc35..02e74400 100644 --- a/src/components/Search/CtrlSearch.vue +++ b/src/components/Search/CtrlSearch.vue @@ -39,7 +39,8 @@ + @click="gotoResult($event, i)" + > {{ result.name || result.value }} @@ -92,7 +93,7 @@ export default { 'fetchSearch' ]), formatValue (value) { - return value.toString().replaceAll(',', '') + return value.toString().replaceAll(',', '').trim() }, btnClear () { this.clear() @@ -121,8 +122,8 @@ export default { this.selectResult(0) const value = event.target.value this.value = value - this.emit(event, type, value) - this.emit(event, 'change', value) + this.emit(event, type, value.trim()) + this.emit(event, 'change', value.trim()) }, emit (event, type, value) { type = type || event.type @@ -230,3 +231,12 @@ export default { } } + + diff --git a/src/components/Search/SearchBox.vue b/src/components/Search/SearchBox.vue index 07536052..0065a645 100644 --- a/src/components/Search/SearchBox.vue +++ b/src/components/Search/SearchBox.vue @@ -88,7 +88,7 @@ export default { }, onInput ({ event, value }) { this.clearRequests() - if (!value || value.length < 2) return + if (!value) return this.setValue(value) this.fetchSearch({ value }) }, diff --git a/src/components/controls/CtrlBigText.vue b/src/components/controls/CtrlBigText.vue index 0dbba93d..d9fd3524 100644 --- a/src/components/controls/CtrlBigText.vue +++ b/src/components/controls/CtrlBigText.vue @@ -5,6 +5,7 @@ strong.subtitle {{title}} copy-button.button(v-bind='{value,css,title:copyTitle}') download-button.button(v-if='fileType' v-bind='{fileName,fileType,value,css, title:downloadTitle}') + remix-link(v-if='remixLink' :remixLink='remixLink') .big-text(:style='style') slot .content(v-if='!hasSlots') {{value}} @@ -12,11 +13,14 @@