Skip to content

Commit

Permalink
remove unused components
Browse files Browse the repository at this point in the history
  • Loading branch information
kingsleydon committed Apr 11, 2022
1 parent f001972 commit e12cffa
Show file tree
Hide file tree
Showing 13 changed files with 23 additions and 159 deletions.
5 changes: 1 addition & 4 deletions packages/app-bridge/src/BridgePage.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {Announcement, ToasterContainer} from '@phala/react-components'
import {Announcement} from '@phala/react-components'
import {StyledLink} from 'baseui/link'
import {PLACEMENT} from 'baseui/toast'
import {FC, useState} from 'react'
import {Helmet} from 'react-helmet'
import {ExchangeIcon} from './components/ExchangeIcon'
Expand Down Expand Up @@ -90,8 +89,6 @@ export const BridgePage: FC = () => {
isOpen={isOpenTransferModal}
/>
</Root>

<ToasterContainer placement={PLACEMENT.topRight} />
</>
)
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {toast} from '@phala/react-components'
import {
useErc20AssetHandlerAllowanceQuery,
useEthereumBridgeFee,
} from '@phala/react-libs'
import {validateAddress} from '@phala/utils'
import {toaster} from 'baseui/toast'
import Decimal from 'decimal.js'
import {ComponentProps, FC} from 'react'
import {toKaruraXcmFee, toKhalaXcmFee} from '../../config'
Expand Down Expand Up @@ -99,7 +99,7 @@ export const SubmitButton: FC<SubmitButtonProps> = (props) => {
errorString = 'Please approve first'
}
if (errorString) {
toast(errorString, 'error')
toaster.negative(errorString, {})
return
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Alert, Spacer, toast} from '@phala/react-components'
import {Alert, Spacer} from '@phala/react-components'
import {
useErc20BalanceQuery,
useErc20Deposit,
Expand All @@ -17,6 +17,7 @@ import {Button} from '../../../Button'
import {CurrentTransferInformationDetailItems} from '../../../CurrentTransferInformationDetailItems'
import {EthereumToKhalaFee} from './EthereumToKhalaFee'
import {StyledLink} from 'baseui/link'
import {toaster} from 'baseui/toast'

interface TransferPHAFromEthereumToKhalaProps {
onCloseTransfer(): void
Expand Down Expand Up @@ -64,7 +65,7 @@ export const TransferPHAFromEthereumToKhala: React.FC<
} catch (error) {
if (error instanceof Error) {
console.error(error)
toast(error.message)
toaster.negative(error.message, {})
}

setSubmitting(false)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {useCurrentAccount} from '@phala/app-store'
import {Alert, Checkbox, FeeLabel, Spacer, toast} from '@phala/react-components'
import {Alert, Checkbox, FeeLabel, Spacer} from '@phala/react-components'
import {Link} from '@phala/react-components/src/Announcement/styledComponents'
import {
decimalToBalance,
Expand All @@ -10,6 +10,7 @@ import {
import {Block} from 'baseui/block'
import {KIND as ButtonKind} from 'baseui/button'
import {ModalBody, ModalButton, ModalFooter} from 'baseui/modal'
import {toaster} from 'baseui/toast'
import Decimal from 'decimal.js'
import {getAddress} from 'ethers/lib/utils'
import React, {Fragment, useEffect, useMemo, useState} from 'react'
Expand Down Expand Up @@ -65,7 +66,7 @@ export const TransferPHAFromKhalaToEthereum: React.FC<

const submit = async () => {
if (!checkBoxChecked) {
toast('Please check the risk warning.')
toaster.warning('Please check the risk warning.', {})
return
}

Expand Down Expand Up @@ -137,7 +138,7 @@ export const TransferPHAFromKhalaToEthereum: React.FC<
than 24h. You can follow each step of the transaction through{' '}
<Link
target="_blank"
href={`https://khala.subscan.io/account/${fromAddress}?tab=transfer`}
href={`https://khala.subscan.io/account/${currentAccount?.address}?tab=transfer`}
>
Khala&apos;s explorer
</Link>{' '}
Expand Down
29 changes: 13 additions & 16 deletions packages/app/src/WrapApp.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {ethereumGraphEndpoint} from '@phala/app-config'
import {MobileToastContextProvider} from '@phala/react-components'
import {Provider as LibProvider} from '@phala/react-libs'
import {isProduction} from '@phala/utils'
import {BaseProvider} from 'baseui'
Expand Down Expand Up @@ -56,22 +55,20 @@ const WrapApp: React.FC = ({children}) => {
<QueryClientProvider contextSharing={true} client={client.current}>
<LibProvider {...productionConfig}>
<ThemeProvider theme={theme}>
<MobileToastContextProvider>
<BaseProvider theme={baseTheme}>
<SnackbarProvider>{children}</SnackbarProvider>
<ToasterContainer
autoHideDuration={3000}
overrides={{
ToastBody: {
style: {
maxWidth: '100%',
width: '400px',
},
<BaseProvider theme={baseTheme}>
<SnackbarProvider>{children}</SnackbarProvider>
<ToasterContainer
autoHideDuration={3000}
overrides={{
ToastBody: {
style: {
maxWidth: '100%',
width: '400px',
},
}}
/>
</BaseProvider>
</MobileToastContextProvider>
},
}}
/>
</BaseProvider>
</ThemeProvider>
<ReactQueryDevtools />
</LibProvider>
Expand Down
23 changes: 0 additions & 23 deletions packages/react-components/src/MobileToast/Icon.tsx

This file was deleted.

30 changes: 0 additions & 30 deletions packages/react-components/src/MobileToast/MobileToast.tsx

This file was deleted.

16 changes: 0 additions & 16 deletions packages/react-components/src/MobileToast/MobileToastContext.ts

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions packages/react-components/src/MobileToast/index.ts

This file was deleted.

32 changes: 0 additions & 32 deletions packages/react-components/src/MobileToast/styled.ts

This file was deleted.

6 changes: 0 additions & 6 deletions packages/react-components/src/MobileToast/useToast.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/react-components/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export * from './Input'
export * from './InputAction'
export * from './InputExternalInfo'
export * from './InputNumber'
export * from './MobileToast'
export * from './Modal'
export * from './PhalaStakePoolTransactionFeeLabel'
export * from './PolkadotInstallModal'
Expand Down

0 comments on commit e12cffa

Please sign in to comment.