import {
IonContent, IonHeader, IonPage, IonTitle, IonToolbar,
IonAlert, IonButton, IonCard, IonCardHeader,
IonCardSubtitle, IonCardTitle, IonCardContent,
IonItem, IonIcon, IonLabel, IonBadge, IonList,
IonItemDivider, IonCheckbox, IonFab, IonFabButton,
IonFabList, IonItemGroup, IonItemSliding,
IonItemOptions, IonItemOption, IonNote, IonMenu,
IonRouterOutlet, IonListHeader, IonMenuToggle,
IonButtons, IonMenuButton, IonInput, IonSplitPane,
IonPopover, IonSpinner, IonRadioGroup, IonRadio,
IonRange, IonSearchbar, IonFooter, IonSegmentButton,
IonSegment, IonToast
} from '@ionic/react';
import ExploreContainer from '../components/ExploreContainer';
import './Tab3.css';
import {
call, home, heart, pin, star,
globe, basket, camera, bookmark
} from 'ionicons/icons';
const Tab3: React.FC = () => {
const [showToast1, setShowToast1] = useState(false);
const [showToast2, setShowToast2] = useState(false);
return (
<IonPage>
<IonHeader>
<IonToolbar>
<IonTitle>Toast Example</IonTitle>
</IonToolbar>
</IonHeader>
<IonContent>
<IonButton onClick={() => setShowToast1(true)} expand="block">Show Toast 1</IonButton>
<IonButton onClick={() => setShowToast2(true)} expand="block">Show Toast 2</IonButton>
<IonToast
isOpen={showToast1}
onDidDismiss={() => setShowToast1(false)}
message="Your settings have been saved."
duration={200}
/>
<IonToast
isOpen={showToast2}
onDidDismiss={() => setShowToast2(false)}
message="Click to Close"
position="middle"
buttons={[
{
side: 'start',
icon: 'star',
text: 'Favorite',
handler: () => {
console.log('Favorite clicked');
}
},
{
text: 'Done',
role: 'cancel',
handler: () => {
console.log('Cancel clicked');
}
}
]}
/>
</IonContent>
</IonPage>
);
};
export default Tab3;
No comments:
Post a Comment