-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* config file in prerequisites * move product hub to prerequisites * featured earn products * featured multiply products * top borrow products * top tokens * tokens and use cases * custom modules * remove comments
- Loading branch information
1 parent
6f873dd
commit e390e74
Showing
56 changed files
with
966 additions
and
1,192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import { BaseNetworkNames, networksByName } from 'blockchain/networks' | ||
import { NavigationMenuDropdownContentListItem } from 'components/navigation/NavigationMenuDropdownContentListItem' | ||
import type { SwapWidgetChangeAction } from 'features/swapWidget/SwapWidgetChange' | ||
import { SWAP_WIDGET_CHANGE_SUBJECT } from 'features/swapWidget/SwapWidgetChange' | ||
import { useConnection } from 'features/web3OnBoard/useConnection' | ||
import { uiChanges } from 'helpers/uiChanges' | ||
import { useTranslation } from 'next-i18next' | ||
import type { FC } from 'react' | ||
import React from 'react' | ||
import { bridge } from 'theme/icons' | ||
import { Box, Flex, Image } from 'theme-ui' | ||
|
||
export const NavigationModuleBridge: FC = () => { | ||
const { t } = useTranslation() | ||
|
||
const { connect } = useConnection() | ||
|
||
return ( | ||
<NavigationMenuDropdownContentListItem | ||
title={t('nav.bridge')} | ||
description={ | ||
<> | ||
{t('nav.bridge-description')} | ||
<Flex | ||
as="ul" | ||
sx={{ | ||
mt: '14px', | ||
ml: 0, | ||
p: 0, | ||
listStyle: 'none', | ||
columnGap: '14px', | ||
}} | ||
> | ||
{[BaseNetworkNames.Ethereum, BaseNetworkNames.Optimism, BaseNetworkNames.Arbitrum].map( | ||
(network) => ( | ||
<Box as="li" key={network}> | ||
<Image | ||
src={networksByName[network].icon} | ||
width={20} | ||
sx={{ verticalAlign: 'bottom' }} | ||
/> | ||
</Box> | ||
), | ||
)} | ||
</Flex> | ||
</> | ||
} | ||
icon={{ | ||
position: 'global', | ||
icon: bridge, | ||
}} | ||
onClick={() => { | ||
connect() | ||
uiChanges.publish<SwapWidgetChangeAction>(SWAP_WIDGET_CHANGE_SUBJECT, { | ||
type: 'open', | ||
variant: 'bridge', | ||
}) | ||
}} | ||
/> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { NavigationMenuDropdownContentListItem } from 'components/navigation/NavigationMenuDropdownContentListItem' | ||
import type { SwapWidgetChangeAction } from 'features/swapWidget/SwapWidgetChange' | ||
import { SWAP_WIDGET_CHANGE_SUBJECT } from 'features/swapWidget/SwapWidgetChange' | ||
import { useConnection } from 'features/web3OnBoard/useConnection' | ||
import { uiChanges } from 'helpers/uiChanges' | ||
import { useTranslation } from 'next-i18next' | ||
import type { FC } from 'react' | ||
import React from 'react' | ||
import { exchange } from 'theme/icons' | ||
|
||
export const NavigationModuleSwap: FC = () => { | ||
const { t } = useTranslation() | ||
|
||
const { connect } = useConnection() | ||
|
||
return ( | ||
<NavigationMenuDropdownContentListItem | ||
title={t('nav.swap')} | ||
description={t('nav.swap-description')} | ||
icon={{ | ||
position: 'global', | ||
icon: exchange, | ||
}} | ||
onClick={() => { | ||
connect() | ||
uiChanges.publish<SwapWidgetChangeAction>(SWAP_WIDGET_CHANGE_SUBJECT, { | ||
type: 'open', | ||
variant: 'swap', | ||
}) | ||
}} | ||
/> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.