Skip to content

Commit

Permalink
Tom/feature/wallet buttons (#1346)
Browse files Browse the repository at this point in the history
* refactor: add tab props

* feature: add bridge button to assets table

* refactor: don't show buy button for wrapped token
  • Loading branch information
tomjeatt authored Jun 27, 2023
1 parent 8656b5b commit f3a7a12
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 26 deletions.
49 changes: 27 additions & 22 deletions src/pages/Transfer/TransferForms/TransferForms.tsx
Original file line number Diff line number Diff line change
@@ -1,30 +1,35 @@
import { Flex, Tabs, TabsItem } from '@/component-library';
import MainContainer from '@/parts/MainContainer';
import { useTabPageLocation } from '@/utils/hooks/use-tab-page-location';

import { CrossChainTransferForm, TransferForm } from './components';
import { StyledCard, StyledFormWrapper, StyledWrapper } from './TransferForms.styles';

const TransferForms = (): JSX.Element => (
<MainContainer>
<StyledWrapper>
<StyledCard gap='spacing2'>
<Flex direction='column' gap='spacing8'>
<Tabs size='large' fullWidth>
<TabsItem title='Transfer' key='transfer'>
<StyledFormWrapper>
<TransferForm />
</StyledFormWrapper>
</TabsItem>
<TabsItem title='Cross Chain Transfer' key='crossChainTransfer'>
<StyledFormWrapper>
<CrossChainTransferForm />
</StyledFormWrapper>
</TabsItem>
</Tabs>
</Flex>
</StyledCard>
</StyledWrapper>
</MainContainer>
);
const TransferForms = (): JSX.Element => {
const { tabsProps } = useTabPageLocation();

return (
<MainContainer>
<StyledWrapper>
<StyledCard gap='spacing2'>
<Flex direction='column' gap='spacing8'>
<Tabs {...tabsProps} size='large' fullWidth>
<TabsItem title='Transfer' key='transfer'>
<StyledFormWrapper>
<TransferForm />
</StyledFormWrapper>
</TabsItem>
<TabsItem title='Cross Chain Transfer' key='crossChainTransfer'>
<StyledFormWrapper>
<CrossChainTransferForm />
</StyledFormWrapper>
</TabsItem>
</Tabs>
</Flex>
</StyledCard>
</StyledWrapper>
</MainContainer>
);
};

export default TransferForms;
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,6 @@ const ActionsCell = ({
{t('redeem')}
</CTALink>
)}
{/* TODO: add when xcm re-vamp is added */}
{/* <CTALink {...commonCTAProps} to={PAGES.TRANSFER}>
{t('transfer')}
</CTALink> */}
{isPooledAsset && (
<CTALink
{...commonCTAProps}
Expand All @@ -106,6 +102,19 @@ const ActionsCell = ({
)}
</>
)}
{!isWrappedToken && (
<CTALink
{...commonCTAProps}
to={{
pathname: PAGES.TRANSFER,
search: queryString.stringify({
[QUERY_PARAMETERS.TAB]: 'crossChainTransfer'
})
}}
>
Bridge
</CTALink>
)}
</Flex>
</Flex>
);
Expand Down

2 comments on commit f3a7a12

@vercel
Copy link

@vercel vercel bot commented on f3a7a12 Jun 27, 2023

Choose a reason for hiding this comment

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

@vercel
Copy link

@vercel vercel bot commented on f3a7a12 Jun 27, 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.