You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A pre-configured Zodius API client with Tenstack Query for managing API calls. The `./api` folder includes a fully set up example for GET and POST requests, complete with schemas, definitions, and global error handling through a custom Zodius plugin.
192
+
A pre-configured Orval setup generates a typed API client and TanStack Query hooks from your OpenAPI spec. The `api/generated` folder contains endpoints, models, and optional MSW mocks, powered by a custom Axios mutator and React Query.
@@ -623,55 +631,6 @@ import { WithValidationError } from '@components/ValidationError';
623
631
624
632
The `ValidationError` and `WithValidationError` components help maintain a clean UI by only showing error messages when necessary, enhancing the user experience with clear feedback.
625
633
626
-
<aname="toaster"></a>
627
-
628
-
## Toaster 🍞
629
-
630
-
The `Toaster` component is a dynamic and interactive toast notification system designed to provide immediate feedback to users. It's connected to a store for global state management and comes with an API plugin for automatic display on API events.
631
-
632
-
### Component Features
633
-
634
-
-**Gesture Support**: Users can dismiss the toast by dragging it down, thanks to the integrated gesture handler.
635
-
-**Animated Visibility**: Uses `react-native-reanimated` for smooth show and hide animations.
636
-
-**Safe Area Handling**: Accounts for device safe areas, ensuring the toast is always visible and accessible.
637
-
-**Custom Icons**: Displays icons for error, success, or information based on the toast type.
638
-
639
-
### How It Works
640
-
641
-
The `Toaster` component listens to the toast state from `useToastStore`. When a toast is set, it animates into view. It can be dismissed with a drag gesture or by pressing the 'Dismiss' button.
642
-
643
-
### Usage
644
-
645
-
The `Toaster` component does not need to be manually managed; it works by setting the toast state through the `useToastStore` actions:
646
-
647
-
```javascript
648
-
useToastStore.getState().setToast({
649
-
type:'success',
650
-
message:'Your changes have been saved!',
651
-
});
652
-
```
653
-
654
-
### Customizing the Toaster
655
-
656
-
While the `Toaster` itself does not require props, you can customize the animations and styles directly within the component's file if needed.
657
-
658
-
### API Integration
659
-
660
-
`apiToastPlugin` is set up to automatically display toasts in response to API calls, making use of the `ZodiosPlugin` system. It provides feedback for errors and successes, skipping certain URLs or GET requests as configured.
661
-
662
-
### Example of Plugin Usage
663
-
664
-
Simply add the `apiToastPlugin` to your Zodios API client configuration:
665
-
666
-
```javascript
667
-
constapiClient=newZodios(API_URL, [
668
-
/* ...endpoints */
669
-
]);
670
-
apiClient.use(apiToastPlugin);
671
-
```
672
-
673
-
The `Toaster` provides a smooth, user-friendly notification mechanism that enhances the interactivity of the application, keeping users informed with minimal disruption.
674
-
675
634
## More Components Comming Soon... 🎉
676
635
677
636
Stay tuned for more components and features that will be added to the template in the future. We're committed to providing a comprehensive set of tools and solutions to help you build your mobile applications with ease.
0 commit comments