-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Consolidate all the provider to single Provider (#147)
* Consolidate all the provider to single Provider * Fix import * Fix CUIProvider Props * Fix test cases
- Loading branch information
1 parent
6b58460
commit ffdbdc5
Showing
16 changed files
with
107 additions
and
100 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,31 @@ | ||
import { | ||
Provider as TooltipProvider, | ||
TooltipProviderProps, | ||
} from "@radix-ui/react-tooltip"; | ||
import { ToastProps } from "@radix-ui/react-toast"; | ||
import { ToastProvider } from "@/components/Toast/Toast"; | ||
import { ThemeName } from "@/theme"; | ||
import { ThemeProvider } from "@/theme/theme"; | ||
import { ReactNode } from "react"; | ||
|
||
interface Props { | ||
config?: { | ||
tooltip?: Omit<TooltipProviderProps, "children">; | ||
toast?: Omit<ToastProps, "children">; | ||
}; | ||
theme: ThemeName; | ||
children: ReactNode; | ||
} | ||
|
||
const ClickUIProvider = ({ children, theme, config = {} }: Props) => { | ||
const { toast = {}, tooltip = {} } = config; | ||
return ( | ||
<ThemeProvider theme={theme}> | ||
<ToastProvider {...toast}> | ||
<TooltipProvider {...tooltip}>{children}</TooltipProvider> | ||
</ToastProvider> | ||
</ThemeProvider> | ||
); | ||
}; | ||
|
||
export default ClickUIProvider; |
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 |
---|---|---|
@@ -1,18 +1,18 @@ | ||
import { Meta, IconGallery, IconItem } from "@storybook/blocks"; | ||
import LogosLight from "./LogosLight.ts" | ||
import { Logo } from "./Logo" | ||
import { ThemeProvider } from "../../theme"; | ||
import { ClickUIProvider } from ".."; | ||
|
||
<Meta title='Display/Logo/Logos' /> | ||
|
||
# Logos | ||
|
||
<ThemeProvider theme='light'> | ||
<ClickUIProvider theme='light'> | ||
<IconGallery> | ||
{Object.keys(LogosLight).map((iconName) => ( | ||
<IconItem name={iconName} key={iconName}> | ||
<Logo name={iconName} /> | ||
</IconItem> | ||
))} | ||
</IconGallery> | ||
</ThemeProvider> | ||
</ClickUIProvider> |
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
Oops, something went wrong.
ffdbdc5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
click-ui – ./
click-ui-git-main-clickhouse.vercel.app
click-ui.vercel.app
click-ui-clickhouse.vercel.app