-
-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into task-1083-mmo-label-util
- Loading branch information
Showing
67 changed files
with
1,183 additions
and
474 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,22 @@ | ||
import React, {ReactNode} from 'react'; | ||
import {UsageContext, useUsage} from 'js/account/usage/useUsage.hook'; | ||
import {ProductsContext, useProducts} from 'js/account/useProducts.hook'; | ||
import { | ||
OrganizationContext, | ||
useOrganization, | ||
} from 'js/account/organizations/useOrganization.hook'; | ||
import sessionStore from 'js/stores/session'; | ||
import {useOrganizationQuery} from 'js/account/stripe.api'; | ||
|
||
export const BillingContextProvider = (props: {children: ReactNode}) => { | ||
const orgQuery = useOrganizationQuery(); | ||
|
||
if (!sessionStore.isLoggedIn) { | ||
return <>{props.children}</>; | ||
} | ||
const [organization, reloadOrg, orgStatus] = useOrganization(); | ||
const usage = useUsage(organization?.id); | ||
const usage = useUsage(orgQuery.data?.id || null); | ||
const products = useProducts(); | ||
return ( | ||
<OrganizationContext.Provider value={[organization, reloadOrg, orgStatus]}> | ||
<UsageContext.Provider value={usage}> | ||
<ProductsContext.Provider value={products}> | ||
{props.children} | ||
</ProductsContext.Provider> | ||
</UsageContext.Provider> | ||
</OrganizationContext.Provider> | ||
<UsageContext.Provider value={usage}> | ||
<ProductsContext.Provider value={products}> | ||
{props.children} | ||
</ProductsContext.Provider> | ||
</UsageContext.Provider> | ||
); | ||
}; |
17 changes: 9 additions & 8 deletions
17
jsapp/js/account/organizations/requireOrgOwner.component.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 was deleted.
Oops, something went wrong.
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.