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#ExploreApiSearch TypeScript Examples
The following examples show how to use
components#ExploreApiSearch.
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: Main.tsx From substrate-api-explorer with Apache License 2.0 | 6 votes |
Main = ({ api, match }: Props) => {
const location = useLocation()
return (
<S.Wrapper>
<S.Title>
<S.CategoryName>{api.url}</S.CategoryName>
<S.Search>
<ExploreApiSearch focusOnMount={location?.state?.fromSearch} />
</S.Search>
</S.Title>
{_isEmpty(api.description) ? (
<S.Empty>There's nothing in here ?</S.Empty>
) : (
Object.keys(api.description)
.sort()
.map((item, idx) => (
<ExploreApiLink
key={`exploreApi-category-${idx}`}
to={`${match.url}/${item}`}
name={item}
description={api.description[item].description}
/>
))
)}
</S.Wrapper>
)
}
Example #2
Source File: ExploreApiSearch.stories.tsx From substrate-api-explorer with Apache License 2.0 | 6 votes |
storiesOf('COMPONENTS|ExploreApiSearch', module).add('default', () => {
const focusOnMountKnob = boolean('focusOnMount', true, 'props')
const queryKnob = text('query', 'Default value', 'props')
return (
<div style={{ padding: '24px' }}>
<ExploreApiSearch
focusOnMount={focusOnMountKnob}
query={queryKnob}
storybookDemo
/>
</div>
)
})
Example #3
Source File: Search.tsx From substrate-api-explorer with Apache License 2.0 | 5 votes |
Search = ({ match }: Props) => {
const api = useSelector(apiSelector)
const { searchQuery } = match.params
const [foundItems, setFoundItems] = useState<[string, string][]>([])
const handleSearch = () => {
const regex = new RegExp(
'^(?=.*' +
decodeURIComponent(searchQuery)
.trim()
.split(' ')
.join(')(?=.*') +
').*$',
'gi'
)
const foundItems = api.current.search.filter(([path, description]) => {
return regex.test(path + description)
})
setFoundItems(foundItems)
}
useEffect(handleSearch, [searchQuery])
return (
<S.Wrapper>
<S.Title>
<S.CategoryName>Search API</S.CategoryName>
<S.Search>
<ExploreApiSearch focusOnMount query={searchQuery} />
</S.Search>
</S.Title>
{_isEmpty(foundItems) ? (
<S.Empty>Nothing was found ?</S.Empty>
) : (
foundItems.sort().map((item, idx) => {
const link = item[0].split('.')
return (
<ExploreApiLink
key={`searchResult-${idx}`}
to={{
pathname: `/explore-api/${link[1]}/${link[2]}/${link[3]}`,
state: { routeName: 'Search', search: searchQuery }
}}
name={item[0]}
description={item[1]}
/>
)
})
)}
</S.Wrapper>
)
}