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#ExploreApiConst TypeScript Examples
The following examples show how to use
components#ExploreApiConst.
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: ExploreApiConst.stories.tsx From substrate-api-explorer with Apache License 2.0 | 6 votes |
storiesOf('COMPONENTS|ExploreApiConst', module).add('default', () => {
const nameKnob = text('name', 'bar', 'props')
const pathKnob = text('path', 'api.query.foo.bar', 'props')
const typeKnob = text('type', 'number', 'props')
const descriptionKnob = text(
'description',
'This is the description.',
'props'
)
const valueKnob = text('value', '123', 'props')
return (
<div style={{ maxWidth: 800, padding: '24px' }}>
<ExploreApiConst
name={nameKnob}
path={pathKnob}
type={typeKnob}
description={descriptionKnob}
value={valueKnob}
/>
</div>
)
})
Example #2
Source File: Subcategory.tsx From substrate-api-explorer with Apache License 2.0 | 5 votes |
Subcategory = ({ api, match }: Props) => {
const { category, subcategory } = match.params
return (
<S.Wrapper>
<S.Title>
<S.CategoryName>
<div>
<strong>{subcategory}</strong>
<span>
Available {category === 'consts' ? 'consts' : 'methods'}:
</span>
</div>
</S.CategoryName>
<ExploreApiBreadcrumbs match={match} />
</S.Title>
{/* We have to disable ESLint here because it doesn't
play nicely with Prettier */}
{/* eslint-disable indent */}
{_isEmpty(api.description[category]?.categories[subcategory]?.methods) ? (
<S.Empty>There's nothing in here ?</S.Empty>
) : (
Object.entries(
api.description[category]?.categories[subcategory]?.methods
)
.sort((a: [string, Method], b: [string, Method]) => {
return a[0] < b[0] ? -1 : 1
})
.map((item: [string, Method], idx) =>
category === 'consts' ? (
<ExploreApiConst
key={`exploreApi-const-${idx}`}
name={item[0]}
path={`api.consts.${subcategory}.${item[0]}`}
type={item[1].type}
description={item[1].description}
value={JSON.stringify(
api.promise[category][subcategory][item[0]]
)}
/>
) : (
<ExploreApiLink
key={`exploreApi-subcategory-${idx}`}
to={`${match.url}/${item[0]}`}
name={item[0]}
params={item[1].params}
description={item[1].description}
/>
)
)
)}
{/* eslint-enable indent */}
</S.Wrapper>
)
}