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
- react#useState
- @material-ui/core#Button
- @material-ui/core#Typography
- @material-ui/core#Box
- @material-ui/core#ButtonGroup
- @material-ui/core#Grid
- @material-ui/core#useMediaQuery
- @material-ui/core/styles#makeStyles
- @material-ui/core/styles#useTheme
- components#QuestionHelper
- components#SettingsModal
- components#Swap
- hooks/Tokens#useCurrency
components#AddLiquidity TypeScript Examples
The following examples show how to use
components#AddLiquidity.
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: SwapSection.tsx From interface-v2 with GNU General Public License v3.0 | 5 votes |
SwapSection: React.FC = () => {
const classes = useStyles();
const { palette, breakpoints } = useTheme();
const mobileWindowSize = useMediaQuery(breakpoints.down('sm'));
const [tabIndex, setTabIndex] = useState(SWAP_TAB);
return (
<>
<Box className={classes.buttonGroup}>
<ButtonGroup>
<Button
className={tabIndex === SWAP_TAB ? 'active' : ''}
onClick={() => setTabIndex(SWAP_TAB)}
>
Swap
</Button>
<Button
className={tabIndex === LIQUIDITY_TAB ? 'active' : ''}
onClick={() => setTabIndex(LIQUIDITY_TAB)}
>
Liquidity
</Button>
</ButtonGroup>
</Box>
<Box className={classes.swapContainer}>
<Grid container spacing={mobileWindowSize ? 0 : 8} alignItems='center'>
<Grid item sm={12} md={6}>
{tabIndex === SWAP_TAB ? (
<Swap currencyBg={palette.background.paper} />
) : (
<AddLiquidity currencyBg={palette.background.paper} />
)}
</Grid>
<Grid item sm={12} md={6} className={classes.swapInfo}>
<Typography variant='h4'>
{tabIndex === SWAP_TAB
? 'Swap tokens at near-zero gas fees'
: 'Let your crypto work for you'}
</Typography>
<Typography variant='body1' style={{ marginTop: '20px' }}>
{tabIndex === SWAP_TAB
? 'Deposit your Liquidity Provider tokens to receive Rewards in $QUICK on top of LP Fees.'
: 'Provide Liquidity and earn 0.25% fee on all trades proportional to your share of the pool. Earn additional rewards by depositing your LP Tokens in Rewards Pools.'}
</Typography>
</Grid>
</Grid>
</Box>
</>
);
}
Example #2
Source File: SupplyLiquidity.tsx From interface-v2 with GNU General Public License v3.0 | 5 votes |
SupplyLiquidity: React.FC = () => {
const classes = useStyles();
const { palette } = useTheme();
const [openSettingsModal, setOpenSettingsModal] = useState(false);
const parsedQuery = useParsedQueryString();
const qCurrency0 = useCurrency(
parsedQuery && parsedQuery.currency0
? (parsedQuery.currency0 as string)
: undefined,
);
const qCurrency1 = useCurrency(
parsedQuery && parsedQuery.currency1
? (parsedQuery.currency1 as string)
: undefined,
);
return (
<>
{openSettingsModal && (
<SettingsModal
open={openSettingsModal}
onClose={() => setOpenSettingsModal(false)}
/>
)}
<Box display='flex' justifyContent='space-between' alignItems='center'>
<Typography variant='body1' style={{ fontWeight: 600 }}>
Supply Liquidity
</Typography>
<Box display='flex' alignItems='center'>
<Box className={classes.headingItem}>
<QuestionHelper
size={24}
color={palette.text.secondary}
text='When you add liquidity, you are given pool tokens representing your position. These tokens automatically earn fees proportional to your share of the pool, and can be redeemed at any time.'
/>
</Box>
<Box className={classes.headingItem}>
<SettingsIcon onClick={() => setOpenSettingsModal(true)} />
</Box>
</Box>
</Box>
<Box mt={2.5}>
<AddLiquidity
currency0={qCurrency0 ?? undefined}
currency1={qCurrency1 ?? undefined}
/>
</Box>
</>
);
}