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#Type TypeScript Examples
The following examples show how to use
components#Type.
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: Move.tsx From nuzlocke with BSD 3-Clause "New" or "Revised" License | 6 votes |
function Move({ moveDetail, showStatus }: MoveProps): JSX.Element {
return (
<div className={styles.move} style={{ backgroundColor: `${TYPE_COLOR[moveDetail.type]}90` }}>
<Type hideName type={moveDetail.type} />
<span>{moveDetail.name}</span>
{showStatus && (
<img
alt="move status"
src={CATEGORY_COLOR[moveDetail.category]}
title={moveDetail.category}
/>
)}
</div>
);
}
Example #2
Source File: PokemonType.tsx From nuzlocke with BSD 3-Clause "New" or "Revised" License | 6 votes |
function PokemonType({ pokemon }: PokemonTypeProps): JSX.Element {
const selectedGame = useStore(
useCallback((state) => state.selectedGame, []),
shallow
);
return (
<div className={styles.container}>
{pokemon.previousType && Number(selectedGame?.value) < FAIRY_GEN ? (
<>
<Type type={pokemon?.previousType} />
{!!pokemon?.previousDualType && <Type type={pokemon?.previousDualType} />}
</>
) : (
<>
<Type type={pokemon?.type} />
{!!pokemon?.dualtype && <Type type={pokemon?.dualtype} />}
</>
)}
</div>
);
}
Example #3
Source File: Effectiveness.tsx From nuzlocke with BSD 3-Clause "New" or "Revised" License | 5 votes |
Effectiveness = React.memo(function Effectiveness() {
const { t } = useTranslation('common');
const typeModal = useStore((state) => state.typeModal);
const closeTypeModal = useStore((state) => state.closeTypeModal);
const panes = Object.entries(EFFECTIVENESS)?.reduce((newPanes, effectEntry) => {
if (!!typeModal && !!effectEntry[1][typeModal]) {
newPanes.push({
menuItem: effectEntry[0],
render: () => (
<Tab.Pane>
<div className={styles.container}>
{!!typeModal &&
Object.entries(effectEntry[1][typeModal])?.reduce((effects, entry) => {
if (entry[1]?.length > 0) {
effects.push(
<div key={`${effectEntry[0]}-${entry[0]}`}>
<h4>{t(entry[0])}:</h4>
<div className={styles.list}>
{entry[1]?.map((value) => {
return (
<Type key={`${effectEntry[0]}-${entry[0]}-${value}`} type={value} />
);
})}
</div>
</div>
);
}
return effects;
}, [])}
</div>
</Tab.Pane>
),
});
}
return newPanes;
}, []);
return (
<Modal open={!!typeModal}>
<Modal.Content className={styles.content}>
<h3>
<Type type={typeModal} />
</h3>
<Tab panes={panes} />
</Modal.Content>
<Modal.Actions>
<Button data-testid="effect-close" onClick={closeTypeModal}>
{t('cancel')}
</Button>
</Modal.Actions>
</Modal>
);
})