Skip to content

Commit

Permalink
fix mobile + added copy to clip by line
Browse files Browse the repository at this point in the history
  • Loading branch information
Viterbo committed May 29, 2024
1 parent f900c42 commit bd3c5cf
Showing 1 changed file with 25 additions and 3 deletions.
28 changes: 25 additions & 3 deletions src/components/Transaction/TransactionInputViewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,14 @@ onMounted(() => {
initView();
});
const copied = ref(false);
const copyToClipboard = (row_value: string) => {
navigator.clipboard.writeText(row_value);
copied.value = true;
setTimeout(() => {
copied.value = false;
}, 2000);
};
</script>

Expand Down Expand Up @@ -192,11 +200,19 @@ onMounted(() => {
<q-td key="type" :props="props" class="c-transaction-input-viewer__table-cell">
{{ props.row ? props.row.type : '' }}
</q-td>
<q-td key="value" :props="props" class="c-transaction-input-viewer__table-cell c-transaction-input-viewer__table-cell--value">
<q-td
key="value"
:props="props"
class="c-transaction-input-viewer__table-cell c-transaction-input-viewer__table-cell--value"
@click="copyToClipboard(props.row.value)"
>
<div class="c-transaction-input-viewer__table-cell-value">
{{ props.row ? props.row.value : '' }}
<q-tooltip>{{ props.row ? props.row.value : '' }}</q-tooltip>
</div>
<q-tooltip>
<q-icon v-if="copied" class="fas fa-check" />
{{ copied ? $t('components.copied') : $t('components.copy_to_clipboard') }}
</q-tooltip>
</q-td>
</q-tr>
</template>
Expand Down Expand Up @@ -242,8 +258,14 @@ onMounted(() => {
}
&-cell {
&--value {
cursor: pointer;
}
&-value {
white-space: normal;
// solamente para resoluciones desktop
@media (min-width: 1024px) {
white-space: normal;
}
}
}
&-header-cell {
Expand Down

0 comments on commit bd3c5cf

Please sign in to comment.