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#CompareApiLink TypeScript Examples
The following examples show how to use
components#CompareApiLink.
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: Category.tsx From substrate-api-explorer with Apache License 2.0 | 6 votes |
Category = ({ api, apiDiff, match }: Props) => {
const { category } = match.params
return (
<S.Wrapper>
<S.Title>
<S.CategoryName>{category}</S.CategoryName>
<CompareApiBreadcrumbs apiName={api.compare.url} match={match} />
</S.Title>
{_isEmpty(api.compare.description[category]) ? (
<S.Empty>There's nothing in here ?</S.Empty>
) : (
Object.entries(api.compare.description[category].categories)
.sort((a: [string, Method], b: [string, Method]) => {
return a[0] < b[0] ? -1 : 1
})
.map((item: [string, Method], idx) => {
const added = !!apiDiff.added[category]?.categories[item[0]]
const deleted = !!apiDiff.deleted[category]?.categories[item[0]]
const updated = !!apiDiff.updated[category]?.categories[item[0]]
const isNew =
added && !api.current.description[category]?.categories[item[0]]
return (
(added || deleted || updated) && (
<CompareApiLink
key={`compareApi-subcategory-${idx}`}
to={`${match.url}/${item[0]}`}
name={item[0]}
description={item[1].description}
states={{ added, deleted, updated, isNew }}
/>
)
)
})
)}
</S.Wrapper>
)
}
Example #2
Source File: Main.tsx From substrate-api-explorer with Apache License 2.0 | 6 votes |
Main = ({ api, apiDiff, match }: Props) => (
<S.Wrapper>
{_isEmpty(api.compare.description) ? (
<S.Empty>There's nothing in here ?</S.Empty>
) : (
Object.keys(api.compare.description)
.sort()
.map((item, idx) => {
const added = !!apiDiff.added[item]
const deleted = !!apiDiff.deleted[item]
const updated = !!apiDiff.updated[item]
const isNew = added && !api.current.description[item]
return (
(added || deleted || updated) && (
<CompareApiLink
key={`compareApi-category-${idx}`}
to={`${match.url}/${item}`}
name={item}
description={api.compare.description[item].description}
states={{ added, deleted, updated, isNew }}
/>
)
)
})
)}
</S.Wrapper>
)
Example #3
Source File: CompareApiLink.stories.tsx From substrate-api-explorer with Apache License 2.0 | 6 votes |
storiesOf('COMPONENTS|CompareApiLink', module)
.addDecorator(story => (
<MemoryRouter initialEntries={['/']}>{story()}</MemoryRouter>
))
.add('default', () => {
const nameKnob = text('name', 'fooBar', 'props')
const descriptionKnob = text(
'description',
'This is the description',
'props'
)
const addedKnob = boolean('states.added', true, 'props')
const deletedKnob = boolean('states.deleted', true, 'props')
const updatedKnob = boolean('states.updated', true, 'props')
return (
<div style={{ maxWidth: 800, padding: '24px' }}>
<CompareApiLink
name={nameKnob}
description={descriptionKnob}
states={{
added: addedKnob,
deleted: deletedKnob,
updated: updatedKnob
}}
/>
</div>
)
})