@trackunit/react-core-contexts 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ManagerApolloProvider.d.ts +6 -0
- package/README.md +17 -0
- package/TrackunitProviders.d.ts +8 -0
- package/UserSubscriptionProvider.d.ts +6 -0
- package/environment/TileEnvironmentProvider.d.ts +6 -0
- package/index.d.ts +2 -0
- package/index.js +2453 -0
- package/package.json +23 -0
- package/test/config/jest.setup.d.ts +1 -0
- package/token/TileTokenProvider.d.ts +6 -0
- package/user/TileCurrentUserProvider.d.ts +6 -0
package/README.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# react-core-contexts
|
|
2
|
+
|
|
3
|
+
The purpose of this library is to contain the core context providers for the Iris App SDK.
|
|
4
|
+
## TrackunitProviders
|
|
5
|
+
|
|
6
|
+
The `TrackunitProviders` component is exposed through the `@trackunit/react-core-contexts` package.
|
|
7
|
+
The component is a wrapper for all the base react providers needed to use contexts available in the trackunit manager.
|
|
8
|
+
This makes it possible to use Hooks and complex components in your Iris App.
|
|
9
|
+
|
|
10
|
+
Inside the provider the following hooks from `react-core-hooks` can be used:
|
|
11
|
+
- Get data on the current user through `useCurrentUser` hook.
|
|
12
|
+
- Read the current environment through the `useEnvironment` hook.
|
|
13
|
+
- Get the users subscription package and features with the `useUserSubscription` hook.
|
|
14
|
+
- Obtain an access token from the `useToken` hook.
|
|
15
|
+
|
|
16
|
+
The provider also wraps the ThemeProvider which is currently needed for our React components.
|
|
17
|
+
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Theme } from "@trackunit/ui-theme";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export declare const tuTheme: Theme;
|
|
4
|
+
interface IProps {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare const TrackunitProviders: ({ children }: IProps) => JSX.Element;
|
|
8
|
+
export {};
|
package/index.d.ts
ADDED