Skip to content

Commit

Permalink
fixes for contract-creation-form
Browse files Browse the repository at this point in the history
  • Loading branch information
Yehor Podporinov authored and Yehor Podporinov committed Jun 5, 2024
1 parent 1b45a9c commit b26ff3a
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 59 deletions.
13 changes: 13 additions & 0 deletions src/forms/ContractCreationForm/components/ArbitrumStep.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,15 @@
<h5 class="arbitrum-step__settings-title">
{{ $t(`${I18N_KEY_PREFIX}.settings.title`) }}
</h5>
<p class="general-step__settings-description">
{{
$t(`${I18N_KEY_PREFIX}.settings.description`, {
token:
form.arbitrumConfig.tokenSymbol ||
$t(`${I18N_KEY_PREFIX}.settings.default-token`),
})
}}
</p>
<div class="arbitrum-step__settings-fields">
<input-field
:model-value="form.arbitrumConfig.settings.tokenInAddress"
Expand Down Expand Up @@ -195,6 +204,10 @@ const emitSettingsField = (
@include body-2-semi-bold;
}
.general-step__settings-description {
margin-top: toRem(8);
}
.arbitrum-step__settings-fields {
margin-top: toRem(20);
display: grid;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,13 @@ watch(

<style lang="scss" scoped>
.group-builder__fields {
margin-top: toRem(32);
margin-top: toRem(16);
display: grid;
grid-gap: toRem(40);
grid-gap: toRem(16);
}
.group-builder__build-btn {
margin: toRem(-24) 0 0 auto;
margin-left: auto;
@include body-3-semi-bold;
}
Expand Down
30 changes: 4 additions & 26 deletions src/forms/ContractCreationForm/components/EthereumStep/index.vue
Original file line number Diff line number Diff line change
@@ -1,28 +1,6 @@
<template>
<div class="ethereum-step">
<div class="ethereum-step__fields">
<input-field
:model-value="form.ethereumConfig.tokenName"
:label="$t(`${I18N_KEY_PREFIX}.token-name-label`)"
:placeholder="$t(`${I18N_KEY_PREFIX}.token-name-placeholder`)"
:error-message="
formValidation.getFieldErrorMessage('ethereumConfig.tokenName')
"
:disabled="isSubmitting"
@blur="formValidation.touchField('ethereumConfig.tokenName')"
@update:model-value="emitRootField('tokenName', $event)"
/>
<input-field
:model-value="form.ethereumConfig.tokenSymbol"
:label="$t(`${I18N_KEY_PREFIX}.token-symbol-label`)"
:placeholder="$t(`${I18N_KEY_PREFIX}.token-symbol-placeholder`)"
:error-message="
formValidation.getFieldErrorMessage('ethereumConfig.tokenSymbol')
"
:disabled="isSubmitting"
@blur="formValidation.touchField('ethereumConfig.tokenSymbol')"
@update:model-value="emitRootField('tokenSymbol', $event)"
/>
<input-field
:model-value="form.ethereumConfig.adminContractAddress"
:label="$t(`${I18N_KEY_PREFIX}.admin-contract-address-label`)"
Expand All @@ -49,7 +27,7 @@
<div class="ethereum-step__divider" />
<div class="ethereum-step__groups">
<h5 class="ethereum-step__group-title">
{{ `GROUP #${form.ethereumConfig.groups.length}` }}
{{ `Group #${form.ethereumConfig.groups.length}` }}
</h5>
<p class="ethereum-step__group-instruction">
{{ $t(`${I18N_KEY_PREFIX}.group-instruction`) }}
Expand Down Expand Up @@ -198,15 +176,15 @@ const removeGroup = (idx: number) => {
}
.ethereum-step__groups {
margin-top: toRem(40);
margin-top: toRem(16);
}
.ethereum-step__group-title {
@include body-2-semi-bold;
}
.ethereum-step__group-instruction {
margin-top: toRem(20);
margin-top: toRem(8);
}
.ethereum-step__groups-dashboard {
Expand All @@ -219,7 +197,7 @@ const removeGroup = (idx: number) => {
.ethereum-step__groups-list-wrp {
position: relative;
overflow: auto;
margin-top: toRem(58);
margin-top: toRem(42);
&::-webkit-scrollbar {
height: 0;
Expand Down
6 changes: 1 addition & 5 deletions src/forms/ContractCreationForm/components/GeneralStep.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,7 @@ const emitRootField = (
max-width: toRem(560);
}
.general-step__instruction {
@include body-2-regular;
}
.general-step .general-step__project-name {
margin-top: toRem(30);
margin-top: toRem(20);
}
</style>
4 changes: 0 additions & 4 deletions src/forms/ContractCreationForm/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@ const form = useStorage<Form>(storageKey.value, {
},
},
ethereumConfig: {
tokenName: '',
tokenSymbol: '',
adminContractAddress: '',
isUpgradeable: true,
groups: [],
Expand Down Expand Up @@ -137,8 +135,6 @@ const formValidation = useFormValidation(
}),
...(form.value.stepId === STEP_IDS.ethereum && {
ethereumConfig: {
tokenName: { required },
tokenSymbol: { required },
adminContractAddress: { required, address },
// groups validation is delegated to GroupBuilder.vue
},
Expand Down
2 changes: 0 additions & 2 deletions src/forms/ContractCreationForm/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ export type EthereumConfigGroup = {
}

export type EthereumConfig = {
tokenName: string
tokenSymbol: string
adminContractAddress: string
isUpgradeable: boolean
groups: EthereumConfigGroup[]
Expand Down
36 changes: 17 additions & 19 deletions src/localization/resources/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,34 +22,32 @@
"project-name-placeholder": "Project name"
},
"arbitrum-step": {
"token-name-label": "Lorem ipsum dolor sit amet consectetur. Montes sapien ipsum ipsum adipiscing amet ac purus pellentesque.",
"token-name-label": "The name of the token for your protocol.",
"token-name-placeholder": "Token name",
"token-symbol-label": "Lorem ipsum dolor sit amet consectetur. Montes sapien ipsum ipsum adipiscing amet ac purus pellentesque.",
"token-symbol-label": "The symbol of the token for your protocol.",
"token-symbol-placeholder": "Token symbol",
"admin-contract-address-label": "Lorem ipsum dolor sit amet consectetur. Montes sapien ipsum ipsum adipiscing amet ac purus pellentesque.",
"admin-contract-address-label": "Specify the address of the protocol administrator. The administrator will be able to change the settings after deployment on the networks.",
"admin-contract-address-placeholder": "Contracts administrator address",
"is-upgradeable-label": "Keep upgreadability?",
"admin-contract-address-placeholder": "Contract administrator's address",
"settings": {
"default-token": "Your token",
"title":"Uniswap settings",
"token-in-address-label": "Token In",
"token-in-address-placeholder": "Enter address",
"token-out-address-label": "Token Out",
"token-out-address-placeholder": "Enter address",
"first-swap-fee-label": "First swap deposit token Uniswap fee (%)",
"first-swap-fee-placeholder": "Enter Fee",
"second-swap-fee-label": "Second swap reward token Uniswap fee (%)",
"second-swap-fee-placeholder": "Enter Fee"
"description": "This section configures the parameters for exchanging yield for the project token.\nBy default, the exchange for the project token is done in 2 swaps. For example wstETH -> wETH and wETH -> {token}.",
"token-in-address-label": "The address of the token on which yield is generated, on the Arbitrum network (e.g. wstETH).",
"token-in-address-placeholder": "Yield token",
"token-out-address-label": "The yield token will be exchanged for the current token. For example (wETH).",
"token-out-address-placeholder": "Intermediate token",
"first-swap-fee-label": "Uniswap fee to swap yield token to intermediate token. It is specified as a percentage, usually it is 0.3%.",
"first-swap-fee-placeholder": "Swap fee for yield token",
"second-swap-fee-label": "Uniswap fee to swap intermediate token to project token. It is specified as a percentage, usually it is 0.3%.",
"second-swap-fee-placeholder": "Swap fee for project token"
}
},
"ethereum-step": {
"token-name-label": "Lorem ipsum dolor sit amet consectetur. Montes sapien ipsum ipsum adipiscing amet ac purus pellentesque.",
"token-name-placeholder": "Token name",
"token-symbol-label": "Lorem ipsum dolor sit amet consectetur. Montes sapien ipsum ipsum adipiscing amet ac purus pellentesque.",
"token-symbol-placeholder": "Token symbol",
"admin-contract-address-label": "Lorem ipsum dolor sit amet consectetur. Montes sapien ipsum ipsum adipiscing amet ac purus pellentesque.",
"admin-contract-address-placeholder": "Contract administrator's address",
"admin-contract-address-label": "Specify the address of the protocol administrator. The administrator will be able to change the settings after deployment on the networks.",
"admin-contract-address-placeholder": "Contracts administrator address",
"is-upgradeable-label": "Keep upgreadability?",
"group-instruction": "Lorem ipsum dolor sit amet consectetur. Nullam tempus sed turpis sed ut ornare egestas morbi neque.",
"group-instruction": "Add the new distribution group to your protocol.",
"group-builder": {
"is-public-label": "Is Public",
"name-placeholder": "Group name",
Expand Down

0 comments on commit b26ff3a

Please sign in to comment.