Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into fix/swap-empty-search
Browse files Browse the repository at this point in the history
  • Loading branch information
banklesss committed Sep 9, 2024
2 parents 166ee48 + 4a74877 commit b785bf5
Show file tree
Hide file tree
Showing 68 changed files with 2,120 additions and 842 deletions.
33 changes: 7 additions & 26 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,31 +19,25 @@ While developing, you can run the [example app](/example/) to test your changes.
To start the packager:

```sh
yarn example start
yarn start
```

To run the example app on Android:

```sh
yarn example android
yarn run:android:<>
```

To run the example app on iOS:

```sh
yarn example ios
```

To run the example app on Web:

```sh
yarn example web
yarn run:ios:<>
```

Make sure your code passes TypeScript and ESLint. Run the following to verify:

```sh
yarn typecheck
yarn tsc
yarn lint
```

Expand All @@ -59,17 +53,18 @@ Remember to add tests for your change if possible. Run the unit tests by:
yarn test
```


### Commit message convention

We follow the [conventional commits specification](https://www.conventionalcommits.org/en) for our commit messages:

- `fix`: bug fixes, e.g. fix crash due to deprecated method.
- `feat`: new features, e.g. add new method to the module.
- `feature`: new features, e.g. add new method to the module.
- `refactor`: code refactor, e.g. migrate from class components to hooks.
- `docs`: changes into documentation, e.g. add usage example for the module..
- `test`: adding or updating tests, e.g. add integration tests using detox.
- `chore`: tooling changes, e.g. change CI config.
- `merge`: merging actions.

Our pre-commit hooks verify that your commit message matches this format when committing.

Expand All @@ -88,23 +83,9 @@ We use [release-it](https://github.com/release-it/release-it) to make it easier
To publish new versions, run the following:

```sh
yarn release
fastlane release <>
```

### Scripts

The `package.json` file contains various scripts for common tasks:

- `yarn bootstrap`: setup project by installing all dependencies and pods.
- `yarn typecheck`: type-check files with TypeScript.
- `yarn lint`: lint files with ESLint.
- `yarn test`: run unit tests with Jest.
- `yarn example start`: start the Metro server for the example app.
- `yarn example android`: run the example app on Android.
- `yarn example ios`: run the example app on iOS.

### Sending a pull request

> **Working on your first pull request?** You can learn how from this _free_ series: [How to Contribute to an Open Source Project on GitHub](https://app.egghead.io/playlists/how-to-contribute-to-an-open-source-project-on-github).
When you're sending a pull request:
Expand Down
1 change: 0 additions & 1 deletion apps/wallet-mobile/.storybook/storybook.requires.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions apps/wallet-mobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@
"@types/bip39": "^3.0.0",
"@types/pbkdf2": "^3.1.2",
"@yoroi/api": "^1.5.2",
"@yoroi/claim": "1.0.0",
"@yoroi/common": "^1.5.4",
"@yoroi/exchange": "^2.1.1",
"@yoroi/explorers": "^1.0.2",
Expand Down

This file was deleted.

183 changes: 0 additions & 183 deletions apps/wallet-mobile/src/components/AmountItem/AmountItem.tsx

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,25 +1,19 @@
import {Claim} from '@yoroi/types'

import {useApiErrorResolver} from '../../../hooks/useApiErrorResolver'
import {
ClaimApiErrorsAlreadyClaimed,
ClaimApiErrorsExpired,
ClaimApiErrorsInvalidRequest,
ClaimApiErrorsNotFound,
ClaimApiErrorsRateLimited,
ClaimApiErrorsTooEarly,
} from '../module/errors'
import {useDialogs} from './useDialogs'

export const useClaimErrorResolver = () => {
const dialogs = useDialogs()
const apiResolver = useApiErrorResolver()

const resolver = (error: unknown) => {
if (error instanceof ClaimApiErrorsAlreadyClaimed) return dialogs.errorAlreadyClaimed
if (error instanceof ClaimApiErrorsExpired) return dialogs.errorExpired
if (error instanceof ClaimApiErrorsInvalidRequest) return dialogs.errorInvalidRequest
if (error instanceof ClaimApiErrorsNotFound) return dialogs.errorNotFound
if (error instanceof ClaimApiErrorsRateLimited) return dialogs.errorRateLimited
if (error instanceof ClaimApiErrorsTooEarly) return dialogs.errorTooEarly
if (error instanceof Claim.Api.Errors.AlreadyClaimed) return dialogs.errorAlreadyClaimed
if (error instanceof Claim.Api.Errors.Expired) return dialogs.errorExpired
if (error instanceof Claim.Api.Errors.InvalidRequest) return dialogs.errorInvalidRequest
if (error instanceof Claim.Api.Errors.NotFound) return dialogs.errorNotFound
if (error instanceof Claim.Api.Errors.RateLimited) return dialogs.errorRateLimited
if (error instanceof Claim.Api.Errors.TooEarly) return dialogs.errorTooEarly

// falback to api errors
return apiResolver(error)
Expand Down
Loading

0 comments on commit b785bf5

Please sign in to comment.