├── .commitlintrc.json
├── .eslintignore
├── .eslintrc.js
├── .gitattributes
├── .gitignore
├── .husky
├── commit-msg
└── pre-commit
├── .npmignore
├── .prettierignore
├── .prettierrc
├── README.md
├── assets
├── Screenshots
│ ├── react-native-subscibe-card.png
│ ├── react-native-subscibe-normal-card.png
│ └── react-native-subscribe-selected-card.png
└── logo.png
├── example
├── .bundle
│ └── config
├── .eslintrc.js
├── .gitignore
├── .node-version
├── .prettierrc.js
├── .watchmanconfig
├── App.tsx
├── Gemfile
├── Gemfile.lock
├── __tests__
│ └── App-test.tsx
├── android
│ ├── app
│ │ ├── build.gradle
│ │ ├── debug.keystore
│ │ ├── proguard-rules.pro
│ │ └── src
│ │ │ ├── debug
│ │ │ ├── AndroidManifest.xml
│ │ │ └── java
│ │ │ │ └── com
│ │ │ │ └── example
│ │ │ │ └── ReactNativeFlipper.java
│ │ │ ├── main
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── assets
│ │ │ │ └── fonts
│ │ │ │ │ ├── Roboto-Black.ttf
│ │ │ │ │ ├── Roboto-BlackItalic.ttf
│ │ │ │ │ ├── Roboto-Bold.ttf
│ │ │ │ │ ├── Roboto-BoldItalic.ttf
│ │ │ │ │ ├── Roboto-Italic.ttf
│ │ │ │ │ ├── Roboto-Light.ttf
│ │ │ │ │ ├── Roboto-LightItalic.ttf
│ │ │ │ │ ├── Roboto-Medium.ttf
│ │ │ │ │ ├── Roboto-MediumItalic.ttf
│ │ │ │ │ ├── Roboto-Regular.ttf
│ │ │ │ │ ├── Roboto-Thin.ttf
│ │ │ │ │ └── Roboto-ThinItalic.ttf
│ │ │ ├── java
│ │ │ │ └── com
│ │ │ │ │ └── example
│ │ │ │ │ ├── MainActivity.java
│ │ │ │ │ └── MainApplication.java
│ │ │ └── res
│ │ │ │ ├── drawable
│ │ │ │ └── rn_edit_text_material.xml
│ │ │ │ ├── mipmap-hdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ │ ├── mipmap-mdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ │ ├── mipmap-xhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ │ ├── mipmap-xxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ │ ├── mipmap-xxxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ │ └── values
│ │ │ │ ├── strings.xml
│ │ │ │ └── styles.xml
│ │ │ └── release
│ │ │ └── java
│ │ │ └── com
│ │ │ └── example
│ │ │ └── ReactNativeFlipper.java
│ ├── build.gradle
│ ├── gradle.properties
│ ├── gradle
│ │ └── wrapper
│ │ │ ├── gradle-wrapper.jar
│ │ │ └── gradle-wrapper.properties
│ ├── gradlew
│ ├── gradlew.bat
│ ├── link-assets-manifest.json
│ └── settings.gradle
├── app.json
├── assets
│ └── fonts
│ │ └── Roboto
│ │ ├── Roboto-Black.ttf
│ │ ├── Roboto-BlackItalic.ttf
│ │ ├── Roboto-Bold.ttf
│ │ ├── Roboto-BoldItalic.ttf
│ │ ├── Roboto-Italic.ttf
│ │ ├── Roboto-Light.ttf
│ │ ├── Roboto-LightItalic.ttf
│ │ ├── Roboto-Medium.ttf
│ │ ├── Roboto-MediumItalic.ttf
│ │ ├── Roboto-Regular.ttf
│ │ ├── Roboto-Thin.ttf
│ │ └── Roboto-ThinItalic.ttf
├── babel.config.js
├── index.js
├── ios
│ ├── .xcode.env
│ ├── Podfile
│ ├── Podfile.lock
│ ├── example.xcodeproj
│ │ ├── project.pbxproj
│ │ └── xcshareddata
│ │ │ └── xcschemes
│ │ │ └── example.xcscheme
│ ├── example.xcworkspace
│ │ └── contents.xcworkspacedata
│ ├── example
│ │ ├── AppDelegate.h
│ │ ├── AppDelegate.mm
│ │ ├── Images.xcassets
│ │ │ ├── AppIcon.appiconset
│ │ │ │ └── Contents.json
│ │ │ └── Contents.json
│ │ ├── Info.plist
│ │ ├── LaunchScreen.storyboard
│ │ └── main.m
│ ├── exampleTests
│ │ ├── Info.plist
│ │ └── exampleTests.m
│ └── link-assets-manifest.json
├── metro.config.js
├── package-lock.json
├── package.json
├── react-native.config.js
├── tsconfig.json
└── yarn.lock
├── lib
├── SubscribeCard.style.ts
└── SubscribeCard.tsx
├── package-lock.json
├── package.json
└── tsconfig.json
/.commitlintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": ["@commitlint/config-conventional"],
3 | "rules": {
4 | "header-max-length": [0, "always", 150],
5 | "subject-case": [0, "always", "sentence-case"],
6 | "type-enum": [
7 | 2,
8 | "always",
9 | [
10 | "ci",
11 | "chore",
12 | "docs",
13 | "feat",
14 | "fix",
15 | "perf",
16 | "refactor",
17 | "revert",
18 | "style",
19 | "test"
20 | ]
21 | ]
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/.eslintignore:
--------------------------------------------------------------------------------
1 | node_modules/**
--------------------------------------------------------------------------------
/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | root: true,
3 | extends: [
4 | "eslint:recommended",
5 | "plugin:react/recommended",
6 | "plugin:@typescript-eslint/recommended",
7 | "@react-native-community",
8 | "prettier",
9 | ],
10 | ignorePatterns: [
11 | "**/*/*.js",
12 | "*.js",
13 | "*.svg",
14 | "*.json",
15 | "*.png",
16 | "package.json",
17 | "package-lock.json",
18 | ],
19 | parser: "@typescript-eslint/parser",
20 | plugins: [
21 | "import",
22 | "react",
23 | "react-native",
24 | "prettier",
25 | "react-hooks",
26 | "@typescript-eslint",
27 | "promise",
28 | "jest",
29 | "unused-imports",
30 | ],
31 | env: {
32 | browser: true,
33 | es2021: true,
34 | "jest/globals": true,
35 | "react-native/react-native": true,
36 | },
37 | settings: {
38 | "import/resolver": {
39 | node: {
40 | extensions: [
41 | ".js",
42 | ".jsx",
43 | ".ts",
44 | ".tsx",
45 | ".d.ts",
46 | ".android.js",
47 | ".android.jsx",
48 | ".android.ts",
49 | ".android.tsx",
50 | ".ios.js",
51 | ".ios.jsx",
52 | ".ios.ts",
53 | ".ios.tsx",
54 | ".web.js",
55 | ".web.jsx",
56 | ".web.ts",
57 | ".web.tsx",
58 | ],
59 | },
60 | },
61 | },
62 | rules: {
63 | quotes: [
64 | "error",
65 | "double",
66 | {
67 | avoidEscape: true,
68 | },
69 | ],
70 | "import/extensions": [
71 | "error",
72 | "never",
73 | {
74 | svg: "always",
75 | model: "always",
76 | style: "always",
77 | png: "always",
78 | jpg: "always",
79 | json: "always",
80 | constant: "always",
81 | },
82 | ],
83 | "no-useless-catch": 0,
84 | "react-hooks/exhaustive-deps": 0,
85 | "max-len": ["error", 120],
86 | "@typescript-eslint/ban-ts-comment": 1,
87 | "@typescript-eslint/no-empty-function": 0,
88 | "@typescript-eslint/no-explicit-any": 1,
89 | "@typescript-eslint/explicit-module-boundary-types": 0,
90 | "react/jsx-filename-extension": ["error", { extensions: [".tsx"] }],
91 | "react-native/no-unused-styles": 2,
92 | "react-native/split-platform-components": 2,
93 | "react-native/no-inline-styles": 0,
94 | "react-native/no-color-literals": 0,
95 | "react-native/no-raw-text": 0,
96 | "import/no-extraneous-dependencies": 2,
97 | "import/no-named-as-default-member": 2,
98 | "import/order": 0,
99 | "import/no-duplicates": 2,
100 | "import/no-useless-path-segments": 2,
101 | "import/no-cycle": 2,
102 | "import/prefer-default-export": 0,
103 | "import/no-anonymous-default-export": 0,
104 | "import/named": 0,
105 | "@typescript-eslint/no-empty-interface": 0,
106 | "import/namespace": 0,
107 | "import/default": 0,
108 | "import/no-named-as-default": 0,
109 | "import/no-unused-modules": 0,
110 | "import/no-deprecated": 0,
111 | "@typescript-eslint/indent": 0,
112 | "react-hooks/rules-of-hooks": 2,
113 | camelcase: 2,
114 | "prefer-destructuring": 2,
115 | "no-nested-ternary": 2,
116 | "prettier/prettier": [
117 | "error",
118 | {
119 | endOfLine: "auto",
120 | },
121 | ],
122 | },
123 | };
124 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | *.pbxproj -text
2 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # OSX
2 | #
3 | .DS_Store
4 |
5 | # Xcode
6 | #
7 | build/
8 | *.pbxuser
9 | !default.pbxuser
10 | *.mode1v3
11 | !default.mode1v3
12 | *.mode2v3
13 | !default.mode2v3
14 | *.perspectivev3
15 | !default.perspectivev3
16 | xcuserdata
17 | *.xccheckout
18 | *.moved-aside
19 | DerivedData
20 | *.hmap
21 | *.ipa
22 | *.xcuserstate
23 |
24 | # Android/IntelliJ
25 | #
26 | build/
27 | .idea
28 | .gradle
29 | local.properties
30 | *.iml
31 |
32 | # Visual Studio Code
33 | #
34 | .vscode/
35 |
36 | # node.js
37 | #
38 | node_modules/
39 | npm-debug.log
40 | yarn-error.log
41 |
42 | # BUCK
43 | buck-out/
44 | \.buckd/
45 | *.keystore
46 | !debug.keystore
47 |
48 | # fastlane
49 | #
50 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
51 | # screenshots whenever they are needed.
52 | # For more information about the recommended setup visit:
53 | # https://docs.fastlane.tools/best-practices/source-control/
54 |
55 | */fastlane/report.xml
56 | */fastlane/Preview.html
57 | */fastlane/screenshots
58 |
59 | # Bundle artifact
60 | *.jsbundle
61 |
62 | # CocoaPods
63 | /ios/Pods/
64 |
--------------------------------------------------------------------------------
/.husky/commit-msg:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 | . "$(dirname -- "$0")/_/husky.sh"
3 |
4 | npx --no-install commitlint --edit
5 |
--------------------------------------------------------------------------------
/.husky/pre-commit:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 | . "$(dirname -- "$0")/_/husky.sh"
3 |
4 | npm run prettier
5 | npm run lint
6 |
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | # Node Modules
2 | **/node_modules
3 | node_modules
4 | # Example
5 | example
6 | # Assets
7 | Assets
8 | assets
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 | node_modules/**
--------------------------------------------------------------------------------
/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "bracketSpacing": true,
3 | "jsxBracketSameLine": false,
4 | "singleQuote": false,
5 | "trailingComma": "all",
6 | "tabWidth": 2,
7 | "semi": true
8 | }
9 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | [](https://github.com/WrathChaos/react-native-subscribe-card)
4 |
5 | [](https://www.npmjs.com/package/react-native-subscribe-card)
6 | [](https://www.npmjs.com/package/react-native-subscribe-card)
7 | 
8 | [](https://opensource.org/licenses/MIT)
9 | [](https://github.com/prettier/prettier)
10 |
11 |
12 |
14 |
39 |
41 |
60 |
62 |
82 |
84 |
This source code is licensed under the MIT license found in the LICENSE file in the root
5 | * directory of this source tree.
6 | */
7 | package com.example;
8 |
9 | import android.content.Context;
10 | import com.facebook.flipper.android.AndroidFlipperClient;
11 | import com.facebook.flipper.android.utils.FlipperUtils;
12 | import com.facebook.flipper.core.FlipperClient;
13 | import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin;
14 | import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin;
15 | import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin;
16 | import com.facebook.flipper.plugins.inspector.DescriptorMapping;
17 | import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin;
18 | import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor;
19 | import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;
20 | import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;
21 | import com.facebook.react.ReactInstanceEventListener;
22 | import com.facebook.react.ReactInstanceManager;
23 | import com.facebook.react.bridge.ReactContext;
24 | import com.facebook.react.modules.network.NetworkingModule;
25 | import okhttp3.OkHttpClient;
26 |
27 | /**
28 | * Class responsible of loading Flipper inside your React Native application. This is the debug
29 | * flavor of it. Here you can add your own plugins and customize the Flipper setup.
30 | */
31 | public class ReactNativeFlipper {
32 | public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
33 | if (FlipperUtils.shouldEnableFlipper(context)) {
34 | final FlipperClient client = AndroidFlipperClient.getInstance(context);
35 |
36 | client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));
37 | client.addPlugin(new DatabasesFlipperPlugin(context));
38 | client.addPlugin(new SharedPreferencesFlipperPlugin(context));
39 | client.addPlugin(CrashReporterPlugin.getInstance());
40 |
41 | NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();
42 | NetworkingModule.setCustomClientBuilder(
43 | new NetworkingModule.CustomClientBuilder() {
44 | @Override
45 | public void apply(OkHttpClient.Builder builder) {
46 | builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin));
47 | }
48 | });
49 | client.addPlugin(networkFlipperPlugin);
50 | client.start();
51 |
52 | // Fresco Plugin needs to ensure that ImagePipelineFactory is initialized
53 | // Hence we run if after all native modules have been initialized
54 | ReactContext reactContext = reactInstanceManager.getCurrentReactContext();
55 | if (reactContext == null) {
56 | reactInstanceManager.addReactInstanceEventListener(
57 | new ReactInstanceEventListener() {
58 | @Override
59 | public void onReactContextInitialized(ReactContext reactContext) {
60 | reactInstanceManager.removeReactInstanceEventListener(this);
61 | reactContext.runOnNativeModulesQueueThread(
62 | new Runnable() {
63 | @Override
64 | public void run() {
65 | client.addPlugin(new FrescoFlipperPlugin());
66 | }
67 | });
68 | }
69 | });
70 | } else {
71 | client.addPlugin(new FrescoFlipperPlugin());
72 | }
73 | }
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/example/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 | This source code is licensed under the MIT license found in the LICENSE file in the root
5 | * directory of this source tree.
6 | */
7 | package com.example;
8 |
9 | import android.content.Context;
10 | import com.facebook.react.ReactInstanceManager;
11 |
12 | /**
13 | * Class responsible of loading Flipper inside your React Native application. This is the release
14 | * flavor of it so it's empty as we don't want to load Flipper.
15 | */
16 | public class ReactNativeFlipper {
17 | public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
18 | // Do nothing as we don't want to initialize Flipper on Release.
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/example/android/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | ext {
5 | buildToolsVersion = "33.0.0"
6 | minSdkVersion = 21
7 | compileSdkVersion = 33
8 | targetSdkVersion = 33
9 |
10 | // We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
11 | ndkVersion = "23.1.7779620"
12 | }
13 | repositories {
14 | google()
15 | mavenCentral()
16 | }
17 | dependencies {
18 | classpath("com.android.tools.build:gradle:7.3.1")
19 | classpath("com.facebook.react:react-native-gradle-plugin")
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/example/android/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx512m -XX:MaxMetaspaceSize=256m
13 | org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
19 |
20 | # AndroidX package structure to make it clearer which packages are bundled with the
21 | # Android operating system, and which are packaged with your app's APK
22 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
23 | android.useAndroidX=true
24 | # Automatically convert third-party libraries to use AndroidX
25 | android.enableJetifier=true
26 |
27 | # Version of flipper SDK to use with React Native
28 | FLIPPER_VERSION=0.125.0
29 |
30 | # Use this property to specify which architecture you want to build.
31 | # You can also override it from the CLI using
32 | # ./gradlew