Skip to content

Commit

Permalink
Remove promo banner
Browse files Browse the repository at this point in the history
  • Loading branch information
samchuk-vlad committed Mar 4, 2024
1 parent b6b9a49 commit 4c4204f
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 43 deletions.
20 changes: 10 additions & 10 deletions src/components/transfer/configs/custom/HydraAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,26 +326,26 @@ const createBalanceStorages = (api: AnyApi) => {
Storage.create<DeriveBalancesAll>({
api,
path: 'derive.balances.all',
params: [address],
params: [ address ],
}),
assets: (tokenId: number, address: string) =>
Storage.create<any>({
api,
path: 'query.tokens.accounts',
params: [address, tokenId],
params: [ address, tokenId ],
}),
}
}

class HydradxBalanceAdapter extends BalanceAdapter {
private storages: ReturnType<typeof createBalanceStorages>

constructor({ api, chain, tokens }: BalanceAdapterConfigs) {
constructor ({ api, chain, tokens }: BalanceAdapterConfigs) {
super({ api, chain, tokens })
this.storages = createBalanceStorages(api)
}

public subscribeBalance(
public subscribeBalance (
tokenName: string,
address: string
): Observable<BalanceData> {
Expand Down Expand Up @@ -391,7 +391,7 @@ class HydradxBalanceAdapter extends BalanceAdapter {
class BaseHydradxAdapter extends BaseCrossChainAdapter {
private balanceAdapter?: HydradxBalanceAdapter

public async init(api: AnyApi) {
public async init (api: AnyApi) {
this.api = api

await api.isReady
Expand All @@ -403,7 +403,7 @@ class BaseHydradxAdapter extends BaseCrossChainAdapter {
})
}

public subscribeTokenBalance(
public subscribeTokenBalance (
token: string,
address: string
): Observable<BalanceData> {
Expand All @@ -414,7 +414,7 @@ class BaseHydradxAdapter extends BaseCrossChainAdapter {
return this.balanceAdapter.subscribeBalance(token, address)
}

public subscribeMaxInput(
public subscribeMaxInput (
token: string,
address: string,
to: ChainId
Expand Down Expand Up @@ -453,7 +453,7 @@ class BaseHydradxAdapter extends BaseCrossChainAdapter {
)
}

public createTx(
public createTx (
params: TransferParams
):
| SubmittableExtrinsic<'promise', ISubmittableResult>
Expand Down Expand Up @@ -523,13 +523,13 @@ class BaseHydradxAdapter extends BaseCrossChainAdapter {
}

export class BasiliskAdapter extends BaseHydradxAdapter {
constructor() {
constructor () {
super(chains.basilisk, basiliskRouteConfigs, basiliskTokensConfig)
}
}

export class HydraDxAdapter extends BaseHydradxAdapter {
constructor() {
constructor () {
super(chains.hydradx, hydradxRoutersConfig, hydradxTokensConfig)
}
}
2 changes: 1 addition & 1 deletion src/components/transfer/configs/custom/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { isEthereumAddress } from '@polkadot/util-crypto'
import { AnyApi } from '@acala-network/sdk-core'
import { checkMessageVersionIsV3 } from '@polkawallet/bridge/utils/check-message-version'
import { ExtendedToken } from '@polkawallet/bridge'
import { BN } from '@polkadot/util';
import { BN } from '@polkadot/util'
export type AddressType = 'substract' | 'ethereum'

export const getValidDestAddrType = (
Expand Down
75 changes: 43 additions & 32 deletions src/components/utils/PageContainer.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { useEffect, FC, useMemo } from 'react'
import {
getAddressFromStorage } from '../utils/index'
import React, { useEffect, FC } from 'react'
import { getAddressFromStorage } from '../utils/index'
import { PageContent } from './PageWrapper'
import {
useIsSignedIn,
Expand All @@ -18,8 +17,10 @@ const AccountInfo = dynamic(() => import('../homePage/AccountInfo'), {
ssr: false,
})
const Footer = dynamic(() => import('../footer/Footer'), { ssr: false })
const OnlySearch = dynamic(() => import('../onlySearch/OnlySearch'), { ssr: false })
const PromoBanner = dynamic(import('./banners/PromoBanner/index'), { ssr: false })
const OnlySearch = dynamic(() => import('../onlySearch/OnlySearch'), {
ssr: false,
})
// const PromoBanner = dynamic(import('./banners/PromoBanner/index'), { ssr: false })

type PageContainerProps = {
isHomePage?: boolean
Expand Down Expand Up @@ -60,14 +61,17 @@ const PageContainer: FC<PageContainerProps> = ({ children, isHomePage }) => {
}
}, [ addressFromStorage, isSignIn ])

const banner = useMemo(() => <PromoBanner />, [])

if (isEmptyArray(parsedAddressFromUrl) && (!isServerSide && !isSignIn)) return <>
<div className='layout-wrapper'>
<OnlySearch />
</div>
<Footer />
</>
// const banner = useMemo(() => <PromoBanner />, [])

if (isEmptyArray(parsedAddressFromUrl) && !isServerSide && !isSignIn)
return (
<>
<div className='layout-wrapper'>
<OnlySearch />
</div>
<Footer />
</>
)

if (isEmptyArray(parsedAddressFromUrl) && !isServerSide && !isSignIn)
return (
Expand All @@ -79,25 +83,32 @@ const PageContainer: FC<PageContainerProps> = ({ children, isHomePage }) => {
</>
)

return <>
<div className='layout-wrapper'>
<PageContent>
{!isValid && !isServerSide && asPath !== '/' && !asPath.includes('#')
? <NoData description='Address is not valid' />
: <>
{isHomePage && banner}
<AccountInfo
addresses={addresses}
addressFromStorage={addressFromStorage}
size={isMobile ? 60 : 90}
isHomePage={isHomePage}
/>
{children}
</>}
</PageContent>
</div>
<Footer />
</>
return (
<>
<div className='layout-wrapper'>
<PageContent>
{!isValid &&
!isServerSide &&
asPath !== '/' &&
!asPath.includes('#') ? (
<NoData description='Address is not valid' />
) : (
<>
{/* {isHomePage && banner} */}
<AccountInfo
addresses={addresses}
addressFromStorage={addressFromStorage}
size={isMobile ? 60 : 90}
isHomePage={isHomePage}
/>
{children}
</>
)}
</PageContent>
</div>
<Footer />
</>
)
}

export default PageContainer

0 comments on commit 4c4204f

Please sign in to comment.