Bug/typo/style fixes and some minor improvements

This commit is contained in:
Vladyslav Matsiiako
2023-02-10 22:17:39 -08:00
parent b5bcd0a308
commit 66659c8fc8
17 changed files with 58 additions and 57 deletions
@@ -26,7 +26,7 @@ export const OrgProvider = ({ children }: Props): JSX.Element => {
// memorize the workspace details for the context
const value = useMemo<TOrgContext>(
() => ({
org: userOrgs,
orgs: userOrgs,
currentOrg: (userOrgs || []).find(({ _id }) => _id === currentWsOrgID),
isLoading
}),
@@ -36,10 +36,10 @@ export const OrgProvider = ({ children }: Props): JSX.Element => {
return <OrgContext.Provider value={value}>{children}</OrgContext.Provider>;
};
export const useOrgnization = () => {
export const useOrganization = () => {
const ctx = useContext(OrgContext);
if (!ctx) {
throw new Error('useOrgnization to be used within <OrgContext.Provider>');
throw new Error('useOrganization to be used within <OrgContext.Provider>');
}
return ctx;
@@ -1 +1 @@
export { OrgProvider, useOrgnization } from './OrganizationContext';
export { OrgProvider, useOrganization } from './OrganizationContext';
+1 -1
View File
@@ -1,5 +1,5 @@
export { AuthProvider } from './AuthContext';
export { OrgProvider, useOrgnization } from './OrganizationContext';
export { OrgProvider, useOrganization } from './OrganizationContext';
export { SubscriptionProvider, useSubscription } from './SubscriptionContext';
export { UserProvider, useUser } from './UserContext';
export { useWorkspace, WorkspaceProvider } from './WorkspaceContext';