Skip to content

Commit

Permalink
fix: make builder context global
Browse files Browse the repository at this point in the history
  • Loading branch information
jurajpiar committed Nov 21, 2024
1 parent 83c4c40 commit e618008
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/app/collective-rewards/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

import { BuildersLeaderBoard } from '@/app/collective-rewards/leaderboard'
import { Metrics } from '@/app/collective-rewards/metrics'
import { WhitelistContextProviderWithBuilders, WhitelistSection } from '@/app/collective-rewards/whitelist'
import { WhitelistContextProvider, WhitelistSection } from '@/app/collective-rewards/whitelist'
import { MainContainer } from '@/components/MainContainer/MainContainer'

export default function BuildersIncentiveMarket() {
return (
<MainContainer>
<div className="grid grid-rows-1 gap-[32px]">
<Metrics />
<WhitelistContextProviderWithBuilders>
<WhitelistContextProvider>
<WhitelistSection />
</WhitelistContextProviderWithBuilders>
</WhitelistContextProvider>
<BuildersLeaderBoard />
</div>
</MainContainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,5 @@ export const BecomeABuilderHandler = ({ address }: { address: Address }) => {
}

export const BecomeABuilderButton = ({ address }: { address: Address }) => {
return (
<BuilderContextProvider>
<BecomeABuilderHandler address={address} />
</BuilderContextProvider>
)
return <BecomeABuilderHandler address={address} />
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ interface WhitelistProviderProps {
children: ReactNode
}

const WhitelistContextProvider: FC<WhitelistProviderProps> = ({ children }) => {
export const WhitelistContextProvider: FC<WhitelistProviderProps> = ({ children }) => {
const [search, setSearch] = useState('')
const [filterBy, setFilterBy] = useState<BuilderStatusFilter>(initialFilterByValue)
const { data, isLoading, error } = useGetFilteredBuilders({ builderName: search, status: filterBy })
Expand Down
5 changes: 4 additions & 1 deletion src/app/providers/ContextProviders.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { WagmiProvider } from 'wagmi'
import { AlertProvider } from './AlertProvider'
import ErrorBoundary from '@/components/ErrorPage/ErrorBoundary'
import { AllocationsContextProvider } from '../collective-rewards/allocations'
import { BuilderContextProviderWithPrices } from '../collective-rewards/user'

interface Props {
children: ReactNode
Expand All @@ -18,7 +19,9 @@ export const ContextProviders = ({ children }: Props) => {
<WagmiProvider config={config}>
<QueryClientProvider client={queryClient}>
<AlertProvider>
<AllocationsContextProvider>{children}</AllocationsContextProvider>
<BuilderContextProviderWithPrices>
<AllocationsContextProvider>{children}</AllocationsContextProvider>
</BuilderContextProviderWithPrices>
</AlertProvider>
</QueryClientProvider>
</WagmiProvider>
Expand Down

0 comments on commit e618008

Please sign in to comment.