-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c1f595a
commit c8283e9
Showing
1 changed file
with
89 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,92 @@ | ||
# react-mobile-app-button | ||
|
||
A react component that allows you to place an iOS App Store, Google Play Store and Huawei AppGallery Download button! | ||
|
||
## Install | ||
|
||
install using `npm` | ||
|
||
```bash | ||
npm i react-mobile-app-button | ||
``` | ||
or: | ||
|
||
```bash | ||
yarn add react-mobile-app-button | ||
``` | ||
|
||
You will get an App Store, Google Play and AppGallery dwonload button on Web page looks like this: | ||
|
||
![image](https://user-images.githubusercontent.com/58111243/226064773-ee6d7ce3-e3cf-4a37-95d6-5e6db6c916c3.png) | ||
![image](https://user-images.githubusercontent.com/58111243/226064822-65a6cf71-32fe-4298-b4ca-6f624f82dddf.png) | ||
|
||
|
||
## Usage | ||
|
||
Example Code: | ||
|
||
```js | ||
import { GooglePlayButton } from "react-mobile-app-button"; | ||
|
||
export const MyComponent = () => { | ||
const APKUrl = | ||
"https://play.google.com/store/apps/details?id=host.exp.exponent"; | ||
|
||
return ( | ||
<div> | ||
<GooglePlayButton | ||
url={APKUrl} | ||
theme={"light"} | ||
className={"custom-style"} | ||
/> | ||
</div> | ||
); | ||
}; | ||
``` | ||
|
||
You can also import more than one burron in a row: | ||
|
||
```js | ||
import { | ||
GooglePlayButton, | ||
AppGalleryButton, | ||
ButtonsContainer, | ||
} from "react-mobile-app-button"; | ||
|
||
export const MyComponent = () => { | ||
const APKUrl = | ||
"https://play.google.com/store/apps/details?id=host.exp.exponent"; | ||
const iOSUrl = "https://apps.apple.com/us/app/expo-go/id982107779"; | ||
|
||
return ( | ||
<ButtonsContainer> | ||
<GooglePlayButton | ||
url={APKUrl} | ||
theme={"light"} | ||
className={"custom-style"} | ||
/> | ||
|
||
<AppGalleryButton | ||
url={iOSUrl} | ||
theme={"light"} | ||
className={"custom-style"} | ||
/> | ||
</ButtonsContainer> | ||
); | ||
}; | ||
``` | ||
## props | ||
|
||
| Name | Component | Type | Description | ||
| ------------- | ------------- | ------------- | ------------- | | ||
| url | `GooglePlayButton`, `AppGalleryButton`, `AppStoreButton` | string | Store URL | | ||
| theme | `GooglePlayButton`, `AppGalleryButton`, `AppStoreButton` | "dark" / "light" | Button Theme | | ||
| className | `GooglePlayButton`, `AppGalleryButton`, `AppStoreButton` | string | For manually styling | | ||
| height | `GooglePlayButton`, `AppGalleryButton`, `AppStoreButton` | number | For manually styling | | ||
| width | `GooglePlayButton`, `AppGalleryButton`, `AppStoreButton` | number | For manually styling | | ||
| gap | `ButtonsContainer` | number | Control the space between buttons | | ||
| direction | `ButtonsContainer` | "row" / "column" | Control flex direction | | ||
|
||
|
||
|
||
|