Skip to content

Commit

Permalink
chore: merging global error toast with client lib + some refactoring (#…
Browse files Browse the repository at this point in the history
…938)

* fix: apollo hook warning

* chore: making toast on error local to apollo client

* chore: better log message

* chore: misc update storybook

* chore: trying why did you render

* chore: remove wdyr as part of this PR

* chore: move error toast in a new file

---------

Co-authored-by: Nicolas Burtey <nb@galoy.io>
  • Loading branch information
nicolasburtey and Nicolas Burtey authored Feb 15, 2023
1 parent 1cc4dee commit dbd7bb4
Show file tree
Hide file tree
Showing 18 changed files with 61 additions and 292 deletions.
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,8 @@ test: unit check-code

codegen:
yarn dev:codegen

reset-ios:
yarn cache:clear
yarn install
yarn ios
Empty file.
3 changes: 0 additions & 3 deletions __mocks__/react-native-device-info.js

This file was deleted.

26 changes: 0 additions & 26 deletions __mocks__/react-native-firebase.js

This file was deleted.

3 changes: 0 additions & 3 deletions __mocks__/react-native-geetest-module.js

This file was deleted.

5 changes: 0 additions & 5 deletions __mocks__/react-native-iphone-x-helper.js

This file was deleted.

27 changes: 0 additions & 27 deletions __mocks__/react-native-secure-key-store.js

This file was deleted.

10 changes: 0 additions & 10 deletions __mocks__/react-navigation-native.js

This file was deleted.

3 changes: 0 additions & 3 deletions __mocks__/react-navigation-stack.js

This file was deleted.

147 changes: 0 additions & 147 deletions __tests__/screens/global-error.spec.tsx

This file was deleted.

2 changes: 0 additions & 2 deletions app/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import { Dimensions } from "react-native"
import ErrorBoundary from "react-native-error-boundary"
import EStyleSheet from "react-native-extended-stylesheet"
import { RootSiblingParent } from "react-native-root-siblings"
import { GlobalErrorToast } from "./components/global-error"
import { RootStack } from "./navigation/root-navigator"
import { ErrorScreen } from "./screens/error-screen"
import { ThemeProvider } from "@rneui/themed"
Expand Down Expand Up @@ -60,7 +59,6 @@ export const App = () => (
<RootSiblingParent>
<AppStateWrapper />
<NotificationComponent />
<GlobalErrorToast />
<RootStack />
<GaloyToast />
</RootSiblingParent>
Expand Down
1 change: 0 additions & 1 deletion app/components/global-error/index.ts

This file was deleted.

33 changes: 17 additions & 16 deletions app/components/wallet-summary/wallet-summary.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,28 @@ import { storiesOf } from "@storybook/react-native"
import { Story, StoryScreen, UseCase } from "../../../.storybook/views"
import { WalletSummary } from "./wallet-summary"
import { WalletType } from "@app/utils/enum"
import { MockedProvider } from "@apollo/client/testing"

declare let module

storiesOf("Wallet Summary", module)
.addDecorator((fn) => <StoryScreen>{fn()}</StoryScreen>)
.addDecorator((fn) => <MockedProvider><StoryScreen>{fn()}</StoryScreen></MockedProvider>)
.add("Style Presets", () => (
<Story>
<UseCase text="BTC" usage="The default.">
<WalletSummary
amountType="SEND"
walletType={WalletType.BTC}
usdBalanceInDollars={129.2}
btcBalanceInSats={2000}
/>
</UseCase>
<UseCase text="USD" usage="The default.">
<WalletSummary
amountType="SEND"
walletType={WalletType.USD}
usdBalanceInDollars={129.2}
/>
</UseCase>
<UseCase text="BTC" usage="The default.">
<WalletSummary
amountType="SEND"
walletType={WalletType.BTC}
usdBalanceInDollars={129.2}
btcBalanceInSats={2000}
/>
</UseCase>
<UseCase text="USD" usage="The default.">
<WalletSummary
amountType="SEND"
walletType={WalletType.USD}
usdBalanceInDollars={129.2}
/>
</UseCase>
</Story>
))
Loading

0 comments on commit dbd7bb4

Please sign in to comment.