Skip to content

Commit

Permalink
chore: remove unused Global Alert provider
Browse files Browse the repository at this point in the history
  • Loading branch information
agualis committed Jan 17, 2025
1 parent 4256d5f commit 5bc3f40
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 95 deletions.
2 changes: 0 additions & 2 deletions apps/beets-frontend-v3/app/layouts/base-layout.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import NextTopLoader from 'nextjs-toploader'
import { PropsWithChildren } from 'react'
import { NavBarContainer } from '@/lib/components/navs/NavBarContainer'
import { GlobalAlerts } from '@repo/lib/shared/components/navs/GlobalAlerts'
import { FooterContainer } from '@/lib/components/footer/FooterContainer'
import { LzBeetsMigrateModal } from '@/lib/components/modals/LzBeetsMigrateModal'

Expand All @@ -17,7 +16,6 @@ export function BaseLayout({
}}
>
<NextTopLoader color="#7f6ae8" showSpinner={false} />
<GlobalAlerts />
<NavBarContainer />
{children}
{renderLzBeetsModal && <LzBeetsMigrateModal />}
Expand Down
1 change: 1 addition & 0 deletions apps/beets-frontend-v3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
},
"devDependencies": {
"@chakra-ui/cli": "^2.4.1",
"@chakra-ui/styled-system": "2.12.0",
"@repo/eslint-config": "workspace:*",
"@repo/prettier-config": "workspace:*",
"@repo/typescript-config": "workspace:*",
Expand Down
17 changes: 1 addition & 16 deletions apps/frontend-v3/app/(app)/debug/alerts/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
import { BalAlert } from '@repo/lib/shared/components/alerts/BalAlert'
import { BalAlertButton } from '@repo/lib/shared/components/alerts/BalAlertButton'
import { BalAlertContent } from '@repo/lib/shared/components/alerts/BalAlertContent'
import { useGlobalAlerts } from '@repo/lib/shared/components/alerts/GlobalAlertsProvider'
import { GenericError } from '@repo/lib/shared/components/errors/GenericError'
import { Button, VStack } from '@chakra-ui/react'
import { VStack } from '@chakra-ui/react'

const exceptionName = 'Error fetching swap'
const exceptionMessage = `Execution reverted for an unknown reason. Raw Call Arguments:
Expand All @@ -21,7 +20,6 @@ class TestError extends Error {
}

export default function Page() {
const { addAlert } = useGlobalAlerts()
return (
<VStack width="full">
<BalAlert content={<TitleWithButton title="Info alert" />} status="info" />
Expand Down Expand Up @@ -50,19 +48,6 @@ export default function Page() {
/>

<GenericError error={new TestError(exceptionName, exceptionMessage)} maxWidth="500" />

<Button
onClick={() =>
addAlert({
id: 'debugAlert',
title: 'Global warning alert:',
description: 'with global description',
status: 'warning',
})
}
>
Show global warning alert
</Button>
</VStack>
)
}
Expand Down
2 changes: 0 additions & 2 deletions apps/frontend-v3/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import NextTopLoader from 'nextjs-toploader'
import { SpeedInsights } from '@vercel/speed-insights/next'
import '@repo/lib/assets/css/global.css'
import { Fathom } from '@repo/lib/shared/services/fathom/Fathom'
import { GlobalAlerts } from '@repo/lib/shared/components/navs/GlobalAlerts'
import { PropsWithChildren } from 'react'
import { Providers } from '@repo/lib/shared/components/site/providers'
import { NavBarContainer } from '@/lib/components/navs/NavBarContainer'
Expand Down Expand Up @@ -51,7 +50,6 @@ export default function RootLayout({ children }: PropsWithChildren) {
<ColorThemeProvider defaultTheme={DEFAULT_THEME_COLOR_MODE}>
<ThemeProvider>
<Providers>
<GlobalAlerts />
<NavBarContainer />
{children}
<FooterContainer />
Expand Down
1 change: 1 addition & 0 deletions apps/frontend-v3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
},
"devDependencies": {
"@chakra-ui/cli": "^2.4.1",
"@chakra-ui/styled-system": "2.12.0",
"@repo/eslint-config": "workspace:*",
"@repo/prettier-config": "workspace:*",
"@repo/typescript-config": "workspace:*",
Expand Down
40 changes: 0 additions & 40 deletions packages/lib/shared/components/alerts/GlobalAlertsProvider.tsx

This file was deleted.

21 changes: 0 additions & 21 deletions packages/lib/shared/components/navs/GlobalAlerts.tsx

This file was deleted.

25 changes: 11 additions & 14 deletions packages/lib/shared/components/site/providers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,20 @@ import { ApolloGlobalDataProvider } from '@repo/lib/shared/services/api/apollo-g
import { UserSettingsProvider } from '@repo/lib/modules/user/settings/UserSettingsProvider'

import { wagmiConfig } from '@repo/lib/modules/web3/WagmiConfig'
import { GlobalAlertsProvider } from '@repo/lib/shared/components/alerts/GlobalAlertsProvider'
import { VebalLockDataProvider } from '@repo/lib/modules/vebal/lock/VebalLockDataProvider'

export function Providers({ children }: { children: ReactNode }) {
return (
<GlobalAlertsProvider>
<Web3Provider wagmiConfig={wagmiConfig}>
<ApolloClientProvider>
<ApolloGlobalDataProvider>
<UserSettingsProvider>
<VebalLockDataProvider>
<RecentTransactionsProvider>{children}</RecentTransactionsProvider>
</VebalLockDataProvider>
</UserSettingsProvider>
</ApolloGlobalDataProvider>
</ApolloClientProvider>
</Web3Provider>
</GlobalAlertsProvider>
<Web3Provider wagmiConfig={wagmiConfig}>
<ApolloClientProvider>
<ApolloGlobalDataProvider>
<UserSettingsProvider>
<VebalLockDataProvider>
<RecentTransactionsProvider>{children}</RecentTransactionsProvider>
</VebalLockDataProvider>
</UserSettingsProvider>
</ApolloGlobalDataProvider>
</ApolloClientProvider>
</Web3Provider>
)
}

0 comments on commit 5bc3f40

Please sign in to comment.