|
9 | 9 | type ToastComponentProps, |
10 | 10 | } from 'heroui-native'; |
11 | 11 | import { useCallback, useRef, useState } from 'react'; |
12 | | -import { TextInput, View } from 'react-native'; |
| 12 | +import { Platform, TextInput, View } from 'react-native'; |
13 | 13 | import { withUniwind } from 'uniwind'; |
14 | 14 | import type { UsageVariant } from '../../../components/component-presentation/types'; |
15 | 15 | import { UsageVariantFlatList } from '../../../components/component-presentation/usage-variant-flatlist'; |
@@ -524,7 +524,7 @@ const CustomToastsContent = () => { |
524 | 524 |
|
525 | 525 | // ------------------------------------------------------------------------------ |
526 | 526 |
|
527 | | -const TOAST_VARIANTS: UsageVariant[] = [ |
| 527 | +const TOAST_VARIANTS_IOS: UsageVariant[] = [ |
528 | 528 | { |
529 | 529 | value: 'default-variants', |
530 | 530 | label: 'Default variants', |
@@ -557,6 +557,38 @@ const TOAST_VARIANTS: UsageVariant[] = [ |
557 | 557 | }, |
558 | 558 | ]; |
559 | 559 |
|
| 560 | +const TOAST_VARIANTS_ANDROID: UsageVariant[] = [ |
| 561 | + { |
| 562 | + value: 'default-variants', |
| 563 | + label: 'Default variants', |
| 564 | + content: <DefaultVariantsContent />, |
| 565 | + }, |
| 566 | + { |
| 567 | + value: 'placement-variants', |
| 568 | + label: 'Placement variants', |
| 569 | + content: <PlacementVariantsContent />, |
| 570 | + }, |
| 571 | + { |
| 572 | + value: 'different-content-sizes', |
| 573 | + label: 'Different content sizes', |
| 574 | + content: <DifferentContentSizesContent />, |
| 575 | + }, |
| 576 | + { |
| 577 | + value: 'keyboard-avoiding', |
| 578 | + label: 'Keyboard avoiding', |
| 579 | + content: <KeyboardAvoidingContent />, |
| 580 | + }, |
| 581 | + { |
| 582 | + value: 'custom-toasts', |
| 583 | + label: 'Custom toasts', |
| 584 | + content: <CustomToastsContent />, |
| 585 | + }, |
| 586 | +]; |
| 587 | + |
560 | 588 | export default function ToastScreen() { |
561 | | - return <UsageVariantFlatList data={TOAST_VARIANTS} />; |
| 589 | + return ( |
| 590 | + <UsageVariantFlatList |
| 591 | + data={Platform.OS === 'ios' ? TOAST_VARIANTS_IOS : TOAST_VARIANTS_ANDROID} |
| 592 | + /> |
| 593 | + ); |
562 | 594 | } |
0 commit comments