b078fc9aad
* chore: change tab panel background and spacing * chore: prevent tabs shiting on click, bg tweak * chore: adjust chrome layout/spacing * chore: fix horizontal alignment when accordion chevron rotates * chore: adjusting bold levels and making market name pink on light theme * chore: changing white theme header to black background * chore: re-ordering bottom tabs * chore: tweaking font sizes * chore: adjusting dropdown button hover colour * chore: colour tweaks for accessibility, plus orderbook column widths * Remove redundant style Removed 'bg-white' left by error. * Setting header text to white * chore: alterative fix to prevent tabs moving * chore: fixing header font colours * chore: adding padding to orderbook * chore: preventing modal close icon from moving on focus * chore: remove inner shadow from selectbox * chore: adding padding to orderbook * chore: preventing @ sign from moving when changing order type * chore: fix background colour on smaller responsive view * chore: fix truncated market header on smaller responsive view * chore: reorder tabs in smaller responsive view to match standard view * fix: fix broken test
52 lines
1.3 KiB
TypeScript
52 lines
1.3 KiB
TypeScript
import { FormGroup, Input } from '@vegaprotocol/ui-toolkit';
|
|
import { t } from '@vegaprotocol/react-helpers';
|
|
import { validateSize } from '@vegaprotocol/orders';
|
|
import type { DealTicketAmountProps } from './deal-ticket-amount';
|
|
|
|
export type DealTicketMarketAmountProps = Omit<
|
|
DealTicketAmountProps,
|
|
'orderType'
|
|
>;
|
|
|
|
export const DealTicketMarketAmount = ({
|
|
register,
|
|
price,
|
|
step,
|
|
quoteName,
|
|
}: DealTicketMarketAmountProps) => {
|
|
return (
|
|
<div className="flex items-center gap-8">
|
|
<div className="flex-1">
|
|
<FormGroup label={t('Amount')} labelFor="input-order-size-market">
|
|
<Input
|
|
id="input-order-size-market"
|
|
className="w-full"
|
|
type="number"
|
|
step={step}
|
|
min={step}
|
|
data-testid="order-size"
|
|
{...register('size', {
|
|
required: true,
|
|
min: step,
|
|
validate: validateSize(step),
|
|
})}
|
|
/>
|
|
</FormGroup>
|
|
</div>
|
|
<div className="pt-4 text-black dark:text-white">@</div>
|
|
<div
|
|
className="flex-1 pt-4 text-black dark:text-white"
|
|
data-testid="last-price"
|
|
>
|
|
{price && quoteName ? (
|
|
<>
|
|
~{price} {quoteName}
|
|
</>
|
|
) : (
|
|
'-'
|
|
)}
|
|
</div>
|
|
</div>
|
|
);
|
|
};
|