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#Move TypeScript Examples
The following examples show how to use
components#Move.
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: Moves.tsx From nuzlocke with BSD 3-Clause "New" or "Revised" License | 6 votes |
function Moves({ moves = [], showStatus = false }: MovesProps): JSX.Element {
return (
<div className={styles.moves}>
{moves?.map((move, i) => {
const moveDetail = MOVEMAP.get(move);
return (
!!moveDetail && (
<Move key={`move-${move}-${i + 1}`} moveDetail={moveDetail} showStatus={showStatus} />
)
);
})}
</div>
);
}
Example #2
Source File: MoveSelector.tsx From nuzlocke with BSD 3-Clause "New" or "Revised" License | 4 votes |
function MoveSelector({
currentMoveId,
handleMove,
hideGen,
limitGen,
}: MoveSelectorProps): JSX.Element {
const { t } = useTranslation('common');
const [open, setOpen] = useState(false);
const values = useFilter();
const itemSize = useRemtoPx(2.857);
const selectedGame = useStore(useCallback((state) => state.selectedGame, []));
const isSplit = !PHYS_SPEC_SPLIT.includes(selectedGame?.value);
const currentMove = MOVEMAP.get(currentMoveId);
const filteredMoves = MOVES.filter(
(m) =>
m.name.toUpperCase().includes(values.search) &&
(values.gens.length > 0 ? values.gens.includes(m.gen) : true) &&
(limitGen ? m.gen <= limitGen : true) &&
(values.types.length > 0 ? values.types.includes(m.type) : true)
);
const handleClick = (moveId: number) => {
handleMove(moveId);
setOpen(false);
};
const handleClear = (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {
e.preventDefault();
e.stopPropagation();
handleMove(null);
};
const renderRow: React.FC<RowProps> = ({ index, style }) => {
const move = filteredMoves[index];
return (
<div style={style}>
<div
className={styles.row}
data-testid={`move-${move.name}`}
onClick={() => handleClick(move.id)}
role="presentation"
>
<Move moveDetail={move} showStatus={isSplit} />
</div>
</div>
);
};
return (
<Modal
open={open}
trigger={
currentMoveId ? (
<div onClick={() => setOpen(true)} role="presentation" className={styles.currentMove}>
<Move moveDetail={currentMove} showStatus={isSplit} />
<Button
basic
className={styles.trash}
compact
icon="trash"
name="trash"
onClick={handleClear}
/>
</div>
) : (
<div className={styles.selector} onClick={() => setOpen(true)} role="presentation">
<b>{t('select_move')}</b> <Icon name="hand pointer outline" />
</div>
)
}
>
<Modal.Content className={styles.content} scrolling>
<div data-testid="move-selector-wrapper">
<Filter hideGen={hideGen} values={values} />
</div>
{/* @ts-ignore */}
<FixedSizeList
height={400}
itemCount={filteredMoves.length}
itemSize={itemSize}
width="100%"
>
{renderRow}
</FixedSizeList>
</Modal.Content>
<Modal.Actions>
<Button onClick={() => setOpen(false)}>{t('cancel')}</Button>
</Modal.Actions>
</Modal>
);
}