forked from umami-software/umami
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
123 additions
and
98 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
2 changes: 1 addition & 1 deletion
2
src/app/(main)/settings/teams/[teamId]/TeamMemberRemoveButton.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
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
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,5 +1,10 @@ | ||
import WebsiteSettings from '../WebsiteSettings'; | ||
import WebsiteProvider from 'app/(main)/websites/[websiteId]/WebsiteProvider'; | ||
import WebsiteSettings from './WebsiteSettings'; | ||
|
||
export default async function WebsiteSettingsPage({ params: { websiteId } }) { | ||
return <WebsiteSettings websiteId={websiteId} />; | ||
return ( | ||
<WebsiteProvider websiteId={websiteId}> | ||
<WebsiteSettings websiteId={websiteId} /> | ||
</WebsiteProvider> | ||
); | ||
} |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
'use client'; | ||
import { createContext, ReactNode, useEffect } from 'react'; | ||
import { useTeam } from 'components/hooks'; | ||
import { Loading } from 'react-basics'; | ||
import useModified from 'store/modified'; | ||
|
||
export const TeamContext = createContext(null); | ||
|
||
export function TeamProvider({ teamId, children }: { teamId: string; children: ReactNode }) { | ||
const modified = useModified(state => state?.[`team:${teamId}`]); | ||
const { data: team, isLoading, isFetching, refetch } = useTeam(teamId); | ||
|
||
useEffect(() => { | ||
if (modified) { | ||
refetch(); | ||
} | ||
}, [modified]); | ||
|
||
if (isFetching && isLoading) { | ||
return <Loading />; | ||
} | ||
|
||
if (!team) { | ||
return null; | ||
} | ||
|
||
return <TeamContext.Provider value={team}>{children}</TeamContext.Provider>; | ||
} | ||
|
||
export default TeamProvider; |
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,5 +1,5 @@ | ||
import Team from './Team'; | ||
import TeamProvider from './TeamProvider'; | ||
|
||
export default function ({ children }) { | ||
return <Team>{children}</Team>; | ||
return <TeamProvider>{children}</TeamProvider>; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
'use client'; | ||
import { createContext, ReactNode, useEffect } from 'react'; | ||
import { useWebsite } from 'components/hooks'; | ||
import { Loading } from 'react-basics'; | ||
import useModified from 'store/modified'; | ||
|
||
export const WebsiteContext = createContext(null); | ||
|
||
export function WebsiteProvider({ | ||
websiteId, | ||
children, | ||
}: { | ||
websiteId: string; | ||
children: ReactNode; | ||
}) { | ||
const modified = useModified(state => state?.[`website:${websiteId}`]); | ||
const { data: website, isFetching, isLoading, refetch } = useWebsite(websiteId); | ||
|
||
useEffect(() => { | ||
if (modified) { | ||
refetch(); | ||
} | ||
}, [modified]); | ||
|
||
if (isFetching && isLoading) { | ||
return <Loading position="page" />; | ||
} | ||
|
||
return <WebsiteContext.Provider value={website}>{children}</WebsiteContext.Provider>; | ||
} | ||
|
||
export default WebsiteProvider; |
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.