fix: 1644 edit order dialog default to existing price and change price label (#1695)

* fix: #1644 default to existing price and change label

* fix: #1644 fix formatting
This commit is contained in:
m.ray 2022-10-10 16:05:42 +01:00 committed by GitHub
parent 37ecb0d526
commit 4d8abeb2a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 2 deletions

View File

@ -40,7 +40,14 @@ export const OrderEditDialog = ({
register,
formState: { errors },
handleSubmit,
} = useForm<FormFields>();
} = useForm<FormFields>({
defaultValues: {
entryPrice: addDecimalsFormatNumber(
order.price,
order.market?.decimalPlaces ?? 0
),
},
});
const step = toDecimal(order.market?.decimalPlaces ?? 0);
@ -92,7 +99,7 @@ export const OrderEditDialog = ({
data-testid="edit-order"
className="w-1/2 mt-4"
>
<FormGroup label={t('Entry price')} labelFor="entryPrice">
<FormGroup label={t('Price')} labelFor="entryPrice">
<Input
type="number"
step={step}

View File

@ -9,6 +9,7 @@
"postinstall": "husky install && yarn tsc -b tools/executors/next && yarn tsc -b tools/executors/webpack",
"test:all": "nx run-many --all --target=test",
"build:all": "nx run-many --all --target=build",
"lint:all": "nx run-many --all --target=lint",
"vegacapsule": "vegacapsule network bootstrap --config-path=../frontend-monorepo/vegacapsule/config.hcl"
},
"engines": {