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

feat: set ui for contract v2 address and fix address alignment #393

Merged
merged 2 commits into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
100 changes: 59 additions & 41 deletions packages/ui/components/IntegrationDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,34 @@
</div>
</div>
<div class="right">
<p class="title-address">
<p v-if="isContractVersion2" class="title-address">
{{ $t('data_feed_details.contract_address_title').toUpperCase() }}
</p>
<p v-else class="title-address">
{{ $t('data_feed_details.proxy_address').toUpperCase() }}
</p>
<a :href="urlProxyContract" target="_blank" class="contract-info">
<a
v-if="isContractVersion2"
:href="urlProxyContract"
target="_blank"
class="contract-info"
>
{{ proxyAddress }}
<font-awesome-icon class="icon" icon="external-link-alt" />
</a>
<p class="title-address">
{{ $t('data_feed_details.underlying_feed_contract').toUpperCase() }}
</p>
<a :href="urlUnderlyingContract" target="_blank" class="contract-info">
{{ feedAddress }}
<font-awesome-icon class="icon" icon="external-link-alt" />
</a>
<div v-else class="contract-addresses">
<a :href="urlProxyContract" target="_blank" class="contract-info">
{{ proxyAddress }}
<font-awesome-icon class="icon" icon="external-link-alt" />
</a>
<p class="title-address">
{{ $t('data_feed_details.underlying_feed_contract').toUpperCase() }}
</p>
<a :href="urlUnderlyingContract" target="_blank" class="contract-info">
{{ feedAddress }}
<font-awesome-icon class="icon" icon="external-link-alt" />
</a>
</div>
<p class="title-address">
{{ $t('data_feed_details.erc2362_asset_id').toUpperCase() }}
</p>
Expand All @@ -48,41 +62,37 @@
</div>
</template>

<script>
<script setup lang="ts">
import { urls } from '../constants'
export default {
props: {
network: {
type: String,
required: true,
},
proxyAddress: {
type: String,
required: true,
},
feedAddress: {
type: String,
required: true,
},
contractId: {
type: String,
required: true,
},
urlUnderlyingContract: {
type: String,
required: true,
},
urlProxyContract: {
type: String,
required: true,
},
const props = defineProps({
network: {
type: String,
required: true,
},
data() {
return {
urls,
}
proxyAddress: {
type: String,
required: true,
},
}
feedAddress: {
type: String,
required: true,
},
contractId: {
type: String,
required: true,
},
urlUnderlyingContract: {
type: String,
required: true,
},
urlProxyContract: {
type: String,
required: true,
},
})
const isContractVersion2: boolean = computed(
() => props.feedAddress === props.proxyAddress,
)
</script>

<style lang="scss" scoped>
Expand Down Expand Up @@ -129,6 +139,11 @@ export default {
word-break: break-all;
max-width: 400px;
}
.contract-addresses {
display: grid;
grid-template-columns: 1fr;
grid-gap: 8px;
}
.contract-info {
font-family:
Roboto Mono,
Expand All @@ -138,6 +153,9 @@ export default {
word-break: break-all;
margin-bottom: 8px;
cursor: pointer;
display: flex;
gap: 4px;
align-items: center;
}
.icon {
font-size: 10px;
Expand Down
3 changes: 3 additions & 0 deletions packages/ui/components/TransactionItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ export default {
Roboto Mono,
monospace;
transition: all 0.3 ease-in-out;
display: flex;
align-items: center;
gap: 4px;

&:hover {
opacity: 0.8;
Expand Down
1 change: 1 addition & 0 deletions packages/ui/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"recommended_for_testing": "Recommended for testing and upgradability",
"optimized_for_gas_cost": "Optimized for gas cost and decentralization",
"proxy_address": "Proxy address",
"contract_address_title": "Contract address",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"contract_address_title": "Contract address",
"contract_address_title": "Price Feeds Contract",

"underlying_feed_contract": "Underlying feed contract address",
"erc2362_asset_id": "ERC2362 asset ID",
"integration_details_description": "Witnet price feeds can be integrated into your own {0} contracts in two different ways:",
Expand Down
1 change: 1 addition & 0 deletions packages/ui/locales/es-ES.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"recommended_for_testing": "Recomendado para pruebas y actualizaciones",
"optimized_for_gas_cost": "Optimizado para el coste del gas y mayor descentralización",
"proxy_address": "Dirección proxy",
"contract_address_title": "Dirección del contrato",
"underlying_feed_contract": "Underlying feed contract address",
"erc2362_asset_id": "Identificador ERC2362",
"integration_details_description": "Los data feed de Witnet pueden ser integrados en tu propio contrato de {0} de dos formas diferentes:",
Expand Down
Loading