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
// App.tsx | |
import React from 'react'; | |
import { SafeAreaView, Text, View } from 'react-native'; | |
import appStyle from './AppTheme' | |
import whiteLabelConfig from './whitelabel/WhiteLabelConfig'; | |
const app = () => ( |
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
// AppTheme.tsx | |
import { StyleSheet } from 'react-native'; | |
import whiteLabelConfig from './whitelabel/WhiteLabelConfig'; | |
export default StyleSheet.create({ | |
screen: { | |
flex: 1, | |
justifyContent: 'center', | |
backgroundColor: whiteLabelConfig.PRIMARY_COLOR |
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
// WhiteLabelConfig.tsx | |
import { NativeModules } from 'react-native'; | |
export default class WhiteLabelConfig { | |
public static readonly APP_NAME: string = 'WhiteLabelDemo'; | |
public static readonly PRIMARY_COLOR: string = '#fdf6e3'; | |
public static readonly PRIMARY_TEXT_COLOR: string = '#657b83'; | |
public static readonly GREETING_TEXT: string = 'Welcome'; | |
} |
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
// WhiteLabelConfig.h | |
#import <Foundation/Foundation.h> | |
#import <React/RCTBridgeModule.h> | |
@interface WhiteLabelConfig : NSObject<RCTBridgeModule> | |
@end |
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
// WhiteLabelConfig.m | |
@implementation WhiteLabelConfig | |
RCT_EXPORT_MODULE(WhiteLabelConfig); | |
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(getAppName) { | |
return [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"]; | |
} | |
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
// WhiteLabelConfig.tsx | |
import { NativeModules } from 'react-native'; | |
export default class WhiteLabelConfig { | |
public static readonly APP_NAME: string = NativeModules.WhiteLabelConfig.getAppName(); | |
public static readonly PRIMARY_COLOR: string = NativeModules.WhiteLabelConfig.getPrimaryColor(); | |
public static readonly PRIMARY_TEXT_COLOR: string = NativeModules.WhiteLabelConfig.getPrimaryTextColor(); | |
public static readonly GREETING_TEXT: string = NativeModules.WhiteLabelConfig.getGreetingText(); | |
} |
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
// WhiteLabelConfig.m for purple parrots | |
#import "WhiteLabelConfig.h" | |
@implementation WhiteLabelConfig | |
RCT_EXPORT_MODULE(WhiteLabelConfig); | |
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(getAppName) { | |
return [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"]; |
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
// WhiteLabelConfig.m for green monkeys | |
#import "WhiteLabelConfig.h" | |
@implementation WhiteLabelConfig | |
RCT_EXPORT_MODULE(WhiteLabelConfig); | |
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(getAppName) { | |
return [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"]; |
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
// WhiteLabelConfig.java | |
package com.whitelabeldemo; | |
import com.facebook.react.bridge.ReactApplicationContext; | |
import com.facebook.react.bridge.ReactContextBaseJavaModule; | |
import com.facebook.react.bridge.ReactMethod; | |
import javax.annotation.Nonnull; |
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
// WhiteLabelConfigPackage.java | |
package com.whitelabeldemo; | |
import com.facebook.react.ReactPackage; | |
import com.facebook.react.bridge.NativeModule; | |
import com.facebook.react.bridge.ReactApplicationContext; | |
import com.facebook.react.uimanager.ViewManager; | |
import javax.annotation.Nonnull; |
OlderNewer