Skip to content

Commit

Permalink
refactor: applied github permission context
Browse files Browse the repository at this point in the history
  • Loading branch information
haydencleary committed Nov 15, 2024
1 parent 4d5cdb6 commit 7adf27d
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 20 deletions.
1 change: 0 additions & 1 deletion app/my-dashboard/_features/contributions/contributions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ export function Contributions() {
search: debouncedSearch,
projectSlugs: projectSlug ? [projectSlug] : undefined,
types: ["ISSUE", "PULL_REQUEST"],
showLinkedIssues: false,
sort: "UPDATED_AT",
sortDirection: "DESC",
...filters,
Expand Down
39 changes: 21 additions & 18 deletions app/my-dashboard/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { ActivitySection } from "@/app/my-dashboard/_sections/activity-section/a
import { AnimatedColumn } from "@/shared/components/animated-column-group/animated-column/animated-column";
import { withClientOnly } from "@/shared/components/client-only/client-only";
import { ScrollView } from "@/shared/components/scroll-view/scroll-view";
import { GithubPermissionsProvider } from "@/shared/features/github-permissions/github-permissions.context";
import { PageContent } from "@/shared/features/page-content/page-content";
import { PageWrapper } from "@/shared/features/page-wrapper/page-wrapper";
import { RequestPaymentFlowProvider } from "@/shared/panels/_flows/request-payment-flow/request-payment-flow.context";
Expand All @@ -30,24 +31,26 @@ function MyDashboardPage() {
],
}}
>
<RequestPaymentFlowProvider>
<PosthogCaptureOnMount eventName={"my_dashboard_viewed"} />

<AnimatedColumn className="h-full">
<ScrollView className="flex flex-col gap-md">
<PageContent classNames={{ base: "flex-none" }}>
<FinancialSection />
</PageContent>
<PageContent classNames={{ base: "tablet:overflow-hidden" }}>
<ActivitySection />
</PageContent>
</ScrollView>
</AnimatedColumn>

<ContributorSidepanel />
<ContributionsSidepanel />
<RewardDetailSidepanel />
</RequestPaymentFlowProvider>
<GithubPermissionsProvider>
<RequestPaymentFlowProvider>
<PosthogCaptureOnMount eventName={"my_dashboard_viewed"} />

<AnimatedColumn className="h-full">
<ScrollView className="flex flex-col gap-md">
<PageContent classNames={{ base: "flex-none" }}>
<FinancialSection />
</PageContent>
<PageContent classNames={{ base: "tablet:overflow-hidden" }}>
<ActivitySection />
</PageContent>
</ScrollView>
</AnimatedColumn>

<ContributorSidepanel />
<ContributionsSidepanel />
<RewardDetailSidepanel />
</RequestPaymentFlowProvider>
</GithubPermissionsProvider>
</PageWrapper>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const GithubPermissionsContext = createContext<GithubPermissionsContextInterface
setIsGithubPublicScopePermissionModalOpen: () => {},
});

export function GithubPermissionsProvider({ children, projectSlug }: PropsWithChildren & { projectSlug: string }) {
export function GithubPermissionsProvider({ children, projectSlug }: PropsWithChildren & { projectSlug?: string }) {
const [enablePooling, setEnablePooling] = useState(false);
const [repoId, setRepoId] = useState<number | undefined>();
const { isOpen: isGithubPermissionModalOpen, setIsOpen: setIsGithubPermissionModalOpen } = useGithubPermissionModal();
Expand Down

0 comments on commit 7adf27d

Please sign in to comment.