components APIs
- Header
- Button
- Layout
- Footer
- Text
- Box
- Card
- Table
- Loading
- Select
- Loader
- Toolbar
- Icon
- CodeInput
- BottomSheet
- InfoBlock
- LanguageToggle
- ProgressCircles
- Ripple
- Toggle
- Tag
- Input
- Paginator
- Filter
- AsyncSelect
- CatalogBigButton
- ReadMore
- ConditionalWrapper
- LastCheckedDisplay
- PriceLabel
- PageTitle
- CartTable
- CartFinalPriceTable
- LoadingSpin
- InfoModal
- ProductCard
- RecommendCoupon
- PriceVales
- NomalLayout
- Web3ReactManager
- Popups
- CurrencyInput
- TransactionErrorContent
- TransactionConfirmationModal
- ConfirmationModalContent
- DoubleCurrencyLogo
- CustomModal
- CurrencySearchModal
- CurrencyLogo
- NumericalInput
- Logo
- QuestionHelper
- ListLogo
- DataTable
- WalletModal
- CustomTable
- MinimalPositionCard
- RemoveLiquidityModal
- CustomTooltip
- ColoredSlider
- ToggleSwitch
- FormattedPriceImpact
- SettingsModal
- ConfirmSwapModal
- AdvancedSwapDetails
- AddressInput
- LineChart
- StakeSyrupModal
- AccountDetails
- BetaWarningBanner
- AreaChart
- ChartType
- TokensTable
- PairTable
- TopMovers
- BarChart
- TransactionsTable
- StakeQuickModal
- UnstakeQuickModal
- SyrupCard
- CustomMenu
- SearchInput
- CustomSwitch
- FarmCard
- BuyFiatModal
- MoonpayModal
- RewardSlider
- Swap
- AddLiquidity
- PoolFinderModal
- PoolPositionCard
- SwapTokenDetails
- SuperHeader
- GlobalStyles
- PrimaryButton
- SectionTitle
- Section
- AccentSection
- ChainSelection
- CoinSelection
- AddressSelection
- SendAction
- Buttons
- Content
- Particles
- IconButton
- NotSupported
- InputSearch
- RouteGuard
- SearchBar
- FileInput
- GovBanner
- AuthForm
- DomainDetails
- Subnav
- ColumnFilter
- ImportExport
- selectFilter
- TaggedArrayInput
- FacetFilter
- ButtonSingleLine
- TextMultiline
- ButtonSelect
- BottomSheetBehavior
- InfoButton
- BulletPointX
- BulletPointCheck
- Title
- LoadingIcon
- SelectFilterControls
- CORInputForm
- SdnInputForm
- Navbar
- HomeRoute
- AuthRoute
- DocumentDetails
- DocumentStepper
- AddGame
- Auth
- Effectiveness
- Export
- PokemonType
- Moves
- Member
- MoveSelector
- Type
- Natures
- Move
- PokeInfo
- Share
- Badges
- Status
- UpdateSW
- About
- Builder
- Calculator
- Changelog
- Import
- Pokestats
- Report
- Rules
- Settings
- Tracker
- DarkThemeProvider
- NotificationHandler
- Background
- Indicator
- StyledButton
- StyledText
- Illustration
- OnboardingSlider
- FlexList
- AppLayout
- ScrollableList
- Visualization
- DataSearch
- Region
- App
- CompareApiLegend
- CompareApiBreadcrumbs
- CompareApiLink
- CompareApiCard
- ExploreApiBreadcrumbs
- ExploreApiLink
- ExploreApiSearch
- ExploreApiConst
- ApiLoader
- RefreshButton
- Listing
- PriceModal
- ConfirmationModal
- Transition
- AutoComplete
- useInput
- Avatar
- Badge
- Breadcrumbs
- ButtonDropdown
- ButtonGroup
- Capacity
- Checkbox
- Code
- Collapse
- CssBaseline
- GeistProvider
- Description
- Display
- Divider
- Dot
- Drawer
- useModal
- Fieldset
- Grid
- Image
- Keyboard
- Link
- Modal
- Note
- Page
- Pagination
- Popover
- Progress
- Radio
- Rating
- Slider
- Snippet
- Spacer
- Spinner
- Tabs
- Textarea
- Tooltip
- Tree
- useBodyScroll
- useClasses
- useClickAway
- useClipboard
- useCurrentState
- useKeyboard
- KeyMod
- KeyCode
- useMediaQuery
- useTabs
- useToasts
- User
- useTheme
- Themes
- GeistUIThemes
- useAllThemes
- CollapsableDialog
- Map
- IPForm
- IPMenu
- Container
- Parallax
- Nav
- SEO
- BlogNav
- ExtensionCard
- MenuComp
Other Related APIs
components#SuperHeader TypeScript Examples
The following examples show how to use
components#SuperHeader.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Routes.tsx From frontend-v1 with GNU Affero General Public License v3.0 | 4 votes |
Routes: FC<Props> = () => {
const { showConfirmationScreen } = useDeposits();
const { error, provider, chainId } = useConnection();
const location = useLocation();
const sendState = useAppSelector((state) => state.send);
const { error: globalError, removeError } = useContext(ErrorContext);
const wrongNetworkSend =
provider &&
chainId &&
(error instanceof UnsupportedChainIdError ||
chainId !== sendState.currentlySelectedFromChain.chainId);
const wrongNetworkPool =
provider &&
(error instanceof UnsupportedChainIdError ||
chainId !== DEFAULT_TO_CHAIN_ID);
return (
<>
{showMigrationBanner && (
<Banner>
<div>
Across v2 transition is coming!{" "}
<a
href="https://medium.com/across-protocol/lps-migrate-liquidity-from-v1-to-v2-screenshots-and-faqs-8616150b3396"
target="_blank"
rel="noreferrer"
>
Read here
</a>{" "}
to learn how to migrate your pool liquidity from Across v1.
</div>
</Banner>
)}
{globalError && (
<SuperHeader>
<div>{globalError}</div>
<RemoveErrorSpan onClick={() => removeError()}>X</RemoveErrorSpan>
</SuperHeader>
)}
{wrongNetworkSend && location.pathname === "/" && (
<SuperHeader>
<div>
You are on an incorrect network. Please{" "}
<button
onClick={() =>
switchChain(
provider,
sendState.currentlySelectedFromChain.chainId
)
}
>
switch to{" "}
{CHAINS[sendState.currentlySelectedFromChain.chainId].name}
</button>
</div>
</SuperHeader>
)}
{wrongNetworkPool && location.pathname === "/pool" && (
<SuperHeader>
<div>
You are on an incorrect network. Please{" "}
<button onClick={() => switchChain(provider, DEFAULT_TO_CHAIN_ID)}>
switch to {CHAINS[DEFAULT_TO_CHAIN_ID].name}
</button>
</div>
</SuperHeader>
)}
<Header />
<Switch>
{!process.env.REACT_APP_HIDE_POOL ? (
<Route exact path="/pool" component={Pool} />
) : null}
<Route exact path="/about" component={About} />
<Route
exact
path="/"
component={showConfirmationScreen ? Confirmation : Send}
/>
</Switch>
</>
);
}