Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove offline plugin #1387

Merged
merged 4 commits into from
May 29, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,5 @@ exports[`App should match a snapshot 1`] = `
<Component>
<Component />
</Component>
<Component
message="A new version is available. Please refresh your browser or click on this notification to receive the latest update."
preventClose={true}
variant="primary"
visible={false}
/>
</Provider>
`;
12 changes: 0 additions & 12 deletions packages/aml-checklist/src/core/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,13 @@ import Router from './router'
import { Provider } from 'react-redux'
import store from './store'
import * as React from 'react'
import { ToastMessage, useOfflinePLugin } from '@reapit/elements'

const App = () => {
const { isNewVersionAvailable } = useOfflinePLugin()
const bindedWindowLocation = React.useMemo(() => window.location.reload.bind(window.location), [])

return (
<Provider store={store.reduxStore}>
<PortalProvider>
<Router />
</PortalProvider>
<ToastMessage
preventClose={true}
visible={isNewVersionAvailable}
variant="primary"
onCloseToast={bindedWindowLocation}
/* eslint-disable-next-line max-len */
message="A new version is available. Please refresh your browser or click on this notification to receive the latest update."
/>
</Provider>
)
}
Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion packages/elements/src/hooks/use-offline-plugin/index.ts

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion packages/elements/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import * as v2 from './v2'
// Hooks
export * from './hooks/UsePortal'
export * from './hooks/use-offline-plugin'

// Dependencies
export * from 'formik'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,5 @@ exports[`App should match a snapshot 1`] = `
<Component>
<Component />
</Component>
<Component
message="A new version is available. Please refresh your browser or click on this notification to receive the latest update."
preventClose={true}
variant="primary"
visible={false}
/>
</Provider>
`;
14 changes: 1 addition & 13 deletions packages/geo-diary/src/core/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,15 @@ import '../styles/index.scss'
import React from 'react'
import { Provider } from 'react-redux'
import Router from './router'
import { PortalProvider, useOfflinePLugin } from '@reapit/elements'
import { PortalProvider } from '@reapit/elements'
import store from './store'
import { ToastMessage as ReapitElementsToastMessage } from '@reapit/elements'

const App = () => {
const bindedWindowLocation = React.useMemo(() => window.location.reload.bind(window.location), [])
const { isNewVersionAvailable } = useOfflinePLugin()

return (
<Provider store={store.reduxStore}>
<PortalProvider>
<Router />
</PortalProvider>
<ReapitElementsToastMessage
preventClose={true}
visible={isNewVersionAvailable}
variant="primary"
onCloseToast={bindedWindowLocation}
/* eslint-disable-next-line max-len */
message="A new version is available. Please refresh your browser or click on this notification to receive the latest update."
/>
</Provider>
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ exports[`App should match a snapshot 1`] = `
>
<Component>
<Component />
<Component
message="A new version is available. Please refresh your browser or click on this notification to receive the latest update."
preventClose={true}
variant="primary"
visible={false}
/>
</Component>
</Provider>
`;
13 changes: 1 addition & 12 deletions packages/lifetime-legal/src/core/app.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,14 @@
import { PortalProvider, useOfflinePLugin, ToastMessage } from '@reapit/elements'
import { PortalProvider } from '@reapit/elements'
import Router from './router'
import { Provider } from 'react-redux'
import store from './store'
import * as React from 'react'

const App = () => {
const bindedWindowLocation = React.useMemo(() => window.location.reload.bind(window.location), [])
const { isNewVersionAvailable } = useOfflinePLugin()

return (
<Provider store={store.reduxStore}>
<PortalProvider>
<Router />
<ToastMessage
preventClose={true}
visible={isNewVersionAvailable}
variant="primary"
onCloseToast={bindedWindowLocation}
/* eslint-disable-next-line max-len */
message="A new version is available. Please refresh your browser or click on this notification to receive the latest update."
/>
</PortalProvider>
</Provider>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1985,12 +1985,6 @@ input OfficeModelAddressInput {
<UploadProvider>
<Component />
</UploadProvider>
<Component
message="A new version is available. Please refresh your browser or click on this notification to receive the latest update."
preventClose={true}
variant="primary"
visible={false}
/>
</Component>
<GlobalStyleComponent />
</ApolloProvider>
Expand Down
13 changes: 1 addition & 12 deletions packages/smb-onboarder/src/core/app.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react'
import { createGlobalStyle } from 'styled-components'
import { PortalProvider, useOfflinePLugin, ToastMessage } from '@reapit/elements'
import { PortalProvider } from '@reapit/elements'
import { ApolloProvider } from '@apollo/react-hooks'
import { useAuth } from '@/hooks/use-auth'
import { AuthContext } from '@/context'
Expand All @@ -18,9 +18,6 @@ const GlobalStyle = createGlobalStyle`
`

const App = () => {
const { isNewVersionAvailable } = useOfflinePLugin()
const bindedWindowLocation = React.useMemo(() => window.location.reload.bind(window.location), [])

const { loginSession, refreshParams, getLoginSession, ...rest } = useAuth()
if (!loginSession && refreshParams) {
getLoginSession(refreshParams)
Expand All @@ -35,14 +32,6 @@ const App = () => {
<UploadProvider>
<Router />
</UploadProvider>
<ToastMessage
preventClose={true}
visible={isNewVersionAvailable}
variant="primary"
onCloseToast={bindedWindowLocation}
/* eslint-disable-next-line max-len */
message="A new version is available. Please refresh your browser or click on this notification to receive the latest update."
/>
</PortalProvider>
<GlobalStyle />
</ApolloProvider>
Expand Down