Skip to content

Commit

Permalink
Align buttons in margin trade dialog (#1497)
Browse files Browse the repository at this point in the history
* Align buttons in margin trade dialog

* [Portfolio] - fix #1555

Co-authored-by: soulBit <its.soulBit@gmail.com>
Co-authored-by: pietro-maximoff <pietro.maxim.official@protonmail.com>
Co-authored-by: Victor Creed <69458664+creed-victor@users.noreply.github.com>
  • Loading branch information
4 people authored Jul 27, 2021
1 parent 26403e1 commit 3dcd68d
Show file tree
Hide file tree
Showing 18 changed files with 40 additions and 34 deletions.
7 changes: 5 additions & 2 deletions src/app/components/Form/DialogButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,18 @@ export function DialogButton({
return (
<div className="tw-flex tw-justify-between tw-items-center tw-space-x-3">
<button
className={cn('tw-btn-dialog', className)}
className={cn('tw-btn-dialog tw-truncate', className)}
onClick={onConfirm}
{...props}
>
{confirmLabel}
</button>
{cancelLabel && onCancel && (
<button
className={cn('tw-btn-dialog tw-btn-dialog__secondary', className)}
className={cn(
'tw-btn-dialog tw-truncate tw-btn-dialog__secondary',
className,
)}
onClick={onCancel}
type="button"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ export function NotificationForm(props: Props) {
}
/> */}
<Dialog isOpen={showForm} onClose={onClickClose}>
<div className="tw-mw-320 tw-mx-auto">
<div className="tw-mw-340 tw-mx-auto">
<h1 className="tw-text-white tw-tracking-normal">
{t(translations.notificationFormContainer.dialog.title)}
</h1>
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/OptOutDialog/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default function OptOutDialog(props: OptOutProps) {
return (
<>
<Dialog isOpen={props.open} onClose={props.onClose}>
<div className="tw-mw-320 tw-mx-auto">
<div className="tw-mw-340 tw-mx-auto">
<h1 className="tw-mb-6 tw-text-white tw-text-center">
{t(translations.analyticsDialog.title)}
</h1>
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/UserAssets/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export function UserAssets() {
setTransack(false);
}}
>
<div className="tw-mw-320 tw-mx-auto">
<div className="tw-mw-340 tw-mx-auto">
<h1 className="tw-mb-6 tw-text-white tw-text-center">
{t(translations.common.maintenance)}
</h1>
Expand Down
23 changes: 13 additions & 10 deletions src/app/components/UserAssets/useVestedStaking_balanceOf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,6 @@ export function useVestedStaking_balanceOf(address: string) {
[address],
);

const babelFishVested = await contractReader.call<string>(
'lockedFund',
'getVestedBalance',
[address],
);

if (babelFishVested !== '0') {
setBabelFishVestedValue(babelFishVested);
}

if (adr1 !== ethGenesisAddress) {
const vested = await contractReader.call('staking', 'balanceOf', [
adr1,
Expand Down Expand Up @@ -86,6 +76,19 @@ export function useVestedStaking_balanceOf(address: string) {
setLMVestedValue(String(lmVested));
}

const adr5 = await contractReader.call('lockedFund', 'getVestedBalance', [
address,
]);

if (adr5 && adr5 !== '0') {
const babelFishVested = await contractReader.call<string>(
'lockedFund',
'getVestedBalance',
[adr5],
);
setBabelFishVestedValue(String(babelFishVested));
}

if (
adr1 === adr2 &&
adr2 === adr3 &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ export function LendingDialog({
return (
<>
<Dialog isOpen={props.showModal} onClose={() => props.onCloseModal()}>
<div className="tw-mw-320 tw-mx-auto">
<div className="tw-mw-340 tw-mx-auto">
<h1 className="tw-text-white tw-text-center tw-tracking-normal">
{t(modalTranslation.title)}
</h1>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export function AddLiquidityDialogV1({ pool, ...props }: Props) {
return (
<>
<Dialog isOpen={props.showModal} onClose={() => props.onCloseModal()}>
<div className="tw-mw-320 tw-mx-auto">
<div className="tw-mw-340 tw-mx-auto">
<h1 className="tw-text-white tw-text-center tw-tracking-normal">
{t(translations.liquidityMining.modals.deposit.title)}
</h1>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export function AddLiquidityDialog({ pool, ...props }: Props) {
return (
<>
<Dialog isOpen={props.showModal} onClose={() => props.onCloseModal()}>
<div className="tw-mw-320 tw-mx-auto">
<div className="tw-mw-340 tw-mx-auto">
<h1 className="tw-text-white tw-text-center tw-tracking-normal">
{t(translations.liquidityMining.modals.deposit.title)}
</h1>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export function PoolTransferDialog({ ...props }: Props) {
return (
<>
<Dialog isOpen={props.showModal} onClose={() => props.onCloseModal()}>
<div className="tw-mw-320 tw-mx-auto">
<div className="tw-mw-340 tw-mx-auto">
<h1 className="tw-mb-6 tw-text-white tw-text-center">
{t(translations.liquidity.PoolTransferDialog.title)}
</h1>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ export function RemoveLiquidityDialogV1({ pool, ...props }: Props) {
return (
<>
<Dialog isOpen={props.showModal} onClose={() => props.onCloseModal()}>
<div className="tw-mw-320 tw-mx-auto">
<div className="tw-mw-340 tw-mx-auto">
<h1 className="tw-text-white tw-text-center tw-tracking-normal">
{t(translations.liquidityMining.modals.withdraw.title)}
</h1>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export function RemoveLiquidityDialog({ pool, ...props }: Props) {
return (
<>
<Dialog isOpen={props.showModal} onClose={() => props.onCloseModal()}>
<div className="tw-mw-320 tw-mx-auto">
<div className="tw-mw-340 tw-mx-auto">
<h1 className="tw-text-white tw-text-center tw-tracking-normal">
{t(translations.liquidityMining.modals.withdraw.title)}
</h1>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export function AddToMarginDialog(props: Props) {
return (
<>
<Dialog isOpen={props.showModal} onClose={() => props.onCloseModal()}>
<div className="tw-mw-320 tw-mx-auto">
<div className="tw-mw-340 tw-mx-auto">
<h1 className="tw-mb-6 tw-text-white tw-text-center">
{t(translations.addToMargin.title)}
</h1>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export function ClosePositionDialog(props: Props) {
return (
<>
<Dialog isOpen={props.showModal} onClose={() => props.onCloseModal()}>
<div className="tw-mw-320 tw-mx-auto">
<div className="tw-mw-340 tw-mx-auto">
<h1 className="tw-mb-6 tw-text-white tw-text-center tw-tracking-normal">
{t(translations.closeTradingPositionHandler.title)}
</h1>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export function TradeDialog() {
isOpen={!!position}
onClose={() => dispatch(actions.closeTradingModal())}
>
<div className="tw-mw-320 tw-mx-auto">
<div className="tw-mw-340 tw-mx-auto">
<h1 className="tw-mb-6 tw-text-white tw-text-center">
{t(translations.marginTradePage.tradeDialog.title)}
</h1>
Expand Down Expand Up @@ -227,6 +227,7 @@ export function TradeDialog() {
disabled={openTradesLocked}
cancelLabel={t(translations.common.cancel)}
onCancel={() => dispatch(actions.closeTradingModal())}
className="tw-max-w-50"
/>
</div>
</Dialog>
Expand Down
4 changes: 2 additions & 2 deletions src/app/pages/MarginTradePage/components/TradeForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export function TradeForm() {
return (
<>
<div className="tw-trading-form-card tw-bg-black tw-rounded-3xl tw-p-12 tw-mx-auto xl:tw-mx-0">
<div className="tw-mw-320 tw-mx-auto">
<div className="tw-mw-340 tw-mx-auto">
<FormGroup
label={t(translations.marginTradePage.tradeForm.labels.pair)}
className="tw-mb-6"
Expand Down Expand Up @@ -146,7 +146,7 @@ export function TradeForm() {
)}
</div>
{!openTradesLocked && (
<div className="tw-flex tw-flex-row tw-items-center tw-justify-between tw-space-x-4 tw-mw-320 tw-mx-auto">
<div className="tw-flex tw-flex-row tw-items-center tw-justify-between tw-space-x-4 tw-mw-340 tw-mx-auto">
<Button
text={t(translations.marginTradePage.tradeForm.buttons.long)}
position={TradingPosition.LONG}
Expand Down
4 changes: 2 additions & 2 deletions src/app/pages/SpotTradingPage/components/TradeForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export function TradeForm() {
/>
)}
<div className="tw-trading-form-card spot-form tw-bg-black tw-rounded-3xl tw-p-12 tw-mx-auto xl:tw-mx-0">
<div className="tw-mw-320 tw-mx-auto">
<div className="tw-mw-340 tw-mx-auto">
<BuySell value={tradeType} onChange={setTradeType} />

<FormGroup
Expand Down Expand Up @@ -187,7 +187,7 @@ export function TradeForm() {
)}
</div>
{!spotLocked && (
<div className="tw-mw-320 tw-flex tw-flex-row tw-items-center tw-justify-between tw-space-x-4 tw-mx-auto">
<div className="tw-mw-340 tw-flex tw-flex-row tw-items-center tw-justify-between tw-space-x-4 tw-mx-auto">
<Button
text={t(
tradeType === TradingTypes.BUY
Expand Down
8 changes: 4 additions & 4 deletions src/styles/components.css
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@
width: 100%;
}

.tw-mw-320 {
.tw-mw-340 {
@apply tw-w-full;
max-width: 320px;
max-width: 340px;
}
/* staking */
.p-18 {
Expand Down Expand Up @@ -294,6 +294,6 @@
outline: none;
}

.tw-mw-320 {
max-width: 320px;
.tw-mw-340 {
max-width: 340px;
}
3 changes: 1 addition & 2 deletions src/styles/tailwindcss/components/inputs.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@layer components {
.tw-input-wrapper {
height: 2.5rem;
max-width:320px;
max-width: 340px;
@apply tw-bg-white tw-flex tw-flex-row tw-justify-center tw-items-center tw-space-x-4 tw-rounded;
@apply tw-font-semibold tw-font-body tw-text-black;
@apply tw-w-full;
Expand All @@ -16,7 +16,6 @@

.tw-input-label {
@apply tw-text-white;

}
.tw-input-append {
@apply tw-text-black;
Expand Down

0 comments on commit 3dcd68d

Please sign in to comment.