Skip to content

Commit e0a3908

Browse files
authored
Merge pull request #9 from just1and0/dev
Dev
2 parents 33bf48b + 75d11e4 commit e0a3908

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+23960
-65
lines changed

.DS_Store

6 KB
Binary file not shown.

.github/workflows/versioning.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ name: Release
33
on:
44
push:
55
branches:
6-
- main
7-
6+
- dev
7+
88
jobs:
99
build:
1010
runs-on: ubuntu-latest
@@ -27,6 +27,3 @@ jobs:
2727

2828
- name: Release new version
2929
run: npm run release
30-
31-
32-

CONTRIBUTING.md

Lines changed: 198 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,198 @@
1+
# Contributing
2+
3+
We want this community to be friendly and respectful to each other. Please follow it in all your interactions with the project.
4+
5+
## Development workflow
6+
7+
To get started with the project, run `yarn` in the root directory to install the required dependencies for each package:
8+
9+
```sh
10+
yarn
11+
```
12+
13+
> While it's possible to use [`npm`](https://github.com/npm/cli), the tooling is built around [`yarn`](https://classic.yarnpkg.com/), so you'll have an easier time if you use `yarn` for development.
14+
15+
While developing, you can run the [example app](/example/) to test your changes. Any changes you make in your library's JavaScript code will be reflected in the example app without a rebuild. If you change any native code, then you'll need to rebuild the example app.
16+
17+
To start the packager:
18+
19+
```sh
20+
yarn example start
21+
```
22+
23+
To run the example app on Android:
24+
25+
```sh
26+
yarn example android
27+
```
28+
29+
To run the example app on iOS:
30+
31+
```sh
32+
yarn example ios
33+
```
34+
35+
To run the example app on Web:
36+
37+
```sh
38+
yarn example web
39+
```
40+
41+
Make sure your code passes TypeScript and ESLint. Run the following to verify:
42+
43+
```sh
44+
yarn typescript
45+
yarn lint
46+
```
47+
48+
To fix formatting errors, run the following:
49+
50+
```sh
51+
yarn lint --fix
52+
```
53+
54+
Remember to add tests for your change if possible. Run the unit tests by:
55+
56+
```sh
57+
yarn test
58+
```
59+
60+
### Commit message convention
61+
62+
We follow the [conventional commits specification](https://www.conventionalcommits.org/en) for our commit messages:
63+
64+
- `fix`: bug fixes, e.g. fix crash due to deprecated method.
65+
- `feat`: new features, e.g. add new method to the module.
66+
- `refactor`: code refactor, e.g. migrate from class components to hooks.
67+
- `docs`: changes into documentation, e.g. add usage example for the module..
68+
- `test`: adding or updating tests, e.g. add integration tests using detox.
69+
- `chore`: tooling changes, e.g. change CI config.
70+
71+
Our pre-commit hooks verify that your commit message matches this format when committing.
72+
73+
### Linting and tests
74+
75+
[ESLint](https://eslint.org/), [Prettier](https://prettier.io/), [TypeScript](https://www.typescriptlang.org/)
76+
77+
We use [TypeScript](https://www.typescriptlang.org/) for type checking, [ESLint](https://eslint.org/) with [Prettier](https://prettier.io/) for linting and formatting the code, and [Jest](https://jestjs.io/) for testing.
78+
79+
Our pre-commit hooks verify that the linter and tests pass when committing.
80+
81+
### Publishing to npm
82+
83+
We use [release-it](https://github.com/release-it/release-it) to make it easier to publish new versions. It handles common tasks like bumping version based on semver, creating tags and releases etc.
84+
85+
To publish new versions, run the following:
86+
87+
```sh
88+
yarn release
89+
```
90+
91+
### Scripts
92+
93+
The `package.json` file contains various scripts for common tasks:
94+
95+
- `yarn bootstrap`: setup project by installing all dependencies and pods.
96+
- `yarn typescript`: type-check files with TypeScript.
97+
- `yarn lint`: lint files with ESLint.
98+
- `yarn test`: run unit tests with Jest.
99+
- `yarn example start`: start the Metro server for the example app.
100+
- `yarn example android`: run the example app on Android.
101+
- `yarn example ios`: run the example app on iOS.
102+
103+
### Sending a pull request
104+
105+
> **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).
106+
107+
When you're sending a pull request:
108+
109+
- Prefer small pull requests focused on one change.
110+
- Verify that linters and tests are passing.
111+
- Review the documentation to make sure it looks good.
112+
- Follow the pull request template when opening a pull request.
113+
- For pull requests that change the API or implementation, discuss with maintainers first by opening an issue.
114+
115+
## Code of Conduct
116+
117+
### Our Pledge
118+
119+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
120+
121+
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
122+
123+
### Our Standards
124+
125+
Examples of behavior that contributes to a positive environment for our community include:
126+
127+
- Demonstrating empathy and kindness toward other people
128+
- Being respectful of differing opinions, viewpoints, and experiences
129+
- Giving and gracefully accepting constructive feedback
130+
- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
131+
- Focusing on what is best not just for us as individuals, but for the overall community
132+
133+
Examples of unacceptable behavior include:
134+
135+
- The use of sexualized language or imagery, and sexual attention or
136+
advances of any kind
137+
- Trolling, insulting or derogatory comments, and personal or political attacks
138+
- Public or private harassment
139+
- Publishing others' private information, such as a physical or email
140+
address, without their explicit permission
141+
- Other conduct which could reasonably be considered inappropriate in a
142+
professional setting
143+
144+
### Enforcement Responsibilities
145+
146+
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
147+
148+
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
149+
150+
### Scope
151+
152+
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
153+
154+
### Enforcement
155+
156+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [INSERT CONTACT METHOD]. All complaints will be reviewed and investigated promptly and fairly.
157+
158+
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
159+
160+
### Enforcement Guidelines
161+
162+
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
163+
164+
#### 1. Correction
165+
166+
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
167+
168+
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
169+
170+
#### 2. Warning
171+
172+
**Community Impact**: A violation through a single incident or series of actions.
173+
174+
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
175+
176+
#### 3. Temporary Ban
177+
178+
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
179+
180+
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
181+
182+
#### 4. Permanent Ban
183+
184+
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
185+
186+
**Consequence**: A permanent ban from any sort of public interaction within the community.
187+
188+
### Attribution
189+
190+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
191+
available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
192+
193+
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
194+
195+
[homepage]: https://www.contributor-covenant.org
196+
197+
For answers to common questions about this code of conduct, see the FAQ at
198+
https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2021 Oluwatobi Shokunbi
3+
Copyright (c) 2021 Oluwatobi Shokunbi
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ Okra’s API empowers companies and developers to build products with seamless a
77

88
![alt text](https://files.readme.io/41dcda7-react-native-black.svg)
99

10-
React Native SDK for implementing the OkraJS widget - OkraJS is a safe and secure web drop-in module and this library provides a front-end web (also available in [iOS](https://github.com/okraHQ/okra-ios-sdk) and [Android](https://github.com/okraHQ/okra-android-sdk)) SDK for [account authentication](https://docs.okra.ng/docs/widget-properties) and [payment initiation](https://docs.okra.ng/docs/creating-a-charge) for each bank that Okra [supports](https://docs.okra.ng/docs/bank-coverage).
10+
React Native SDK for implementing the OkraJS widget - OkraJS is a safe and secure web drop-in module and this library provides a front-end web (also available in [iOS](https://github.com/okraHQ/okra-ios-sdk) and [Android](https://github.com/okraHQ/okra-android-sdk)) SDK for [account authentication](https://docs.okra.ng/docs/widget-properties) and [payment initiation](https://docs.okra.ng/docs/creating-a-charge) for each bank that Okra [supports](https://docs.okra.ng/docs/bank-coverage).
1111

1212
## Try the demo
1313
Checkout the [widget flow](https://okra.ng/) to view how the Okra Widget works. *Click "See How it Works"*
1414

1515
## Before getting started
1616
- Checkout our [get started guide](https://docs.okra.ng/docs/get-started-with-okra) to create your developer account and retrieve your Client Token, API Keys, and Private Keys.
17-
- Create a [sandbox customer](https://docs.okra.ng/docs/creating-sandbox-customers), so you can get connecting immediately.
17+
- Create a [sandbox customer](https://docs.okra.ng/docs/creating-sandbox-customers), so you can get connecting immediately.
1818

1919
## buildWithShortURL
2020
- If you are using the `buildWithShortURL` version, you will first need to [create a link](https://docs.okra.ng/docs/widget-customization) on your dashboard, and use the `short url` returend at the end of the creation flow.
@@ -56,14 +56,14 @@ For React Native based application import it and use
5656

5757
import React from 'react';
5858
import {
59-
Alert,
60-
SafeAreaView,
61-
StatusBar,
59+
Alert,
60+
SafeAreaView,
61+
StatusBar,
6262
useColorScheme,
6363
View,
6464
} from 'react-native';
6565

66-
import Okra from 'okra-react-native-sdk';
66+
import { Okra } from 'react-native-okra-webview';
6767

6868
const App = () => {
6969
const isDarkMode = useColorScheme() === 'dark';
@@ -104,18 +104,18 @@ For others, just use
104104

105105
import React, { useState } from 'react';
106106
import {
107-
Alert,
108-
SafeAreaView,
109-
StatusBar,
107+
Alert,
108+
SafeAreaView,
109+
StatusBar,
110110
useColorScheme,
111111
View,
112112
} from 'react-native';
113-
114-
import Okra from 'okra-react-native-sdk';
115-
113+
114+
import { Okra } from 'react-native-okra-webview';
115+
116116
const App = () => {
117117
const isDarkMode = useColorScheme() === 'dark';
118-
118+
119119
return (
120120
<SafeAreaView style={{flex:1}}>
121121
<StatusBar barStyle={isDarkMode ? 'light-content' : 'dark-content'} />
@@ -137,7 +137,7 @@ import Okra from 'okra-react-native-sdk';
137137
</SafeAreaView>
138138
);
139139
};
140-
140+
141141
export default App;
142142
```
143143

@@ -154,16 +154,16 @@ import Okra from 'okra-react-native-sdk';
154154
| `payment` | `Booelan` | false | | Whether you want to initiate a payment (https://docs.okra.ng/docs/payments)
155155
| `charge ` | `Object` | false | | Payment charge opject (https://docs.okra.ng/docs/creating-a-charge)
156156
| `products` | `Array` | true | `['Auth']` | The Okra products you want to use with the widget.
157-
| `logo ` | `String(URL)` | false | Okra's Logo |
158-
| `name ` | `String` | false | Your Company's name | Name on the widget
159-
| `color` | `HEX ` | false | #3AB795 | Theme on the widget
157+
| `logo ` | `String(URL)` | false | Okra's Logo |
158+
| `name ` | `String` | false | Your Company's name | Name on the widget
159+
| `color` | `HEX ` | false | #3AB795 | Theme on the widget
160160
| `limit` | `Number` | false | 24 | Statement length
161161
| `filter` | `Object` | false | | Filter for widget
162162
| `isCorporate` | `Boolen` | false | `false` | Corporate or Individual account
163163
| `connectMessage` | `String` | false | | Instruction to connnect account
164164
| `widget_success` | `String` | false | | Widget Success Message
165165
| `widget_failed` | `String` | false | | Widget Failed Message
166-
| `callback_url` | `String(Url)` | false | |
166+
| `callback_url` | `String(Url)` | false | |
167167
| `currency` | `String` | false | NGN | Wallet to bill
168168
| `exp` | `Date` | false | Won't expire | Expirary date of widget
169169
| `options` | `Object` | false | | You can pass a object custom values eg id
@@ -187,6 +187,8 @@ View a complete list of customizable options [here](https://docs.okra.ng/docs/wi
187187
## Done connecting?
188188
Checkout our [API Overiview](https://docs.okra.ng/docs/api-overview) and see how to use the data you've received and [other products](https://docs.okra.ng/docs/selfie-verification) you can use to create more personalized experiences for your customers!
189189

190-
## Not a developer?
190+
## Not a developer?
191191
Get started without writing a single line of code, Try our App Builder! [Click here to get started](https://dash.okra.ng/link-builder)
192-
192+
193+
## Huge Thanks & Credits
194+
(https://github.com/callstack/react-native-builder-bob)[Bob RN package template]

babel.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: ['module:metro-react-native-babel-preset'],
3+
};

example/.DS_Store

6 KB
Binary file not shown.

example/.expo/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
> Why do I have a folder named ".expo" in my project?
2+
3+
The ".expo" folder is created when an Expo project is started using "expo start" command.
4+
5+
> What does the "packager-info.json" file contain?
6+
7+
The "packager-info.json" file contains port numbers and process PIDs that are used to serve the application to the mobile device/simulator.
8+
9+
> What does the "settings.json" file contain?
10+
11+
The "settings.json" file contains the server configuration that is used to serve the application manifest.
12+
13+
> Should I commit the ".expo" folder?
14+
15+
No, you should not share the ".expo" folder. It does not contain any information that is relevant for other developers working on the project, it is specific to your machine.
16+
17+
Upon project creation, the ".expo" folder is already added to your ".gitignore" file.

example/.expo/packager-info.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"devToolsPort": 19002,
3+
"expoServerPort": null,
4+
"packagerPort": null,
5+
"packagerPid": null,
6+
"expoServerNgrokUrl": null,
7+
"packagerNgrokUrl": null,
8+
"ngrokPid": null,
9+
"webpackServerPort": null
10+
}

example/.expo/settings.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"hostType": "lan",
3+
"lanType": "ip",
4+
"dev": true,
5+
"minify": false,
6+
"urlRandomness": null,
7+
"https": false,
8+
"scheme": null,
9+
"devClient": false
10+
}

0 commit comments

Comments
 (0)