Skip to content

Commit

Permalink
fix: UI styling bugs (#1371)
Browse files Browse the repository at this point in the history
* fix: change broken gradient id ref

* refactor: add opacity value to navigation separator

* fix: update padding

* fix: border opacity

* fix: use transaction details component

* refactor: change how padding is set
  • Loading branch information
tomjeatt authored Jun 28, 2023
1 parent 7a8db34 commit 06b0ca4
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 35 deletions.
2 changes: 1 addition & 1 deletion src/assets/img/exchanges/acala-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 1 addition & 2 deletions src/component-library/Select/Select.style.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ const StyledTriggerValue = styled(Span)<StyledTriggerValueProps>`

const StyledList = styled(List)`
overflow: auto;
padding: 0 ${theme.dialog.medium.body.paddingX} ${theme.dialog.medium.body.paddingY}
${theme.dialog.medium.body.paddingX};
padding: 0 ${theme.dialog.medium.body.paddingX} ${theme.dialog.medium.body.paddingX};
`;

const StyledChevronDown = styled(ChevronDown)`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const InterlayDefaultContainedButton = React.forwardRef<Ref, Props>(

'border',
'border-black',
'border-opacity-25',
'border-opacity-10',
'font-medium',

disabledOrPending
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
import styled from 'styled-components';

import { ArrowRightCircle } from '@/assets/icons';
import { Dl, Flex, theme } from '@/component-library';
import { Flex, theme } from '@/component-library';

import { ChainSelect } from '../ChainSelect';

const StyledDl = styled(Dl)`
background-color: ${theme.card.bg.secondary};
padding: ${theme.spacing.spacing4};
font-size: ${theme.text.xs};
border-radius: ${theme.rounded.rg};
`;

const StyledArrowRightCircle = styled(ArrowRightCircle)`
transform: rotate(90deg);
align-self: center;
Expand Down Expand Up @@ -39,4 +32,4 @@ const StyledSourceChainSelect = styled(ChainSelect)`
}
`;

export { ChainSelectSection, StyledArrowRightCircle, StyledDl, StyledSourceChainSelect };
export { ChainSelectSection, StyledArrowRightCircle, StyledSourceChainSelect };
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,15 @@ import { ChangeEventHandler, Key, useCallback, useEffect, useState } from 'react
import { useTranslation } from 'react-i18next';

import { convertMonetaryAmountToValueInUSD, newSafeMonetaryAmount } from '@/common/utils/utils';
import { Dd, DlGroup, Dt, Flex, LoadingSpinner, TokenInput } from '@/component-library';
import { AccountSelect, AuthCTA } from '@/components';
import { Flex, LoadingSpinner, TokenInput } from '@/component-library';
import {
AccountSelect,
AuthCTA,
TransactionDetails,
TransactionDetailsDd,
TransactionDetailsDt,
TransactionDetailsGroup
} from '@/components';
import {
CROSS_CHAIN_TRANSFER_AMOUNT_FIELD,
CROSS_CHAIN_TRANSFER_FROM_FIELD,
Expand All @@ -30,12 +37,7 @@ import { Transaction, useTransaction } from '@/utils/hooks/transaction';
import useAccountId from '@/utils/hooks/use-account-id';

import { ChainSelect } from '../ChainSelect';
import {
ChainSelectSection,
StyledArrowRightCircle,
StyledDl,
StyledSourceChainSelect
} from './CrossChainTransferForm.styles';
import { ChainSelectSection, StyledArrowRightCircle, StyledSourceChainSelect } from './CrossChainTransferForm.styles';

const CrossChainTransferForm = (): JSX.Element => {
const [destinationChains, setDestinationChains] = useState<Chains>([]);
Expand Down Expand Up @@ -249,20 +251,20 @@ const CrossChainTransferForm = (): JSX.Element => {
onChange: handleDestinationAccountChange
})}
/>
<StyledDl direction='column' gap='spacing2'>
<DlGroup justifyContent='space-between'>
<Dt size='xs' color='primary'>
<TransactionDetails>
<TransactionDetailsGroup>
<TransactionDetailsDt size='xs' color='primary'>
Origin chain transfer fee
</Dt>
<Dd size='xs'>{currentToken?.originFee}</Dd>
</DlGroup>
<DlGroup justifyContent='space-between'>
<Dt size='xs' color='primary'>
Destination chain transfer fee estimate
</Dt>
<Dd size='xs'>{`${currentToken?.destFee.toString()} ${currentToken?.value}`}</Dd>
</DlGroup>
</StyledDl>
</TransactionDetailsDt>
<TransactionDetailsDd size='xs'>{currentToken?.originFee}</TransactionDetailsDd>
</TransactionDetailsGroup>
<TransactionDetailsGroup>
<TransactionDetailsDt>Destination chain transfer fee estimate</TransactionDetailsDt>
<TransactionDetailsDd size='xs'>{`${currentToken?.destFee.toString()} ${
currentToken?.value
}`}</TransactionDetailsDd>
</TransactionDetailsGroup>
</TransactionDetails>
<AuthCTA size='large' type='submit' disabled={isCTADisabled} loading={transaction.isLoading}>
{isCTADisabled ? 'Enter transfer amount' : t('transfer')}
</AuthCTA>
Expand Down
2 changes: 1 addition & 1 deletion src/parts/Sidebar/SidebarContent/Navigation/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ const Navigation = ({
<nav className={clsx('px-2', 'space-y-1', { 'flex-1': !onSmallScreen }, className)} {...rest}>
{PRIMARY_NAVIGATION_ITEMS.map((navigationItem) => {
if (navigationItem.separator) {
return <Hr2 key={navigationItem.name} />;
return <Hr2 className='opacity-10' key={navigationItem.name} />;
}

if (navigationItem.hidden) {
Expand Down

1 comment on commit 06b0ca4

@vercel
Copy link

@vercel vercel bot commented on 06b0ca4 Jun 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.