-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* kebab-case in template in app.vue * renamed address predicator -> address utils * added common addresses tab in address utils * added common-addresses page * added random address --------- Co-authored-by: Yehor Podporinov <[email protected]>
- Loading branch information
1 parent
cd75cd9
commit a09a138
Showing
11 changed files
with
111 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<template> | ||
<form class="common-addresses-form" @submit.prevent> | ||
<div class="common-addresses-form__input"> | ||
<h3>{{ $t('common-addresses-form.input-title') }}</h3> | ||
<input-field | ||
v-for="(_, key) in form" | ||
:key="key" | ||
readonly | ||
:label="$t(`common-addresses-form.${key}-label`)" | ||
:model-value="form[key]" | ||
> | ||
<template #nodeLeft> | ||
<app-copy :value="form[key]" /> | ||
<button | ||
v-if="key === 'randomAddress'" | ||
@click="form.randomAddress = generateRandomAddress()" | ||
> | ||
<app-icon | ||
class="common-addresses-form__btn-icon" | ||
:name="$icons.refresh" | ||
/> | ||
</button> | ||
</template> | ||
</input-field> | ||
</div> | ||
</form> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { AppCopy, AppIcon } from '#components' | ||
import { InputField } from '@/fields' | ||
import { Wallet } from 'ethers' | ||
import { onMounted, reactive } from 'vue' | ||
const generateRandomAddress = (): string => Wallet.createRandom().address | ||
const form = reactive({ | ||
zeroAddress: '0x0000000000000000000000000000000000000000', | ||
allFsAddress: '0xFFfFfFffFFfffFFfFFfFFFFFffFFFffffFfFFFfF', | ||
allEsAddress: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE', | ||
randomAddress: '', | ||
}) | ||
onMounted(() => { | ||
form.randomAddress = generateRandomAddress() | ||
}) | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
.common-addresses-form { | ||
@include solidity-tools-form; | ||
} | ||
.common-addresses-form__input { | ||
@include solidity-tools-form-part; | ||
} | ||
.common-addresses-form .common-addresses-form__btn-icon { | ||
height: toRem(16); | ||
width: toRem(16); | ||
color: var(--primary-main); | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<template> | ||
<common-addresses-form /> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { CommonAddressesForm } from '@/forms' | ||
</script> |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters