-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(provider): Renamed package and added
ToastProvider
component
- Loading branch information
1 parent
0763e4c
commit daab4ee
Showing
20 changed files
with
451 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { getJestConfig } from "@storm-software/testing-tools"; | ||
|
||
export default getJestConfig("packages/provider", true, "provider"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { PropsWithChildren } from "react"; | ||
import { | ||
ThemeProviderServer, | ||
type ThemeProviderServerProps | ||
} from "./ThemeProvider.server"; | ||
import { ToastProvider, type ToastProviderProps } from "./ToastProvider"; | ||
|
||
export type ProviderServerProps = PropsWithChildren<{ | ||
toast: ToastProviderProps; | ||
theme: ThemeProviderServerProps; | ||
}>; | ||
|
||
export const ProviderServer = ({ | ||
children, | ||
toast, | ||
theme, | ||
...props | ||
}: ProviderServerProps) => { | ||
return ( | ||
<ThemeProviderServer {...theme}> | ||
<ToastProvider {...toast}>{children}</ToastProvider> | ||
</ThemeProviderServer> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { PropsWithChildren } from "react"; | ||
import { ToastProvider, type ToastProviderProps } from "./ToastProvider"; | ||
import { ThemeProvider, type ThemeProviderProps } from "./ThemeProvider"; | ||
|
||
export type ProviderProps = PropsWithChildren<{ | ||
toast: ToastProviderProps; | ||
theme: ThemeProviderProps; | ||
}>; | ||
|
||
export const Provider = ({ | ||
children, | ||
toast, | ||
theme, | ||
...props | ||
}: ProviderProps) => { | ||
return ( | ||
<ThemeProvider {...theme}> | ||
<ToastProvider {...toast}>{children}</ToastProvider> | ||
</ThemeProvider> | ||
); | ||
}; |
7 changes: 5 additions & 2 deletions
7
...eme-provider/src/ThemeProvider.server.tsx → ...ges/provider/src/ThemeProvider.server.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { | ||
ToastProvider as TamaguiToastProvider, | ||
type ToastProviderProps as TamaguiToastProviderProps | ||
} from "@tamagui/toast"; | ||
import { PropsWithChildren } from "react"; | ||
|
||
export type ToastProviderProps = PropsWithChildren< | ||
Partial<TamaguiToastProviderProps> & Omit<TamaguiToastProviderProps, "id"> | ||
>; | ||
|
||
export const ToastProvider = ({ children, ...props }: ToastProviderProps) => { | ||
return ( | ||
<TamaguiToastProvider id="Storm Software" {...props}> | ||
{children} | ||
</TamaguiToastProvider> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/** | ||
* The provider library used by Storm Software for building TypeScript applications. | ||
* | ||
* @remarks | ||
* A package containing the Provider component used to manage the applications theme state | ||
* | ||
* @packageDocumentation | ||
*/ | ||
|
||
export * from "./ThemeProvider"; | ||
export * from "./ThemeProvider.server"; | ||
export * from "./theme-state"; | ||
export * from "./ToastProvider"; | ||
export * from "./Provider"; | ||
export * from "./Provider.server"; |
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
packages/theme-provider/tsconfig.json → packages/provider/tsconfig.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.